mirror of
https://github.com/nasa/openmct.git
synced 2025-01-31 16:36:13 +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}
|
* @returns {Promise}
|
||||||
*/
|
*/
|
||||||
fetch: function (options) {
|
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) {
|
if (!this.unsubscribe) {
|
||||||
this.unsubscribe = this.openmct
|
this.unsubscribe = this.openmct
|
||||||
.telemetry
|
.telemetry
|
||||||
|
@ -102,7 +102,8 @@ define([
|
|||||||
this.startLoading();
|
this.startLoading();
|
||||||
var options = {
|
var options = {
|
||||||
size: this.$element[0].offsetWidth,
|
size: this.$element[0].offsetWidth,
|
||||||
domain: this.config.xAxis.get('key')
|
domain: this.config.xAxis.get('key'),
|
||||||
|
shouldUseMinMax: this.shouldUseMinMax(series)
|
||||||
};
|
};
|
||||||
|
|
||||||
series.load(options)
|
series.load(options)
|
||||||
@ -133,6 +134,11 @@ define([
|
|||||||
this.listenTo(series, 'change:yKey', function () {
|
this.listenTo(series, 'change:yKey', function () {
|
||||||
this.loadSeriesData(series);
|
this.loadSeriesData(series);
|
||||||
}, this);
|
}, this);
|
||||||
|
|
||||||
|
this.listenTo(series, 'change:interpolate', function () {
|
||||||
|
this.loadSeriesData(series);
|
||||||
|
}, this);
|
||||||
|
|
||||||
this.loadSeriesData(series);
|
this.loadSeriesData(series);
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -155,6 +161,10 @@ define([
|
|||||||
return config;
|
return config;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
PlotController.prototype.shouldUseMinMax = function (series) {
|
||||||
|
return series.model.interpolate !== 'none';
|
||||||
|
};
|
||||||
|
|
||||||
PlotController.prototype.onTimeSystemChange = function (timeSystem) {
|
PlotController.prototype.onTimeSystemChange = function (timeSystem) {
|
||||||
this.config.xAxis.set('key', timeSystem.key);
|
this.config.xAxis.set('key', timeSystem.key);
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user