@@ -725,11 +725,23 @@ export default {
725
725
// setSeries links graphs so clicking an item to hide it also hides the other graph item
726
726
// setSeries: true,
727
727
},
728
+ bind: {
729
+ mouseup : (self , targ , handler ) => {
730
+ return (e ) => {
731
+ // Single click while paused will resume the graph
732
+ // This makes it possible to resume in TlmViewer widgets
733
+ if (this .state === ' pause' && self .select .width === 0 ) {
734
+ this .$emit (' start' )
735
+ }
736
+ handler (e)
737
+ }
738
+ },
739
+ },
728
740
},
729
741
hooks: {
730
742
setScale: [
731
743
(chart , key ) => {
732
- if (key == ' x' && ! this .zoomOverview && this .overview ) {
744
+ if (key === ' x' && ! this .zoomOverview && this .overview ) {
733
745
this .zoomChart = true
734
746
let left = Math .round (
735
747
this .overview .valToPos (chart .scales .x .min , ' x' )
@@ -742,6 +754,14 @@ export default {
742
754
}
743
755
},
744
756
],
757
+ setSelect: [
758
+ (chart ) => {
759
+ // Pause the graph while selecting a range to zoom
760
+ if (this .state === ' start' && chart .select .width > 0 ) {
761
+ this .$emit (' pause' )
762
+ }
763
+ },
764
+ ],
745
765
ready: [
746
766
(u ) => {
747
767
let canvas = u .root .querySelector (' .u-over' )
@@ -819,6 +839,10 @@ export default {
819
839
setSelect: [
820
840
(chart ) => {
821
841
if (! this .zoomChart ) {
842
+ // Pause the graph while selecting an overview range to zoom
843
+ if (this .state === ' start' && chart .select .width > 0 ) {
844
+ this .$emit (' pause' )
845
+ }
822
846
this .zoomOverview = true
823
847
let min = chart .posToVal (chart .select .left , ' x' )
824
848
let max = chart .posToVal (
@@ -997,7 +1021,7 @@ export default {
997
1021
editGraphClose : function () {
998
1022
this .editGraph = false
999
1023
if (this .needToUpdate ) {
1000
- if (this .subscription === null ) {
1024
+ if (this .subscription == null ) {
1001
1025
this .startGraph ()
1002
1026
} else {
1003
1027
// NOTE: removing and adding back to back broke the streaming_api
@@ -1291,7 +1315,7 @@ export default {
1291
1315
// Draw green limits & operational limits
1292
1316
ctx .fillStyle = ' rgba(0,255,0,0.15)'
1293
1317
// If there are no operational limits the interior is all green
1294
- if (this .limitsValues .length == 4 ) {
1318
+ if (this .limitsValues .length === 4 ) {
1295
1319
// Determine if we show any green
1296
1320
if (
1297
1321
u .scales .y .min < this .limitsValues [2 ] && // yellowHigh
@@ -1378,7 +1402,7 @@ export default {
1378
1402
if (typeof rawValue === ' string' || isNaN (rawValue)) {
1379
1403
return ' NaN'
1380
1404
} else {
1381
- return rawValue === null ? ' --' : rawValue .toFixed (2 )
1405
+ return rawValue == null ? ' --' : rawValue .toFixed (2 )
1382
1406
}
1383
1407
},
1384
1408
},
@@ -1469,7 +1493,7 @@ export default {
1469
1493
for (let i = 0 ; i < data .length ; i++ ) {
1470
1494
let time = data[i].__time / 1_000_000_000.0 // Time in seconds
1471
1495
let length = data[0 ].length
1472
- if (length == 0 || time > data[0 ][length - 1 ]) {
1496
+ if (length === 0 || time > data[0 ][length - 1 ]) {
1473
1497
// Nominal case - append new data to end
1474
1498
for (let j = 0 ; j < this .data .length ; j++ ) {
1475
1499
this .data [j].push (null )
@@ -1491,7 +1515,7 @@ export default {
1491
1515
}
1492
1516
}
1493
1517
// If we weren't passed a startTime notify grapher of our start
1494
- if (this .startTime === null ) {
1518
+ if (this .startTime == null ) {
1495
1519
let newStartTime = this .data [0 ][0 ] * 1_000_000_000
1496
1520
this .$emit (' started' , newStartTime)
1497
1521
}
@@ -1503,7 +1527,7 @@ export default {
1503
1527
set_data_at_index : function (index , time , new_data ) {
1504
1528
this .data [0 ][index] = time
1505
1529
for (const [key , value ] of Object .entries (new_data)) {
1506
- if (key == ' time' ) {
1530
+ if (key === ' time' ) {
1507
1531
continue
1508
1532
}
1509
1533
let key_index = this .indexes [key]
0 commit comments