33
33
/>
34
34
<mct-plot
35
35
:class="[plotLegendExpandedStateClass, plotLegendPositionClass]"
36
- :init-grid-lines="gridLines "
36
+ :init-grid-lines="gridLinesProp "
37
37
:init-cursor-guide="cursorGuide"
38
38
:options="options"
39
- :limit-line-labels="limitLineLabels"
39
+ :limit-line-labels="limitLineLabelsProp"
40
+ :parent-y-tick-width="parentYTickWidth"
41
+ :color-palette="colorPalette"
40
42
@loadingUpdated="loadingUpdated"
41
43
@statusUpdated="setStatus"
42
44
@configLoaded="updateReady"
43
45
@lockHighlightPoint="lockHighlightPointUpdated"
44
46
@highlights="highlightsUpdated"
47
+ @plotYTickWidth="onYTickWidthChange"
48
+ @cursorGuide="onCursorGuideChange"
49
+ @gridLines="onGridLinesChange"
45
50
>
46
51
<plot-legend
47
- v-if="configReady"
52
+ v-if="configReady && hideLegend === false "
48
53
:cursor-locked="lockHighlightPoint"
49
54
:highlights="highlights"
50
55
@legendHoverChanged="legendHoverChanged"
@@ -79,14 +84,50 @@ export default {
79
84
compact: false
80
85
};
81
86
}
87
+ },
88
+ gridLines: {
89
+ type: Boolean,
90
+ default() {
91
+ return true;
92
+ }
93
+ },
94
+ cursorGuide: {
95
+ type: Boolean,
96
+ default() {
97
+ return false;
98
+ }
99
+ },
100
+ parentLimitLineLabels: {
101
+ type: Object,
102
+ default() {
103
+ return undefined;
104
+ }
105
+ },
106
+ colorPalette: {
107
+ type: Object,
108
+ default() {
109
+ return undefined;
110
+ }
111
+ },
112
+ parentYTickWidth: {
113
+ type: Object,
114
+ default() {
115
+ return {
116
+ leftTickWidth: 0,
117
+ rightTickWidth: 0,
118
+ hasMultipleLeftAxes: false
119
+ };
120
+ }
121
+ },
122
+ hideLegend: {
123
+ type: Boolean,
124
+ default() {
125
+ return false;
126
+ }
82
127
}
83
128
},
84
129
data() {
85
130
return {
86
- //Don't think we need this as it appears to be stacked plot specific
87
- // hideExportButtons: false
88
- cursorGuide: false,
89
- gridLines: !this.options.compact,
90
131
loading: false,
91
132
status: '',
92
133
staleObjects: [],
@@ -99,6 +140,12 @@ export default {
99
140
};
100
141
},
101
142
computed: {
143
+ limitLineLabelsProp() {
144
+ return this.parentLimitLineLabels ?? this.limitLineLabels;
145
+ },
146
+ gridLinesProp() {
147
+ return this.gridLines ?? !this.options.compact;
148
+ },
102
149
staleClass() {
103
150
if (this.staleObjects.length !== 0) {
104
151
return 'is-stale';
@@ -117,6 +164,14 @@ export default {
117
164
}
118
165
}
119
166
},
167
+ watch: {
168
+ gridLines(newGridLines) {
169
+ this.gridLines = newGridLines;
170
+ },
171
+ cursorGuide(newCursorGuide) {
172
+ this.cursorGuide = newCursorGuide;
173
+ }
174
+ },
120
175
mounted() {
121
176
eventHelpers.extend(this);
122
177
this.imageExporter = new ImageExporter(this.openmct);
@@ -188,6 +243,7 @@ export default {
188
243
},
189
244
loadingUpdated(loading) {
190
245
this.loading = loading;
246
+ this.$emit('loadingUpdated', ...arguments);
191
247
},
192
248
destroy() {
193
249
if (this.stalenessSubscription) {
@@ -223,9 +279,11 @@ export default {
223
279
},
224
280
lockHighlightPointUpdated(data) {
225
281
this.lockHighlightPoint = data;
282
+ this.$emit('lockHighlightPoint', ...arguments);
226
283
},
227
284
highlightsUpdated(data) {
228
285
this.highlights = data;
286
+ this.$emit('highlights', ...arguments);
229
287
},
230
288
legendHoverChanged(data) {
231
289
this.limitLineLabels = data;
@@ -238,6 +296,16 @@ export default {
238
296
},
239
297
updateReady(ready) {
240
298
this.configReady = ready;
299
+ this.$emit('configLoaded', ...arguments);
300
+ },
301
+ onYTickWidthChange() {
302
+ this.$emit('plotYTickWidth', ...arguments);
303
+ },
304
+ onCursorGuideChange() {
305
+ this.$emit('cursorGuide', ...arguments);
306
+ },
307
+ onGridLinesChange() {
308
+ this.$emit('gridLines', ...arguments);
241
309
}
242
310
}
243
311
};
0 commit comments