Upgraded truckroll view
diff --git a/views/ngXosViews/serviceGrid/src/vendor/angular-chart.js/dist/angular-chart.css b/views/ngXosViews/serviceGrid/src/vendor/angular-chart.js/dist/angular-chart.css
new file mode 100644
index 0000000..9fc8593
--- /dev/null
+++ b/views/ngXosViews/serviceGrid/src/vendor/angular-chart.js/dist/angular-chart.css
@@ -0,0 +1,49 @@
+.chart-legend,
+.bar-legend,
+.line-legend,
+.pie-legend,
+.radar-legend,
+.polararea-legend,
+.doughnut-legend {
+ list-style-type: none;
+ margin-top: 5px;
+ text-align: center;
+ /* NOTE: Browsers automatically add 40px of padding-left to all lists, so we should offset that, otherwise the legend is off-center */
+ -webkit-padding-start: 0;
+ /* Webkit */
+ -moz-padding-start: 0;
+ /* Mozilla */
+ padding-left: 0;
+ /* IE (handles all cases, really, but we should also include the vendor-specific properties just to be safe) */
+}
+.chart-legend li,
+.bar-legend li,
+.line-legend li,
+.pie-legend li,
+.radar-legend li,
+.polararea-legend li,
+.doughnut-legend li {
+ display: inline-block;
+ white-space: nowrap;
+ position: relative;
+ margin-bottom: 4px;
+ border-radius: 5px;
+ padding: 2px 8px 2px 28px;
+ font-size: smaller;
+ cursor: default;
+}
+.chart-legend-icon,
+.bar-legend-icon,
+.line-legend-icon,
+.pie-legend-icon,
+.radar-legend-icon,
+.polararea-legend-icon,
+.doughnut-legend-icon {
+ display: block;
+ position: absolute;
+ left: 0;
+ top: 0;
+ width: 20px;
+ height: 20px;
+ border-radius: 5px;
+}
diff --git a/views/ngXosViews/serviceGrid/src/vendor/angular-chart.js/dist/angular-chart.js b/views/ngXosViews/serviceGrid/src/vendor/angular-chart.js/dist/angular-chart.js
new file mode 100644
index 0000000..4624343
--- /dev/null
+++ b/views/ngXosViews/serviceGrid/src/vendor/angular-chart.js/dist/angular-chart.js
@@ -0,0 +1,375 @@
+(function (factory) {
+ 'use strict';
+ if (typeof exports === 'object') {
+ // Node/CommonJS
+ module.exports = factory(
+ typeof angular !== 'undefined' ? angular : require('angular'),
+ typeof Chart !== 'undefined' ? Chart : require('chart.js'));
+ } else if (typeof define === 'function' && define.amd) {
+ // AMD. Register as an anonymous module.
+ define(['angular', 'chart'], factory);
+ } else {
+ // Browser globals
+ factory(angular, Chart);
+ }
+}(function (angular, Chart) {
+ 'use strict';
+
+ Chart.defaults.global.responsive = true;
+ Chart.defaults.global.multiTooltipTemplate = '<%if (datasetLabel){%><%=datasetLabel%>: <%}%><%= value %>';
+
+ Chart.defaults.global.colours = [
+ '#97BBCD', // blue
+ '#DCDCDC', // light grey
+ '#F7464A', // red
+ '#46BFBD', // green
+ '#FDB45C', // yellow
+ '#949FB1', // grey
+ '#4D5360' // dark grey
+ ];
+
+ var usingExcanvas = typeof window.G_vmlCanvasManager === 'object' &&
+ window.G_vmlCanvasManager !== null &&
+ typeof window.G_vmlCanvasManager.initElement === 'function';
+
+ if (usingExcanvas) Chart.defaults.global.animation = false;
+
+ return angular.module('chart.js', [])
+ .provider('ChartJs', ChartJsProvider)
+ .factory('ChartJsFactory', ['ChartJs', '$timeout', ChartJsFactory])
+ .directive('chartBase', ['ChartJsFactory', function (ChartJsFactory) { return new ChartJsFactory(); }])
+ .directive('chartLine', ['ChartJsFactory', function (ChartJsFactory) { return new ChartJsFactory('Line'); }])
+ .directive('chartBar', ['ChartJsFactory', function (ChartJsFactory) { return new ChartJsFactory('Bar'); }])
+ .directive('chartRadar', ['ChartJsFactory', function (ChartJsFactory) { return new ChartJsFactory('Radar'); }])
+ .directive('chartDoughnut', ['ChartJsFactory', function (ChartJsFactory) { return new ChartJsFactory('Doughnut'); }])
+ .directive('chartPie', ['ChartJsFactory', function (ChartJsFactory) { return new ChartJsFactory('Pie'); }])
+ .directive('chartPolarArea', ['ChartJsFactory', function (ChartJsFactory) { return new ChartJsFactory('PolarArea'); }]);
+
+ /**
+ * Wrapper for chart.js
+ * Allows configuring chart js using the provider
+ *
+ * angular.module('myModule', ['chart.js']).config(function(ChartJsProvider) {
+ * ChartJsProvider.setOptions({ responsive: true });
+ * ChartJsProvider.setOptions('Line', { responsive: false });
+ * })))
+ */
+ function ChartJsProvider () {
+ var options = {};
+ var ChartJs = {
+ Chart: Chart,
+ getOptions: function (type) {
+ var typeOptions = type && options[type] || {};
+ return angular.extend({}, options, typeOptions);
+ }
+ };
+
+ /**
+ * Allow to set global options during configuration
+ */
+ this.setOptions = function (type, customOptions) {
+ // If no type was specified set option for the global object
+ if (! customOptions) {
+ customOptions = type;
+ options = angular.extend(options, customOptions);
+ return;
+ }
+ // Set options for the specific chart
+ options[type] = angular.extend(options[type] || {}, customOptions);
+ };
+
+ this.$get = function () {
+ return ChartJs;
+ };
+ }
+
+ function ChartJsFactory (ChartJs, $timeout) {
+ return function chart (type) {
+ return {
+ restrict: 'CA',
+ scope: {
+ data: '=?',
+ labels: '=?',
+ options: '=?',
+ series: '=?',
+ colours: '=?',
+ getColour: '=?',
+ chartType: '=',
+ legend: '@',
+ click: '=?',
+ hover: '=?',
+
+ chartData: '=?',
+ chartLabels: '=?',
+ chartOptions: '=?',
+ chartSeries: '=?',
+ chartColours: '=?',
+ chartLegend: '@',
+ chartClick: '=?',
+ chartHover: '=?'
+ },
+ link: function (scope, elem/*, attrs */) {
+ var chart, container = document.createElement('div');
+ container.className = 'chart-container';
+ elem.replaceWith(container);
+ container.appendChild(elem[0]);
+
+ if (usingExcanvas) window.G_vmlCanvasManager.initElement(elem[0]);
+
+ ['data', 'labels', 'options', 'series', 'colours', 'legend', 'click', 'hover'].forEach(deprecated);
+ function aliasVar (fromName, toName) {
+ scope.$watch(fromName, function (newVal) {
+ if (typeof newVal === 'undefined') return;
+ scope[toName] = newVal;
+ });
+ }
+ /* provide backward compatibility to "old" directive names, by
+ * having an alias point from the new names to the old names. */
+ aliasVar('chartData', 'data');
+ aliasVar('chartLabels', 'labels');
+ aliasVar('chartOptions', 'options');
+ aliasVar('chartSeries', 'series');
+ aliasVar('chartColours', 'colours');
+ aliasVar('chartLegend', 'legend');
+ aliasVar('chartClick', 'click');
+ aliasVar('chartHover', 'hover');
+
+ // Order of setting "watch" matter
+
+ scope.$watch('data', function (newVal, oldVal) {
+ if (! newVal || ! newVal.length || (Array.isArray(newVal[0]) && ! newVal[0].length)) {
+ destroyChart(chart, scope);
+ return;
+ }
+ var chartType = type || scope.chartType;
+ if (! chartType) return;
+
+ if (chart && canUpdateChart(newVal, oldVal))
+ return updateChart(chart, newVal, scope, elem);
+
+ createChart(chartType);
+ }, true);
+
+ scope.$watch('series', resetChart, true);
+ scope.$watch('labels', resetChart, true);
+ scope.$watch('options', resetChart, true);
+ scope.$watch('colours', resetChart, true);
+
+ scope.$watch('chartType', function (newVal, oldVal) {
+ if (isEmpty(newVal)) return;
+ if (angular.equals(newVal, oldVal)) return;
+ createChart(newVal);
+ });
+
+ scope.$on('$destroy', function () {
+ destroyChart(chart, scope);
+ });
+
+ function resetChart (newVal, oldVal) {
+ if (isEmpty(newVal)) return;
+ if (angular.equals(newVal, oldVal)) return;
+ var chartType = type || scope.chartType;
+ if (! chartType) return;
+
+ // chart.update() doesn't work for series and labels
+ // so we have to re-create the chart entirely
+ createChart(chartType);
+ }
+
+ function createChart (type) {
+ if (isResponsive(type, scope) && elem[0].clientHeight === 0 && container.clientHeight === 0) {
+ return $timeout(function () {
+ createChart(type);
+ }, 50, false);
+ }
+ if (! scope.data || ! scope.data.length) return;
+ scope.getColour = typeof scope.getColour === 'function' ? scope.getColour : getRandomColour;
+ var colours = getColours(type, scope);
+ var cvs = elem[0], ctx = cvs.getContext('2d');
+ var data = Array.isArray(scope.data[0]) ?
+ getDataSets(scope.labels, scope.data, scope.series || [], colours) :
+ getData(scope.labels, scope.data, colours);
+ var options = angular.extend({}, ChartJs.getOptions(type), scope.options);
+
+ // Destroy old chart if it exists to avoid ghost charts issue
+ // https://github.com/jtblin/angular-chart.js/issues/187
+ destroyChart(chart, scope);
+ chart = new ChartJs.Chart(ctx)[type](data, options);
+ scope.$emit('create', chart);
+
+ // Bind events
+ cvs.onclick = scope.click ? getEventHandler(scope, chart, 'click', false) : angular.noop;
+ cvs.onmousemove = scope.hover ? getEventHandler(scope, chart, 'hover', true) : angular.noop;
+
+ if (scope.legend && scope.legend !== 'false') setLegend(elem, chart);
+ }
+
+ function deprecated (attr) {
+ if (typeof console !== 'undefined' && ChartJs.getOptions().env !== 'test') {
+ var warn = typeof console.warn === 'function' ? console.warn : console.log;
+ if (!! scope[attr]) {
+ warn.call(console, '"%s" is deprecated and will be removed in a future version. ' +
+ 'Please use "chart-%s" instead.', attr, attr);
+ }
+ }
+ }
+ }
+ };
+ };
+
+ function canUpdateChart (newVal, oldVal) {
+ if (newVal && oldVal && newVal.length && oldVal.length) {
+ return Array.isArray(newVal[0]) ?
+ newVal.length === oldVal.length && newVal.every(function (element, index) {
+ return element.length === oldVal[index].length; }) :
+ oldVal.reduce(sum, 0) > 0 ? newVal.length === oldVal.length : false;
+ }
+ return false;
+ }
+
+ function sum (carry, val) {
+ return carry + val;
+ }
+
+ function getEventHandler (scope, chart, action, triggerOnlyOnChange) {
+ var lastState = null;
+ return function (evt) {
+ var atEvent = chart.getPointsAtEvent || chart.getBarsAtEvent || chart.getSegmentsAtEvent;
+ if (atEvent) {
+ var activePoints = atEvent.call(chart, evt);
+ if (triggerOnlyOnChange === false || angular.equals(lastState, activePoints) === false) {
+ lastState = activePoints;
+ scope[action](activePoints, evt);
+ scope.$apply();
+ }
+ }
+ };
+ }
+
+ function getColours (type, scope) {
+ var notEnoughColours = false;
+ var colours = angular.copy(scope.colours ||
+ ChartJs.getOptions(type).colours ||
+ Chart.defaults.global.colours
+ );
+ while (colours.length < scope.data.length) {
+ colours.push(scope.getColour());
+ notEnoughColours = true;
+ }
+ // mutate colours in this case as we don't want
+ // the colours to change on each refresh
+ if (notEnoughColours) scope.colours = colours;
+ return colours.map(convertColour);
+ }
+
+ function convertColour (colour) {
+ if (typeof colour === 'object' && colour !== null) return colour;
+ if (typeof colour === 'string' && colour[0] === '#') return getColour(hexToRgb(colour.substr(1)));
+ return getRandomColour();
+ }
+
+ function getRandomColour () {
+ var colour = [getRandomInt(0, 255), getRandomInt(0, 255), getRandomInt(0, 255)];
+ return getColour(colour);
+ }
+
+ function getColour (colour) {
+ return {
+ fillColor: rgba(colour, 0.2),
+ strokeColor: rgba(colour, 1),
+ pointColor: rgba(colour, 1),
+ pointStrokeColor: '#fff',
+ pointHighlightFill: '#fff',
+ pointHighlightStroke: rgba(colour, 0.8)
+ };
+ }
+
+ function getRandomInt (min, max) {
+ return Math.floor(Math.random() * (max - min + 1)) + min;
+ }
+
+ function rgba (colour, alpha) {
+ if (usingExcanvas) {
+ // rgba not supported by IE8
+ return 'rgb(' + colour.join(',') + ')';
+ } else {
+ return 'rgba(' + colour.concat(alpha).join(',') + ')';
+ }
+ }
+
+ // Credit: http://stackoverflow.com/a/11508164/1190235
+ function hexToRgb (hex) {
+ var bigint = parseInt(hex, 16),
+ r = (bigint >> 16) & 255,
+ g = (bigint >> 8) & 255,
+ b = bigint & 255;
+
+ return [r, g, b];
+ }
+
+ function getDataSets (labels, data, series, colours) {
+ return {
+ labels: labels,
+ datasets: data.map(function (item, i) {
+ return angular.extend({}, colours[i], {
+ label: series[i],
+ data: item
+ });
+ })
+ };
+ }
+
+ function getData (labels, data, colours) {
+ return labels.map(function (label, i) {
+ return angular.extend({}, colours[i], {
+ label: label,
+ value: data[i],
+ color: colours[i].strokeColor,
+ highlight: colours[i].pointHighlightStroke
+ });
+ });
+ }
+
+ function setLegend (elem, chart) {
+ var $parent = elem.parent(),
+ $oldLegend = $parent.find('chart-legend'),
+ legend = '<chart-legend>' + chart.generateLegend() + '</chart-legend>';
+ if ($oldLegend.length) $oldLegend.replaceWith(legend);
+ else $parent.append(legend);
+ }
+
+ function updateChart (chart, values, scope, elem) {
+ if (Array.isArray(scope.data[0])) {
+ chart.datasets.forEach(function (dataset, i) {
+ (dataset.points || dataset.bars).forEach(function (dataItem, j) {
+ dataItem.value = values[i][j];
+ });
+ });
+ } else {
+ chart.segments.forEach(function (segment, i) {
+ segment.value = values[i];
+ });
+ }
+ chart.update();
+ scope.$emit('update', chart);
+ if (scope.legend && scope.legend !== 'false') setLegend(elem, chart);
+ }
+
+ function isEmpty (value) {
+ return ! value ||
+ (Array.isArray(value) && ! value.length) ||
+ (typeof value === 'object' && ! Object.keys(value).length);
+ }
+
+ function isResponsive (type, scope) {
+ var options = angular.extend({}, Chart.defaults.global, ChartJs.getOptions(type), scope.options);
+ return options.responsive;
+ }
+
+ function destroyChart(chart, scope) {
+ if(! chart) return;
+ chart.destroy();
+ scope.$emit('destroy', chart);
+ }
+ }
+}));
diff --git a/views/ngXosViews/serviceGrid/src/vendor/angular-chart.js/dist/angular-chart.js.tar.gz b/views/ngXosViews/serviceGrid/src/vendor/angular-chart.js/dist/angular-chart.js.tar.gz
new file mode 100644
index 0000000..8171824
--- /dev/null
+++ b/views/ngXosViews/serviceGrid/src/vendor/angular-chart.js/dist/angular-chart.js.tar.gz
Binary files differ
diff --git a/views/ngXosViews/serviceGrid/src/vendor/angular-chart.js/dist/angular-chart.min.css b/views/ngXosViews/serviceGrid/src/vendor/angular-chart.js/dist/angular-chart.min.css
new file mode 100644
index 0000000..40c1412
--- /dev/null
+++ b/views/ngXosViews/serviceGrid/src/vendor/angular-chart.js/dist/angular-chart.min.css
@@ -0,0 +1,2 @@
+.bar-legend,.chart-legend,.doughnut-legend,.line-legend,.pie-legend,.polararea-legend,.radar-legend{list-style-type:none;margin-top:5px;text-align:center;-webkit-padding-start:0;-moz-padding-start:0;padding-left:0}.bar-legend li,.chart-legend li,.doughnut-legend li,.line-legend li,.pie-legend li,.polararea-legend li,.radar-legend li{display:inline-block;white-space:nowrap;position:relative;margin-bottom:4px;border-radius:5px;padding:2px 8px 2px 28px;font-size:smaller;cursor:default}.bar-legend-icon,.chart-legend-icon,.doughnut-legend-icon,.line-legend-icon,.pie-legend-icon,.polararea-legend-icon,.radar-legend-icon{display:block;position:absolute;left:0;top:0;width:20px;height:20px;border-radius:5px}
+/*# sourceMappingURL=angular-chart.min.css.map */
diff --git a/views/ngXosViews/serviceGrid/src/vendor/angular-chart.js/dist/angular-chart.min.css.map b/views/ngXosViews/serviceGrid/src/vendor/angular-chart.js/dist/angular-chart.min.css.map
new file mode 100644
index 0000000..65db89b
--- /dev/null
+++ b/views/ngXosViews/serviceGrid/src/vendor/angular-chart.js/dist/angular-chart.min.css.map
@@ -0,0 +1 @@
+{"version":3,"sources":["angular-chart.css"],"names":[],"mappings":"AAAc,W,CAAd,a,CAKkB,gB,CAJN,Y,CACC,W,CAEC,iB,CADF,a,CAIV,oB,CACA,c,CACA,iB,CAEA,uB,CAEA,oB,CAEA,c,CAGe,c,CAAjB,gB,CAKqB,mB,CAJN,e,CACC,c,CAEC,oB,CADF,gB,CAIb,oB,CACA,kB,CACA,iB,CACA,iB,CACA,iB,CACA,wB,CACA,iB,CACA,c,CAEiB,gB,CAAnB,kB,CAKuB,qB,CAJN,iB,CACC,gB,CAEC,sB,CADF,kB,CAIf,a,CACA,iB,CACA,M,CACA,K,CACA,U,CACA,W,CACA,iB","file":"angular-chart.min.css","sourcesContent":[".chart-legend,\n.bar-legend,\n.line-legend,\n.pie-legend,\n.radar-legend,\n.polararea-legend,\n.doughnut-legend {\n list-style-type: none;\n margin-top: 5px;\n text-align: center;\n /* NOTE: Browsers automatically add 40px of padding-left to all lists, so we should offset that, otherwise the legend is off-center */\n -webkit-padding-start: 0;\n /* Webkit */\n -moz-padding-start: 0;\n /* Mozilla */\n padding-left: 0;\n /* IE (handles all cases, really, but we should also include the vendor-specific properties just to be safe) */\n}\n.chart-legend li,\n.bar-legend li,\n.line-legend li,\n.pie-legend li,\n.radar-legend li,\n.polararea-legend li,\n.doughnut-legend li {\n display: inline-block;\n white-space: nowrap;\n position: relative;\n margin-bottom: 4px;\n border-radius: 5px;\n padding: 2px 8px 2px 28px;\n font-size: smaller;\n cursor: default;\n}\n.chart-legend-icon,\n.bar-legend-icon,\n.line-legend-icon,\n.pie-legend-icon,\n.radar-legend-icon,\n.polararea-legend-icon,\n.doughnut-legend-icon {\n display: block;\n position: absolute;\n left: 0;\n top: 0;\n width: 20px;\n height: 20px;\n border-radius: 5px;\n}\n"],"sourceRoot":"/source/"}
\ No newline at end of file
diff --git a/views/ngXosViews/serviceGrid/src/vendor/angular-chart.js/dist/angular-chart.min.js b/views/ngXosViews/serviceGrid/src/vendor/angular-chart.js/dist/angular-chart.min.js
new file mode 100644
index 0000000..eca3a1e
--- /dev/null
+++ b/views/ngXosViews/serviceGrid/src/vendor/angular-chart.js/dist/angular-chart.min.js
@@ -0,0 +1,2 @@
+!function(t){"use strict";"object"==typeof exports?module.exports=t("undefined"!=typeof angular?angular:require("angular"),"undefined"!=typeof Chart?Chart:require("chart.js")):"function"==typeof define&&define.amd?define(["angular","chart"],t):t(angular,Chart)}(function(t,e){"use strict";function n(){var n={},r={Chart:e,getOptions:function(e){var r=e&&n[e]||{};return t.extend({},n,r)}};this.setOptions=function(e,r){return r?void(n[e]=t.extend(n[e]||{},r)):(r=e,void(n=t.extend(n,r)))},this.$get=function(){return r}}function r(n,r){function o(t,e){return t&&e&&t.length&&e.length?Array.isArray(t[0])?t.length===e.length&&t.every(function(t,n){return t.length===e[n].length}):e.reduce(i,0)>0?t.length===e.length:!1:!1}function i(t,e){return t+e}function c(e,n,r,a){var o=null;return function(i){var c=n.getPointsAtEvent||n.getBarsAtEvent||n.getSegmentsAtEvent;if(c){var l=c.call(n,i);a!==!1&&t.equals(o,l)!==!1||(o=l,e[r](l,i),e.$apply())}}}function l(r,a){for(var o=!1,i=t.copy(a.colours||n.getOptions(r).colours||e.defaults.global.colours);i.length<a.data.length;)i.push(a.getColour()),o=!0;return o&&(a.colours=i),i.map(u)}function u(t){return"object"==typeof t&&null!==t?t:"string"==typeof t&&"#"===t[0]?f(g(t.substr(1))):s()}function s(){var t=[h(0,255),h(0,255),h(0,255)];return f(t)}function f(t){return{fillColor:d(t,.2),strokeColor:d(t,1),pointColor:d(t,1),pointStrokeColor:"#fff",pointHighlightFill:"#fff",pointHighlightStroke:d(t,.8)}}function h(t,e){return Math.floor(Math.random()*(e-t+1))+t}function d(t,e){return a?"rgb("+t.join(",")+")":"rgba("+t.concat(e).join(",")+")"}function g(t){var e=parseInt(t,16),n=e>>16&255,r=e>>8&255,a=255&e;return[n,r,a]}function p(e,n,r,a){return{labels:e,datasets:n.map(function(e,n){return t.extend({},a[n],{label:r[n],data:e})})}}function v(e,n,r){return e.map(function(e,a){return t.extend({},r[a],{label:e,value:n[a],color:r[a].strokeColor,highlight:r[a].pointHighlightStroke})})}function y(t,e){var n=t.parent(),r=n.find("chart-legend"),a="<chart-legend>"+e.generateLegend()+"</chart-legend>";r.length?r.replaceWith(a):n.append(a)}function C(t,e,n,r){Array.isArray(n.data[0])?t.datasets.forEach(function(t,n){(t.points||t.bars).forEach(function(t,r){t.value=e[n][r]})}):t.segments.forEach(function(t,n){t.value=e[n]}),t.update(),n.$emit("update",t),n.legend&&"false"!==n.legend&&y(r,t)}function b(t){return!t||Array.isArray(t)&&!t.length||"object"==typeof t&&!Object.keys(t).length}function m(r,a){var o=t.extend({},e.defaults.global,n.getOptions(r),a.options);return o.responsive}function w(t,e){t&&(t.destroy(),e.$emit("destroy",t))}return function(e){return{restrict:"CA",scope:{data:"=?",labels:"=?",options:"=?",series:"=?",colours:"=?",getColour:"=?",chartType:"=",legend:"@",click:"=?",hover:"=?",chartData:"=?",chartLabels:"=?",chartOptions:"=?",chartSeries:"=?",chartColours:"=?",chartLegend:"@",chartClick:"=?",chartHover:"=?"},link:function(i,u){function f(t,e){i.$watch(t,function(t){"undefined"!=typeof t&&(i[e]=t)})}function h(n,r){if(!b(n)&&!t.equals(n,r)){var a=e||i.chartType;a&&d(a)}}function d(e){if(m(e,i)&&0===u[0].clientHeight&&0===k.clientHeight)return r(function(){d(e)},50,!1);if(i.data&&i.data.length){i.getColour="function"==typeof i.getColour?i.getColour:s;var a=l(e,i),o=u[0],f=o.getContext("2d"),h=Array.isArray(i.data[0])?p(i.labels,i.data,i.series||[],a):v(i.labels,i.data,a),g=t.extend({},n.getOptions(e),i.options);w(A,i),A=new n.Chart(f)[e](h,g),i.$emit("create",A),o.onclick=i.click?c(i,A,"click",!1):t.noop,o.onmousemove=i.hover?c(i,A,"hover",!0):t.noop,i.legend&&"false"!==i.legend&&y(u,A)}}function g(t){if("undefined"!=typeof console&&"test"!==n.getOptions().env){var e="function"==typeof console.warn?console.warn:console.log;i[t]&&e.call(console,'"%s" is deprecated and will be removed in a future version. Please use "chart-%s" instead.',t,t)}}var A,k=document.createElement("div");k.className="chart-container",u.replaceWith(k),k.appendChild(u[0]),a&&window.G_vmlCanvasManager.initElement(u[0]),["data","labels","options","series","colours","legend","click","hover"].forEach(g),f("chartData","data"),f("chartLabels","labels"),f("chartOptions","options"),f("chartSeries","series"),f("chartColours","colours"),f("chartLegend","legend"),f("chartClick","click"),f("chartHover","hover"),i.$watch("data",function(t,n){if(!t||!t.length||Array.isArray(t[0])&&!t[0].length)return void w(A,i);var r=e||i.chartType;if(r)return A&&o(t,n)?C(A,t,i,u):void d(r)},!0),i.$watch("series",h,!0),i.$watch("labels",h,!0),i.$watch("options",h,!0),i.$watch("colours",h,!0),i.$watch("chartType",function(e,n){b(e)||t.equals(e,n)||d(e)}),i.$on("$destroy",function(){w(A,i)})}}}}e.defaults.global.responsive=!0,e.defaults.global.multiTooltipTemplate="<%if (datasetLabel){%><%=datasetLabel%>: <%}%><%= value %>",e.defaults.global.colours=["#97BBCD","#DCDCDC","#F7464A","#46BFBD","#FDB45C","#949FB1","#4D5360"];var a="object"==typeof window.G_vmlCanvasManager&&null!==window.G_vmlCanvasManager&&"function"==typeof window.G_vmlCanvasManager.initElement;return a&&(e.defaults.global.animation=!1),t.module("chart.js",[]).provider("ChartJs",n).factory("ChartJsFactory",["ChartJs","$timeout",r]).directive("chartBase",["ChartJsFactory",function(t){return new t}]).directive("chartLine",["ChartJsFactory",function(t){return new t("Line")}]).directive("chartBar",["ChartJsFactory",function(t){return new t("Bar")}]).directive("chartRadar",["ChartJsFactory",function(t){return new t("Radar")}]).directive("chartDoughnut",["ChartJsFactory",function(t){return new t("Doughnut")}]).directive("chartPie",["ChartJsFactory",function(t){return new t("Pie")}]).directive("chartPolarArea",["ChartJsFactory",function(t){return new t("PolarArea")}])});
+//# sourceMappingURL=angular-chart.min.js.map
diff --git a/views/ngXosViews/serviceGrid/src/vendor/angular-chart.js/dist/angular-chart.min.js.map b/views/ngXosViews/serviceGrid/src/vendor/angular-chart.js/dist/angular-chart.min.js.map
new file mode 100644
index 0000000..6d5826f
--- /dev/null
+++ b/views/ngXosViews/serviceGrid/src/vendor/angular-chart.js/dist/angular-chart.min.js.map
@@ -0,0 +1 @@
+{"version":3,"sources":["angular-chart.min.js"],"names":["factory","exports","module","angular","require","Chart","define","amd","ChartJsProvider","options","ChartJs","getOptions","type","typeOptions","extend","this","setOptions","customOptions","$get","ChartJsFactory","$timeout","canUpdateChart","newVal","oldVal","length","Array","isArray","every","element","index","reduce","sum","carry","val","getEventHandler","scope","chart","action","triggerOnlyOnChange","lastState","evt","atEvent","getPointsAtEvent","getBarsAtEvent","getSegmentsAtEvent","activePoints","call","equals","$apply","getColours","notEnoughColours","colours","copy","defaults","global","data","push","getColour","map","convertColour","colour","hexToRgb","substr","getRandomColour","getRandomInt","fillColor","rgba","strokeColor","pointColor","pointStrokeColor","pointHighlightFill","pointHighlightStroke","min","max","Math","floor","random","alpha","usingExcanvas","join","concat","hex","bigint","parseInt","r","g","b","getDataSets","labels","series","datasets","item","i","label","getData","value","color","highlight","setLegend","elem","$parent","parent","$oldLegend","find","legend","generateLegend","replaceWith","append","updateChart","values","forEach","dataset","points","bars","dataItem","j","segments","segment","update","$emit","isEmpty","Object","keys","isResponsive","responsive","destroyChart","destroy","restrict","chartType","click","hover","chartData","chartLabels","chartOptions","chartSeries","chartColours","chartLegend","chartClick","chartHover","link","aliasVar","fromName","toName","$watch","resetChart","createChart","clientHeight","container","cvs","ctx","getContext","onclick","noop","onmousemove","deprecated","attr","console","env","warn","log","document","createElement","className","appendChild","window","G_vmlCanvasManager","initElement","$on","multiTooltipTemplate","animation","provider","directive"],"mappings":"CAAC,SAAUA,GACT,YACuB,iBAAZC,SAETC,OAAOD,QAAUD,EACI,mBAAZG,SAA0BA,QAAUC,QAAQ,WAClC,mBAAVC,OAAwBA,MAAQD,QAAQ,aACrB,kBAAXE,SAAyBA,OAAOC,IAEjDD,QAAQ,UAAW,SAAUN,GAG7BA,EAAQG,QAASE,QAEnB,SAAUF,EAASE,GACnB,YAyCA,SAASG,KACP,GAAIC,MACAC,GACFL,MAAOA,EACPM,WAAY,SAAUC,GACpB,GAAIC,GAAcD,GAAQH,EAAQG,MAClC,OAAOT,GAAQW,UAAWL,EAASI,IAOvCE,MAAKC,WAAa,SAAUJ,EAAMK,GAEhC,MAAMA,QAMNR,EAAQG,GAAQT,EAAQW,OAAOL,EAAQG,OAAaK,KALlDA,EAAgBL,OAChBH,EAAUN,EAAQW,OAAOL,EAASQ,MAOtCF,KAAKG,KAAO,WACV,MAAOR,IAIX,QAASS,GAAgBT,EAASU,GAsIhC,QAASC,GAAgBC,EAAQC,GAC/B,MAAID,IAAUC,GAAUD,EAAOE,QAAUD,EAAOC,OACvCC,MAAMC,QAAQJ,EAAO,IAC5BA,EAAOE,SAAWD,EAAOC,QAAUF,EAAOK,MAAM,SAAUC,EAASC,GACjE,MAAOD,GAAQJ,SAAWD,EAAOM,GAAOL,SACxCD,EAAOO,OAAOC,EAAK,GAAK,EAAIT,EAAOE,SAAWD,EAAOC,QAAS,GAE3D,EAGT,QAASO,GAAKC,EAAOC,GACnB,MAAOD,GAAQC,EAGjB,QAASC,GAAiBC,EAAOC,EAAOC,EAAQC,GAC9C,GAAIC,GAAY,IAChB,OAAO,UAAUC,GACf,GAAIC,GAAUL,EAAMM,kBAAoBN,EAAMO,gBAAkBP,EAAMQ,kBACtE,IAAIH,EAAS,CACX,GAAII,GAAeJ,EAAQK,KAAKV,EAAOI,EACnCF,MAAwB,GAASnC,EAAQ4C,OAAOR,EAAW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{\n 'use strict';\n if (typeof exports === 'object') {\n // Node/CommonJS\n module.exports = factory(\n typeof angular !== 'undefined' ? angular : require('angular'),\n typeof Chart !== 'undefined' ? Chart : require('chart.js'));\n } else if (typeof define === 'function' && define.amd) {\n // AMD. Register as an anonymous module.\n define(['angular', 'chart'], factory);\n } else {\n // Browser globals\n factory(angular, Chart);\n }\n}(function (angular, Chart) {\n 'use strict';\n\n Chart.defaults.global.responsive = true;\n Chart.defaults.global.multiTooltipTemplate = '<%if (datasetLabel){%><%=datasetLabel%>: <%}%><%= value %>';\n\n Chart.defaults.global.colours = [\n '#97BBCD', // blue\n '#DCDCDC', // light grey\n '#F7464A', // red\n '#46BFBD', // green\n '#FDB45C', // yellow\n '#949FB1', // grey\n '#4D5360' // dark grey\n ];\n\n var usingExcanvas = typeof window.G_vmlCanvasManager === 'object' &&\n window.G_vmlCanvasManager !== null &&\n typeof window.G_vmlCanvasManager.initElement === 'function';\n\n if (usingExcanvas) Chart.defaults.global.animation = false;\n\n return angular.module('chart.js', [])\n .provider('ChartJs', ChartJsProvider)\n .factory('ChartJsFactory', ['ChartJs', '$timeout', ChartJsFactory])\n .directive('chartBase', ['ChartJsFactory', function (ChartJsFactory) { return new ChartJsFactory(); }])\n .directive('chartLine', ['ChartJsFactory', function (ChartJsFactory) { return new ChartJsFactory('Line'); }])\n .directive('chartBar', ['ChartJsFactory', function (ChartJsFactory) { return new ChartJsFactory('Bar'); }])\n .directive('chartRadar', ['ChartJsFactory', function (ChartJsFactory) { return new ChartJsFactory('Radar'); }])\n .directive('chartDoughnut', ['ChartJsFactory', function (ChartJsFactory) { return new ChartJsFactory('Doughnut'); }])\n .directive('chartPie', ['ChartJsFactory', function (ChartJsFactory) { return new ChartJsFactory('Pie'); }])\n .directive('chartPolarArea', ['ChartJsFactory', function (ChartJsFactory) { return new ChartJsFactory('PolarArea'); }]);\n\n /**\n * Wrapper for chart.js\n * Allows configuring chart js using the provider\n *\n * angular.module('myModule', ['chart.js']).config(function(ChartJsProvider) {\n * ChartJsProvider.setOptions({ responsive: true });\n * ChartJsProvider.setOptions('Line', { responsive: false });\n * })))\n */\n function ChartJsProvider () {\n var options = {};\n var ChartJs = {\n Chart: Chart,\n getOptions: function (type) {\n var typeOptions = type && options[type] || {};\n return angular.extend({}, options, typeOptions);\n }\n };\n\n /**\n * Allow to set global options during configuration\n */\n this.setOptions = function (type, customOptions) {\n // If no type was specified set option for the global object\n if (! customOptions) {\n customOptions = type;\n options = angular.extend(options, customOptions);\n return;\n }\n // Set options for the specific chart\n options[type] = angular.extend(options[type] || {}, customOptions);\n };\n\n this.$get = function () {\n return ChartJs;\n };\n }\n\n function ChartJsFactory (ChartJs, $timeout) {\n return function chart (type) {\n return {\n restrict: 'CA',\n scope: {\n data: '=?',\n labels: '=?',\n options: '=?',\n series: '=?',\n colours: '=?',\n getColour: '=?',\n chartType: '=',\n legend: '@',\n click: '=?',\n hover: '=?',\n\n chartData: '=?',\n chartLabels: '=?',\n chartOptions: '=?',\n chartSeries: '=?',\n chartColours: '=?',\n chartLegend: '@',\n chartClick: '=?',\n chartHover: '=?'\n },\n link: function (scope, elem/*, attrs */) {\n var chart, container = document.createElement('div');\n container.className = 'chart-container';\n elem.replaceWith(container);\n container.appendChild(elem[0]);\n\n if (usingExcanvas) window.G_vmlCanvasManager.initElement(elem[0]);\n\n ['data', 'labels', 'options', 'series', 'colours', 'legend', 'click', 'hover'].forEach(deprecated);\n function aliasVar (fromName, toName) {\n scope.$watch(fromName, function (newVal) {\n if (typeof newVal === 'undefined') return;\n scope[toName] = newVal;\n });\n }\n /* provide backward compatibility to \"old\" directive names, by\n * having an alias point from the new names to the old names. */\n aliasVar('chartData', 'data');\n aliasVar('chartLabels', 'labels');\n aliasVar('chartOptions', 'options');\n aliasVar('chartSeries', 'series');\n aliasVar('chartColours', 'colours');\n aliasVar('chartLegend', 'legend');\n aliasVar('chartClick', 'click');\n aliasVar('chartHover', 'hover');\n\n // Order of setting \"watch\" matter\n\n scope.$watch('data', function (newVal, oldVal) {\n if (! newVal || ! newVal.length || (Array.isArray(newVal[0]) && ! newVal[0].length)) {\n destroyChart(chart, scope);\n return;\n }\n var chartType = type || scope.chartType;\n if (! chartType) return;\n\n if (chart && canUpdateChart(newVal, oldVal))\n return updateChart(chart, newVal, scope, elem);\n\n createChart(chartType);\n }, true);\n\n scope.$watch('series', resetChart, true);\n scope.$watch('labels', resetChart, true);\n scope.$watch('options', resetChart, true);\n scope.$watch('colours', resetChart, true);\n\n scope.$watch('chartType', function (newVal, oldVal) {\n if (isEmpty(newVal)) return;\n if (angular.equals(newVal, oldVal)) return;\n createChart(newVal);\n });\n\n scope.$on('$destroy', function () {\n destroyChart(chart, scope);\n });\n\n function resetChart (newVal, oldVal) {\n if (isEmpty(newVal)) return;\n if (angular.equals(newVal, oldVal)) return;\n var chartType = type || scope.chartType;\n if (! chartType) return;\n\n // chart.update() doesn't work for series and labels\n // so we have to re-create the chart entirely\n createChart(chartType);\n }\n\n function createChart (type) {\n if (isResponsive(type, scope) && elem[0].clientHeight === 0 && container.clientHeight === 0) {\n return $timeout(function () {\n createChart(type);\n }, 50, false);\n }\n if (! scope.data || ! scope.data.length) return;\n scope.getColour = typeof scope.getColour === 'function' ? scope.getColour : getRandomColour;\n var colours = getColours(type, scope);\n var cvs = elem[0], ctx = cvs.getContext('2d');\n var data = Array.isArray(scope.data[0]) ?\n getDataSets(scope.labels, scope.data, scope.series || [], colours) :\n getData(scope.labels, scope.data, colours);\n var options = angular.extend({}, ChartJs.getOptions(type), scope.options);\n\n // Destroy old chart if it exists to avoid ghost charts issue\n // https://github.com/jtblin/angular-chart.js/issues/187\n destroyChart(chart, scope);\n chart = new ChartJs.Chart(ctx)[type](data, options);\n scope.$emit('create', chart);\n\n // Bind events\n cvs.onclick = scope.click ? getEventHandler(scope, chart, 'click', false) : angular.noop;\n cvs.onmousemove = scope.hover ? getEventHandler(scope, chart, 'hover', true) : angular.noop;\n\n if (scope.legend && scope.legend !== 'false') setLegend(elem, chart);\n }\n\n function deprecated (attr) {\n if (typeof console !== 'undefined' && ChartJs.getOptions().env !== 'test') {\n var warn = typeof console.warn === 'function' ? console.warn : console.log;\n if (!! scope[attr]) {\n warn.call(console, '\"%s\" is deprecated and will be removed in a future version. ' +\n 'Please use \"chart-%s\" instead.', attr, attr);\n }\n }\n }\n }\n };\n };\n\n function canUpdateChart (newVal, oldVal) {\n if (newVal && oldVal && newVal.length && oldVal.length) {\n return Array.isArray(newVal[0]) ?\n newVal.length === oldVal.length && newVal.every(function (element, index) {\n return element.length === oldVal[index].length; }) :\n oldVal.reduce(sum, 0) > 0 ? newVal.length === oldVal.length : false;\n }\n return false;\n }\n\n function sum (carry, val) {\n return carry + val;\n }\n\n function getEventHandler (scope, chart, action, triggerOnlyOnChange) {\n var lastState = null;\n return function (evt) {\n var atEvent = chart.getPointsAtEvent || chart.getBarsAtEvent || chart.getSegmentsAtEvent;\n if (atEvent) {\n var activePoints = atEvent.call(chart, evt);\n if (triggerOnlyOnChange === false || angular.equals(lastState, activePoints) === false) {\n lastState = activePoints;\n scope[action](activePoints, evt);\n scope.$apply();\n }\n }\n };\n }\n\n function getColours (type, scope) {\n var notEnoughColours = false;\n var colours = angular.copy(scope.colours ||\n ChartJs.getOptions(type).colours ||\n Chart.defaults.global.colours\n );\n while (colours.length < scope.data.length) {\n colours.push(scope.getColour());\n notEnoughColours = true;\n }\n // mutate colours in this case as we don't want\n // the colours to change on each refresh\n if (notEnoughColours) scope.colours = colours;\n return colours.map(convertColour);\n }\n\n function convertColour (colour) {\n if (typeof colour === 'object' && colour !== null) return colour;\n if (typeof colour === 'string' && colour[0] === '#') return getColour(hexToRgb(colour.substr(1)));\n return getRandomColour();\n }\n\n function getRandomColour () {\n var colour = [getRandomInt(0, 255), getRandomInt(0, 255), getRandomInt(0, 255)];\n return getColour(colour);\n }\n\n function getColour (colour) {\n return {\n fillColor: rgba(colour, 0.2),\n strokeColor: rgba(colour, 1),\n pointColor: rgba(colour, 1),\n pointStrokeColor: '#fff',\n pointHighlightFill: '#fff',\n pointHighlightStroke: rgba(colour, 0.8)\n };\n }\n\n function getRandomInt (min, max) {\n return Math.floor(Math.random() * (max - min + 1)) + min;\n }\n\n function rgba (colour, alpha) {\n if (usingExcanvas) {\n // rgba not supported by IE8\n return 'rgb(' + colour.join(',') + ')';\n } else {\n return 'rgba(' + colour.concat(alpha).join(',') + ')';\n }\n }\n\n // Credit: http://stackoverflow.com/a/11508164/1190235\n function hexToRgb (hex) {\n var bigint = parseInt(hex, 16),\n r = (bigint >> 16) & 255,\n g = (bigint >> 8) & 255,\n b = bigint & 255;\n\n return [r, g, b];\n }\n\n function getDataSets (labels, data, series, colours) {\n return {\n labels: labels,\n datasets: data.map(function (item, i) {\n return angular.extend({}, colours[i], {\n label: series[i],\n data: item\n });\n })\n };\n }\n\n function getData (labels, data, colours) {\n return labels.map(function (label, i) {\n return angular.extend({}, colours[i], {\n label: label,\n value: data[i],\n color: colours[i].strokeColor,\n highlight: colours[i].pointHighlightStroke\n });\n });\n }\n\n function setLegend (elem, chart) {\n var $parent = elem.parent(),\n $oldLegend = $parent.find('chart-legend'),\n legend = '<chart-legend>' + chart.generateLegend() + '</chart-legend>';\n if ($oldLegend.length) $oldLegend.replaceWith(legend);\n else $parent.append(legend);\n }\n\n function updateChart (chart, values, scope, elem) {\n if (Array.isArray(scope.data[0])) {\n chart.datasets.forEach(function (dataset, i) {\n (dataset.points || dataset.bars).forEach(function (dataItem, j) {\n dataItem.value = values[i][j];\n });\n });\n } else {\n chart.segments.forEach(function (segment, i) {\n segment.value = values[i];\n });\n }\n chart.update();\n scope.$emit('update', chart);\n if (scope.legend && scope.legend !== 'false') setLegend(elem, chart);\n }\n\n function isEmpty (value) {\n return ! value ||\n (Array.isArray(value) && ! value.length) ||\n (typeof value === 'object' && ! Object.keys(value).length);\n }\n\n function isResponsive (type, scope) {\n var options = angular.extend({}, Chart.defaults.global, ChartJs.getOptions(type), scope.options);\n return options.responsive;\n }\n\n function destroyChart(chart, scope) {\n if(! chart) return;\n chart.destroy();\n scope.$emit('destroy', chart);\n }\n }\n}));\n"],"sourceRoot":"/source/"}
\ No newline at end of file