@@ -105,13 +105,15 @@ export const ReactTimeSeriesWithoutContext = ({
105
105
106
106
const durationGroups = useMemo ( ( ) => {
107
107
if ( ! annotation ?. durations )
108
- return [
109
- {
110
- color : "#888888" ,
111
- misc : true ,
112
- durations : [ ] ,
113
- } ,
114
- ]
108
+ return ! enabledTools . includes ( "create-durations" )
109
+ ? [ ]
110
+ : [
111
+ {
112
+ color : "#888888" ,
113
+ misc : true ,
114
+ durations : [ ] ,
115
+ } ,
116
+ ]
115
117
116
118
const availableLabels = Array . from (
117
119
new Set (
@@ -138,15 +140,18 @@ export const ReactTimeSeriesWithoutContext = ({
138
140
} )
139
141
. filter ( ( dg ) => dg . durations . length > 0 )
140
142
141
- durationGroups . push ( {
142
- color : "#888888" ,
143
- misc : true ,
144
- durations : durationGroups
145
- . filter ( ( dg ) => dg . durations . length === 1 )
146
- . flatMap ( ( dg ) => dg . durations )
147
- . concat ( annotation . durations . filter ( ( d ) => ! d . label ) )
148
- . map ( ( d ) => ( { ...d , color : getRandomColorUsingHash ( d . label ) } ) ) ,
149
- } )
143
+ if ( enabledTools . includes ( "create-durations" ) ) {
144
+ durationGroups . push ( {
145
+ color : "#888888" ,
146
+ misc : true ,
147
+ durations : durationGroups
148
+ . filter ( ( dg ) => dg . durations . length === 1 )
149
+ . flatMap ( ( dg ) => dg . durations )
150
+ . concat ( annotation . durations . filter ( ( d ) => ! d . label ) )
151
+ . map ( ( d ) => ( { ...d , color : getRandomColorUsingHash ( d . label ) } ) ) ,
152
+ } )
153
+ }
154
+
150
155
durationGroups = durationGroups . filter (
151
156
( dg ) => dg . misc || dg . durations . length > 1
152
157
)
@@ -155,6 +160,8 @@ export const ReactTimeSeriesWithoutContext = ({
155
160
// eslint-disable-next-line
156
161
} , [ annotation ?. durations ] )
157
162
163
+ console . log ( { durationGroups } )
164
+
158
165
const onChangeDurationGroups = useEventCallback ( ( newDurationGroups ) => {
159
166
onModifySample (
160
167
setIn (
0 commit comments