1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/21121d6283a9/ Changeset: 21121d6283a9 User: guerler Date: 2014-05-03 01:40:37 Summary: Charts: Add color combos, fixes for heatmaps Affected #: 4 files diff -r 9dd03d95b91c22c1a35aa6328e2d7261705fe454 -r 21121d6283a95942061819f5e788ab41cfc1c000 config/plugins/visualizations/charts/static/charts/heatmap/config.js --- a/config/plugins/visualizations/charts/static/charts/heatmap/config.js +++ b/config/plugins/visualizations/charts/static/charts/heatmap/config.js @@ -17,6 +17,97 @@ value : { title : 'Observations' }, + }, + + settings: { + color_set : { + title : 'Color scheme', + info : 'Select a color scheme for your heatmap', + type : 'select', + init : 'ocean', + data : [ + { + label : 'Cold-to-Hot', + value : 'hot' + }, + { + label : 'Cool', + value : 'cool' + }, + { + label : 'Copper', + value : 'copper' + }, + { + label : 'Gebco', + value : 'gebco' + }, + { + label : 'Globe', + value : 'globe' + }, + { + label : 'Gray scale', + value : 'gray' + }, + { + label : 'Haxby', + value : 'haxby' + }, + { + label : 'Jet', + value : 'jet' + }, + { + label : 'No-Green', + value : 'no_green' + }, + { + label : 'Ocean', + value : 'ocean' + }, + { + label : 'Polar', + value : 'polar' + }, + { + label : 'Rainbow', + value : 'rainbow' + }, + { + label : 'Red-to-Green', + value : 'redgreen' + }, + { + label : 'Red-to-green (saturated)', + value : 'red2green' + }, + { + label : 'Relief', + value : 'relief' + }, + { + label : 'Seismograph', + value : 'seis' + }, + { + label : 'Sealand', + value : 'sealand' + }, + { + label : 'Split', + value : 'split' + }, + { + label : 'Topo', + value : 'topo' + }, + { + label : 'Wysiwyg', + value : 'wysiwyg' + } + ] + } } }; diff -r 9dd03d95b91c22c1a35aa6328e2d7261705fe454 -r 21121d6283a95942061819f5e788ab41cfc1c000 config/plugins/visualizations/charts/static/charts/heatmap/heatmap-parameters.js --- /dev/null +++ b/config/plugins/visualizations/charts/static/charts/heatmap/heatmap-parameters.js @@ -0,0 +1,52 @@ +// dependencies +define(['utils/utils', 'plugin/charts/heatmap/heatmap-plugin'], function(Utils, HeatmapPlugin) { + +// color palettes +var colorSets = { + seis: ['#AA0000', '#D00000', '#F70000', '#FF1D00', '#FF4400', '#FF6A00', '#FF9000', '#FFB700', '#FFDD00', '#FFFF00', '#FFFF00', '#FFFF00', '#BDFF0C', '#73FF1A', '#3FFA36', '#16F45A', '#00D08B', '#0087CD', '#0048FA', '#0024E3'], + + sealand: ['#8C66FF', '#6A66FF', '#6684FF', '#66A7FF', '#66CAFF', '#66ECFF', '#66FFF0', '#66FFCE', '#66FFAB', '#66FF88', '#66FF66', '#88FF66', '#ABFF66', '#CEFF66', '#FFEEA6', '#FFD3A6', '#FFB8A6', '#FFAAB0', '#FFB5CB', '#FFC0E1'], + + redgreen: ['#005824', '#1A693B', '#347B53', '#4F8D6B', '#699F83', '#83B09B', '#9EC2B3', '#B8D4CB', '#D2E6E3', '#EDF8FB', '#FFFFFF', '#F1EEF6', '#E6D3E1','#DBB9CD', '#D19EB9', '#C684A4', '#BB6990', '#B14F7C', '#A63467', '#9B1A53', '#91003F'], + + ocean: ['#000000', '#000209', '#000413', '#00061E', '#000728', '#000932', '#002650', '#00426E', '#005E8C', '#007AAA', '#0096C8', '#22A9C2', '#45BCBB', '#67CFB5', '#8AE2AE', '#ACF6A8', '#BCF8B9', '#CBF9CA', '#DBFBDC', '#EBFDED'], + + cool: ['#00FFFF', '#0DF2FF', '#19E6FF', '#26D9FF', '#33CCFF', '#3FBFFF', '#4CB3FF', '#59A6FF', '#6699FF', '#738CFF', '#7F7FFF', '#8C73FF', '#9966FF', '#A659FF', '#B24DFF', '#BF3FFF', '#CC33FF', '#D926FF', '#E619FF', '#F20DFF'], + + copper: ['#000000', '#100906', '#1F130D', '#301E13', '#40281A', '#50321F', '#603C26', '#70462D', '#805033', '#905A3A', '#A06440', '#B06E46', '#C0784D', '#D08253', '#E08C5A', '#F09660', '#FFA066', '#FFAA6D', '#FFB473', '#FFBE7A'], + + gebco: ['#00F0FF', '#00F0FF', '#00F0FF', '#23FFFF', '#23FFFF', '#23FFFF', '#5AFFFF', '#5AFFFF', '#5AFFFF', '#8CFFE6', '#8CFFE6', '#8CFFE6', '#A5FFD7', '#A5FFD7', '#A5FFD7', '#C3FFD7', '#C3FFD7', '#C3FFD7', '#D2FFD7', '#E6FFF0'], + + globe: ['#9900FF', '#9900FF', '#7722FF', '#5544FF', '#3366FF', '#1188FF', '#1BA4FF', '#51BAFF', '#86D0FF', '#BCE6FF', '#336600', '#F3CA89', '#D9A627', '#A49019', '#9F7B0D', '#996600', '#B27676', '#C2B0B0', '#E5E5E5', '#FFFFFF'], + + gray: ['#000000', '#0D0D0D', '#191919', '#262626', '#333333', '#3F3F3F', '#4C4C4C', '#595959', '#666666', '#737373', '#7F7F7F', '#8C8C8C', '#999999', '#A6A6A6', '#B2B2B2', '#BFBFBF', '#CCCCCC', '#D9D9D9', '#E6E6E6', '#F2F2F2'], + + haxby: ['#090079', '#280096', '#0009C8', '#0019D4', '#1A66F0', '#19AFFF', '#32BEFF', '#61E1F0', '#6AECE1', '#8AECAE', '#CDFFA2', '#DFF68D', '#F8D768', '#FFBD57', '#F4754B', '#FF5A5A', '#FF7C7C', '#F6B3AE', '#FFC4C4', '#FFECEC'], + + hot: ['#000000', '#220000', '#440000', '#660000', '#880000', '#AA0000', '#CC0000', '#EE0000', '#FF1100', '#FF3300', '#FF5500', '#FF7700', '#FF9900', '#FFBB00', '#FFDD00', '#FFFF00', '#FFFF33', '#FFFF66', '#FFFF99', '#FFFFCC'], + + jet: ['#00007F', '#0000B2', '#0000E5', '#0019FF', '#004DFF', '#007FFF', '#00B2FF', '#00E5FF', '#FFFFF2', '#FFFFD9', '#FFFFBF', '#FFFFA5', '#FFFF8C', '#FFE500', '#FFB300', '#FF7F00', '#FF4C00', '#FF1900', '#E50000', '#B20000'], + + no_green: ['#1F60FF', '#1F60FF', '#1F9FFF', '#1FBFFF', '#00CFFF', '#2AFFFF', '#2AFFFF', '#55FFFF', '#7FFFFF', '#AAFFFF', '#FFFF54', '#FFFF54', '#FFF000', '#FFBF00', '#FFA800', '#FF8A00', '#FF8A00', '#FF7000', '#FF4D00', '#FF0000'], + + polar: ['#0000FF', '#1919FF', '#3333FF', '#4C4CFF', '#6666FF', '#7F7FFF', '#9999FF', '#B2B2FF', '#CCCCFF', '#E6E6FF', '#FFFFFF', '#FFE5E5', '#FFCCCC', '#FFB2B2', '#FF9999', '#FF7F7F', '#FF6666', '#FF4C4C', '#FF3333', '#FF1A1A'], + + rainbow: ['#FF00FF', '#BF00FF', '#7F00FF', '#3F00FF', '#0000FF', '#003FFF', '#007FFF', '#00BFFF', '#00FFFF', '#00FFBF', '#00FF7F', '#00FF3F', '#00FF00', '#3FFF00', '#7FFF00', '#BFFF00', '#FFFF00', '#FFBF00', '#FF7F00', '#FF3F00'], + + red2green: ['#FF0000', '#FF1919', '#FF3333', '#FF4C4C', '#FF6666', '#FF7F7F', '#FF9999', '#FFB2B2', '#FFCCCC', '#FFE6E6', '#FFFFFF', '#E5FFE5', '#CCFFCC', '#B2FFB2', '#99FF99', '#7FFF7F', '#66FF66', '#4CFF4C', '#33FF33', '#1AFF1A'], + + relief: ['#000000', '#000413', '#000728', '#002650', '#005E8C', '#0096C8', '#45BCBB', '#8AE2AE', '#BCF8B9', '#DBFBDC', '#467832', '#887438', '#B19D48', '#DBC758', '#FAE769', '#FAEB7E', '#FCED93', '#FCF1A7', '#FCF6C1', '#FDFAE0'], + + split: ['#7F7FFF', '#6666E6', '#4D4DCC', '#3333B3', '#1A1A99', '#00007F', '#000066', '#00004D', '#000033', '#00001A', '#000000', '#1A0000', '#330000', '#4D0000', '#660000', '#7F0000', '#991A1A', '#B33333', '#CC4D4D', '#E66666'], + + topo: ['#C977D9', '#A18AE6', '#8AA2E6', '#8BD1E7', '#8AF3CF', '#85F38E', '#BDF385', '#EDE485', '#F0B086', '#DE9F8B', '#74A3B3', '#99CC70', '#DCD68E', '#EDDFAD', '#F7E8CA', '#FFF9F3', '#FFF9F6', '#FFFBF9', '#FFFCFA', '#FFFEFD'], + + wysiwyg: ['#3F003F', '#3F003F', '#3F00BF', '#003FFF', '#00A0FF', '#3FBFFF', '#3FBFFF', '#40E0FF', '#3FFFBF', '#3FFF3F', '#7FFF3F', '#BFFF3F', '#BFFF3F', '#FFE040', '#FFE040', '#FF6040', '#FF1F40', '#FF60C0', '#FFA0FF', '#FFA0FF'] +} + +// return +return { + colorSets: colorSets +} + +}); \ No newline at end of file diff -r 9dd03d95b91c22c1a35aa6328e2d7261705fe454 -r 21121d6283a95942061819f5e788ab41cfc1c000 config/plugins/visualizations/charts/static/charts/heatmap/heatmap-plugin.js --- a/config/plugins/visualizations/charts/static/charts/heatmap/heatmap-plugin.js +++ b/config/plugins/visualizations/charts/static/charts/heatmap/heatmap-plugin.js @@ -1,5 +1,6 @@ // dependencies -define(['utils/utils'], function(Utils) { +define(['utils/utils'], +function(Utils) { // widget return Backbone.View.extend( @@ -30,8 +31,7 @@ right : 10, bottom : 50, left : 100 - }, - colors : ['#005824','#1A693B','#347B53','#4F8D6B','#699F83','#83B09B','#9EC2B3','#B8D4CB','#D2E6E3','#EDF8FB','#FFFFFF','#F1EEF6','#E6D3E1','#DBB9CD','#D19EB9','#C684A4','#BB6990','#B14F7C','#A63467','#9B1A53','#91003F'] + } }, // initialize @@ -43,8 +43,8 @@ this.options = Utils.merge(options, this.optionsDefault) // check requirements - if (!this.options.data || !this.options.div) { - console.debug('FAILED - HeatMapPlugin::initialize() - Parameters (container and/or data) missing.'); + if (!this.options.data || !this.options.div || !this.options.colors) { + console.debug('FAILED - HeatMapPlugin::initialize() - Parameters (container and/or data and/or colors) missing.'); return; } @@ -221,10 +221,10 @@ // add main group and translate this.svg = d3.select(this.$el[0]).append('svg') - .attr("width", width + margin.left + margin.right) - .attr("height", height + margin.top + margin.bottom) - .append("g") - .attr("transform", "translate(" + (container_width - width) / 2 + "," + (container_height - height) / 2 + ")") + .attr('width', width + margin.left + margin.right) + .attr('height', height + margin.top + margin.bottom) + .append('g') + .attr('transform', 'translate(' + (container_width - width) / 2 + ',' + (container_height - height) / 2 + ')') // reset sorting this.rowSortOrder = false; @@ -264,35 +264,35 @@ dataRange[dataRangeMax] = this.max; // create legend - var legend = this.svg.selectAll(".legend") + var legend = this.svg.selectAll('.legend') .data(dataRange) - .enter().append("g") - .attr("class", "legend"); + .enter().append('g') + .attr('class', 'legend'); // add boxes - legend.append("rect") - .attr("x", function(d, i) { + legend.append('rect') + .attr('x', function(d, i) { return legendCellWidth * i; }) - .attr("y", height + cellSize) - .attr("width", legendCellWidth) - .attr("height", cellSize) - .style("fill", function(d, i) { + .attr('y', height + cellSize) + .attr('width', legendCellWidth) + .attr('height', cellSize) + .style('fill', function(d, i) { return self.options.colors[i]; }); // add text - legend.append("text") - .attr("class", "mono") + legend.append('text') + .attr('class', 'mono') .text(function(d) { return d; }) - .attr("width", legendCellWidth) - .attr("x", function(d, i) { + .attr('width', legendCellWidth) + .attr('x', function(d, i) { return legendCellWidth * i; }) - .attr("y", height + cellSize) - .style("font-size", cellSize + "px"); + .attr('y', height + cellSize) + .style('font-size', cellSize + 'px'); }, // build column labels @@ -306,36 +306,36 @@ var colLabel = this.colLabel; // column labels - var colLabels = this.svg.append("g") - .selectAll(".colLabelg") + var colLabels = this.svg.append('g') + .selectAll('.colLabelg') .data(colLabel) .enter() - .append("text") + .append('text') .text(function (d) { return d; }) - .attr("x", 0) - .attr("y", function (d, i) { + .attr('x', 0) + .attr('y', function (d, i) { return colIndex.indexOf(i) * cellSize; }) - .style("font-size", cellSize + "px") - .style("text-anchor", "left") - .attr("transform", "translate(" + cellSize / 2 + ", -17) rotate (-90)") - .attr("class", function (d, i) { - return "colLabel mono c" + i; + .style('font-size', cellSize + 'px') + .style('text-anchor', 'left') + .attr('transform', 'translate(' + cellSize / 2 + ', -17) rotate (-90)') + .attr('class', function (d, i) { + return 'colLabel mono c' + i; }) - .on("mouseover", function(d) { - d3.select(this).classed("text-hover",true); - d3.select(this).style("font-size", parseInt(cellSize * 1.3) + "px"); + .on('mouseover', function(d) { + d3.select(this).classed('text-hover',true); + d3.select(this).style('font-size', parseInt(cellSize * 1.3) + 'px'); }) - .on("mouseout" , function(d) { - d3.select(this).classed("text-hover",false); - d3.select(this).style("font-size", parseInt(cellSize) + "px"); + .on('mouseout' , function(d) { + d3.select(this).classed('text-hover',false); + d3.select(this).style('font-size', parseInt(cellSize) + 'px'); }) - .on("click", function(d, i) { + .on('click', function(d, i) { self.colSortOrder=!self.colSortOrder; - self._sortByLabel("c", i, self.colSortOrder); - d3.select("#order").property("selectedIndex", 4).node().focus(); + self._sortByLabel('c', i, self.colSortOrder); + d3.select('#order').property('selectedIndex', 4).node().focus(); }); }, @@ -350,36 +350,36 @@ var rowLabel = this.rowLabel; // draw labels - var rowLabels = this.svg.append("g") - .selectAll(".rowLabelg") + var rowLabels = this.svg.append('g') + .selectAll('.rowLabelg') .data(rowLabel) .enter() - .append("text") + .append('text') .text(function (d) { return d; }) - .attr("x", 0) - .attr("y", function (d, i) { + .attr('x', 0) + .attr('y', function (d, i) { return rowIndex.indexOf(i) * cellSize; }) - .style("font-size", cellSize + "px") - .style("text-anchor", "end") - .attr("transform", "translate(-10," + cellSize / 1.5 + ")") - .attr("class", function (d, i) { - return "rowLabel mono r" + i; + .style('font-size', cellSize + 'px') + .style('text-anchor', 'end') + .attr('transform', 'translate(-10,' + cellSize / 1.5 + ')') + .attr('class', function (d, i) { + return 'rowLabel mono r' + i; } ) - .on("mouseover", function(d) { - d3.select(this).classed("text-hover",true); - d3.select(this).style("font-size", parseInt(cellSize * 1.3) + "px"); + .on('mouseover', function(d) { + d3.select(this).classed('text-hover',true); + d3.select(this).style('font-size', parseInt(cellSize * 1.3) + 'px'); }) - .on("mouseout" , function(d) { - d3.select(this).classed("text-hover",false); - d3.select(this).style("font-size", parseInt(cellSize) + "px"); + .on('mouseout' , function(d) { + d3.select(this).classed('text-hover',false); + d3.select(this).style('font-size', parseInt(cellSize) + 'px'); }) - .on("click", function(d, i) { + .on('click', function(d, i) { self.rowSortOrder=!self.rowSortOrder; - self._sortByLabel("r", i, self.rowSortOrder); - d3.select("#order").property("selectedIndex", 4).node().focus(); + self._sortByLabel('r', i, self.rowSortOrder); + d3.select('#order').property('selectedIndex', 4).node().focus(); }); }, @@ -396,47 +396,47 @@ var colLabel = this.colLabel; // heat map - var heatMap = this.svg.append("g").attr("class","g3") - .selectAll(".cellg") + var heatMap = this.svg.append('g').attr('class','g3') + .selectAll('.cellg') .data(self.data, function(d) { - return d.row_rank + ":" + d.col_rank; + return d.row_rank + ':' + d.col_rank; }) .enter() - .append("rect") - .attr("x", function(d) { + .append('rect') + .attr('x', function(d) { return colIndex.indexOf(d.col_rank) * cellSize; }) - .attr("y", function(d) { + .attr('y', function(d) { return rowIndex.indexOf(d.row_rank) * cellSize; }) - .attr("class", function(d){ - return "cell cell-border cr" + d.row_rank + " cc" + d.col_rank; + .attr('class', function(d){ + return 'cell cell-border cr' + d.row_rank + ' cc' + d.col_rank; }) - .attr("width", cellSize) - .attr("height", cellSize) - .style("fill", function(d) { + .attr('width', cellSize) + .attr('height', cellSize) + .style('fill', function(d) { return self.colorScale(d.value); }) - .on("mouseover", function(d){ + .on('mouseover', function(d){ // highlight text - d3.select(this).classed("cell-hover",true); - d3.selectAll(".rowLabel").classed("text-highlight",function(r,ri){ return ri==(d.row_rank);}); - d3.selectAll(".colLabel").classed("text-highlight",function(c,ci){ return ci==(d.col_rank);}); + d3.select(this).classed('cell-hover',true); + d3.selectAll('.rowLabel').classed('text-highlight',function(r,ri){ return ri==(d.row_rank);}); + d3.selectAll('.colLabel').classed('text-highlight',function(c,ci){ return ci==(d.col_rank);}); // update the tooltip position and value - d3.select("#heatmap-tooltip") - .style("left", (d3.event.pageX+10) + "px") - .style("top", (d3.event.pageY-10) + "px") - .select("#value") - .text("Label: " + rowLabel[d.row_rank] + " | " + colLabel[d.col_rank] + ", Value: " + d.value); + d3.select('#heatmap-tooltip') + .style('left', (d3.event.pageX+10) + 'px') + .style('top', (d3.event.pageY-10) + 'px') + .select('#value') + .text('Label: ' + rowLabel[d.row_rank] + ' | ' + colLabel[d.col_rank] + ', Value: ' + d.value); // show the tooltip - d3.select("#heatmap-tooltip").classed("hidden", false); + d3.select('#heatmap-tooltip').classed('hidden', false); }) - .on("mouseout", function(){ - d3.select(this).classed("cell-hover",false); - d3.selectAll(".rowLabel").classed("text-highlight",false); - d3.selectAll(".colLabel").classed("text-highlight",false); - d3.select("#heatmap-tooltip").classed("hidden", true); + .on('mouseout', function(){ + d3.select(this).classed('cell-hover',false); + d3.selectAll('.rowLabel').classed('text-highlight',false); + d3.selectAll('.colLabel').classed('text-highlight',false); + d3.select('#heatmap-tooltip').classed('hidden', true); }); }, @@ -450,7 +450,7 @@ // collect cells var cells=[]; - t.selectAll(".c" + rORc + i) + t.selectAll('.c' + rORc + i) .filter(function(ce){ cells.push(ce); }); @@ -465,7 +465,7 @@ }); // rows or columns - if(rORc == "r") { + if(rORc == 'r') { // get sorted key list var sorted = []; for (var i in cells) { @@ -473,14 +473,14 @@ } // sort cells - t.selectAll(".cell") - .attr("x", function(d) { + t.selectAll('.cell') + .attr('x', function(d) { return sorted.indexOf(d.col_rank) * cellSize; }); // sort labels - t.selectAll(".colLabel") - .attr("y", function (d, i) { + t.selectAll('.colLabel') + .attr('y', function (d, i) { return sorted.indexOf(i) * cellSize; }); } else { @@ -491,14 +491,14 @@ } // sort cells - t.selectAll(".cell") - .attr("y", function(d) { + t.selectAll('.cell') + .attr('y', function(d) { return sorted.indexOf(d.row_rank) * cellSize; }); // sort labels - t.selectAll(".rowLabel") - .attr("y", function (d, i) { + t.selectAll('.rowLabel') + .attr('y', function (d, i) { return sorted.indexOf(i) * cellSize; }); } @@ -518,60 +518,60 @@ // set duration / select element var t = this.svg.transition().duration(this.options.pace); - if(value=="hclust"){ - t.selectAll(".cell") - .attr("x", function(d) { + if(value=='hclust'){ + t.selectAll('.cell') + .attr('x', function(d) { return colIndex.indexOf(d.col_rank) * cellSize; }) - .attr("y", function(d) { + .attr('y', function(d) { return rowIndex.indexOf(d.row_rank) * cellSize; }); - t.selectAll(".rowLabel") - .attr("y", function(d, i) { + t.selectAll('.rowLabel') + .attr('y', function(d, i) { return rowIndex.indexOf(i) * cellSize; }); - t.selectAll(".colLabel") - .attr("y", function(d, i) { + t.selectAll('.colLabel') + .attr('y', function(d, i) { return colIndex.indexOf(i) * cellSize; }); - } else if (value=="byboth") { - t.selectAll(".cell") - .attr("x", function(d) { + } else if (value=='byboth') { + t.selectAll('.cell') + .attr('x', function(d) { return d.col_rank * cellSize; }) - .attr("y", function(d) { + .attr('y', function(d) { return d.row_rank * cellSize; }); - t.selectAll(".rowLabel") - .attr("y", function (d, i) { + t.selectAll('.rowLabel') + .attr('y', function (d, i) { return i * cellSize; }); - t.selectAll(".colLabel") - .attr("y", function (d, i) { + t.selectAll('.colLabel') + .attr('y', function (d, i) { return i * cellSize; }); - } else if (value=="byrow") { - t.selectAll(".cell") - .attr("y", function(d) { + } else if (value=='byrow') { + t.selectAll('.cell') + .attr('y', function(d) { return d.row_rank * cellSize; }); - t.selectAll(".rowLabel") - .attr("y", function (d, i) { + t.selectAll('.rowLabel') + .attr('y', function (d, i) { return i * cellSize; }); - } else if (value=="bycol"){ - t.selectAll(".cell") - .attr("x", function(d) { + } else if (value=='bycol'){ + t.selectAll('.cell') + .attr('x', function(d) { return d.col_rank * cellSize; }); - t.selectAll(".colLabel") - .attr("y", function (d, i) { + t.selectAll('.colLabel') + .attr('y', function (d, i) { return i * cellSize; }); } @@ -582,35 +582,35 @@ // // selection // - var sa=d3.select(".g3") - .on("mousedown", function() { + var sa=d3.select('.g3') + .on('mousedown', function() { if( !d3.event.altKey) { - d3.selectAll(".cell-selected").classed("cell-selected", false); - d3.selectAll(".rowLabel").classed("text-selected", false); - d3.selectAll(".colLabel").classed("text-selected", false); + d3.selectAll('.cell-selected').classed('cell-selected', false); + d3.selectAll('.rowLabel').classed('text-selected', false); + d3.selectAll('.colLabel').classed('text-selected', false); } var p = d3.mouse(this); - sa.append("rect") + sa.append('rect') .attr({ rx : 0, ry : 0, - class : "selection", + class : 'selection', x : p[0], y : p[1], width : 1, height : 1 }) }) - .on("mousemove", function() { - var s = sa.select("rect.selection"); + .on('mousemove', function() { + var s = sa.select('rect.selection'); if(!s.empty()) { var p = d3.mouse(this), d = { - x : parseInt(s.attr("x"), 10), - y : parseInt(s.attr("y"), 10), - width : parseInt(s.attr("width"), 10), - height : parseInt(s.attr("height"), 10) + x : parseInt(s.attr('x'), 10), + y : parseInt(s.attr('y'), 10), + width : parseInt(s.attr('width'), 10), + height : parseInt(s.attr('height'), 10) }, move = { x : p[0] - d.x, @@ -633,46 +633,46 @@ s.attr(d); // deselect all temporary selected state objects - d3.selectAll(".cell-selection.cell-selected").classed("cell-selected", false); - d3.selectAll(".text-selection.text-selected").classed("text-selected",false); - d3.selectAll(".cell").filter(function(cell_d, i) { - if(!d3.select(this).classed("cell-selected") && + d3.selectAll('.cell-selection.cell-selected').classed('cell-selected', false); + d3.selectAll('.text-selection.text-selected').classed('text-selected',false); + d3.selectAll('.cell').filter(function(cell_d, i) { + if(!d3.select(this).classed('cell-selected') && // inner circle inside selection frame (this.x.baseVal.value)+cellSize >= d.x && (this.x.baseVal.value)<=d.x+d.width && (this.y.baseVal.value)+cellSize >= d.y && (this.y.baseVal.value)<=d.y+d.height) { d3.select(this) - .classed("cell-selection", true) - .classed("cell-selected", true); + .classed('cell-selection', true) + .classed('cell-selected', true); - d3.select(".r"+(cell_d.row_rank)) - .classed("text-selection",true) - .classed("text-selected",true); + d3.select('.r'+(cell_d.row_rank)) + .classed('text-selection',true) + .classed('text-selected',true); - d3.select(".c"+(cell_d.col_rank)) - .classed("text-selection",true) - .classed("text-selected",true); + d3.select('.c'+(cell_d.col_rank)) + .classed('text-selection',true) + .classed('text-selected',true); } }); } }) - .on("mouseup", function() { + .on('mouseup', function() { // remove selection frame - sa.selectAll("rect.selection").remove(); + sa.selectAll('rect.selection').remove(); // remove temporary selection marker class - d3.selectAll(".cell-selection").classed("cell-selection", false); - d3.selectAll(".text-selection").classed("text-selection",false); + d3.selectAll('.cell-selection').classed('cell-selection', false); + d3.selectAll('.text-selection').classed('text-selection', false); }) - .on("mouseout", function() { + .on('mouseout', function() { if(d3.event.relatedTarget.tagName=='html') { // remove selection frame - sa.selectAll("rect.selection").remove(); + sa.selectAll('rect.selection').remove(); // remove temporary selection marker class - d3.selectAll(".cell-selection").classed("cell-selection", false); - d3.selectAll(".rowLabel").classed("text-selected",false); - d3.selectAll(".colLabel").classed("text-selected",false); + d3.selectAll('.cell-selection').classed('cell-selection', false); + d3.selectAll('.rowLabel').classed('text-selected',false); + d3.selectAll('.colLabel').classed('text-selected',false); } }); }, diff -r 9dd03d95b91c22c1a35aa6328e2d7261705fe454 -r 21121d6283a95942061819f5e788ab41cfc1c000 config/plugins/visualizations/charts/static/charts/heatmap/heatmap.js --- a/config/plugins/visualizations/charts/static/charts/heatmap/heatmap.js +++ b/config/plugins/visualizations/charts/static/charts/heatmap/heatmap.js @@ -1,5 +1,6 @@ // dependencies -define(['utils/utils', 'plugin/charts/heatmap/heatmap-plugin'], function(Utils, HeatmapPlugin) { +define(['utils/utils', 'plugin/charts/heatmap/heatmap-plugin', 'plugin/charts/heatmap/heatmap-parameters'], +function(Utils, HeatmapPlugin, HeatmapParameters) { // widget return Backbone.View.extend( @@ -24,8 +25,9 @@ // draw plot var heatmap = new HeatmapPlugin({ - 'data' : group.values, - 'div' : self.options.canvas[group_index] + 'colors' : HeatmapParameters.colorSets[chart.settings.get('color_set')], + 'data' : group.values, + 'div' : self.options.canvas[group_index] }); } 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.