@@ -85,6 +85,9 @@ SpectrumChartD3 = function(elem, options) {
85
85
if ( ( typeof this . options . doubleClickDelay ) !== 'number' ) this . options . doubleClickDelay = 500 ;
86
86
87
87
this . options . refLineTopPad = 30 ;
88
+ this . options . refLineWidth = 1 ;
89
+ this . options . refLineWidthHover = 2 ;
90
+ this . options . featureLineWidth = 2 ;
88
91
89
92
self . options . logYFracTop = 0.05 ;
90
93
self . options . logYFracBottom = 0.025 ;
@@ -3983,7 +3986,7 @@ SpectrumChartD3.prototype.drawHighlightRegions = function(){
3983
3986
* -------------- Reference Gamma Lines Functions --------------
3984
3987
*/
3985
3988
SpectrumChartD3 . prototype . drawRefGammaLines = function ( ) {
3986
- /*Drawing of the refrenece lines is super duper un-optimized!!! */
3989
+ /*Drawing of the reference lines is super duper un-optimized!!! */
3987
3990
const self = this ;
3988
3991
3989
3992
if ( ! self . refLines || ! self . refLines . length || ! self . refLines [ 0 ] . lines || ! self . refLines [ 0 ] . lines . length ) {
@@ -4013,13 +4016,13 @@ SpectrumChartD3.prototype.drawRefGammaLines = function() {
4013
4016
var gy = self . vis . selectAll ( "g.ref" )
4014
4017
. data ( reflines , function ( d ) { return d . id ; } )
4015
4018
. attr ( "transform" , tx )
4016
- . attr ( "stroke-width" , 1 ) ;
4019
+ . attr ( "stroke-width" , self . options . refLineWidth ) ;
4017
4020
4018
4021
var gye = gy . enter ( ) . insert ( "g" , "a" )
4019
4022
. attr ( "class" , "ref" )
4020
4023
. attr ( "transform" , tx ) ;
4021
4024
4022
- function stroke ( d ) { return d . parent . color ; } ;
4025
+ function stroke ( d ) { return d . color ? d . color : d . parent . color ; } ;
4023
4026
4024
4027
function dashfunc ( d ) {
4025
4028
const particles = [ "gamma" , "xray" , "beta" , "alpha" , "positron" , "electronCapture" , "cascade-sum" , "S.E." , "D.E." ] ;
@@ -4413,8 +4416,10 @@ SpectrumChartD3.prototype.updateMouseCoordText = function() {
4413
4416
self . refLineInfoTxt . attr ( "transform" , tx ) ;
4414
4417
}
4415
4418
4416
-
4417
- d3 . select ( nearestline ) . attr ( "stroke-width" , 2 ) . select ( "line" ) . attr ( "dx" , "-1" ) ;
4419
+ d3 . select ( nearestline )
4420
+ . attr ( "stroke-width" , self . options . refLineWidthHover )
4421
+ . select ( "line" )
4422
+ . attr ( "dx" , "-1" ) ;
4418
4423
}
4419
4424
4420
4425
SpectrumChartD3 . prototype . setShowMouseStats = function ( d ) {
@@ -8174,7 +8179,7 @@ SpectrumChartD3.prototype.updateFeatureMarkers = function( mouseDownEnergy, over
8174
8179
if ( ! self . doubleEscape && doubleEscapeEnergy >= 0 ) {
8175
8180
self . doubleEscape = self . vis . append ( "line" ) /* create double escape line */
8176
8181
. attr ( "class" , "peakLine" )
8177
- . attr ( "stroke-width" , 2 )
8182
+ . attr ( "stroke-width" , self . options . featureLineWidth )
8178
8183
. attr ( "x1" , doubleEscapePix )
8179
8184
. attr ( "x2" , doubleEscapePix )
8180
8185
. attr ( "y1" , 0 )
@@ -8235,7 +8240,7 @@ SpectrumChartD3.prototype.updateFeatureMarkers = function( mouseDownEnergy, over
8235
8240
/* draw compton edge line here */
8236
8241
self . comptonPeak = self . vis . append ( "line" )
8237
8242
. attr ( "class" , "peakLine" )
8238
- . attr ( "stroke-width" , 2 )
8243
+ . attr ( "stroke-width" , self . options . featureLineWidth )
8239
8244
. attr ( "y1" , 0 ) ;
8240
8245
self . comptonPeakText = self . vis . append ( "text" )
8241
8246
. attr ( "class" , "peakText" )
@@ -8294,7 +8299,7 @@ SpectrumChartD3.prototype.updateFeatureMarkers = function( mouseDownEnergy, over
8294
8299
/* draw compton edge line here */
8295
8300
self . comptonEdge = self . vis . append ( "line" )
8296
8301
. attr ( "class" , "peakLine" )
8297
- . attr ( "stroke-width" , 2 ) ;
8302
+ . attr ( "stroke-width" , self . options . featureLineWidth ) ;
8298
8303
self . comptonEdgeText = self . vis . append ( "text" )
8299
8304
. attr ( "class" , "peakText" )
8300
8305
. text ( self . options . txt . comptonEdge ) ;
@@ -8386,7 +8391,7 @@ SpectrumChartD3.prototype.updateFeatureMarkers = function( mouseDownEnergy, over
8386
8391
/* draw compton edge line here */
8387
8392
self . clickedSumPeak = self . vis . append ( "line" )
8388
8393
. attr ( "class" , "peakLine" )
8389
- . attr ( "stroke-width" , 2 ) ;
8394
+ . attr ( "stroke-width" , self . options . featureLineWidth ) ;
8390
8395
self . clickedSumPeakMeas = self . vis . append ( "text" )
8391
8396
. attr ( "class" , "peakText" ) ;
8392
8397
}
@@ -8435,7 +8440,7 @@ SpectrumChartD3.prototype.updateFeatureMarkers = function( mouseDownEnergy, over
8435
8440
/* draw left-sum peak line here */
8436
8441
self . leftSumPeak = self . vis . append ( "line" )
8437
8442
. attr ( "class" , "peakLine" )
8438
- . attr ( "stroke-width" , 2 ) ;
8443
+ . attr ( "stroke-width" , self . options . featureLineWidth ) ;
8439
8444
self . leftSumPeakText = self . vis . append ( "text" )
8440
8445
. attr ( "class" , "peakText" )
8441
8446
. text ( self . options . txt . clickedPeak ) ;
@@ -8481,7 +8486,7 @@ SpectrumChartD3.prototype.updateFeatureMarkers = function( mouseDownEnergy, over
8481
8486
/* draw sum peak line here */
8482
8487
self . sumPeak = self . vis . append ( "line" )
8483
8488
. attr ( "class" , "peakLine" )
8484
- . attr ( "stroke-width" , 2 ) ;
8489
+ . attr ( "stroke-width" , self . options . featureLineWidth ) ;
8485
8490
self . sumPeakText = self . vis . append ( "text" )
8486
8491
. attr ( "class" , "peakText" )
8487
8492
. text ( self . options . txt . sumPeak ) ;
0 commit comments