Commit 2c6a3445 authored by Xiaowu Zhang's avatar Xiaowu Zhang

erp5_officejs_eci_directory: european cloud industry

See merge request nexedi/erp5!1621
parents 4db8132c 7dab8617
......@@ -48,6 +48,7 @@
<option>Web Table Editor</option>
<option>Image Editor</option>
<option>Awesome Free Software Publisher List</option>
<option>European Cloud Industry</option>
<option>Monitoring App</option>
<option>Todomvc</option>
<option>App Store</option>
......
......@@ -235,7 +235,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>985.28933.8790.47291</string> </value>
<value> <string>1001.15759.21278.29644</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -253,7 +253,7 @@
</tuple>
<state>
<tuple>
<float>1595583478.67</float>
<float>1659963257.75</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -79,6 +79,12 @@
"cache": precache_manifest,
"no_installer": true
},
"European Cloud Industry": {
"url": "european_cloud_industry/",
"storage_type": "precache",
"cache": precache_manifest,
"no_installer": true
},
"Jabber Client": {
"url": "jabber_client/",
"cache": "gadget_jabberclient.appcache",
......
......@@ -258,7 +258,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>992.64248.47613.22510</string> </value>
<value> <string>1001.15759.21278.29644</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -276,7 +276,7 @@
</tuple>
<state>
<tuple>
<float>1624657859.54</float>
<float>1659963275.0</float>
<string>UTC</string>
</tuple>
</state>
......
<!Doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Graph</title>
<link rel="stylesheet" href="dygraph.css" />
<link rel="stylesheet" href="gadget_erp5_eci.css" />
<script src="rsvp.js" type="text/javascript"></script>
<script src="renderjs.js" type="text/javascript"></script>
<script src="handlebars.js" type="text/javascript"></script>
<script src="dygraph.js" type="text/javascript"></script>
<script src="gadget_erp5_eci_dygraph.js" type="text/javascript"></script>
</head>
<body>
<div class="dygraph-multibar dygraph-fullsize-chart chart"></div>
</body>
</html>
\ No newline at end of file
/*globals window, RSVP, rJS, Dygraph, Date, Object, Intl*/
/*jslint indent: 2, nomen: true, maxlen: 80*/
(function (window, RSVP, rJS, Dygraph, Date, Object, Intl) {
"use strict";
// Darken a color
function darkenColor(colorStr) {
// Defined in dygraph-utils.js
var color = Dygraph.toRGB_(colorStr);
color.r = Math.floor((255 + color.r) / 2);
color.g = Math.floor((255 + color.g) / 2);
color.b = Math.floor((255 + color.b) / 2);
return 'rgb(' + color.r + ',' + color.g + ',' + color.b + ')';
}
function multiColumnBarPlotter(e) {
var g,
ctx,
set,
y_bottom,
min_sep,
j,
points,
sep,
sets,
bar_width,
fillColors,
strokeColors,
i,
k,
l,
m,
p,
center_x,
x_left;
if (e.seriesIndex !== 0) {
return;
}
g = e.dygraph;
ctx = e.drawingContext;
sets = e.allSeriesPoints;
y_bottom = e.dygraph.toDomYCoord(0);
min_sep = Infinity;
// Find the minimum separation between x-values.
// This determines the bar width.
for (j = 0; j < sets.length; j += 1) {
points = sets[j];
for (i = 1; i < points.length; i++) {
sep = points[i].canvasx - points[i - 1].canvasx;
if (sep < min_sep) {
min_sep = sep;
}
}
}
bar_width = Math.floor(2.0 / 3 * min_sep);
fillColors = [];
strokeColors = g.getColors();
for (m = 0; m < strokeColors.length; m += 1) {
fillColors.push(darkenColor(strokeColors[m]));
}
for (k = 0; k < sets.length; k += 1) {
ctx.fillStyle = fillColors[k];
ctx.strokeStyle = strokeColors[k];
for (l = 0; l < sets[k].length; l += 1) {
p = sets[k][l];
center_x = p.canvasx;
x_left = center_x - (bar_width / 2) * (1 - k / (sets.length - 1));
ctx.fillRect(
x_left,
p.canvasy,
bar_width / sets.length,
y_bottom - p.canvasy
);
ctx.strokeRect(
x_left,
p.canvasy,
bar_width / sets.length,
y_bottom - p.canvasy
);
}
}
}
function prepDataSet(my_data) {
return Object.keys(my_data).map(function (year) {
var reported_year = my_data[year];
return [
new Date(year + "/6/30"),
reported_year.total_assets.value,
reported_year.revenues.value,
reported_year.earnings.value,
reported_year.staff.value
];
});
}
function getElem(my_element, my_selector) {
return my_element.querySelector(my_selector);
}
rJS(window)
.ready(function (gadget) {
gadget.property_dict = {
"graph_wrapper": getElem(gadget.element, ".dygraph-multibar"),
"graph": null
};
// disable zoom
Dygraph.prototype.doZoomY_ = function () {
return;
};
Dygraph.prototype.doZoomX_ = function () {
return;
};
})
.declareMethod("render", function (options) {
this.property_dict.data = options.data;
})
.declareMethod("renderGraph", function () {
var gadget = this;
var dict = gadget.property_dict;
var max = Math.max(...Object.keys(dict.data).map(Number));
var min = Math.min(...Object.keys(dict.data).map(Number));
dict.graph = new Dygraph(
dict.graph_wrapper,
prepDataSet(dict.data),
{
dateWindow: [Date.parse(min + "/01/01"), Date.parse(max + "/12/31")],
legend: 'always',
drawPoints: true,
title: 'Aggregate Financial Performance',
width: "auto",
height: 720,
maxNumberWidth: 20,
includeZero: true,
plotter: multiColumnBarPlotter,
axes : {
x : {
axisLabelFormatter: function (d) {
return d.getFullYear();
},
valueFormatter: function (ms) {
return new Date(ms).getFullYear();
}
},
y: {
axisLabelWidth: 100,
valueFormatter: function (value) {
return new Intl.NumberFormat('en-EN', {
style: 'currency',
currency: 'EUR',
minimumFractionDigits: "0"
}).format(value);
}
},
y2: {
labelsKMB: true,
axisLabelWidth: 100,
independentTicks: true
}
},
labels: ["Year", "Total Assets", "Revenues", "Earnings", "Staff"],
series: {
"Staff": {
axis: "y2"
}
}
}
);
})
.declareService(function () {
return this.renderGraph();
});
}(window, RSVP, rJS, Dygraph, Date, Object, Intl));
\ No newline at end of file
/*globals window, RSVP, rJS, Handlebars, jIO, QueryFactory, URI*/
/*jslint indent: 2, nomen: true, maxlen: 200*/
(function (window, RSVP, rJS, Handlebars, jIO) {
"use strict";
var gadget_klass = rJS(window),
templater = gadget_klass.__template_element,
display_widget_table = Handlebars.compile(
templater.getElementById("display-template").innerHTML
);
rJS(window)
.declareAcquiredMethod('jio_get', 'jio_get')
.declareMethod('render', function (options) {
var gadget = this;
return gadget.jio_get(options.value.jio_key)
.push(function (result) {
result.display_header = options.value.display_header;
gadget.element.querySelector(".display-financial-widget-in-listbox").innerHTML = display_widget_table(result);
});
});
}(window, RSVP, rJS, Handlebars, jIO));
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" />
<title>Localisation</title>
<!-- renderjs -->
<script src="rsvp.js" type="text/javascript"></script>
<script src="renderjs.js" type="text/javascript"></script>
<link rel="stylesheet" href="leaflet.css" />
<script src="leaflet.js"></script>
<script src="gadget_erp5_eci_map.js" type="text/javascript"></script>
</head>
<body>
<div id="mapid" style="height:100%;width:100%;"></div>
</body>
</html>
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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