Skip to content

Commit cda8d83

Browse files
committed
Add potentually including the ref line name in chart double-click callback.
WIP.
1 parent 75953e7 commit cda8d83

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

d3_resources/SpectrumChartD3.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2605,7 +2605,13 @@ SpectrumChartD3.prototype.handleVisMouseUp = function () {
26052605
self.mouseDownRoi = null;
26062606
}
26072607

2608-
self.WtEmit(self.chart.id, {name: 'doubleclicked'}, energy, count);
2608+
let ref_line = "";
2609+
if( self.mousedOverRefLine && self.mousedOverRefLine.__data__ && self.mousedOverRefLine.__data__.parent )
2610+
{
2611+
ref_line = self.mousedOverRefLine.__data__.parent.parent;
2612+
console.log( "self.mousedOverRefLine:", self.mousedOverRefLine, ", data:", self.mousedOverRefLine.__data__, ", parent:", self.mousedOverRefLine.__data__.parent );
2613+
}
2614+
self.WtEmit(self.chart.id, {name: 'doubleclicked'}, energy, count, ref_line);
26092615
} else {
26102616
// This is the first click - maybe there will be another click, maybe not
26112617
if( !modKeyPressed )
@@ -3449,10 +3455,6 @@ SpectrumChartD3.prototype.mousemove = function () {
34493455
return function() {
34503456
/*This function is called whenever a mouse movement occurs */
34513457
var p = d3.mouse(self.vis[0][0]);
3452-
//var t = d3.event.changedTouches;
3453-
3454-
var energy = self.xScale.invert(p[0]),
3455-
mousey = self.yScale.invert(p[1]);
34563458

34573459
self.updateFeatureMarkers(-1);
34583460
self.updateMouseCoordText();
@@ -3482,8 +3484,6 @@ SpectrumChartD3.prototype.mousemove = function () {
34823484

34833485
if (self.dragged) {
34843486
/*We make it here if a data point is dragged (which is not allowed) */
3485-
3486-
/*self.dragged.y = self.yScale.invert(Math.max(0, Math.min(self.size.height, p[1]))); */
34873487
self.update(false); /* boolean set to false to indicate no animation needed */
34883488
};
34893489

@@ -4016,7 +4016,7 @@ SpectrumChartD3.prototype.drawRefGammaLines = function() {
40164016
var bisector = d3.bisector(function(d){return d.e;});
40174017
var lindex = bisector.left( lines, xrange[0] );
40184018
var rindex = bisector.right( lines, xrange[1] );
4019-
return lines.slice(lindex,rindex).filter(function(d){return d.h > 1E-16;});
4019+
return lines.slice(lindex,rindex).filter(function(d){return d.h > 1E-32;});
40204020
}
40214021

40224022
let reflines = [];
@@ -4211,8 +4211,8 @@ SpectrumChartD3.prototype.handleUpdateKineticRefLineUpdate = function(){
42114211
if( bestRefLine !== this.currentKineticRefLine ) {
42124212
this.currentKineticRefLine = bestRefLine;
42134213
this.drawRefGammaLines();
4214+
this.updateMouseCoordText();
42144215
}
4215-
42164216
}//SpectrumChartD3.prototype.handleUpdateKineticRefLineUpdate
42174217

42184218
/**

0 commit comments

Comments
 (0)