@agorapulse/ui-charts 2.5.0 → 13.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/agorapulse-ui-charts-13.0.0.tgz +0 -0
  2. package/agorapulse-ui-charts.d.ts +1 -0
  3. package/{esm2015/agorapulse-ui-charts.js → esm2020/agorapulse-ui-charts.mjs} +0 -0
  4. package/{esm2015/index.js → esm2020/index.mjs} +0 -0
  5. package/esm2020/src/lib/agorapulse-ui-charts.module.mjs +60 -0
  6. package/esm2020/src/lib/chart-bar/chart-bar-options.model.mjs +80 -0
  7. package/esm2020/src/lib/chart-bar/chart-bar.component.mjs +58 -0
  8. package/{esm2015/src/lib/chart-colors.js → esm2020/src/lib/chart-colors.mjs} +0 -0
  9. package/esm2020/src/lib/chart-column/chart-column-options.model.mjs +104 -0
  10. package/esm2020/src/lib/chart-column/chart-column.component.mjs +59 -0
  11. package/{esm2015/src/lib/chart-heatmap/chart-heatmap-options.model.js → esm2020/src/lib/chart-heatmap/chart-heatmap-options.model.mjs} +0 -0
  12. package/esm2020/src/lib/chart-heatmap/chart-heatmap.component.mjs +55 -0
  13. package/{esm2015/src/lib/chart-metric.js → esm2020/src/lib/chart-metric.mjs} +0 -0
  14. package/esm2020/src/lib/chart-metrics-list/chart-metrics-list.component.mjs +23 -0
  15. package/{esm2015/src/lib/chart-options.js → esm2020/src/lib/chart-options.mjs} +0 -0
  16. package/esm2020/src/lib/chart-pie/chart-pie-options.model.mjs +121 -0
  17. package/esm2020/src/lib/chart-pie/chart-pie.component.mjs +56 -0
  18. package/{esm2015/src/lib/chart-spline/chart-spline-options.model.js → esm2020/src/lib/chart-spline/chart-spline-options.model.mjs} +0 -0
  19. package/esm2020/src/lib/chart-spline/chart-spline.component.mjs +53 -0
  20. package/{esm2015/src/lib/highchart-series.model.js → esm2020/src/lib/highchart-series.model.mjs} +0 -0
  21. package/{esm2015/src/lib/highcharts-border-radius-plugin.js → esm2020/src/lib/highcharts-border-radius-plugin.mjs} +0 -0
  22. package/fesm2015/{agorapulse-ui-charts.js → agorapulse-ui-charts.mjs} +171 -123
  23. package/fesm2015/agorapulse-ui-charts.mjs.map +1 -0
  24. package/fesm2020/agorapulse-ui-charts.mjs +1089 -0
  25. package/fesm2020/agorapulse-ui-charts.mjs.map +1 -0
  26. package/package.json +26 -14
  27. package/src/lib/agorapulse-ui-charts.module.d.ts +13 -0
  28. package/src/lib/chart-bar/chart-bar.component.d.ts +3 -0
  29. package/src/lib/chart-column/chart-column.component.d.ts +3 -0
  30. package/src/lib/chart-heatmap/chart-heatmap.component.d.ts +3 -0
  31. package/src/lib/chart-metrics-list/chart-metrics-list.component.d.ts +3 -0
  32. package/src/lib/chart-pie/chart-pie.component.d.ts +3 -0
  33. package/src/lib/chart-spline/chart-spline.component.d.ts +3 -0
  34. package/agorapulse-ui-charts-2.5.0.tgz +0 -0
  35. package/agorapulse-ui-charts.metadata.json +0 -1
  36. package/bundles/agorapulse-ui-charts.umd.js +0 -1437
  37. package/bundles/agorapulse-ui-charts.umd.js.map +0 -1
  38. package/esm2015/src/lib/agorapulse-ui-charts.module.js +0 -39
  39. package/esm2015/src/lib/chart-bar/chart-bar-options.model.js +0 -77
  40. package/esm2015/src/lib/chart-bar/chart-bar.component.js +0 -51
  41. package/esm2015/src/lib/chart-column/chart-column-options.model.js +0 -103
  42. package/esm2015/src/lib/chart-column/chart-column.component.js +0 -53
  43. package/esm2015/src/lib/chart-heatmap/chart-heatmap.component.js +0 -49
  44. package/esm2015/src/lib/chart-metrics-list/chart-metrics-list.component.js +0 -21
  45. package/esm2015/src/lib/chart-pie/chart-pie-options.model.js +0 -122
  46. package/esm2015/src/lib/chart-pie/chart-pie.component.js +0 -50
  47. package/esm2015/src/lib/chart-spline/chart-spline.component.js +0 -49
  48. package/fesm2015/agorapulse-ui-charts.js.map +0 -1
@@ -1,1437 +0,0 @@
1
- (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('highcharts'), require('@angular/core'), require('@angular/common'), require('@angular/material/list'), require('highcharts-angular'), require('highcharts/highmaps')) :
3
- typeof define === 'function' && define.amd ? define('@agorapulse/ui-charts', ['exports', 'highcharts', '@angular/core', '@angular/common', '@angular/material/list', 'highcharts-angular', 'highcharts/highmaps'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.agorapulse = global.agorapulse || {}, global.agorapulse["ui-charts"] = {}), global.Highcharts, global.ng.core, global.ng.common, global.ng.material.list, global.highchartsAngular, global.highmaps));
5
- })(this, (function (exports, Highcharts, core, common, list, highchartsAngular, highmaps) { 'use strict';
6
-
7
- function _interopNamespace(e) {
8
- if (e && e.__esModule) return e;
9
- var n = Object.create(null);
10
- if (e) {
11
- Object.keys(e).forEach(function (k) {
12
- if (k !== 'default') {
13
- var d = Object.getOwnPropertyDescriptor(e, k);
14
- Object.defineProperty(n, k, d.get ? d : {
15
- enumerable: true,
16
- get: function () { return e[k]; }
17
- });
18
- }
19
- });
20
- }
21
- n["default"] = e;
22
- return Object.freeze(n);
23
- }
24
-
25
- var Highcharts__namespace = /*#__PURE__*/_interopNamespace(Highcharts);
26
-
27
- var borderRadiusPlugin = function (H) {
28
- if (H.borderRadiusPlugininitialized) {
29
- return;
30
- }
31
- H.borderRadiusPlugininitialized = true;
32
- H.wrap(H.seriesTypes.column.prototype, 'translate', function (proceed) {
33
- var options = this.options;
34
- var topMargin = options.topMargin || 0;
35
- var bottomMargin = options.bottomMargin || 0;
36
- var borderRadiusTopLeftSettings = options.borderRadiusTopLeft;
37
- var borderRadiusTopRightSettings = options.borderRadiusTopRight;
38
- var borderRadiusBottomLeftSettings = options.borderRadiusBottomLeft;
39
- var borderRadiusBottomRightSettings = options.borderRadiusBottomRight;
40
- proceed.call(this);
41
- if (!this.points) {
42
- return;
43
- }
44
- this.points.forEach(function (point) {
45
- if (borderRadiusTopLeftSettings || borderRadiusTopRightSettings || borderRadiusBottomLeftSettings || borderRadiusBottomRightSettings) {
46
- var w = point.shapeArgs.width;
47
- var h = point.shapeArgs.height;
48
- var x = point.shapeArgs.x;
49
- var y = point.shapeArgs.y;
50
- var borderRadiusTopLeft = (borderRadiusTopLeftSettings && borderRadiusTopLeftSettings.length) ? borderRadiusTopLeftSettings[point.index] : borderRadiusTopLeftSettings || 0;
51
- var borderRadiusTopRight = (borderRadiusTopRightSettings && borderRadiusTopRightSettings.length) ? borderRadiusTopRightSettings[point.index] : borderRadiusTopRightSettings || 0;
52
- var borderRadiusBottomLeft = (borderRadiusBottomLeftSettings && borderRadiusBottomLeftSettings.length) ? borderRadiusBottomLeftSettings[point.index] : borderRadiusBottomLeftSettings || 0;
53
- var borderRadiusBottomRight = (borderRadiusBottomRightSettings && borderRadiusBottomRightSettings.length) ? borderRadiusBottomRightSettings[point.index] : borderRadiusBottomRightSettings || 0;
54
- var radiusTopLeft = H.relativeLength(borderRadiusTopLeft, w);
55
- var radiusTopRight = H.relativeLength(borderRadiusTopRight, w);
56
- var radiusBottomRight = H.relativeLength(borderRadiusBottomRight, w);
57
- var radiusBottomLeft = H.relativeLength(borderRadiusBottomLeft, w);
58
- var maxR = Math.min(w, h) / 2;
59
- radiusTopLeft = radiusTopLeft > maxR ? maxR : radiusTopLeft;
60
- radiusTopRight = radiusTopRight > maxR ? maxR : radiusTopRight;
61
- radiusBottomRight = radiusBottomRight > maxR ? maxR : radiusBottomRight;
62
- radiusBottomLeft = radiusBottomLeft > maxR ? maxR : radiusBottomLeft;
63
- point.dlBox = point.shapeArgs;
64
- point.shapeType = 'path';
65
- point.shapeArgs = {
66
- d: [
67
- 'M', x + radiusTopLeft, y + topMargin,
68
- 'L', x + w - radiusTopRight, y + topMargin,
69
- 'C', x + w - radiusTopRight / 2, y, x + w, y + radiusTopRight / 2, x + w, y + radiusTopRight,
70
- 'L', x + w, y + h - radiusBottomRight,
71
- 'C', x + w, y + h - radiusBottomRight / 2, x + w - radiusBottomRight / 2, y + h, x + w - radiusBottomRight, y + h + bottomMargin,
72
- 'L', x + radiusBottomLeft, y + h + bottomMargin,
73
- 'C', x + radiusBottomLeft / 2, y + h, x, y + h - radiusBottomLeft / 2, x, y + h - radiusBottomLeft,
74
- 'L', x, y + radiusTopLeft,
75
- 'C', x, y + radiusTopLeft / 2, x + radiusTopLeft / 2, y, x + radiusTopLeft, y,
76
- 'Z'
77
- ]
78
- };
79
- }
80
- });
81
- });
82
- };
83
-
84
- /*! *****************************************************************************
85
- Copyright (c) Microsoft Corporation.
86
-
87
- Permission to use, copy, modify, and/or distribute this software for any
88
- purpose with or without fee is hereby granted.
89
-
90
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
91
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
92
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
93
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
94
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
95
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
96
- PERFORMANCE OF THIS SOFTWARE.
97
- ***************************************************************************** */
98
- /* global Reflect, Promise */
99
- var extendStatics = function (d, b) {
100
- extendStatics = Object.setPrototypeOf ||
101
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
102
- function (d, b) { for (var p in b)
103
- if (Object.prototype.hasOwnProperty.call(b, p))
104
- d[p] = b[p]; };
105
- return extendStatics(d, b);
106
- };
107
- function __extends(d, b) {
108
- if (typeof b !== "function" && b !== null)
109
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
110
- extendStatics(d, b);
111
- function __() { this.constructor = d; }
112
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
113
- }
114
- var __assign = function () {
115
- __assign = Object.assign || function __assign(t) {
116
- for (var s, i = 1, n = arguments.length; i < n; i++) {
117
- s = arguments[i];
118
- for (var p in s)
119
- if (Object.prototype.hasOwnProperty.call(s, p))
120
- t[p] = s[p];
121
- }
122
- return t;
123
- };
124
- return __assign.apply(this, arguments);
125
- };
126
- function __rest(s, e) {
127
- var t = {};
128
- for (var p in s)
129
- if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
130
- t[p] = s[p];
131
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
132
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
133
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
134
- t[p[i]] = s[p[i]];
135
- }
136
- return t;
137
- }
138
- function __decorate(decorators, target, key, desc) {
139
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
140
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
141
- r = Reflect.decorate(decorators, target, key, desc);
142
- else
143
- for (var i = decorators.length - 1; i >= 0; i--)
144
- if (d = decorators[i])
145
- r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
146
- return c > 3 && r && Object.defineProperty(target, key, r), r;
147
- }
148
- function __param(paramIndex, decorator) {
149
- return function (target, key) { decorator(target, key, paramIndex); };
150
- }
151
- function __metadata(metadataKey, metadataValue) {
152
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
153
- return Reflect.metadata(metadataKey, metadataValue);
154
- }
155
- function __awaiter(thisArg, _arguments, P, generator) {
156
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
157
- return new (P || (P = Promise))(function (resolve, reject) {
158
- function fulfilled(value) { try {
159
- step(generator.next(value));
160
- }
161
- catch (e) {
162
- reject(e);
163
- } }
164
- function rejected(value) { try {
165
- step(generator["throw"](value));
166
- }
167
- catch (e) {
168
- reject(e);
169
- } }
170
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
171
- step((generator = generator.apply(thisArg, _arguments || [])).next());
172
- });
173
- }
174
- function __generator(thisArg, body) {
175
- var _ = { label: 0, sent: function () { if (t[0] & 1)
176
- throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
177
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
178
- function verb(n) { return function (v) { return step([n, v]); }; }
179
- function step(op) {
180
- if (f)
181
- throw new TypeError("Generator is already executing.");
182
- while (_)
183
- try {
184
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
185
- return t;
186
- if (y = 0, t)
187
- op = [op[0] & 2, t.value];
188
- switch (op[0]) {
189
- case 0:
190
- case 1:
191
- t = op;
192
- break;
193
- case 4:
194
- _.label++;
195
- return { value: op[1], done: false };
196
- case 5:
197
- _.label++;
198
- y = op[1];
199
- op = [0];
200
- continue;
201
- case 7:
202
- op = _.ops.pop();
203
- _.trys.pop();
204
- continue;
205
- default:
206
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
207
- _ = 0;
208
- continue;
209
- }
210
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
211
- _.label = op[1];
212
- break;
213
- }
214
- if (op[0] === 6 && _.label < t[1]) {
215
- _.label = t[1];
216
- t = op;
217
- break;
218
- }
219
- if (t && _.label < t[2]) {
220
- _.label = t[2];
221
- _.ops.push(op);
222
- break;
223
- }
224
- if (t[2])
225
- _.ops.pop();
226
- _.trys.pop();
227
- continue;
228
- }
229
- op = body.call(thisArg, _);
230
- }
231
- catch (e) {
232
- op = [6, e];
233
- y = 0;
234
- }
235
- finally {
236
- f = t = 0;
237
- }
238
- if (op[0] & 5)
239
- throw op[1];
240
- return { value: op[0] ? op[1] : void 0, done: true };
241
- }
242
- }
243
- var __createBinding = Object.create ? (function (o, m, k, k2) {
244
- if (k2 === undefined)
245
- k2 = k;
246
- Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
247
- }) : (function (o, m, k, k2) {
248
- if (k2 === undefined)
249
- k2 = k;
250
- o[k2] = m[k];
251
- });
252
- function __exportStar(m, o) {
253
- for (var p in m)
254
- if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
255
- __createBinding(o, m, p);
256
- }
257
- function __values(o) {
258
- var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
259
- if (m)
260
- return m.call(o);
261
- if (o && typeof o.length === "number")
262
- return {
263
- next: function () {
264
- if (o && i >= o.length)
265
- o = void 0;
266
- return { value: o && o[i++], done: !o };
267
- }
268
- };
269
- throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
270
- }
271
- function __read(o, n) {
272
- var m = typeof Symbol === "function" && o[Symbol.iterator];
273
- if (!m)
274
- return o;
275
- var i = m.call(o), r, ar = [], e;
276
- try {
277
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
278
- ar.push(r.value);
279
- }
280
- catch (error) {
281
- e = { error: error };
282
- }
283
- finally {
284
- try {
285
- if (r && !r.done && (m = i["return"]))
286
- m.call(i);
287
- }
288
- finally {
289
- if (e)
290
- throw e.error;
291
- }
292
- }
293
- return ar;
294
- }
295
- /** @deprecated */
296
- function __spread() {
297
- for (var ar = [], i = 0; i < arguments.length; i++)
298
- ar = ar.concat(__read(arguments[i]));
299
- return ar;
300
- }
301
- /** @deprecated */
302
- function __spreadArrays() {
303
- for (var s = 0, i = 0, il = arguments.length; i < il; i++)
304
- s += arguments[i].length;
305
- for (var r = Array(s), k = 0, i = 0; i < il; i++)
306
- for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
307
- r[k] = a[j];
308
- return r;
309
- }
310
- function __spreadArray(to, from, pack) {
311
- if (pack || arguments.length === 2)
312
- for (var i = 0, l = from.length, ar; i < l; i++) {
313
- if (ar || !(i in from)) {
314
- if (!ar)
315
- ar = Array.prototype.slice.call(from, 0, i);
316
- ar[i] = from[i];
317
- }
318
- }
319
- return to.concat(ar || Array.prototype.slice.call(from));
320
- }
321
- function __await(v) {
322
- return this instanceof __await ? (this.v = v, this) : new __await(v);
323
- }
324
- function __asyncGenerator(thisArg, _arguments, generator) {
325
- if (!Symbol.asyncIterator)
326
- throw new TypeError("Symbol.asyncIterator is not defined.");
327
- var g = generator.apply(thisArg, _arguments || []), i, q = [];
328
- return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
329
- function verb(n) { if (g[n])
330
- i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
331
- function resume(n, v) { try {
332
- step(g[n](v));
333
- }
334
- catch (e) {
335
- settle(q[0][3], e);
336
- } }
337
- function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
338
- function fulfill(value) { resume("next", value); }
339
- function reject(value) { resume("throw", value); }
340
- function settle(f, v) { if (f(v), q.shift(), q.length)
341
- resume(q[0][0], q[0][1]); }
342
- }
343
- function __asyncDelegator(o) {
344
- var i, p;
345
- return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
346
- function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
347
- }
348
- function __asyncValues(o) {
349
- if (!Symbol.asyncIterator)
350
- throw new TypeError("Symbol.asyncIterator is not defined.");
351
- var m = o[Symbol.asyncIterator], i;
352
- return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
353
- function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
354
- function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
355
- }
356
- function __makeTemplateObject(cooked, raw) {
357
- if (Object.defineProperty) {
358
- Object.defineProperty(cooked, "raw", { value: raw });
359
- }
360
- else {
361
- cooked.raw = raw;
362
- }
363
- return cooked;
364
- }
365
- ;
366
- var __setModuleDefault = Object.create ? (function (o, v) {
367
- Object.defineProperty(o, "default", { enumerable: true, value: v });
368
- }) : function (o, v) {
369
- o["default"] = v;
370
- };
371
- function __importStar(mod) {
372
- if (mod && mod.__esModule)
373
- return mod;
374
- var result = {};
375
- if (mod != null)
376
- for (var k in mod)
377
- if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
378
- __createBinding(result, mod, k);
379
- __setModuleDefault(result, mod);
380
- return result;
381
- }
382
- function __importDefault(mod) {
383
- return (mod && mod.__esModule) ? mod : { default: mod };
384
- }
385
- function __classPrivateFieldGet(receiver, state, kind, f) {
386
- if (kind === "a" && !f)
387
- throw new TypeError("Private accessor was defined without a getter");
388
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
389
- throw new TypeError("Cannot read private member from an object whose class did not declare it");
390
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
391
- }
392
- function __classPrivateFieldSet(receiver, state, value, kind, f) {
393
- if (kind === "m")
394
- throw new TypeError("Private method is not writable");
395
- if (kind === "a" && !f)
396
- throw new TypeError("Private accessor was defined without a setter");
397
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
398
- throw new TypeError("Cannot write private member to an object whose class did not declare it");
399
- return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
400
- }
401
-
402
- exports.ChartColor = void 0;
403
- (function (ChartColor) {
404
- ChartColor[ChartColor["Grey"] = 0] = "Grey";
405
- ChartColor[ChartColor["Orange"] = 1] = "Orange";
406
- ChartColor[ChartColor["SoftBlue"] = 2] = "SoftBlue";
407
- ChartColor[ChartColor["ElectricBlue"] = 3] = "ElectricBlue";
408
- ChartColor[ChartColor["Purple"] = 4] = "Purple";
409
- ChartColor[ChartColor["Green"] = 5] = "Green";
410
- })(exports.ChartColor || (exports.ChartColor = {}));
411
- var ChartColors = /** @class */ (function () {
412
- function ChartColors() {
413
- }
414
- ChartColors.getChartColors = function (color) {
415
- switch (color) {
416
- case exports.ChartColor.Orange:
417
- return this.ORANGE_COLORS;
418
- case exports.ChartColor.SoftBlue:
419
- return this.SOFT_BLUE_COLORS;
420
- case exports.ChartColor.ElectricBlue:
421
- return this.ELECTRIC_BLUE_COLORS;
422
- case exports.ChartColor.Purple:
423
- return this.PURPLE_COLORS;
424
- case exports.ChartColor.Green:
425
- return this.GREEN_COLORS;
426
- default:
427
- return this.GREY_COLORS;
428
- }
429
- };
430
- ChartColors.getColors = function (seriesCount, color) {
431
- var colors = this.getChartColors(color);
432
- switch (seriesCount) {
433
- case 1:
434
- return [colors[100]];
435
- case 2:
436
- return [colors[40], colors[100]];
437
- case 3:
438
- return [colors[20], colors[60], colors[100]];
439
- case 4:
440
- return [colors[20], colors[40], colors[60], colors[100]];
441
- case 5:
442
- return [colors[10], colors[20], colors[40], colors[60], colors[100]];
443
- default:
444
- return [colors[20], colors[40], colors[60], colors[100]];
445
- }
446
- };
447
- return ChartColors;
448
- }());
449
- ChartColors.SOFT_BLUE_COLORS = {
450
- '10': '#EFF5FC',
451
- '20': '#DFEDFA',
452
- '40': '#C0DBF4',
453
- '60': '#A0C8EF',
454
- '85': '#78B1E8',
455
- '100': '#61A4E4'
456
- };
457
- ChartColors.ELECTRIC_BLUE_COLORS = {
458
- '10': '#e8f4ff',
459
- '20': '#d1e8ff',
460
- '40': '#a2d1ff',
461
- '60': '#74bbfe',
462
- '85': '#3a9efe',
463
- '100': '#178dfe'
464
- };
465
- ChartColors.ORANGE_COLORS = {
466
- '10': '#FFEFE9',
467
- '20': '#FFE1D4',
468
- '40': '#FFC2A8',
469
- '60': '#FFA47D',
470
- '85': '#FF7E46',
471
- '100': '#FF6726'
472
- };
473
- ChartColors.GREEN_COLORS = {
474
- '10': '#ECF7ED',
475
- '20': '#DAF1DD',
476
- '40': '#B5E3BB',
477
- '60': '#8FD498',
478
- '85': '#61C26D',
479
- '100': '#45B854'
480
- };
481
- ChartColors.PURPLE_COLORS = {
482
- '10': '#EFEDF8',
483
- '20': '#E0DDF2',
484
- '40': '#C1BBE6',
485
- '60': '#A398D9',
486
- '85': '#7C6DC9',
487
- '100': '#6554C0'
488
- };
489
- ChartColors.GREY_COLORS = {
490
- '5': '#F5F5F7',
491
- '10': '#EAECEF',
492
- '20': '#D6DAE0',
493
- '40': '#AEB5C1',
494
- '60': '#858FA1',
495
- '85': '#5D6A82',
496
- '100': '#344563'
497
- };
498
- ChartColors.BLACK_COLOR = '#000000';
499
- ChartColors.LIMIT_COLOR = '#E81313';
500
- ChartColors.WHITE_COLOR = '#FFFFFF';
501
-
502
- var ChartOptions = /** @class */ (function () {
503
- function ChartOptions() {
504
- }
505
- ChartOptions.build = function (options) {
506
- return mergeDeep(ChartOptions.DEFAULT_OPTIONS, options);
507
- };
508
- ChartOptions.configure = function (series, options, color, labelDateFormat) {
509
- // Configure axis
510
- options.xAxis = mergeDeep({
511
- labels: {
512
- formatter: function () {
513
- return Highcharts.dateFormat(labelDateFormat ? labelDateFormat : '%m/%d', this.value);
514
- }
515
- },
516
- //minTickInterval: 24 * 60 * 60 * 1000 // One day
517
- }, options.xAxis);
518
- // Configure series
519
- if (series && series.length) {
520
- options.series = series;
521
- options.legend.enabled = series.length >= 2;
522
- options.colors = ChartColors.getColors(series.length, color);
523
- }
524
- };
525
- return ChartOptions;
526
- }());
527
- ChartOptions.DEFAULT_DATE_FORMAT = '%A, %b %e, %Y';
528
- ChartOptions.DEFAULT_OPTIONS = {
529
- /*lang: {
530
- decimalPoint: (manager && manager.locale !== 'en') ? ',' : '.',
531
- resetZoom: resetZoomLabel,
532
- resetZoomTitle: resetZoomHtmlTitle,
533
- shortMonths: [
534
- shortJanuary, shortFebruary, shortMarch, shortApril, shortMay, shortJune,
535
- shortJuly, shortAugust, shortSeptember, shortOctober, shortNovember, shortDecember
536
- ],
537
- thousandsSep: (manager && manager.locale !== 'en') ? ' ' : ',',
538
- weekdays: this.weekDays,
539
- zoomIn: zoomInHtmlTitle,
540
- zoomOut: zoomOutHtmlTitle
541
- },*/
542
- chart: {
543
- spacingRight: 20,
544
- zoomType: 'xy',
545
- panning: {
546
- enabled: true
547
- },
548
- panKey: 'shift',
549
- style: {
550
- fontFamily: 'Averta, \'Open Sans\', Helvetica, sans-serif'
551
- },
552
- resetZoomButton: {
553
- theme: {
554
- fill: ChartColors.WHITE_COLOR,
555
- r: 4,
556
- style: {
557
- color: ChartColors.GREY_COLORS[100],
558
- fontSize: '12px'
559
- },
560
- states: {
561
- hover: {
562
- fill: ChartColors.GREY_COLORS[5]
563
- }
564
- }
565
- }
566
- }
567
- },
568
- colorAxis: {
569
- labels: {
570
- style: {
571
- color: ChartColors.GREY_COLORS[60]
572
- }
573
- }
574
- },
575
- credits: {
576
- enabled: false
577
- },
578
- legend: {
579
- borderWidth: 0,
580
- itemStyle: {
581
- color: ChartColors.GREY_COLORS[60],
582
- fontSize: '14px',
583
- fontWeight: 'normal'
584
- },
585
- itemHoverStyle: {
586
- color: ChartColors.GREY_COLORS[100],
587
- fontWeight: 'bold'
588
- }
589
- },
590
- plotOptions: {
591
- series: {
592
- states: {
593
- hover: {
594
- brightness: 0
595
- }
596
- },
597
- connectNulls: true,
598
- lineWidth: 4
599
- }
600
- },
601
- navigation: {
602
- buttonOptions: {
603
- y: 0
604
- }
605
- },
606
- title: {
607
- text: null
608
- },
609
- tooltip: {
610
- backgroundColor: ChartColors.WHITE_COLOR,
611
- borderRadius: 4,
612
- borderWidth: 0,
613
- dateTimeLabelFormats: {
614
- day: ChartOptions.DEFAULT_DATE_FORMAT,
615
- week: ChartOptions.DEFAULT_DATE_FORMAT
616
- },
617
- shadow: {
618
- color: ChartColors.BLACK_COLOR,
619
- offsetX: 0,
620
- offsetY: 2,
621
- opacity: 0.02,
622
- width: 6
623
- },
624
- split: false,
625
- shared: true,
626
- useHTML: true,
627
- headerFormat: "<div style=\"border-bottom: 1px solid " + ChartColors.GREY_COLORS[10] + "; padding: 0 8px 7px\">"
628
- + ("<span style=\"font-size: 12px; color: " + ChartColors.GREY_COLORS[60] + "\">{point.key}</span></div>"),
629
- pointFormat: "<div style=\"font-size: 14px; color: " + ChartColors.GREY_COLORS[100] + "; margin: 6px 8px 0 8px;\">"
630
- + '<span style="color:{point.color}">\u25CF</span> {series.name}: <b>{point.y}</b></div>'
631
- },
632
- xAxis: {
633
- gridLineColor: ChartColors.GREY_COLORS[10],
634
- lineColor: ChartColors.GREY_COLORS[10],
635
- tickColor: ChartColors.GREY_COLORS[10],
636
- gridLineWidth: 1,
637
- title: {
638
- text: null
639
- },
640
- labels: {
641
- style: {
642
- color: ChartColors.GREY_COLORS[40],
643
- fontSize: '12px'
644
- }
645
- }
646
- },
647
- yAxis: {
648
- allowDecimals: false,
649
- gridLineColor: ChartColors.GREY_COLORS[10],
650
- lineColor: ChartColors.GREY_COLORS[10],
651
- gridLineWidth: 1,
652
- title: {
653
- text: null
654
- },
655
- labels: {
656
- style: {
657
- color: ChartColors.GREY_COLORS[40],
658
- fontSize: '12px'
659
- }
660
- }
661
- }
662
- };
663
- function isObject(item) {
664
- return (item && typeof item === 'object' && !Array.isArray(item));
665
- }
666
- function mergeDeep(target, source) {
667
- var output = deepCopy(target);
668
- if (isObject(target) && isObject(source)) {
669
- Object.keys(source).forEach(function (key) {
670
- var _a, _b;
671
- if (isObject(source[key])) {
672
- if (!(key in target))
673
- Object.assign(output, (_a = {}, _a[key] = source[key], _a));
674
- else
675
- output[key] = mergeDeep(target[key], source[key]);
676
- }
677
- else {
678
- Object.assign(output, (_b = {}, _b[key] = source[key], _b));
679
- }
680
- });
681
- }
682
- return output;
683
- }
684
- function deepCopy(source) {
685
- if (typeof source !== "object" || source === null) {
686
- return source; // Return the value if source is not an object
687
- }
688
- // Create an array or object to hold the values
689
- var newObject = Array.isArray(source) ? [] : {};
690
- for (var key in source) {
691
- if (source.hasOwnProperty(key)) {
692
- // Recursively (deep) copy for nested objects, including arrays
693
- newObject[key] = deepCopy(source[key]);
694
- }
695
- }
696
- return newObject;
697
- }
698
-
699
- var ChartBarOptions = /** @class */ (function (_super) {
700
- __extends(ChartBarOptions, _super);
701
- function ChartBarOptions() {
702
- return _super !== null && _super.apply(this, arguments) || this;
703
- }
704
- ChartBarOptions.build = function (options) {
705
- var seriesOptions = {
706
- borderRadiusTopLeft: 100,
707
- borderRadiusTopRight: 100,
708
- borderWidth: 0
709
- };
710
- var defaultColumnOptions = {
711
- chart: {
712
- type: 'bar'
713
- },
714
- xAxis: {
715
- categories: undefined,
716
- gridLineWidth: 0,
717
- lineWidth: 0,
718
- reversed: false,
719
- tickWidth: 0,
720
- labels: {
721
- align: 'center',
722
- formatter: function () {
723
- if (this.value && this.value.toString().length > 16) {
724
- return this.value.toString().substring(0, 15) + "...";
725
- }
726
- return this.value.toString();
727
- },
728
- style: {
729
- width: 100
730
- }
731
- },
732
- type: 'category'
733
- },
734
- yAxis: {
735
- type: 'linear',
736
- minTickInterval: 1
737
- },
738
- plotOptions: {
739
- bar: {
740
- maxPointWidth: 18,
741
- pointWidth: 20
742
- },
743
- series: seriesOptions
744
- }
745
- };
746
- return _super.build.call(this, mergeDeep(defaultColumnOptions, options));
747
- };
748
- ChartBarOptions.configureBar = function (series, categories, options, opposite, color, labelDateFormat) {
749
- ChartOptions.configure(series, options, color, labelDateFormat);
750
- if (categories && categories.length) {
751
- options.xAxis.categories = categories;
752
- }
753
- if (opposite && series.length === 2) {
754
- var negativeSerie = series[0];
755
- negativeSerie.borderRadiusBottomLeft = 100;
756
- negativeSerie.borderRadiusBottomRight = 100;
757
- negativeSerie.borderRadiusTopLeft = 0;
758
- negativeSerie.borderRadiusTopRight = 0;
759
- negativeSerie.data = negativeSerie.data.map(function (point) {
760
- if (point && isNaN(point)) {
761
- return Object.assign(Object.assign({}, point), { y: -Math.abs(point.y) });
762
- }
763
- else if (!isNaN(point)) {
764
- return -Math.abs(point);
765
- }
766
- return point;
767
- });
768
- options.plotOptions.series.stacking = 'normal';
769
- options.yAxis.labels.formatter = function () {
770
- return Math.abs(this.value) + '%';
771
- };
772
- options.tooltip.pointFormatter = function () {
773
- return "<div style=\"font-size: 14px; color: #344563; margin: 6px 8px 0 8px;\"><span style=\"color:" + this.color + ";\">\u25CF</span> " + this.series.name + ": <b>" + (Math.abs(this.y) + '%') + "</b></div>";
774
- };
775
- }
776
- };
777
- return ChartBarOptions;
778
- }(ChartOptions));
779
-
780
- var ChartBarComponent = /** @class */ (function () {
781
- function ChartBarComponent() {
782
- this.categories = [];
783
- this.chartOptions = {}; // https://api.highcharts.com/highcharts/
784
- this.color = exports.ChartColor.ElectricBlue;
785
- this.lastWidth = 0;
786
- }
787
- ChartBarComponent.prototype.ngOnChanges = function (changes) {
788
- if ((changes.series && !changes.series.firstChange) || (changes.color && !changes.color.firstChange)) {
789
- this.initChart();
790
- }
791
- };
792
- ChartBarComponent.prototype.ngAfterViewChecked = function () {
793
- if (this.chartRef && this.chartRef.nativeElement.clientWidth != this.lastWidth) {
794
- this.lastWidth = this.chartRef.nativeElement.clientWidth;
795
- if (this.chart) {
796
- this.chart.reflow();
797
- }
798
- else if (this.series && this.series.length) {
799
- this.initChart();
800
- }
801
- }
802
- };
803
- ChartBarComponent.prototype.initChart = function () {
804
- if (this.series) {
805
- var chartOptions = ChartBarOptions.build(this.chartOptions);
806
- ChartBarOptions.configureBar(this.series, this.categories, chartOptions, this.opposite, this.color, this.labelDateFormat);
807
- this.chart = new Highcharts.Chart(this.chartRef.nativeElement, chartOptions);
808
- }
809
- };
810
- return ChartBarComponent;
811
- }());
812
- ChartBarComponent.decorators = [
813
- { type: core.Component, args: [{
814
- selector: 'ap-chart-bar',
815
- template: "<div #chart></div>\n"
816
- },] }
817
- ];
818
- ChartBarComponent.propDecorators = {
819
- chartRef: [{ type: core.ViewChild, args: ['chart',] }],
820
- categories: [{ type: core.Input }],
821
- chartOptions: [{ type: core.Input }],
822
- color: [{ type: core.Input }],
823
- labelDateFormat: [{ type: core.Input }],
824
- opposite: [{ type: core.Input }],
825
- series: [{ type: core.Input }]
826
- };
827
-
828
- var ChartColumnOptions = /** @class */ (function (_super) {
829
- __extends(ChartColumnOptions, _super);
830
- function ChartColumnOptions() {
831
- return _super !== null && _super.apply(this, arguments) || this;
832
- }
833
- ChartColumnOptions.buildColumn = function (options, simple) {
834
- var defaultColumnOptions = {
835
- chart: {
836
- type: 'column'
837
- },
838
- legend: {
839
- symbolHeight: 10
840
- },
841
- plotOptions: {
842
- column: {
843
- stacking: 'normal',
844
- borderWidth: 0,
845
- maxPointWidth: 20,
846
- events: {
847
- hide: function () {
848
- ChartColumnOptions.redrawWithRoundedColumns(this.chart);
849
- },
850
- show: function () {
851
- ChartColumnOptions.redrawWithRoundedColumns(this.chart);
852
- }
853
- }
854
- }
855
- },
856
- xAxis: {
857
- type: 'datetime'
858
- }
859
- };
860
- var simpleColumnOptions = {
861
- chart: {
862
- type: 'column',
863
- height: '80px'
864
- },
865
- credits: {
866
- enabled: false
867
- },
868
- plotOptions: {
869
- column: {
870
- events: {
871
- hide: function () {
872
- ChartColumnOptions.redrawWithRoundedColumns(this.chart);
873
- },
874
- show: function () {
875
- ChartColumnOptions.redrawWithRoundedColumns(this.chart);
876
- }
877
- },
878
- }
879
- },
880
- xAxis: {
881
- type: 'datetime',
882
- crosshair: true,
883
- labels: {
884
- enabled: false,
885
- formatter: function () {
886
- return Highcharts.dateFormat('%m/%d', this.value);
887
- }
888
- },
889
- lineWidth: 0,
890
- tickWidth: 0,
891
- gridLineWidth: 0
892
- },
893
- yAxis: {
894
- min: 0,
895
- labels: {
896
- enabled: false
897
- },
898
- gridLineWidth: 0
899
- }
900
- };
901
- return _super.build.call(this, mergeDeep(simple ? simpleColumnOptions : defaultColumnOptions, options));
902
- };
903
- ChartColumnOptions.redrawWithRoundedColumns = function (chart) {
904
- chart.series.map(function (serie, serieIndex, arr) {
905
- ChartColumnOptions.roundSerie(arr, serie.options, serieIndex);
906
- });
907
- chart.redraw(true);
908
- };
909
- ChartColumnOptions.roundSerie = function (series, serie, serieIndex) {
910
- var roundedOptionMap = [];
911
- var borderRadius = 0;
912
- if (serie.data) {
913
- serie.data.forEach(function (point, columnIndex) {
914
- // Check if all previous stacked data at the same abscissa (located higher on the graph) are missing or have a value of 0
915
- // if so, it means that this point is the visual top of the column, so we should round it
916
- var roundedColumnEnabled = series.slice(0, serieIndex)
917
- .every(function (otherSerie) {
918
- if (otherSerie.visible === false) {
919
- return true;
920
- }
921
- var pointAtSameAbscissa = otherSerie.options.data.find(function (otherPoint) { return otherPoint[0] === point[0]; });
922
- return !pointAtSameAbscissa || pointAtSameAbscissa[1] === 0;
923
- });
924
- borderRadius = roundedColumnEnabled ? 100 : 0;
925
- roundedOptionMap[columnIndex] = borderRadius;
926
- });
927
- serie.borderRadiusTopLeft = roundedOptionMap;
928
- serie.borderRadiusTopRight = roundedOptionMap;
929
- }
930
- };
931
- return ChartColumnOptions;
932
- }(ChartOptions));
933
-
934
- var ChartColumnComponent = /** @class */ (function () {
935
- function ChartColumnComponent() {
936
- this.chartOptions = {}; // https://api.highcharts.com/highcharts/
937
- this.color = exports.ChartColor.ElectricBlue;
938
- this.simple = false;
939
- this.lastWidth = 0;
940
- }
941
- ChartColumnComponent.prototype.ngOnChanges = function (changes) {
942
- if ((changes.series && !changes.series.firstChange) || (changes.color && !changes.color.firstChange)) {
943
- this.initChart();
944
- }
945
- };
946
- ChartColumnComponent.prototype.ngAfterViewChecked = function () {
947
- if (this.chartRef && this.chartRef.nativeElement.clientWidth != this.lastWidth) {
948
- this.lastWidth = this.chartRef.nativeElement.clientWidth;
949
- if (this.chart) {
950
- this.chart.reflow();
951
- }
952
- else if (this.series && this.series.length) {
953
- this.initChart();
954
- }
955
- }
956
- };
957
- ChartColumnComponent.prototype.initChart = function () {
958
- if (this.series) {
959
- var chartOptions = ChartColumnOptions.buildColumn(this.chartOptions, this.simple);
960
- ChartColumnOptions.configure(this.series, chartOptions, this.color, this.labelDateFormat);
961
- this.chart = new Highcharts.Chart(this.chartRef.nativeElement, chartOptions);
962
- if (this.chart) {
963
- ChartColumnOptions.redrawWithRoundedColumns(this.chart);
964
- }
965
- }
966
- };
967
- return ChartColumnComponent;
968
- }());
969
- ChartColumnComponent.decorators = [
970
- { type: core.Component, args: [{
971
- selector: 'ap-chart-column',
972
- template: "<div #chart></div>\n"
973
- },] }
974
- ];
975
- ChartColumnComponent.propDecorators = {
976
- chartRef: [{ type: core.ViewChild, args: ['chart',] }],
977
- chartOptions: [{ type: core.Input }],
978
- color: [{ type: core.Input }],
979
- labelDateFormat: [{ type: core.Input }],
980
- series: [{ type: core.Input }],
981
- simple: [{ type: core.Input }]
982
- };
983
-
984
- exports.ChartMetricType = void 0;
985
- (function (ChartMetricType) {
986
- ChartMetricType[ChartMetricType["default"] = 0] = "default";
987
- ChartMetricType[ChartMetricType["total"] = 1] = "total";
988
- })(exports.ChartMetricType || (exports.ChartMetricType = {}));
989
- var ChartMetric = /** @class */ (function () {
990
- function ChartMetric() {
991
- }
992
- return ChartMetric;
993
- }());
994
-
995
- var ChartMetricsListComponent = /** @class */ (function () {
996
- function ChartMetricsListComponent() {
997
- this.ChartMetricType = exports.ChartMetricType;
998
- this.digitsInfo = '1.0-1';
999
- }
1000
- return ChartMetricsListComponent;
1001
- }());
1002
- ChartMetricsListComponent.decorators = [
1003
- { type: core.Component, args: [{
1004
- changeDetection: core.ChangeDetectionStrategy.OnPush,
1005
- selector: "ap-chart-metrics-list",
1006
- template: "<mat-list>\n <ng-container *ngIf=\"metrics\">\n <mat-list-item *ngFor=\"let metric of metrics; let i = index\"\n [ngClass]=\"{'chart-metric-total': metric.type == ChartMetricType.total}\">\n <div class=\"chart-metric-name metric-label\"\n *ngIf=\"!metric.children\">\n {{metric.name}}\n </div>\n <div class=\"chart-metric-name\"\n *ngIf=\"metric.children\">\n <span class=\"metric-label\">\n {{metric.name}}\n </span>\n <span class=\"chart-metric-children\">\n <span *ngFor=\"let item of metric.children\">\n <span class=\"child-label\">{{item.name}}</span>: <span class=\"child-value\">{{item.value}}</span>\n </span>\n </span>\n </div>\n <div class=\"chart-metric-value metric-label\">\n {{metric.value | number: digitsInfo: locale}}\n </div>\n <mat-divider *ngIf=\"i < metrics.length - 1\"></mat-divider>\n </mat-list-item>\n </ng-container>\n</mat-list>\n",
1007
- styles: ["[color=facebook]{color:#1877f2}[bgcolor=facebook],[hcolor=facebook]:hover{background-color:#1877f2}[border=facebook]{border:1px solid #1877f2}[color=google]{color:#4e85e8}[bgcolor=google],[hcolor=google]:hover{background-color:#4e85e8}[border=google]{border:1px solid #4e85e8}[color=instagram]{color:#e1306c}[bgcolor=instagram],[hcolor=instagram]:hover{background-color:#e1306c}[border=instagram]{border:1px solid #e1306c}[color=instagrammagenta]{color:#c13584}[bgcolor=instagrammagenta],[hcolor=instagrammagenta]:hover{background-color:#c13584}[border=instagrammagenta]{border:1px solid #c13584}[color=instagramblue]{color:#5851db}[bgcolor=instagramblue],[hcolor=instagramblue]:hover{background-color:#5851db}[border=instagramblue]{border:1px solid #5851db}[color=instagrampurple]{color:#833ab4}[bgcolor=instagrampurple],[hcolor=instagrampurple]:hover{background-color:#833ab4}[border=instagrampurple]{border:1px solid #833ab4}[color=instagramorange]{color:#f56040}[bgcolor=instagramorange],[hcolor=instagramorange]:hover{background-color:#f56040}[border=instagramorange]{border:1px solid #f56040}[color=instagramyellow]{color:#ffdc80}[bgcolor=instagramyellow],[hcolor=instagramyellow]:hover{background-color:#ffdc80}[border=instagramyellow]{border:1px solid #ffdc80}[color=linkedin]{color:#2c67bc}[bgcolor=linkedin],[hcolor=linkedin]:hover{background-color:#2c67bc}[border=linkedin]{border:1px solid #2c67bc}[color=twitter]{color:#55acee}[bgcolor=twitter],[hcolor=twitter]:hover{background-color:#55acee}[border=twitter]{border:1px solid #55acee}[color=youtube]{color:red}[bgcolor=youtube],[hcolor=youtube]:hover{background-color:red}[border=youtube]{border:1px solid red}[color=blood-orange]{color:#ff4d00}[bgcolor=blood-orange],[hcolor=blood-orange]:hover{background-color:#ff4d00}[border=blood-orange]{border:1px solid #ff4d00}[color=pinkish-orange]{color:#ff7b49}[bgcolor=pinkish-orange],[hcolor=pinkish-orange]:hover{background-color:#ff7b49}[border=pinkish-orange]{border:1px solid #ff7b49}[color=charcoal-grey]{color:#2a2f34}[bgcolor=charcoal-grey],[hcolor=charcoal-grey]:hover{background-color:#2a2f34}[border=charcoal-grey]{border:1px solid #2a2f34}[color=azure]{color:#00aeef}[bgcolor=azure],[hcolor=azure]:hover{background-color:#00aeef}[border=azure]{border:1px solid #00aeef}[color=light-azure]{color:#eaf5fd}[bgcolor=light-azure],[hcolor=light-azure]:hover{background-color:#eaf5fd}[border=light-azure]{border:1px solid #eaf5fd}[color=blue-grey]{color:#8d98a9}[bgcolor=blue-grey],[hcolor=blue-grey]:hover{background-color:#8d98a9}[border=blue-grey]{border:1px solid #8d98a9}[color=silver]{color:#ced0da}[bgcolor=silver],[hcolor=silver]:hover{background-color:#ced0da}[border=silver]{border:1px solid #ced0da}[color=pale-grey]{color:#dfe3e9}[bgcolor=pale-grey],[hcolor=pale-grey]:hover{background-color:#dfe3e9}[border=pale-grey]{border:1px solid #dfe3e9}[color=grey-white]{color:#f5f7f8}[bgcolor=grey-white],[hcolor=grey-white]:hover{background-color:#f5f7f8}[border=grey-white]{border:1px solid #f5f7f8}[color=cool-grey]{color:#b4bbc6}[bgcolor=cool-grey],[hcolor=cool-grey]:hover{background-color:#b4bbc6}[border=cool-grey]{border:1px solid #b4bbc6}[color=black]{color:#344563}[bgcolor=black],[hcolor=black]:hover{background-color:#344563}[border=black]{border:1px solid #344563}[color=grey-blue]{color:#68768c}[bgcolor=grey-blue],[hcolor=grey-blue]:hover{background-color:#68768c}[border=grey-blue]{border:1px solid #68768c}[color=strawberry]{color:#f4282d}[bgcolor=strawberry],[hcolor=strawberry]:hover{background-color:#f4282d}[border=strawberry]{border:1px solid #f4282d}[color=light-strawberry]{color:#f8eded}[bgcolor=light-strawberry],[hcolor=light-strawberry]:hover{background-color:#f8eded}[border=light-strawberry]{border:1px solid #f8eded}[color=white]{color:#fff}[bgcolor=white],[hcolor=white]:hover{background-color:#fff}[border=white]{border:1px solid #fff}[color=cool-green]{color:#33c15d}[bgcolor=cool-green],[hcolor=cool-green]:hover{background-color:#33c15d}[border=cool-green]{border:1px solid #33c15d}[color=light-green]{color:#ebfaef}[bgcolor=light-green],[hcolor=light-green]:hover{background-color:#ebfaef}[border=light-green]{border:1px solid #ebfaef}[color=transparent]{color:#0000}[bgcolor=transparent],[hcolor=transparent]:hover{background-color:initial}[border=transparent]{border:1px solid #0000}[color=c0]{color:#a566a5}[bgcolor=c0],[hcolor=c0]:hover{background-color:#a566a5}[border=c0]{border:1px solid #a566a5}[color=c1]{color:#c7ab82}[bgcolor=c1],[hcolor=c1]:hover{background-color:#c7ab82}[border=c1]{border:1px solid #c7ab82}[color=c2]{color:#f2713c}[bgcolor=c2],[hcolor=c2]:hover{background-color:#f2713c}[border=c2]{border:1px solid #f2713c}[color=c3]{color:#ffd006}[bgcolor=c3],[hcolor=c3]:hover{background-color:#ffd006}[border=c3]{border:1px solid #ffd006}[color=c4]{color:#94c5aa}[bgcolor=c4],[hcolor=c4]:hover{background-color:#94c5aa}[border=c4]{border:1px solid #94c5aa}[color=c5]{color:#2a9d8f}[bgcolor=c5],[hcolor=c5]:hover{background-color:#2a9d8f}[border=c5]{border:1px solid #2a9d8f}[color=c6]{color:#78acd8}[bgcolor=c6],[hcolor=c6]:hover{background-color:#78acd8}[border=c6]{border:1px solid #78acd8}[color=c7]{color:#525a9e}[bgcolor=c7],[hcolor=c7]:hover{background-color:#525a9e}[border=c7]{border:1px solid #525a9e}[color=c8]{color:#6a2459}[bgcolor=c8],[hcolor=c8]:hover{background-color:#6a2459}[border=c8]{border:1px solid #6a2459}[color=c9]{color:#74729e}[bgcolor=c9],[hcolor=c9]:hover{background-color:#74729e}[border=c9]{border:1px solid #74729e}.metric-label{font-size:14px;color:#5d6a82}.chart-metric-total .metric-label{font-size:16px;color:#344563!important;font-weight:700}.chart-metric-name .chart-metric-children{color:#aeb5c1;font-size:14px}.chart-metric-name .chart-metric-children .child-label{margin-left:16px}.chart-metric-value{justify-content:left;flex:1 0 0;flex-direction:row;text-align:end;color:#344563}.mat-list-item{height:35px}.mat-list-item ::ng-deep .mat-list-item-content{padding:0}"]
1008
- },] }
1009
- ];
1010
- ChartMetricsListComponent.propDecorators = {
1011
- metrics: [{ type: core.Input }],
1012
- locale: [{ type: core.Input }]
1013
- };
1014
-
1015
- var ChartHeatmapOptions = /** @class */ (function (_super) {
1016
- __extends(ChartHeatmapOptions, _super);
1017
- function ChartHeatmapOptions() {
1018
- return _super !== null && _super.apply(this, arguments) || this;
1019
- }
1020
- ChartHeatmapOptions.build = function (options) {
1021
- var defaultHeatmapOptions = {
1022
- chart: {
1023
- type: 'heatmap',
1024
- height: 600
1025
- },
1026
- colorAxis: {
1027
- allowDecimals: false,
1028
- gridLineWidth: 2,
1029
- gridLineColor: 'white',
1030
- min: 0,
1031
- labels: {
1032
- style: {
1033
- fontSize: '12px'
1034
- }
1035
- }
1036
- },
1037
- legend: {
1038
- enabled: false
1039
- },
1040
- plotOptions: {
1041
- heatmap: {
1042
- borderColor: ChartColors.GREY_COLORS[10],
1043
- borderWidth: 1,
1044
- nullColor: 'white'
1045
- }
1046
- },
1047
- tooltip: {
1048
- headerFormat: '',
1049
- pointFormat: "<div style=\"border-bottom: 1px solid " + ChartColors.GREY_COLORS[10] + "; padding: 0 8px 7px\">"
1050
- + ("<span style=\"font-size: 12px; color: " + ChartColors.GREY_COLORS[60] + "\">{point.tooltipHeaderLabel}</span></div>")
1051
- + ("<div style=\"font-size: 14px; color: " + ChartColors.GREY_COLORS[100] + "; margin: 6px 8px 0 8px;\">")
1052
- + "<span style=\"color:{point.color}\">\u25CF</span> {series.name}: <b>{point.value}</b></div>",
1053
- },
1054
- xAxis: {
1055
- labels: {
1056
- formatter: function () {
1057
- return this.value.toString();
1058
- }
1059
- },
1060
- lineWidth: 1,
1061
- tickWidth: 0,
1062
- visible: true
1063
- },
1064
- yAxis: {
1065
- lineWidth: 0,
1066
- tickInterval: 3,
1067
- reversed: true,
1068
- visible: true
1069
- }
1070
- };
1071
- return _super.build.call(this, mergeDeep(defaultHeatmapOptions, options));
1072
- };
1073
- ChartHeatmapOptions.configureHeatmap = function (categoriesX, categoriesY, series, options, labelDateFormat) {
1074
- _super.configure.call(this, series, options, null, labelDateFormat);
1075
- if (categoriesX && categoriesX.length) {
1076
- options.xAxis.categories = categoriesX;
1077
- }
1078
- if (categoriesY && categoriesY.length) {
1079
- options.yAxis.categories = categoriesY;
1080
- }
1081
- };
1082
- return ChartHeatmapOptions;
1083
- }(ChartOptions));
1084
-
1085
- var ChartHeatmapComponent = /** @class */ (function () {
1086
- function ChartHeatmapComponent() {
1087
- this.categoriesX = [];
1088
- this.categoriesY = [];
1089
- this.chartOptions = {}; // https://api.highcharts.com/highcharts/
1090
- this.lastWidth = 0;
1091
- }
1092
- ChartHeatmapComponent.prototype.ngOnChanges = function (changes) {
1093
- if ((changes.series && !changes.series.firstChange)) {
1094
- this.initChart();
1095
- }
1096
- };
1097
- ChartHeatmapComponent.prototype.ngAfterViewChecked = function () {
1098
- if (this.chartRef && this.chartRef.nativeElement.clientWidth != this.lastWidth) {
1099
- this.lastWidth = this.chartRef.nativeElement.clientWidth;
1100
- if (this.chart) {
1101
- this.chart.reflow();
1102
- }
1103
- else if (this.series && this.series.length) {
1104
- this.initChart();
1105
- }
1106
- }
1107
- };
1108
- ChartHeatmapComponent.prototype.initChart = function () {
1109
- if (this.series) {
1110
- var chartOptions = ChartHeatmapOptions.build(this.chartOptions);
1111
- ChartHeatmapOptions.configureHeatmap(this.categoriesX, this.categoriesY, this.series, chartOptions, this.labelDateFormat);
1112
- highmaps.mapChart(this.chartRef.nativeElement, chartOptions);
1113
- }
1114
- };
1115
- return ChartHeatmapComponent;
1116
- }());
1117
- ChartHeatmapComponent.decorators = [
1118
- { type: core.Component, args: [{
1119
- selector: 'ap-chart-heatmap',
1120
- template: "<div #chart></div>\n"
1121
- },] }
1122
- ];
1123
- ChartHeatmapComponent.propDecorators = {
1124
- chartRef: [{ type: core.ViewChild, args: ['chart',] }],
1125
- categoriesX: [{ type: core.Input }],
1126
- categoriesY: [{ type: core.Input }],
1127
- chartOptions: [{ type: core.Input }],
1128
- labelDateFormat: [{ type: core.Input }],
1129
- series: [{ type: core.Input }]
1130
- };
1131
-
1132
- var ChartSplineOptions = /** @class */ (function (_super) {
1133
- __extends(ChartSplineOptions, _super);
1134
- function ChartSplineOptions() {
1135
- return _super !== null && _super.apply(this, arguments) || this;
1136
- }
1137
- ChartSplineOptions.buildSpline = function (options, singleDayEnabled) {
1138
- var defaultSplineOptions = {
1139
- chart: {
1140
- type: 'spline'
1141
- },
1142
- plotOptions: {
1143
- series: {
1144
- marker: {
1145
- enabled: singleDayEnabled,
1146
- radius: singleDayEnabled ? 5 : 2,
1147
- symbol: 'circle'
1148
- }
1149
- }
1150
- },
1151
- xAxis: {
1152
- type: 'datetime'
1153
- }
1154
- };
1155
- return _super.build.call(this, mergeDeep(defaultSplineOptions, options));
1156
- };
1157
- return ChartSplineOptions;
1158
- }(ChartOptions));
1159
-
1160
- var ChartSplineComponent = /** @class */ (function () {
1161
- function ChartSplineComponent() {
1162
- this.chartOptions = {}; // https://api.highcharts.com/highcharts/
1163
- this.color = exports.ChartColor.ElectricBlue;
1164
- this.lastWidth = 0;
1165
- }
1166
- ChartSplineComponent.prototype.ngOnChanges = function (changes) {
1167
- if ((changes.series && !changes.series.firstChange) || (changes.color && !changes.color.firstChange)) {
1168
- this.initChart();
1169
- }
1170
- };
1171
- ChartSplineComponent.prototype.ngAfterViewChecked = function () {
1172
- if (this.chartRef && this.chartRef.nativeElement.clientWidth !== this.lastWidth) {
1173
- this.lastWidth = this.chartRef.nativeElement.clientWidth;
1174
- if (this.chart) {
1175
- this.chart.reflow();
1176
- }
1177
- else if (this.series && this.series.length) {
1178
- this.initChart();
1179
- }
1180
- }
1181
- };
1182
- ChartSplineComponent.prototype.initChart = function () {
1183
- var _a;
1184
- if (this.series) {
1185
- var chartOptions = ChartSplineOptions.buildSpline(this.chartOptions, ((_a = this.series[0].data) === null || _a === void 0 ? void 0 : _a.length) === 1);
1186
- ChartSplineOptions.configure(this.series, chartOptions, this.color, this.labelDateFormat);
1187
- this.chart = new Highcharts.Chart(this.chartRef.nativeElement, chartOptions);
1188
- }
1189
- };
1190
- return ChartSplineComponent;
1191
- }());
1192
- ChartSplineComponent.decorators = [
1193
- { type: core.Component, args: [{
1194
- selector: 'ap-chart-spline',
1195
- template: "<div #chart></div>\n"
1196
- },] }
1197
- ];
1198
- ChartSplineComponent.propDecorators = {
1199
- chartRef: [{ type: core.ViewChild, args: ['chart',] }],
1200
- chartOptions: [{ type: core.Input }],
1201
- color: [{ type: core.Input }],
1202
- labelDateFormat: [{ type: core.Input }],
1203
- series: [{ type: core.Input }]
1204
- };
1205
-
1206
- var ChartPieOptions = /** @class */ (function (_super) {
1207
- __extends(ChartPieOptions, _super);
1208
- function ChartPieOptions() {
1209
- return _super !== null && _super.apply(this, arguments) || this;
1210
- }
1211
- ChartPieOptions.buildPie = function (options, innerLabels) {
1212
- var defaultPieOptions = {
1213
- chart: {
1214
- type: 'pie',
1215
- plotBackgroundColor: null,
1216
- plotBorderWidth: null,
1217
- plotShadow: false
1218
- },
1219
- plotOptions: {
1220
- pie: {
1221
- dataLabels: {
1222
- distance: innerLabels ? -40 : 30,
1223
- useHTML: true
1224
- },
1225
- innerSize: '50%'
1226
- },
1227
- series: {
1228
- allowPointSelect: !innerLabels,
1229
- dataLabels: innerLabels ? {
1230
- format: '{point.percentage:.1f}%',
1231
- style: {
1232
- fontSize: '16px',
1233
- color: 'white',
1234
- textOutline: '0'
1235
- }
1236
- } : {
1237
- style: {
1238
- fontSize: '12px',
1239
- color: ChartColors.GREY_COLORS[60]
1240
- }
1241
- },
1242
- showInLegend: innerLabels,
1243
- states: {
1244
- inactive: {
1245
- opacity: 1
1246
- }
1247
- }
1248
- }
1249
- },
1250
- legend: innerLabels ? {
1251
- symbolHeight: 10,
1252
- enabled: true
1253
- } : {}
1254
- };
1255
- return _super.build.call(this, mergeDeep(defaultPieOptions, options));
1256
- };
1257
- ChartPieOptions.configurePie = function (series, options, color, labelDateFormat, innerLabels) {
1258
- var _a, _b, _c;
1259
- var _d, _e, _f;
1260
- _super.configure.call(this, series, options, color, labelDateFormat);
1261
- if (innerLabels) {
1262
- options.legend.enabled = true;
1263
- }
1264
- if (series && series.length > 0 && series[0]) {
1265
- options.colors = ChartColors.getColors(series[0].data.length, color);
1266
- (_a = (_d = options.plotOptions.pie).point) !== null && _a !== void 0 ? _a : (_d.point = {});
1267
- (_b = (_e = options.plotOptions.pie.point).events) !== null && _b !== void 0 ? _b : (_e.events = {});
1268
- // entering a slice
1269
- options.plotOptions.pie.point.events.mouseOver = function () {
1270
- var _this = this;
1271
- this.series.chart.series[0].points.forEach(function (point) {
1272
- if (point.index !== _this.index) {
1273
- point.update({
1274
- color: ChartColors.GREY_COLORS[5]
1275
- }, false);
1276
- if (innerLabels) {
1277
- point.update({
1278
- dataLabels: {
1279
- style: {
1280
- color: ChartColors.GREY_COLORS[20]
1281
- }
1282
- }
1283
- }, false);
1284
- }
1285
- }
1286
- });
1287
- this.series.chart.redraw(false);
1288
- };
1289
- // leaving a slice
1290
- options.plotOptions.pie.point.events.mouseOut = function () {
1291
- var _this = this;
1292
- this.series.chart.series[0].points.forEach(function (point, i) {
1293
- if (point.index !== _this.index) {
1294
- point.update({
1295
- color: options.colors[i % options.colors.length]
1296
- }, false);
1297
- if (innerLabels) {
1298
- point.update({
1299
- dataLabels: {
1300
- style: {
1301
- color: 'white'
1302
- }
1303
- }
1304
- }, false);
1305
- }
1306
- }
1307
- });
1308
- };
1309
- (_c = (_f = options.plotOptions.pie).events) !== null && _c !== void 0 ? _c : (_f.events = {});
1310
- // leaving the whole pie
1311
- options.plotOptions.pie.events.mouseOut = function () {
1312
- this.chart.series[0].points.forEach(function (point, i) {
1313
- point.update({
1314
- color: options.colors[i % options.colors.length]
1315
- }, false);
1316
- if (innerLabels) {
1317
- point.update({
1318
- dataLabels: {
1319
- style: {
1320
- color: 'white'
1321
- }
1322
- }
1323
- }, false);
1324
- }
1325
- });
1326
- this.chart.redraw();
1327
- };
1328
- }
1329
- };
1330
- return ChartPieOptions;
1331
- }(ChartOptions));
1332
-
1333
- var ChartPieComponent = /** @class */ (function () {
1334
- function ChartPieComponent() {
1335
- this.chartOptions = {}; // https://api.highcharts.com/highcharts/
1336
- this.color = exports.ChartColor.ElectricBlue;
1337
- this.innerLabels = false;
1338
- this.lastWidth = 0;
1339
- }
1340
- ChartPieComponent.prototype.ngOnChanges = function (changes) {
1341
- if ((changes.series && !changes.series.firstChange) || (changes.color && !changes.color.firstChange)) {
1342
- this.initChart();
1343
- }
1344
- };
1345
- ChartPieComponent.prototype.ngAfterViewChecked = function () {
1346
- if (this.chartRef && this.chartRef.nativeElement.clientWidth !== this.lastWidth) {
1347
- this.lastWidth = this.chartRef.nativeElement.clientWidth;
1348
- if (this.chart) {
1349
- this.chart.reflow();
1350
- }
1351
- else if (this.series && this.series.length) {
1352
- this.initChart();
1353
- }
1354
- }
1355
- };
1356
- ChartPieComponent.prototype.initChart = function () {
1357
- if (this.series) {
1358
- var chartOptions = ChartPieOptions.buildPie(this.chartOptions, this.innerLabels);
1359
- ChartPieOptions.configurePie(this.series, chartOptions, this.color, this.labelDateFormat, this.innerLabels);
1360
- this.chart = new Highcharts.Chart(this.chartRef.nativeElement, chartOptions);
1361
- }
1362
- };
1363
- return ChartPieComponent;
1364
- }());
1365
- ChartPieComponent.decorators = [
1366
- { type: core.Component, args: [{
1367
- selector: 'ap-chart-pie',
1368
- template: "<div #chart></div>\n"
1369
- },] }
1370
- ];
1371
- ChartPieComponent.propDecorators = {
1372
- chartRef: [{ type: core.ViewChild, args: ['chart',] }],
1373
- chartOptions: [{ type: core.Input }],
1374
- color: [{ type: core.Input }],
1375
- innerLabels: [{ type: core.Input }],
1376
- labelDateFormat: [{ type: core.Input }],
1377
- series: [{ type: core.Input }]
1378
- };
1379
-
1380
- var AgorapulseUiChartsModule = /** @class */ (function () {
1381
- function AgorapulseUiChartsModule() {
1382
- }
1383
- return AgorapulseUiChartsModule;
1384
- }());
1385
- AgorapulseUiChartsModule.decorators = [
1386
- { type: core.NgModule, args: [{
1387
- declarations: [
1388
- ChartBarComponent,
1389
- ChartColumnComponent,
1390
- ChartHeatmapComponent,
1391
- ChartMetricsListComponent,
1392
- ChartSplineComponent,
1393
- ChartPieComponent
1394
- ],
1395
- imports: [
1396
- common.CommonModule,
1397
- highchartsAngular.HighchartsChartModule,
1398
- list.MatListModule
1399
- ],
1400
- exports: [
1401
- ChartBarComponent,
1402
- ChartColumnComponent,
1403
- ChartHeatmapComponent,
1404
- ChartMetricsListComponent,
1405
- ChartSplineComponent,
1406
- ChartPieComponent
1407
- ],
1408
- providers: []
1409
- },] }
1410
- ];
1411
-
1412
- /*
1413
- * Public API Surface of ui-charts
1414
- */
1415
- borderRadiusPlugin(Highcharts__namespace);
1416
-
1417
- /**
1418
- * Generated bundle index. Do not edit.
1419
- */
1420
-
1421
- exports.AgorapulseUiChartsModule = AgorapulseUiChartsModule;
1422
- exports.ChartBarComponent = ChartBarComponent;
1423
- exports.ChartColors = ChartColors;
1424
- exports.ChartColumnComponent = ChartColumnComponent;
1425
- exports.ChartHeatmapComponent = ChartHeatmapComponent;
1426
- exports.ChartMetric = ChartMetric;
1427
- exports.ChartMetricsListComponent = ChartMetricsListComponent;
1428
- exports.ChartOptions = ChartOptions;
1429
- exports.ChartPieComponent = ChartPieComponent;
1430
- exports.ChartSplineComponent = ChartSplineComponent;
1431
- exports.borderRadiusPlugin = borderRadiusPlugin;
1432
- exports.mergeDeep = mergeDeep;
1433
-
1434
- Object.defineProperty(exports, '__esModule', { value: true });
1435
-
1436
- }));
1437
- //# sourceMappingURL=agorapulse-ui-charts.umd.js.map