@@ -63,6 +63,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
63
63
</v-col >
64
64
</v-row >
65
65
<div
66
+ ref =" toolbar"
66
67
id =" analysis-toolbar"
67
68
class =" d-flex align-center flex-wrap my-2 col-gap-2 row-gap-4"
68
69
>
@@ -115,32 +116,41 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
115
116
v-if =" chartType === 'table'"
116
117
:tasks =" filteredTasks"
117
118
:timing-option =" timingOption"
119
+ v-model:initial-options =" dataTableOptions"
118
120
/>
119
121
<BoxPlot
120
122
v-else-if =" chartType === 'box'"
121
123
:tasks =" filteredTasks"
122
124
:timing-option =" timingOption"
123
- sort-input-teleport-target =" #analysis-toolbar"
125
+ :sort-input-teleport-target =" toolbar?.id"
126
+ v-model:initial-options =" boxPlotOptions"
124
127
/>
125
128
<TimeSeries
126
129
v-else-if =" chartType === 'timeSeries'"
127
130
:workflowIDs =" workflowIDs"
128
131
:platform-option =" tasksFilter.platformOption"
129
132
:timing-option =" timingOption"
130
- sort-input-teleport-target =" #analysis-toolbar"
133
+ :sort-input-teleport-target =" toolbar?.id"
134
+ v-model:initial-options =" timeseriesPlotOptions"
131
135
/>
132
136
</v-container >
133
137
</div >
134
138
</template >
135
139
136
140
<script >
141
+ import { ref } from ' vue'
137
142
import {
138
143
debounce ,
139
144
pick ,
140
145
} from ' lodash'
141
146
import gql from ' graphql-tag'
142
147
import { getPageTitle } from ' @/utils/index'
143
148
import graphqlMixin from ' @/mixins/graphql'
149
+ import {
150
+ initialOptions ,
151
+ updateInitialOptionsEvent ,
152
+ useInitialOptions
153
+ } from ' @/utils/initialOptions'
144
154
import DeltasCallback from ' @/services/callbacks'
145
155
import AnalysisTable from ' @/components/cylc/analysis/AnalysisTable.vue'
146
156
import BoxPlot from ' @/components/cylc/analysis/BoxPlot.vue'
@@ -248,18 +258,60 @@ export default {
248
258
this .tasksQuery ()
249
259
},
250
260
261
+ emits: [updateInitialOptionsEvent],
262
+
263
+ props: { initialOptions },
264
+
265
+ setup (props , { emit }) {
266
+ /**
267
+ * The task name, timing option and platform filter state.
268
+ * @type {import('vue').Ref<object>}
269
+ */
270
+ const tasksFilter = useInitialOptions (' tasksFilter' , { props, emit }, { name: ' ' , timingOption: ' totalTimes' , platformOption: - 1 })
271
+
272
+ /**
273
+ * Determines the Analysis type ('table' | 'box' | 'timeSeries')
274
+ * @type {import('vue').Ref<string>}
275
+ */
276
+ const chartType = useInitialOptions (' chartType' , { props, emit }, ' table' )
277
+
278
+ /** @type {import('vue').Ref<HTMLElement>} template ref */
279
+ const toolbar = ref (null )
280
+
281
+ /**
282
+ * The Vuetify data table options (sortBy, page etc).
283
+ * @type {import('vue').Ref<object>}
284
+ */
285
+ const dataTableOptions = useInitialOptions (' dataTableOptions' , { props, emit })
286
+
287
+ /**
288
+ * The Vuetify box and whisker plot options (sortBy, page etc).
289
+ * @type {import('vue').Ref<object>}
290
+ */
291
+ const boxPlotOptions = useInitialOptions (' boxPlotOptions' , { props, emit })
292
+
293
+ /**
294
+ * The Vuetify box and whisker plot options (displayedTasks, showOrigin).
295
+ * @type {import('vue').Ref<object>}
296
+ */
297
+ const timeseriesPlotOptions = useInitialOptions (' timeseriesPlotOptions' , { props, emit })
298
+
299
+ return {
300
+ tasksFilter,
301
+ chartType,
302
+ toolbar,
303
+ dataTableOptions,
304
+ boxPlotOptions,
305
+ timeseriesPlotOptions
306
+ }
307
+ },
308
+
251
309
data () {
252
310
const tasks = []
253
311
return {
254
312
callback: new AnalysisTaskCallback (tasks),
255
313
/** Object containing all of the tasks added by the callback */
256
314
tasks,
257
- tasksFilter: {
258
- name: ' ' ,
259
- timingOption: ' totalTimes' ,
260
- platformOption: - 1 ,
261
- },
262
- chartType: ' table' ,
263
315
}
264
316
},
265
317
0 commit comments