Skip to content

Commit f5b321a

Browse files
committed
heatmap bug fixed
1 parent e478876 commit f5b321a

File tree

1 file changed

+29
-2
lines changed

1 file changed

+29
-2
lines changed

public/javascripts/visualisation.js

+29-2
Original file line numberDiff line numberDiff line change
@@ -580,13 +580,23 @@ function joinHeapMap(data) {
580580
;
581581

582582

583-
var heatMap = svg.selectAll(".heatmap")
583+
function stopEvent() {
584+
d3.event.preventDefault();
585+
d3.event.sourceEvent.stopPropagation();
586+
d3.event.preventDefault();
587+
d3.event.stopPropagation();
588+
d3.event.stopImmediatePropagation();
589+
}
590+
591+
var heatMap = svg
592+
.append("g")
593+
.attr("class", "cell_heat_map g3")
594+
.selectAll(".heatmap")
584595
.data(data.values, function(d) {
585596
var row = d.row;
586597
if (d.value != -10) {
587598
numLabel[row - 1] += 1;
588599
}
589-
if (d.value == -10) return null;
590600
return d.row + ':' + d.col;
591601
})
592602
.enter()
@@ -597,6 +607,8 @@ function joinHeapMap(data) {
597607
.attr("width", function(d) { return cellSize; })
598608
.attr("height", function(d) { return cellSize; })
599609
.style("fill", function(d) { return colorScale(d.value); })
610+
.on("mousedown", stopEvent)
611+
.on("click", stopEvent)
600612
.on("mouseover", function(d){
601613
//highlight text
602614
d3.select(this).classed("cell-hover",true);
@@ -656,6 +668,21 @@ function joinHeapMap(data) {
656668
.attr("class", function (d,i) { return "numLabel mono r"+i;} )
657669
;
658670

671+
var sa=d3.select(".g3")
672+
.on("mousedown", function() {
673+
return null;
674+
})
675+
.on("mousemove", function() {
676+
return null;
677+
})
678+
.on("mouseup", function() {
679+
return null;
680+
})
681+
.on("mouseout", function() {
682+
return null;
683+
})
684+
;
685+
659686
function cdrTransform(cdr) {
660687
var cdr3aa = cdr.cdr3aa,
661688
//cdr3nt = cdr.cdr3nt,

0 commit comments

Comments
 (0)