From 490cb2225d0d4f7ffa1d61166cf6a1425bf6588d Mon Sep 17 00:00:00 2001 From: Deep Tailor Date: Wed, 11 Dec 2019 14:49:12 -0800 Subject: [PATCH] Move check for linestyle to plotseries fetch function (#2561) --- .../plot/src/configuration/PlotSeries.js | 20 ++++++------------- .../plot/src/telemetry/PlotController.js | 7 +------ 2 files changed, 7 insertions(+), 20 deletions(-) diff --git a/src/plugins/plot/src/configuration/PlotSeries.js b/src/plugins/plot/src/configuration/PlotSeries.js index 0ac8757cab..9cd30b97b7 100644 --- a/src/plugins/plot/src/configuration/PlotSeries.js +++ b/src/plugins/plot/src/configuration/PlotSeries.js @@ -140,9 +140,14 @@ define([ * @returns {Promise} */ fetch: function (options) { - const strategy = options && options.shouldNotUseMinMax ? undefined : 'minMax'; + let strategy; + + if (this.model.interpolate !== 'none') { + strategy = 'minMax'; + } options = _.extend({}, { size: 1000, strategy, filters: this.filters }, options || {}); + if (!this.unsubscribe) { this.unsubscribe = this.openmct .telemetry @@ -379,19 +384,6 @@ define([ delete this.unsubscribe; } this.fetch(); - }, - - /** - * Clears the plot series, unsubscribes and resubscribes - * @public - */ - refresh: function () { - this.reset(); - if (this.unsubscribe) { - this.unsubscribe(); - delete this.unsubscribe; - } - this.fetch(); } }); diff --git a/src/plugins/plot/src/telemetry/PlotController.js b/src/plugins/plot/src/telemetry/PlotController.js index 03586cbccb..50dd9e945b 100644 --- a/src/plugins/plot/src/telemetry/PlotController.js +++ b/src/plugins/plot/src/telemetry/PlotController.js @@ -102,8 +102,7 @@ define([ this.startLoading(); var options = { size: this.$element[0].offsetWidth, - domain: this.config.xAxis.get('key'), - shouldNotUseMinMax: this.shouldNotUseMinMax(series) + domain: this.config.xAxis.get('key') }; series.load(options) @@ -161,10 +160,6 @@ define([ return config; }; - PlotController.prototype.shouldNotUseMinMax = function (series) { - return series.model.interpolate === 'none'; - }; - PlotController.prototype.onTimeSystemChange = function (timeSystem) { this.config.xAxis.set('key', timeSystem.key); };