commit/galaxy-central: jgoecks: Circster enhancements: (a) dragging and zooming; and (b) fill complete palette.
1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/changeset/51b24be13e90/ changeset: 51b24be13e90 user: jgoecks date: 2012-09-08 19:08:33 summary: Circster enhancements: (a) dragging and zooming; and (b) fill complete palette. affected #: 2 files diff -r 108cda8986460298279279fca9ae40661a8e6174 -r 51b24be13e9085b6fda294354e709d844e5da964 static/scripts/viz/visualization.js --- a/static/scripts/viz/visualization.js +++ b/static/scripts/viz/visualization.js @@ -827,9 +827,11 @@ this.height = options.height; this.total_gap = options.total_gap; this.genome = options.genome; - this.radius_start = options.radius_start; this.dataset_arc_height = options.dataset_arc_height; this.track_gap = 5; + + // Compute radius start based on model. + this.radius_start = this.width/2 - this.model.get('tracks').length * (this.dataset_arc_height + this.track_gap); }, render: function() { @@ -841,8 +843,17 @@ .append("svg") .attr("width", self.width) .attr("height", self.height) - .append("g") - .attr("transform", "translate(" + self.width / 2 + "," + self.height / 2 + ")"); + .attr("pointer-events", "all") + // Set up zooming, dragging. + .append('svg:g') + .call(d3.behavior.zoom().on('zoom', function() { + svg.attr("transform", + "translate(" + d3.event.translate + ")" + + " scale(" + d3.event.scale + ")"); + })) + .attr("transform", "translate(" + self.width / 2 + "," + self.height / 2 + ")") + .append('svg:g') + // -- Render each dataset in the visualization. -- this.model.get('tracks').each(function(track, index) { @@ -889,8 +900,8 @@ .style("stroke", block_color) .style("fill", block_color); }); - }); - } + }); + } }); /** diff -r 108cda8986460298279279fca9ae40661a8e6174 -r 51b24be13e9085b6fda294354e709d844e5da964 templates/visualization/circster.mako --- a/templates/visualization/circster.mako +++ b/templates/visualization/circster.mako @@ -69,14 +69,13 @@ var genome = new Genome(JSON.parse('${ h.to_json_string( genome ) }')) visualization = new GenomeVisualization(JSON.parse('${ h.to_json_string( viz_config ) }')), viz_view = new CircsterView({ - width: 600, - height: 600, + width: 700, + height: 700, // Gap is difficult to set because it very dependent on chromosome size and organization. - total_gap: 2 * Math.PI * 0.2, + total_gap: 2 * Math.PI * 0.1, genome: genome, model: visualization, - radius_start: 100, - dataset_arc_height: 15 + dataset_arc_height: 25 }); // -- Render viz. -- Repository URL: https://bitbucket.org/galaxy/galaxy-central/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email.
participants (1)
-
Bitbucket