mirror of
https://github.com/nasa/openmct.git
synced 2024-12-28 08:58:52 +00:00
fc0376296d
Refactor plot view to use an injected telemetry formatter, instead of explicitly including moment. WTD-599.
40 lines
1.3 KiB
JavaScript
40 lines
1.3 KiB
JavaScript
/*global define*/
|
|
|
|
define(
|
|
["./SubPlot"],
|
|
function (SubPlot) {
|
|
"use strict";
|
|
|
|
/**
|
|
* Utility factory; wraps the SubPlot constructor and adds
|
|
* in a reference to the telemetryFormatter, which will be
|
|
* used to represent telemetry values (timestamps or data
|
|
* values) as human-readable strings.
|
|
* @constructor
|
|
*/
|
|
function SubPlotFactory(telemetryFormatter) {
|
|
return {
|
|
/**
|
|
* Instantiate a new sub-plot.
|
|
* @param {DomainObject[]} telemetryObjects the domain objects
|
|
* which will be plotted in this sub-plot
|
|
* @param {PlotPanZoomStack} panZoomStack the stack of pan-zoom
|
|
* states which is applicable to this sub-plot
|
|
* @returns {SubPlot} the instantiated sub-plot
|
|
* @method
|
|
* @memberof SubPlotFactory
|
|
*/
|
|
createSubPlot: function (telemetryObjects, panZoomStack) {
|
|
return new SubPlot(
|
|
telemetryObjects,
|
|
panZoomStack,
|
|
telemetryFormatter
|
|
);
|
|
}
|
|
};
|
|
}
|
|
|
|
return SubPlotFactory;
|
|
|
|
}
|
|
); |