[Plot] Spec for PlotController

Fill in spec for PlotController, which is the primary
handler of logic associated with plot views, transitioned
for WTD-533.
This commit is contained in:
Victor Woeltjen
2014-12-01 18:13:03 -08:00
parent c9300e8611
commit ad802e674e
2 changed files with 178 additions and 9 deletions

View File

@ -84,13 +84,26 @@ define(
tickGenerator.generateRangeTicks(RANGE_TICKS);
}
function plotTelemetry(telemetry) {
var prepared, data;
function setupAxes(metadatas) {
$scope.axes = [
new PlotAxis("domain", metadatas, AXIS_DEFAULTS[0]),
new PlotAxis("range", metadatas, AXIS_DEFAULTS[1])
];
}
function plotTelemetry() {
var prepared, data, telemetry;
telemetry = $scope.telemetry;
if (!telemetry) {
return;
}
if (!$scope.axes) {
setupAxes(telemetry.getMetadata());
}
data = telemetry.getResponse();
prepared = new PlotPreparer(
@ -119,13 +132,6 @@ define(
updateTicks();
}
function setupAxes(metadatas) {
$scope.axes = [
new PlotAxis("domain", metadatas, AXIS_DEFAULTS[0]),
new PlotAxis("range", metadatas, AXIS_DEFAULTS[1])
];
}
function toMousePosition($event) {
var target = $event.target,
bounds = target.getBoundingClientRect();