Commit b1982b88 authored by Xiaowu Zhang's avatar Xiaowu Zhang

erp5_officejs_eci_directory: european cloud industry

parent e9531ee8
<!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
<!Doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title></title>
<link type="text/css" rel="stylesheet" href="gadget_erp5_eci.css" />
<script src="rsvp.js"></script>
<script src="renderjs.js"></script>
<script src="handlebars.js"></script>
<script src="gadget_erp5_eci_financial_widget.js"></script>
<script id="display-template" type="text/x-handlebars-template">
<section class="ui-grid-container ui-responsive">
<section class="ui-content-header-plain ui-bar-c">
<table>
<tr>
{{#if display_header}}
<th>Type/Year</th>
{{#each kpi_list}}
<th>{{year}}</th>
{{/each}}
{{/if}}
</tr>
<tr>
<td>Staff</td>
{{#each kpi_list}}
{{#if staff}}
<td>{{staff}}</td>
{{else}}
<td>-</td>
{{/if}}
{{/each}}
</tr>
<tr>
<td>Turnover</td>
{{#each kpi_list}}
{{#if revenues}}
<td>{{revenues}}</td>
{{else}}
<td>-</td>
{{/if}}
{{/each}}
</tr>
<tr>
<td>Profit</td>
{{#each kpi_list}}
{{#if earnings}}
<td>{{earnings}}</td>
{{else}}
<td>-</td>
{{/if}}
{{/each}}
</tr>
<tr>
<td>Total assets</td>
{{#each kpi_list}}
{{#if total_assets}}
<td>{{total_assets}}</td>
{{else}}
<td>-</td>
{{/if}}
{{/each}}
</tr>
</table>
</section>
</section>
</script>
</head>
<body>
<div class="display-financial-widget-in-listbox"></div>
</body>
</html>
\ 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
/*jslint nomen: true, indent: 2, maxerr: 3 */
/*global window, rJS, Handlebars, RSVP*/
(function (window, rJS, RSVP, L) {
"use strict";
var gadget_klass = rJS(window);
gadget_klass
.declareMethod('render', function (data_list) {
var gadget = this,
i,
group,
popup_string,
marker,
mymap = L.map('mapid'),
marker_list = [],
myIcon = L.icon({
iconUrl: 'image_module/marker-icon',
iconSize: [35, 50],
iconAnchor: [23, 47],
popupAnchor: [-3, -44],
shadowUrl: 'image_module/marker-shadow',
shadowSize: [65, 50],
shadowAnchor: [23, 47]
});
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
attribution: '&copy; <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
}).addTo(mymap);
for (i = 0; i < data_list.length; i += 1) {
try {
if (data_list[i].href) {
popup_string = '<a href='+ data_list[i].href + '>' + data_list[i].title + '</a>'
} else {
popup_string = data_list[i].title;
}
marker = new L.marker([data_list[i].coordinate_list[0], data_list[i].coordinate_list[1]], {icon: myIcon});
marker.addTo(mymap)
.bindPopup(popup_string, {autoClose:true, closeOnClick: false, maxWidth : 150});
marker_list.push(marker);
} catch(error) {
console.log(error);
console.log(data_list[i]);
}
}
if (marker_list.length > 1) {
group = new L.featureGroup(marker_list);
mymap.fitBounds(group.getBounds());
} else {
if (marker_list.length == 1) {
mymap.setView([marker_list[0]._latlng.lat, marker_list[0]._latlng.lng], 9);
} else {
mymap.setView([48.85749, 2.35107], 13);
}
}
});
}(window, rJS, RSVP, L));
<!Doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Jio ECI Publisher Gadget</title>
<script src="rsvp.js" type="text/javascript"></script>
<script src="renderjs.js" type="text/javascript"></script>
<script src="jiodev.js" type="text/javascript"></script>
<script src="gadget_erp5_eci_tool.js" type="text/javascript"></script>
<script src="gadget_erp5_eci_publisher_storage.js" type="text/javascript"></script>
<script src="gadget_erp5_eci_publisher_jio.js" type="text/javascript"></script>
</head>
<body>
<div data-gadget-url='gadget_jio.html' data-gadget-scope='jio'></div>
</body>
</html>
\ No newline at end of file
<!Doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Router Gadget</title>
<!-- renderjs -->
<script src="rsvp.js" type="text/javascript"></script>
<script src="renderjs.js" type="text/javascript"></script>
<script src="gadget_erp5_eci_router.js" type="text/javascript"></script>
</head>
<body>
<div data-gadget-url="gadget_erp5_router.html" data-gadget-scope="router"></div>
</body>
</html>
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