@@ -65,8 +65,9 @@ class CFDRenderer extends UIControlsRenderer {
6565 this . eventBus ?. addEventListener ( 'change-time-range-scatterplot' , this . updateBrushSelection . bind ( this ) ) ;
6666 this . eventBus ?. addEventListener ( 'scatterplot-mousemove' , ( event ) => this . #handleMouseEvent( event , 'scatterplot-mousemove' ) ) ;
6767 this . eventBus ?. addEventListener ( 'scatterplot-mouseleave' , ( ) => this . hideTooltipAndMovingLine ( ) ) ;
68- this . eventBus ?. addEventListener ( 'change-time-interval-scatterplot' , ( ) => {
69- this . handleXAxisClick ( ) ;
68+ this . eventBus ?. addEventListener ( 'change-time-interval-scatterplot' , ( timeInterval ) => {
69+ this . timeInterval = timeInterval ;
70+ this . drawXAxis ( this . gx , this . x . copy ( ) . domain ( this . selectedTimeRange ) , this . height , true ) ;
7071 } ) ;
7172 }
7273
@@ -113,7 +114,7 @@ class CFDRenderer extends UIControlsRenderer {
113114
114115 const brushArea = this . #createAreaGenerator( this . x , this . y . copy ( ) . range ( [ this . focusHeight - this . margin . top , 4 ] ) ) ;
115116 this . #drawStackedAreaChart( svgBrush , this . #stackedData, brushArea ) ;
116- this . changeTimeInterval ( false , " cfd" ) ;
117+ this . changeTimeInterval ( false , ' cfd' ) ;
117118 this . drawXAxis ( svgBrush . append ( 'g' ) , this . x , this . focusHeight - this . margin . top ) ;
118119 this . brushGroup = svgBrush . append ( 'g' ) ;
119120 this . brushGroup . call ( this . brush ) . call (
@@ -139,11 +140,11 @@ class CFDRenderer extends UIControlsRenderer {
139140 */
140141 updateGraph ( domain ) {
141142 const maxY = d3 . max ( this . #stackedData[ this . #stackedData. length - 1 ] , ( d ) => ( d . data . date <= domain [ 1 ] ? d [ 1 ] : - 1 ) ) ;
142- this . reportingRangeDays = calculateDaysBetweenDates ( domain [ 0 ] , domain [ 1 ] )
143+ this . reportingRangeDays = calculateDaysBetweenDates ( domain [ 0 ] , domain [ 1 ] ) ;
143144 this . currentXScale = this . x . copy ( ) . domain ( domain ) ;
144145 this . currentYScale = this . y . copy ( ) . domain ( [ 0 , maxY ] ) . nice ( ) ;
145- this . changeTimeInterval ( false , " cfd" ) ;
146- this . drawXAxis ( this . gx , this . currentXScale , this . height , true ) ;
146+ this . changeTimeInterval ( false , ' cfd' ) ;
147+ this . drawXAxis ( this . gx , this . currentXScale , this . height , true ) ;
147148 this . drawYAxis ( this . gy , this . currentYScale ) ;
148149
149150 this . chartArea
@@ -286,9 +287,8 @@ class CFDRenderer extends UIControlsRenderer {
286287 */
287288 setupXAxisControl ( ) {
288289 this . gx . on ( 'click' , ( ) => {
289- this . changeTimeInterval ( true , " cfd" ) ;
290+ this . changeTimeInterval ( true , ' cfd' ) ;
290291 this . drawXAxis ( this . gx , this . x . copy ( ) . domain ( this . selectedTimeRange ) , this . height , true ) ;
291-
292292 } ) ;
293293 }
294294
@@ -355,7 +355,7 @@ class CFDRenderer extends UIControlsRenderer {
355355 g . selectAll ( 'text' ) . attr ( 'y' , 30 ) . style ( 'fill' , 'black' ) ;
356356 g . attr ( 'clip-path' , `url(#${ clipId } )` ) ;
357357 } else {
358- axis = this . createXAxis ( x , " months" ) ;
358+ axis = this . createXAxis ( x , ' months' ) ;
359359 g . call ( axis ) . attr ( 'transform' , `translate(0, ${ height } )` ) ;
360360 }
361361 }
@@ -442,9 +442,17 @@ class CFDRenderer extends UIControlsRenderer {
442442 * Creates a tooltip and a moving line for the chart used for the metrics and observation logging.
443443 * @private
444444 */
445- #createTooltipAndMovingLine( x , y ) {
445+ #createTooltipAndMovingLine( x , y ) {
446446 this . tooltip = d3 . select ( 'body' ) . append ( 'div' ) . attr ( 'class' , styles . tooltip ) . attr ( 'id' , 'c-tooltip' ) . style ( 'opacity' , 0 ) ;
447- this . cfdLine = this . chartArea . append ( 'line' ) . attr ( 'id' , 'cfd-line' ) . attr ( 'stroke' , 'black' ) . attr ( 'y1' , 0 ) . attr ( 'y2' , y ) . attr ( 'x1' , x ) . attr ( 'x2' , x ) . style ( 'display' , 'none' ) ;
447+ this . cfdLine = this . chartArea
448+ . append ( 'line' )
449+ . attr ( 'id' , 'cfd-line' )
450+ . attr ( 'stroke' , 'black' )
451+ . attr ( 'y1' , 0 )
452+ . attr ( 'y2' , y )
453+ . attr ( 'x1' , x )
454+ . attr ( 'x2' , x )
455+ . style ( 'display' , 'none' ) ;
448456 }
449457
450458 /**
@@ -469,54 +477,53 @@ class CFDRenderer extends UIControlsRenderer {
469477 const gridContainer = this . tooltip ?. append ( 'div' ) . attr ( 'class' , 'grid grid-cols-2' ) ;
470478 if ( event . metrics . averageCycleTime > 0 ) {
471479 gridContainer
472- . append ( " span" )
473- . text ( " Cycle time:" )
474- . attr ( " class" , " pr-1" )
475- . style ( " text-align" , " start" )
476- . style ( " color" , this . #cycleTimeColor) ;
480+ . append ( ' span' )
481+ . text ( ' Cycle time:' )
482+ . attr ( ' class' , ' pr-1' )
483+ . style ( ' text-align' , ' start' )
484+ . style ( ' color' , this . #cycleTimeColor) ;
477485 gridContainer
478- . append ( " span" )
479- . text ( `${ event . metrics . averageCycleTime } days` )
480- . attr ( " class" , " pl-1" )
481- . style ( " text-align" , " start" )
482- . style ( " color" , this . #cycleTimeColor) ;
486+ . append ( ' span' )
487+ . text ( `${ event . metrics . averageCycleTime } days` )
488+ . attr ( ' class' , ' pl-1' )
489+ . style ( ' text-align' , ' start' )
490+ . style ( ' color' , this . #cycleTimeColor) ;
483491 }
484492 if ( event . metrics . averageLeadTime > 0 ) {
485493 gridContainer
486- . append ( " span" )
487- . text ( " Lead time:" )
488- . attr ( " class" , " pr-1" )
489- . style ( " text-align" , " start" )
490- . style ( " color" , this . #leadTimeColor) ;
494+ . append ( ' span' )
495+ . text ( ' Lead time:' )
496+ . attr ( ' class' , ' pr-1' )
497+ . style ( ' text-align' , ' start' )
498+ . style ( ' color' , this . #leadTimeColor) ;
491499 gridContainer
492- . append ( " span" )
493- . text ( `${ event . metrics . averageLeadTime } days` )
494- . attr ( " class" , " pl-1" )
495- . style ( " text-align" , " start" )
496- . style ( " color" , this . #leadTimeColor) ;
500+ . append ( ' span' )
501+ . text ( `${ event . metrics . averageLeadTime } days` )
502+ . attr ( ' class' , ' pl-1' )
503+ . style ( ' text-align' , ' start' )
504+ . style ( ' color' , this . #leadTimeColor) ;
497505 }
498506 if ( event . metrics . wip > 0 ) {
499- gridContainer . append ( " span" ) . text ( " WIP:" ) . attr ( " class" , " pr-1" ) . style ( " text-align" , " start" ) . style ( " color" , this . #wipColor) ;
507+ gridContainer . append ( ' span' ) . text ( ' WIP:' ) . attr ( ' class' , ' pr-1' ) . style ( ' text-align' , ' start' ) . style ( ' color' , this . #wipColor) ;
500508 gridContainer
501- . append ( " span" )
502- . text ( `${ event . metrics . wip } items` )
503- . attr ( " class" , " pl-1" )
504- . style ( " text-align" , " start" )
505- . style ( " color" , this . #wipColor) ;
509+ . append ( ' span' )
510+ . text ( `${ event . metrics . wip } items` )
511+ . attr ( ' class' , ' pl-1' )
512+ . style ( ' text-align' , ' start' )
513+ . style ( ' color' , this . #wipColor) ;
506514 }
507515 if ( event . metrics . throughput > 0 ) {
508- gridContainer . append ( " span" ) . text ( " Throughput:" ) . attr ( " class" , " pr-1" ) . style ( " text-align" , " start" ) ;
509- gridContainer . append ( " span" ) . text ( `${ event . metrics . throughput } items` ) . attr ( " class" , " pl-1" ) . style ( " text-align" , " start" ) ;
516+ gridContainer . append ( ' span' ) . text ( ' Throughput:' ) . attr ( ' class' , ' pr-1' ) . style ( ' text-align' , ' start' ) ;
517+ gridContainer . append ( ' span' ) . text ( `${ event . metrics . throughput } items` ) . attr ( ' class' , ' pl-1' ) . style ( ' text-align' , ' start' ) ;
510518 }
511519 if ( event . observationBody ) {
512- gridContainer . append ( " span" ) . text ( " Observation:" ) . attr ( " class" , " pr-1" ) . style ( " text-align" , " start" ) ;
520+ gridContainer . append ( ' span' ) . text ( ' Observation:' ) . attr ( ' class' , ' pr-1' ) . style ( ' text-align' , ' start' ) ;
513521 gridContainer
514- . append ( " span" )
515- . text ( `${ event . observationBody . substring ( 0 , 15 ) } ...` )
516- . attr ( " class" , " pl-1" )
517- . style ( " text-align" , " start" ) ;
522+ . append ( ' span' )
523+ . text ( `${ event . observationBody . substring ( 0 , 15 ) } ...` )
524+ . attr ( ' class' , ' pl-1' )
525+ . style ( ' text-align' , ' start' ) ;
518526 }
519-
520527 }
521528
522529 /**
@@ -569,7 +576,7 @@ class CFDRenderer extends UIControlsRenderer {
569576
570577 // Ensure xPosition is within the chart's range
571578 if ( xPosition < 0 || xPosition > this . width ) {
572- console . log ( " xPosition out of bounds:" , xPosition ) ;
579+ console . log ( ' xPosition out of bounds:' , xPosition ) ;
573580 return ;
574581 }
575582
@@ -629,7 +636,7 @@ class CFDRenderer extends UIControlsRenderer {
629636 const noOfItemsAfter = this . #getNoOfItems( currentDataEntry , this . states [ this . states . indexOf ( 'analysis_active' ) ] ) ;
630637
631638 const wip = noOfItemsAfter - noOfItemsBefore ;
632- const throughput = averageLeadTime ? parseFloat ( ( wip / averageLeadTime ) . toFixed ( 1 ) ) : undefined ;
639+ const throughput = averageLeadTime ? parseFloat ( ( wip / averageLeadTime ) . toFixed ( 1 ) ) : undefined ;
633640
634641 excludeCycleTime && ( averageCycleTime = null ) ;
635642 return {
0 commit comments