Commit 1f68292d authored by Jérome Perrin's avatar Jérome Perrin

Output_viewCapacityUtilisationGraph: update to new graph format

(untested)
parent b3dd354c
......@@ -3,18 +3,18 @@
(function (window, rJS, $, initGadgetMixin) {
"use strict";
function capacity_utilisation_graph_widget(all_data) {
function capacity_utilisation_graph_widget(data, result_id) {
var available_capacity_by_station = {},
station_id,
series,
graph_list = [],
options,
capacity_usage_by_station = {},
input_data = all_data.input,
output_data = all_data.result;
input_data = data,
output_data = data.result.result_list[result_id];
// Compute availability by station
$.each(input_data.nodes, function (idx, obj) {
$.each(input_data.graph.node, function (idx, obj) {
var available_capacity = [];
if (obj.intervalCapacity !== undefined) {
$.each(obj.intervalCapacity, function (i, capacity) {
......@@ -72,7 +72,7 @@
}
};
graph_list.push([
input_data.nodes[station_id].name || station_id,
input_data.graph.node[station_id].name || station_id,
series,
options]);
}
......@@ -103,7 +103,7 @@
})
.push(function (simulation_json) {
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