mirror of
https://github.com/nasa/openmct.git
synced 2025-01-19 11:17:04 +00:00
Added listener that reacts to changes on interpolate + fetch data using correct strategy value. (#2469)
This commit is contained in:
parent
68f3436792
commit
d6950a0976
@ -140,7 +140,8 @@ define([
|
||||
* @returns {Promise}
|
||||
*/
|
||||
fetch: function (options) {
|
||||
options = _.extend({}, {size: 1000, strategy: 'minmax', filters: this.filters}, options || {});
|
||||
const strategy = options.shouldUseMinMax ? 'minMax' : undefined;
|
||||
options = _.extend({}, { size: 1000, strategy, filters: this.filters }, options || {});
|
||||
if (!this.unsubscribe) {
|
||||
this.unsubscribe = this.openmct
|
||||
.telemetry
|
||||
|
@ -102,7 +102,8 @@ define([
|
||||
this.startLoading();
|
||||
var options = {
|
||||
size: this.$element[0].offsetWidth,
|
||||
domain: this.config.xAxis.get('key')
|
||||
domain: this.config.xAxis.get('key'),
|
||||
shouldUseMinMax: this.shouldUseMinMax(series)
|
||||
};
|
||||
|
||||
series.load(options)
|
||||
@ -133,6 +134,11 @@ define([
|
||||
this.listenTo(series, 'change:yKey', function () {
|
||||
this.loadSeriesData(series);
|
||||
}, this);
|
||||
|
||||
this.listenTo(series, 'change:interpolate', function () {
|
||||
this.loadSeriesData(series);
|
||||
}, this);
|
||||
|
||||
this.loadSeriesData(series);
|
||||
};
|
||||
|
||||
@ -155,6 +161,10 @@ define([
|
||||
return config;
|
||||
};
|
||||
|
||||
PlotController.prototype.shouldUseMinMax = function (series) {
|
||||
return series.model.interpolate !== 'none';
|
||||
};
|
||||
|
||||
PlotController.prototype.onTimeSystemChange = function (timeSystem) {
|
||||
this.config.xAxis.set('key', timeSystem.key);
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user