Compare commits

...

17 Commits

6 changed files with 41 additions and 36 deletions

View File

@ -339,6 +339,8 @@ define([
return provider.request.apply(provider, arguments)
.catch((rejected) => {
console.log('telemetryAPI rejected!!!!!');
console.log(rejected);
if (rejected.name !== 'AbortError') {
this.openmct.notifications.error('Error requesting telemetry data, see console for details');
console.error(rejected);

View File

@ -87,6 +87,7 @@
:highlights="highlights"
:show-limit-line-labels="showLimitLineLabels"
@plotReinitializeCanvas="initCanvas"
@chartLoaded="initialize"
/>
</div>
@ -359,11 +360,6 @@ export default {
this.setTimeContext();
this.loaded = true;
//We're referencing the canvas elements from the mct-chart in the initialize method.
// So we need $nextTick to ensure the component is fully mounted before we can initialize stuff.
this.$nextTick(this.initialize);
},
beforeDestroy() {
document.removeEventListener('keydown', this.handleKeyDown);

View File

@ -105,9 +105,8 @@ export default {
let canvasEls = this.$parent.$refs.chartContainer.querySelectorAll("canvas");
const mainCanvas = canvasEls[1];
const overlayCanvas = canvasEls[0];
if (this.initializeCanvas(mainCanvas, overlayCanvas)) {
this.draw();
}
const initialized = this.initializeCanvas(mainCanvas, overlayCanvas);
this.listenTo(this.config.series, 'add', this.onSeriesAdd, this);
this.listenTo(this.config.series, 'remove', this.onSeriesRemove, this);
@ -115,6 +114,12 @@ export default {
this.listenTo(this.config.yAxis, 'change', this.updateLimitsAndDraw);
this.listenTo(this.config.xAxis, 'change', this.updateLimitsAndDraw);
this.config.series.forEach(this.onSeriesAdd, this);
if (initialized) {
this.draw();
}
this.$emit('chartLoaded');
},
beforeDestroy() {
this.destroy();

View File

@ -26,13 +26,13 @@
class="c-plot c-plot--stacked holder holder-plot has-control-bar"
:class="[plotLegendExpandedStateClass, plotLegendPositionClass]"
>
<plot-legend
:cursor-locked="!!lockHighlightPoint"
:series="seriesModels"
:highlights="highlights"
:legend="legend"
@legendHoverChanged="legendHoverChanged"
/>
<!-- <plot-legend-->
<!-- :cursor-locked="!!lockHighlightPoint"-->
<!-- :series="seriesModels"-->
<!-- :highlights="highlights"-->
<!-- :legend="legend"-->
<!-- @legendHoverChanged="legendHoverChanged"-->
<!-- />-->
<div class="l-view-section">
<stacked-plot-item
v-for="object in compositionObjects"
@ -244,11 +244,13 @@ export default {
this.highlights = data;
},
registerSeriesListeners(configId) {
this.seriesConfig[configId] = this.getConfig(configId);
this.listenTo(this.seriesConfig[configId].series, 'add', this.addSeries, this);
this.listenTo(this.seriesConfig[configId].series, 'remove', this.removeSeries, this);
// const config = this.getConfig(configId);
// config.series.models.forEach(this.addSeries, this);
this.seriesConfig[configId].series.models.forEach(this.addSeries, this);
// if (config.series.models.length === 0 || config.series.models[0].keyString !== configId) {
// this.listenTo(config.series, 'add', this.addSeries, this);
// this.listenTo(config.series, 'remove', this.removeSeries, this);
// }
},
addSeries(series) {
const index = this.seriesModels.length;

View File

@ -227,28 +227,25 @@ export default {
return this.openmct.objects.areIdsEqual(seriesConfig.identifier, this.childObject.identifier);
});
if (!persistedSeriesConfig) {
persistedSeriesConfig = {
series: {},
yAxis: {}
let domainObject = {
...this.childObject
};
if (persistedSeriesConfig) {
domainObject.configuration = {
series: [
{
identifier: this.childObject.identifier,
...persistedSeriesConfig.series
}
],
yAxis: persistedSeriesConfig.yAxis
};
}
config = new PlotConfigurationModel({
id: configId,
domainObject: {
...this.childObject,
configuration: {
series: [
{
identifier: this.childObject.identifier,
...persistedSeriesConfig.series
}
],
yAxis: persistedSeriesConfig.yAxis
}
},
domainObject,
openmct: this.openmct,
palette: this.colorPalette,
callback: (data) => {

View File

@ -54,6 +54,9 @@ const config = {
"utils": path.join(__dirname, "src/utils")
}
},
optimization: {
minimize: false
},
plugins: [
new webpack.DefinePlugin({
__OPENMCT_VERSION__: `'${packageDefinition.version}'`,