Commit b0341834 authored by Jérome Perrin's avatar Jérome Perrin

Output_viewCapacityUtilisationGraph: update to new graph format

(untested)
parent fa6937c8
...@@ -3,18 +3,18 @@ ...@@ -3,18 +3,18 @@
(function (window, rJS, $, initGadgetMixin) { (function (window, rJS, $, initGadgetMixin) {
"use strict"; "use strict";
function capacity_utilisation_graph_widget(all_data) { function capacity_utilisation_graph_widget(data, result_id) {
var available_capacity_by_station = {}, var available_capacity_by_station = {},
station_id, station_id,
series, series,
graph_list = [], graph_list = [],
options, options,
capacity_usage_by_station = {}, capacity_usage_by_station = {},
input_data = all_data.input, input_data = data,
output_data = all_data.result; output_data = data.result.result_list[result_id];
// Compute availability by station // Compute availability by station
$.each(input_data.nodes, function (idx, obj) { $.each(input_data.graph.node, function (idx, obj) {
var available_capacity = []; var available_capacity = [];
if (obj.intervalCapacity !== undefined) { if (obj.intervalCapacity !== undefined) {
$.each(obj.intervalCapacity, function (i, capacity) { $.each(obj.intervalCapacity, function (i, capacity) {
...@@ -72,7 +72,7 @@ ...@@ -72,7 +72,7 @@
} }
}; };
graph_list.push([ graph_list.push([
input_data.nodes[station_id].name || station_id, input_data.graph.node[station_id].name || station_id,
series, series,
options]); options]);
} }
...@@ -103,7 +103,7 @@ ...@@ -103,7 +103,7 @@
}) })
.push(function (simulation_json) { .push(function (simulation_json) {
gadget.props.result_list = capacity_utilisation_graph_widget( gadget.props.result_list = capacity_utilisation_graph_widget(
JSON.parse(simulation_json)[gadget.props.result] JSON.parse(simulation_json), gadget.props.result
); );
}); });
}) })
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment