mirror of
https://github.com/nasa/openmct.git
synced 2025-06-01 23:20:50 +00:00
[Plot] Integrate PlotPanZoomStackGroup
Utilize PlotPanZoomStackGroup; that is, utilize changes such that a set of pan-zoom stacks can be treated as one, while their domain axis synchronizes, and their range axis does not. WTD-625.
This commit is contained in:
parent
0ce0517e09
commit
9c1d72f917
@ -16,19 +16,13 @@ define(
|
|||||||
stack.pushPanZoom(origin, dimensions);
|
stack.pushPanZoom(origin, dimensions);
|
||||||
} else {
|
} else {
|
||||||
stack.pushPanZoom(
|
stack.pushPanZoom(
|
||||||
[ origin[0], stack.getOrigin[1] ],
|
[ origin[0], stack.getOrigin()[1] ],
|
||||||
[ dimensions[0], stack.getDimensions[1] ]
|
[ dimensions[0], stack.getDimensions()[1] ]
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function setBasePanZoom(origin, dimensions, index) {
|
|
||||||
stacks.forEach(function (stack, i) {
|
|
||||||
stack.setBasePanZoom(origin, dimensions);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
function popPanZoom() {
|
function popPanZoom() {
|
||||||
stacks.forEach(function (stack) {
|
stacks.forEach(function (stack) {
|
||||||
@ -36,6 +30,12 @@ define(
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function setBasePanZoom(origin, dimensions) {
|
||||||
|
stacks.forEach(function (stack) {
|
||||||
|
stack.setBasePanZoom(origin, dimensions);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
function clearPanZoom() {
|
function clearPanZoom() {
|
||||||
stacks.forEach(function (stack) {
|
stacks.forEach(function (stack) {
|
||||||
stack.popPanZoom();
|
stack.popPanZoom();
|
||||||
@ -48,11 +48,11 @@ define(
|
|||||||
result.pushPanZoom = function (origin, dimensions) {
|
result.pushPanZoom = function (origin, dimensions) {
|
||||||
pushPanZoom(origin, dimensions, index);
|
pushPanZoom(origin, dimensions, index);
|
||||||
};
|
};
|
||||||
result.setBasePanZoom = function (origin, dimensions) {
|
result.setBasePanZoom = setBasePanZoom;
|
||||||
|
|
||||||
};
|
|
||||||
result.popPanZoom = popPanZoom;
|
result.popPanZoom = popPanZoom;
|
||||||
result.clearPanZoom = clearPanZoom;
|
result.clearPanZoom = clearPanZoom;
|
||||||
|
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < count; i += 1) {
|
for (i = 0; i < count; i += 1) {
|
||||||
@ -69,6 +69,9 @@ define(
|
|||||||
},
|
},
|
||||||
getPanZoomStack: function (index) {
|
getPanZoomStack: function (index) {
|
||||||
return decoratedStacks[index];
|
return decoratedStacks[index];
|
||||||
|
},
|
||||||
|
getPanZoomStacks: function () {
|
||||||
|
return decoratedStacks;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1,15 +1,19 @@
|
|||||||
/*global define*/
|
/*global define*/
|
||||||
|
|
||||||
define(
|
define(
|
||||||
["../SubPlot", "../elements/PlotPalette", "../elements/PlotPanZoomStack"],
|
["../SubPlot", "../elements/PlotPalette", "../elements/PlotPanZoomStackGroup"],
|
||||||
function (SubPlot, PlotPalette, PlotPanZoomStack) {
|
function (SubPlot, PlotPalette, PlotPanZoomStackGroup) {
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
function PlotStackMode(telemetryObjects) {
|
function PlotStackMode(telemetryObjects) {
|
||||||
var domainOffset,
|
var domainOffset,
|
||||||
panZoomStack = new PlotPanZoomStack([], []),
|
panZoomStackGroup =
|
||||||
subplots = telemetryObjects.map(function (telemetryObject) {
|
new PlotPanZoomStackGroup(telemetryObjects.length),
|
||||||
return new SubPlot([telemetryObject], panZoomStack);
|
subplots = telemetryObjects.map(function (telemetryObject, i) {
|
||||||
|
return new SubPlot(
|
||||||
|
[telemetryObject],
|
||||||
|
panZoomStackGroup.getPanZoomStack(i)
|
||||||
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
function plotTelemetryTo(subplot, prepared, index) {
|
function plotTelemetryTo(subplot, prepared, index) {
|
||||||
@ -31,12 +35,14 @@ define(
|
|||||||
}
|
}
|
||||||
|
|
||||||
function plotTelemetry(prepared) {
|
function plotTelemetry(prepared) {
|
||||||
// Fit to the boundaries of the data, but don't
|
// Fit to the boundaries of the data, but don't
|
||||||
// override any user-initiated pan-zoom changes.
|
// override any user-initiated pan-zoom changes.
|
||||||
panZoomStack.setBasePanZoom(
|
panZoomStackGroup.getPanZoomStacks().forEach(function (stack) {
|
||||||
prepared.getOrigin(),
|
stack.setBasePanZoom(
|
||||||
prepared.getDimensions()
|
prepared.getOrigin(),
|
||||||
);
|
prepared.getDimensions()
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
subplots.forEach(function (subplot, index) {
|
subplots.forEach(function (subplot, index) {
|
||||||
plotTelemetryTo(subplot, prepared, index);
|
plotTelemetryTo(subplot, prepared, index);
|
||||||
@ -49,16 +55,16 @@ define(
|
|||||||
return subplots;
|
return subplots;
|
||||||
},
|
},
|
||||||
isZoomed: function () {
|
isZoomed: function () {
|
||||||
return panZoomStack.getDepth() > 1;
|
return panZoomStackGroup.getDepth() > 1;
|
||||||
},
|
},
|
||||||
stepBackPanZoom: function () {
|
stepBackPanZoom: function () {
|
||||||
panZoomStack.pop();
|
panZoomStackGroup.popPanZoom();
|
||||||
subplots.forEach(function (subplot) {
|
subplots.forEach(function (subplot) {
|
||||||
subplot.update();
|
subplot.update();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
unzoom: function () {
|
unzoom: function () {
|
||||||
panZoomStack.clearPanZoom();
|
panZoomStackGroup.clearPanZoom();
|
||||||
subplots.forEach(function (subplot) {
|
subplots.forEach(function (subplot) {
|
||||||
subplot.update();
|
subplot.update();
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user