Commit 4e1bf2e4 authored by Jérome Perrin's avatar Jérome Perrin

update static version

parent 80291b60
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Graph</title>
<script src="../lib/rsvp.min.js" type="text/javascript"></script>
<script src="../lib/renderjs.min.js" type="text/javascript"></script>
<script src="../lib/jquery.js" type="text/javascript"></script>
<script src="../lib/jquery.flot.js"></script>
<script src="../lib/jquery.flot.stack.js"></script>
<script src="mixin_gadget.js" type="text/javascript"></script>
<script src="Output_viewChart.js" type="text/javascript"></script>
</head>
<body>
<div class="graph_container" style="width: 100%;height:300px"></div>
</body>
</html>
/*global rJS, jQuery, initGadgetMixin, console */
/*jslint unparam: true */
(function(window, rJS, $, initGadgetMixin) {
"use strict";
var gadget_klass = rJS(window);
initGadgetMixin(gadget_klass);
gadget_klass.declareAcquiredMethod("aq_getAttachment", "jio_getAttachment").declareMethod("render", function(options) {
var jio_key = options.id, gadget = this;
gadget.props.jio_key = jio_key;
gadget.props.result = options.result;
return gadget.aq_getAttachment({
_id: gadget.props.jio_key,
_attachment: "body.json"
}).push(function(simulation_json) {
var json_data = JSON.parse(simulation_json);
gadget.props.data = json_data.result.result_list[options.result][options.action_definition.configuration.output_id];
});
}).declareMethod("startService", function() {
// XXX Manually calculate width and height when resizing
$.plot(this.props.element.querySelector(".graph_container"), this.props.data.series, this.props.data.options);
});
})(window, rJS, jQuery, initGadgetMixin);
\ No newline at end of file
......@@ -51,6 +51,9 @@
average: calculate_average(attainment_list)
});
} else {
if (metric_value.length === 1) {
metric_value = metric_value[0];
}
if (typeof metric_value === "object") {
if (metric_value.ub === metric_value.lb) {
metric_value = metric_value.ub;
......@@ -65,6 +68,10 @@
if (typeof metric_value === "number") {
metric_value = metric_value.toFixed(2);
}
// Add time unit in some metric
if (data.general.timeUnit && (metric === "lifespan" || metric === "takt_time")) {
metric_value = metric_value + " " + data.general.timeUnit;
}
// Rename some metric to something more meaningful
if (metric === "lifespan") {
metric = "Cycle Time";
......
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