commit/galaxy-central: jeremy goecks: Circster: (a) add style sheet and (b) update styles to use smaller labels.
1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/2703795990b0/ Changeset: 2703795990b0 User: jeremy goecks Date: 2014-01-22 18:06:59 Summary: Circster: (a) add style sheet and (b) update styles to use smaller labels. Affected #: 4 files diff -r aae0e414a2fa595ee83cf576e36dc5bd25772a9f -r 2703795990b091a98398b19e042f88584533704d static/scripts/viz/circster.js --- a/static/scripts/viz/circster.js +++ b/static/scripts/viz/circster.js @@ -1,4 +1,7 @@ -define(["libs/underscore", "libs/d3", "viz/visualization"], function(_, d3, visualization) { +define(["utils/utils", "libs/underscore", "libs/d3", "viz/visualization"], function(utils, _, d3, visualization) { + +// Load needed CSS. +utils.cssLoadFile("static/style/circster.css"); /** * Utility class for working with SVG. @@ -652,7 +655,7 @@ this.bg_fill = 'fff'; // Minimum arc distance for labels to be applied. - this.min_arc_len = 0.08; + this.min_arc_len = 0.05; }, /** @@ -673,9 +676,9 @@ }) .attr('text-anchor', 'middle') .append("svg:textPath") + .attr("class", "chrom-label") .attr("xlink:href", function(d) { return "#label-" + d.data.chrom; }) .attr('startOffset', '25%') - .attr('font-weight', 'bold') .text(function(d) { return d.data.chrom; }); @@ -791,11 +794,16 @@ return "rotate(90)"; }; + // Draw min, max on first chrom only. + this.drawTicks(this.parent_elt, [ this.chroms_layout[0] ], this._data_bounds_ticks_fn(), textTransform, true); + + /* // Filter for visible chroms, then for every third chrom so that labels attached to only every // third chrom. var visibleChroms = _.filter(this.chroms_layout, function(c) { return c.endAngle - c.startAngle > 0.08; }), labeledChroms = _.filter(visibleChroms, function(c, i) { return i % 3 === 0; }); this.drawTicks(this.parent_elt, labeledChroms, this._data_bounds_ticks_fn(), textTransform, true); + */ }, /** @@ -868,7 +876,8 @@ if (d) { // Each data point has the form [position, value], so return all values. return _.map(d.data, function(p) { - return p[1]; + // Null is used for a lack of data; resolve null to 0 for comparison. + return parseInt(p[1], 10) || 0; }); } else { @@ -876,7 +885,9 @@ } }) ); - return [ _.min(values), this._quantile(values, 0.98) ]; + // For max, use 98% quantile in attempt to avoid very large values. However, this max may be 0 + // for sparsely populated data, so use max in that case. + return [ _.min(values), this._quantile(values, 0.98) || _.max(values) ]; } }); @@ -967,7 +978,7 @@ el : $('#center .unified-panel-body'), // gaps are difficult to set because it very dependent on chromosome size and organization. - total_gap : 2 * Math.PI * 0.1, + total_gap : 2 * Math.PI * 0.4, genome : genome, model : vis, dataset_arc_height : 25 diff -r aae0e414a2fa595ee83cf576e36dc5bd25772a9f -r 2703795990b091a98398b19e042f88584533704d static/style/Gruntfile.js --- a/static/style/Gruntfile.js +++ b/static/style/Gruntfile.js @@ -5,11 +5,11 @@ var theme = grunt.option( 'theme', 'blue' ); - var out = 'blue' - var lessFiles = [ 'base', 'autocomplete_tagging', 'embed_item', 'iphone', 'masthead', 'library', 'trackster' ]; + var out = 'blue'; + var lessFiles = [ 'base', 'autocomplete_tagging', 'embed_item', 'iphone', 'masthead', 'library', 'trackster', 'circster' ]; - var _ = grunt.util._; - var fmt = _.sprintf; + var _ = grunt.util._; + var fmt = _.sprintf; // Project configuration. grunt.initConfig({ diff -r aae0e414a2fa595ee83cf576e36dc5bd25772a9f -r 2703795990b091a98398b19e042f88584533704d static/style/blue/circster.css --- /dev/null +++ b/static/style/blue/circster.css @@ -0,0 +1,2 @@ +.chrom-label{font-size:80%} +.tick{font-size:80%} diff -r aae0e414a2fa595ee83cf576e36dc5bd25772a9f -r 2703795990b091a98398b19e042f88584533704d static/style/src/less/circster.less --- /dev/null +++ b/static/style/src/less/circster.less @@ -0,0 +1,7 @@ +.chrom-label { + font-size: 80%; +} + +.tick { + font-size: 80%; +} \ No newline at end of file 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)
-
commits-noreply@bitbucket.org