barsa-echarts 1.0.456 → 2.0.1

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 (64) hide show
  1. package/{esm2020 → esm2022}/barsa-echarts.mjs +4 -4
  2. package/{esm2020 → esm2022}/lib/barsa-echarts.module.mjs +81 -81
  3. package/esm2022/lib/base/chart-base.directive.mjs +75 -0
  4. package/esm2022/lib/base/chart-line-time-base.directive.mjs +80 -0
  5. package/{esm2020 → esm2022}/lib/base/index.mjs +7 -7
  6. package/{esm2020 → esm2022}/lib/base/micro-chart-area-base.directive.mjs +89 -89
  7. package/esm2022/lib/base/micro-chart-bar-base.directive.mjs +48 -0
  8. package/{esm2020 → esm2022}/lib/base/micro-chart-base.directive.mjs +49 -49
  9. package/{esm2020 → esm2022}/lib/base/micro-chart-circular-base.directive.mjs +75 -75
  10. package/esm2022/lib/base/micro-chart-comparison-base.directive.mjs +99 -0
  11. package/{esm2020 → esm2022}/lib/base/micro-chart-line-base.directive.mjs +60 -60
  12. package/{esm2020 → esm2022}/lib/base/micro-chart-stackbar-base.directive.mjs +51 -51
  13. package/esm2022/lib/micro-charts/micro-chart-area/micro-chart-area.component.mjs +34 -0
  14. package/{esm2020 → esm2022}/lib/micro-charts/micro-chart-bar/micro-chart-bar.component.mjs +25 -25
  15. package/esm2022/lib/micro-charts/micro-chart-bullet/micro-chart-bullet.component.mjs +86 -0
  16. package/{esm2020 → esm2022}/lib/micro-charts/micro-chart-circular/micro-chart-circular.component.mjs +21 -21
  17. package/{esm2020 → esm2022}/lib/micro-charts/micro-chart-comparison/micro-chart-comparison.component.mjs +22 -22
  18. package/{esm2020 → esm2022}/lib/micro-charts/micro-chart-line/micro-chart-line.component.mjs +31 -31
  19. package/{esm2020 → esm2022}/lib/micro-charts/micro-chart-stackbar/micro-chart-stackbar.component.mjs +20 -20
  20. package/{esm2020 → esm2022}/lib/models/area-chart.mjs +1 -1
  21. package/{esm2020 → esm2022}/lib/models/bar-item.mjs +1 -1
  22. package/{esm2020 → esm2022}/lib/models/comparison-item.mjs +1 -1
  23. package/{esm2020 → esm2022}/lib/models/index.mjs +5 -5
  24. package/{esm2020 → esm2022}/lib/models/line-item.mjs +1 -1
  25. package/{esm2020 → esm2022}/lib/models/stackbar-item.mjs +1 -1
  26. package/{esm2020 → esm2022}/public-api.mjs +14 -14
  27. package/{fesm2020 → fesm2022}/barsa-echarts.mjs +838 -838
  28. package/fesm2022/barsa-echarts.mjs.map +1 -0
  29. package/index.d.ts +5 -5
  30. package/lib/barsa-echarts.module.d.ts +22 -22
  31. package/lib/base/chart-base.directive.d.ts +28 -28
  32. package/lib/base/chart-line-time-base.directive.d.ts +19 -19
  33. package/lib/base/index.d.ts +7 -7
  34. package/lib/base/micro-chart-area-base.directive.d.ts +18 -18
  35. package/lib/base/micro-chart-bar-base.directive.d.ts +14 -14
  36. package/lib/base/micro-chart-base.directive.d.ts +14 -14
  37. package/lib/base/micro-chart-circular-base.directive.d.ts +13 -13
  38. package/lib/base/micro-chart-comparison-base.directive.d.ts +17 -17
  39. package/lib/base/micro-chart-line-base.directive.d.ts +15 -15
  40. package/lib/base/micro-chart-stackbar-base.directive.d.ts +14 -14
  41. package/lib/micro-charts/micro-chart-area/micro-chart-area.component.d.ts +19 -19
  42. package/lib/micro-charts/micro-chart-bar/micro-chart-bar.component.d.ts +16 -16
  43. package/lib/micro-charts/micro-chart-bullet/micro-chart-bullet.component.d.ts +35 -35
  44. package/lib/micro-charts/micro-chart-circular/micro-chart-circular.component.d.ts +10 -10
  45. package/lib/micro-charts/micro-chart-comparison/micro-chart-comparison.component.d.ts +12 -12
  46. package/lib/micro-charts/micro-chart-line/micro-chart-line.component.d.ts +18 -18
  47. package/lib/micro-charts/micro-chart-stackbar/micro-chart-stackbar.component.d.ts +11 -11
  48. package/lib/models/area-chart.d.ts +11 -11
  49. package/lib/models/bar-item.d.ts +5 -5
  50. package/lib/models/comparison-item.d.ts +9 -9
  51. package/lib/models/index.d.ts +5 -5
  52. package/lib/models/line-item.d.ts +8 -8
  53. package/lib/models/stackbar-item.d.ts +7 -7
  54. package/package.json +7 -13
  55. package/public-api.d.ts +11 -11
  56. package/esm2020/lib/base/chart-base.directive.mjs +0 -75
  57. package/esm2020/lib/base/chart-line-time-base.directive.mjs +0 -80
  58. package/esm2020/lib/base/micro-chart-bar-base.directive.mjs +0 -48
  59. package/esm2020/lib/base/micro-chart-comparison-base.directive.mjs +0 -99
  60. package/esm2020/lib/micro-charts/micro-chart-area/micro-chart-area.component.mjs +0 -35
  61. package/esm2020/lib/micro-charts/micro-chart-bullet/micro-chart-bullet.component.mjs +0 -87
  62. package/fesm2015/barsa-echarts.mjs +0 -880
  63. package/fesm2015/barsa-echarts.mjs.map +0 -1
  64. package/fesm2020/barsa-echarts.mjs.map +0 -1
@@ -1,880 +0,0 @@
1
- import * as i0 from '@angular/core';
2
- import { Component, ChangeDetectionStrategy, ViewChild, Input, Directive, NgModule, NO_ERRORS_SCHEMA, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
3
- import * as i1$1 from 'barsa-novin-ray-core';
4
- import { BaseComponent, BaseDirective, BarsaNovinRayCoreModule } from 'barsa-novin-ray-core';
5
- import * as i1 from '@angular/common';
6
- import { CommonModule } from '@angular/common';
7
-
8
- class MicroChartBulletComponent extends BaseComponent {
9
- constructor(renderer) {
10
- super();
11
- this.renderer = renderer;
12
- this.suffix = '';
13
- this.separatorLinesFakeArray = [];
14
- }
15
- ngOnInit() {
16
- super.ngOnInit();
17
- this.delta = Math.abs(this.value - this.target);
18
- this.forecastWidth = this.getWidth(this.forecast);
19
- this.deltaWidth = this.getWidth(this.delta);
20
- this.valueWidth = this.getWidth(this.value);
21
- this.targetWidth = this.getWidth(this.target, true);
22
- this.deltaBackgroundColor = this.getBackgroundColor('delta');
23
- this.forecastBackgroundColor = this.getBackgroundColor('forecast');
24
- this.valueBackgroundColor = this.getBackgroundColor('value');
25
- this.targetWithSuffix = this.getValueWithSuffix(this.target);
26
- this.deltaWithSuffix = this.getValueWithSuffix(this.delta);
27
- this.valueWithSuffix = this.getValueWithSuffix(this.value);
28
- this.fakeArray();
29
- }
30
- ngAfterViewInit() {
31
- super.ngAfterViewInit();
32
- if (this.deltaDom) {
33
- const deltaLeft = this.value >= this.target ? this.getWidth(this.target) : this.getWidth(this.target - this.delta);
34
- this.renderer.setStyle(this.deltaDom.nativeElement, 'left', deltaLeft);
35
- const deltaPointerDom = this.deltaDom.nativeElement.querySelector('.pointer');
36
- const deltaPointerLeft = this.value >= this.target ? '' : '0';
37
- this.renderer.setStyle(deltaPointerDom, 'left', deltaPointerLeft);
38
- }
39
- }
40
- getWidth(value, isTarget) {
41
- if (value) {
42
- let width = (value / this.range) * 100;
43
- width = isTarget ? width - 2 : width;
44
- return width.toString() + '%';
45
- }
46
- else {
47
- return '0';
48
- }
49
- }
50
- getValueWithSuffix(value) {
51
- return value.toString() + (this.suffix || '');
52
- }
53
- getBackgroundColor(item) {
54
- if (item === 'forecast') {
55
- return this.forecast >= this.target ? '#a1dbb1' : '#fda8ab';
56
- }
57
- else {
58
- return this.value >= this.target ? '#3fa45b' : '#dc0d0e';
59
- }
60
- }
61
- fakeArray() {
62
- for (let i = 0; i < this.separatorLines; i++) {
63
- this.separatorLinesFakeArray.push(i);
64
- }
65
- }
66
- }
67
- MicroChartBulletComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: MicroChartBulletComponent, deps: [{ token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Component });
68
- MicroChartBulletComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.7", type: MicroChartBulletComponent, selector: "be-micro-chart-bullet", inputs: { range: "range", value: "value", forecast: "forecast", target: "target", suffix: "suffix", separatorLines: "separatorLines", isDelta: "isDelta" }, viewQueries: [{ propertyName: "deltaDom", first: true, predicate: ["deltaBox"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<div class=\"chart-container\">\r\n <div class=\"range\">\r\n <div class=\"target\" *ngIf=\"target\" #target [style.left]=\"targetWidth\">\r\n <span>{{ targetWithSuffix }}</span>\r\n </div>\r\n <div\r\n class=\"forecast\"\r\n *ngIf=\"forecast\"\r\n [style.background-color]=\"forecastBackgroundColor\"\r\n [style.width]=\"forecastWidth\"\r\n ></div>\r\n\r\n <div\r\n class=\"delta\"\r\n #deltaBox\r\n *ngIf=\"isDelta && delta; else valueBox\"\r\n [style.background-color]=\"deltaBackgroundColor\"\r\n [style.width]=\"deltaWidth\"\r\n >\r\n <span [style.color]=\"valueBackgroundColor\">{{ deltaWithSuffix + '\u25B2' }}</span>\r\n <div class=\"pointer\" [style.background-color]=\"deltaBackgroundColor\"></div>\r\n </div>\r\n\r\n <ng-template #valueBox>\r\n <div class=\"value\" *ngIf=\"value\" [style.background-color]=\"valueBackgroundColor\" [style.width]=\"valueWidth\">\r\n <span [style.color]=\"valueBackgroundColor\">{{ valueWithSuffix }}</span>\r\n <div class=\"pointer\" [style.background-color]=\"valueBackgroundColor\"></div>\r\n </div>\r\n </ng-template>\r\n\r\n <!-- separator lines-->\r\n </div>\r\n <div class=\"separator-lines\" *ngIf=\"separatorLines\">\r\n <div *ngFor=\"let i of separatorLinesFakeArray\" class=\"separator-line\"></div>\r\n </div>\r\n</div>\r\n", styles: [".separator-lines,.range .value,.range .target,.range .forecast,.range{margin-bottom:auto;margin-top:auto;top:0;bottom:0}:host{display:flex;width:100%;height:100%;align-items:center}.chart-container{height:15px;width:100%;position:relative}.range{width:100%;position:absolute;background-color:#e6eee8;z-index:2}.range .forecast{position:absolute;left:0}.range .target{position:absolute;z-index:5;width:2%;height:24px;background-color:#000}.range .target span{position:absolute;bottom:-20px;right:-10px}.range .value{position:absolute;left:0;height:7px}.range .value .pointer{position:absolute;width:2px;height:20px;bottom:0}.range .value span{position:absolute;bottom:19px;right:-6px}.range .delta{position:absolute;height:15px}.range .delta .pointer{position:absolute;width:2px;height:20px;bottom:0}.range .delta span{position:absolute;bottom:19px}.separator-lines{position:absolute;display:flex;justify-content:space-between;height:20px;width:100%}.separator-lines .separator-line{background-color:#e9730c;width:2px}.separator-lines .separator-line:first-child,.separator-lines .separator-line:last-child{background-color:#c21a1a!important}\n"], dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
69
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: MicroChartBulletComponent, decorators: [{
70
- type: Component,
71
- args: [{ selector: 'be-micro-chart-bullet', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"chart-container\">\r\n <div class=\"range\">\r\n <div class=\"target\" *ngIf=\"target\" #target [style.left]=\"targetWidth\">\r\n <span>{{ targetWithSuffix }}</span>\r\n </div>\r\n <div\r\n class=\"forecast\"\r\n *ngIf=\"forecast\"\r\n [style.background-color]=\"forecastBackgroundColor\"\r\n [style.width]=\"forecastWidth\"\r\n ></div>\r\n\r\n <div\r\n class=\"delta\"\r\n #deltaBox\r\n *ngIf=\"isDelta && delta; else valueBox\"\r\n [style.background-color]=\"deltaBackgroundColor\"\r\n [style.width]=\"deltaWidth\"\r\n >\r\n <span [style.color]=\"valueBackgroundColor\">{{ deltaWithSuffix + '\u25B2' }}</span>\r\n <div class=\"pointer\" [style.background-color]=\"deltaBackgroundColor\"></div>\r\n </div>\r\n\r\n <ng-template #valueBox>\r\n <div class=\"value\" *ngIf=\"value\" [style.background-color]=\"valueBackgroundColor\" [style.width]=\"valueWidth\">\r\n <span [style.color]=\"valueBackgroundColor\">{{ valueWithSuffix }}</span>\r\n <div class=\"pointer\" [style.background-color]=\"valueBackgroundColor\"></div>\r\n </div>\r\n </ng-template>\r\n\r\n <!-- separator lines-->\r\n </div>\r\n <div class=\"separator-lines\" *ngIf=\"separatorLines\">\r\n <div *ngFor=\"let i of separatorLinesFakeArray\" class=\"separator-line\"></div>\r\n </div>\r\n</div>\r\n", styles: [".separator-lines,.range .value,.range .target,.range .forecast,.range{margin-bottom:auto;margin-top:auto;top:0;bottom:0}:host{display:flex;width:100%;height:100%;align-items:center}.chart-container{height:15px;width:100%;position:relative}.range{width:100%;position:absolute;background-color:#e6eee8;z-index:2}.range .forecast{position:absolute;left:0}.range .target{position:absolute;z-index:5;width:2%;height:24px;background-color:#000}.range .target span{position:absolute;bottom:-20px;right:-10px}.range .value{position:absolute;left:0;height:7px}.range .value .pointer{position:absolute;width:2px;height:20px;bottom:0}.range .value span{position:absolute;bottom:19px;right:-6px}.range .delta{position:absolute;height:15px}.range .delta .pointer{position:absolute;width:2px;height:20px;bottom:0}.range .delta span{position:absolute;bottom:19px}.separator-lines{position:absolute;display:flex;justify-content:space-between;height:20px;width:100%}.separator-lines .separator-line{background-color:#e9730c;width:2px}.separator-lines .separator-line:first-child,.separator-lines .separator-line:last-child{background-color:#c21a1a!important}\n"] }]
72
- }], ctorParameters: function () { return [{ type: i0.Renderer2 }]; }, propDecorators: { deltaDom: [{
73
- type: ViewChild,
74
- args: ['deltaBox']
75
- }], range: [{
76
- type: Input
77
- }], value: [{
78
- type: Input
79
- }], forecast: [{
80
- type: Input
81
- }], target: [{
82
- type: Input
83
- }], suffix: [{
84
- type: Input
85
- }], separatorLines: [{
86
- type: Input
87
- }], isDelta: [{
88
- type: Input
89
- }] } });
90
-
91
- class ChartBaseDirective extends BaseDirective {
92
- constructor(_el, renderer2) {
93
- super(_el);
94
- this._el = _el;
95
- this.renderer2 = renderer2;
96
- this.tooltip = {
97
- trigger: 'item',
98
- responsive: true,
99
- position: 'top',
100
- formatter: '{c}',
101
- backgroundColor: '#fafcfe',
102
- borderColor: '#c8e2f7',
103
- borderWidth: '0.8',
104
- textStyle: {
105
- color: '#5d6f80'
106
- }
107
- };
108
- this.grid = {
109
- top: 0,
110
- bottom: 0,
111
- left: 0,
112
- right: 0
113
- };
114
- this.xAxis = {
115
- data: [],
116
- type: 'value'
117
- };
118
- this.yAxis = {
119
- data: [],
120
- type: 'category'
121
- };
122
- this.series = [];
123
- }
124
- ngOnInit() {
125
- // set some style to chart
126
- super.ngOnInit();
127
- const elDom = this._el.nativeElement;
128
- this.renderer2.setStyle(elDom, 'width', '100%');
129
- this.renderer2.setStyle(elDom, 'height', '100%');
130
- this.renderer2.setStyle(elDom, 'display', 'block');
131
- // initialize echart micro-charts
132
- this._initializeOptions();
133
- }
134
- ngAfterViewInit() {
135
- this.setOptions(this.options);
136
- setTimeout(() => {
137
- head.load(['Lib/Echarts/echarts.My.min.js'], () => {
138
- const elDom = this._el.nativeElement;
139
- this.chart = echarts.init(elDom);
140
- this._renderChart();
141
- });
142
- }, 300);
143
- }
144
- _renderChart() {
145
- this.chart.setOption(this.options);
146
- }
147
- _initializeOptions() {
148
- this.options = {
149
- grid: this.grid,
150
- xAxis: this.xAxis,
151
- yAxis: this.yAxis,
152
- series: this.series,
153
- tooltip: this.tooltip
154
- };
155
- }
156
- }
157
- ChartBaseDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: ChartBaseDirective, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Directive });
158
- ChartBaseDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.7", type: ChartBaseDirective, usesInheritance: true, ngImport: i0 });
159
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: ChartBaseDirective, decorators: [{
160
- type: Directive
161
- }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.Renderer2 }]; } });
162
-
163
- class MicroChartBaseDirective extends ChartBaseDirective {
164
- constructor(_el, renderer2) {
165
- super(_el, renderer2);
166
- this._el = _el;
167
- this.renderer2 = renderer2;
168
- this.xAxis = {
169
- data: [],
170
- type: 'value',
171
- axisLine: {
172
- show: false
173
- },
174
- axisLabel: {
175
- show: false
176
- },
177
- splitLine: {
178
- show: false
179
- },
180
- axisTick: {
181
- show: false
182
- },
183
- max: 100
184
- };
185
- this.yAxis = {
186
- data: [],
187
- type: 'category',
188
- axisLabel: {
189
- show: false
190
- },
191
- axisLine: {
192
- show: false
193
- },
194
- splitLine: {
195
- show: false
196
- },
197
- axisTick: {
198
- show: false
199
- }
200
- };
201
- }
202
- }
203
- MicroChartBaseDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: MicroChartBaseDirective, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Directive });
204
- MicroChartBaseDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.7", type: MicroChartBaseDirective, usesInheritance: true, ngImport: i0 });
205
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: MicroChartBaseDirective, decorators: [{
206
- type: Directive
207
- }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.Renderer2 }]; } });
208
-
209
- class MicroChartLineBaseDirective extends MicroChartBaseDirective {
210
- constructor(_el, renderer2) {
211
- super(_el, renderer2);
212
- this._el = _el;
213
- this.renderer2 = renderer2;
214
- }
215
- setOptions(options) {
216
- this._scaleDownLineData();
217
- // initialize series
218
- this._initSeries(options);
219
- // set input data
220
- this.line.data.forEach((item) => {
221
- var _a, _b;
222
- (_b = (_a = this.xAxis) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.push(item.label);
223
- const dataObj = {
224
- value: item.value,
225
- symbol: 'none'
226
- };
227
- options.series[0].data.push(dataObj);
228
- });
229
- this.xAxis.max = undefined;
230
- this.xAxis.type = 'category';
231
- // set custom yAxis
232
- this.yAxis.min = 0;
233
- this.yAxis.max = 6;
234
- this.yAxis.type = 'value';
235
- }
236
- /* eslint-disable */
237
- _scaleDownLineData() {
238
- const maxValue = Math.max.apply(Math, this.line.data.map((dataItem) => dataItem.value));
239
- return this.line.data.forEach((dataItem) => {
240
- dataItem.value *= 6 / maxValue;
241
- });
242
- }
243
- _initSeries(options) {
244
- var _a;
245
- options.series = [
246
- {
247
- type: 'line',
248
- color: (_a = this.line) === null || _a === void 0 ? void 0 : _a.color,
249
- data: [],
250
- label: {
251
- show: false
252
- }
253
- }
254
- ];
255
- }
256
- }
257
- MicroChartLineBaseDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: MicroChartLineBaseDirective, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Directive });
258
- MicroChartLineBaseDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.7", type: MicroChartLineBaseDirective, selector: "[beMicroChartLine]", inputs: { line: "line" }, usesInheritance: true, ngImport: i0 });
259
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: MicroChartLineBaseDirective, decorators: [{
260
- type: Directive,
261
- args: [{
262
- selector: '[beMicroChartLine]'
263
- }]
264
- }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.Renderer2 }]; }, propDecorators: { line: [{
265
- type: Input
266
- }] } });
267
-
268
- class MicroChartLineComponent extends BaseComponent {
269
- constructor(el) {
270
- super();
271
- this.el = el;
272
- }
273
- ngOnInit() {
274
- super.ngOnInit();
275
- this.getFirstAndLastValues();
276
- }
277
- getFirstAndLastValues() {
278
- const dataLength = this.line.data.length;
279
- this.firstValue = this.line.data[0].value.toString();
280
- this.lastValue = this.line.data[dataLength - 1].value.toString();
281
- this.firstLabel = this.line.data[0].label;
282
- this.lastLabel = this.line.data[dataLength - 1].label;
283
- }
284
- }
285
- MicroChartLineComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: MicroChartLineComponent, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
286
- MicroChartLineComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.7", type: MicroChartLineComponent, selector: "be-micro-chart-line", inputs: { line: "line" }, usesInheritance: true, ngImport: i0, template: "<div class=\"top-labels\">\r\n <span>{{ lastValue }}{{ line?.suffix }}</span>\r\n <span>{{ firstValue }}{{ line?.suffix }}</span>\r\n</div>\r\n\r\n<div class=\"chart\">\r\n <div *untilInView=\"el\" beMicroChartLine [line]=\"line\"></div>\r\n</div>\r\n\r\n<div class=\"bottom-labels\">\r\n <span>{{ lastLabel }}</span>\r\n <span>{{ firstLabel }}</span>\r\n</div>\r\n", styles: [":host{display:block;width:100%;height:100%}.chart{width:100%;height:52%}span{margin:0;font-size:10px}.top-labels{width:100%;height:23%;display:flex;justify-content:space-between}.bottom-labels{width:100%;height:25%;display:flex;justify-content:space-between}\n"], dependencies: [{ kind: "directive", type: i1$1.UntilInViewDirective, selector: "[untilInView]", inputs: ["untilInView", "intersectionDebounce"] }, { kind: "directive", type: MicroChartLineBaseDirective, selector: "[beMicroChartLine]", inputs: ["line"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
287
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: MicroChartLineComponent, decorators: [{
288
- type: Component,
289
- args: [{ selector: 'be-micro-chart-line', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"top-labels\">\r\n <span>{{ lastValue }}{{ line?.suffix }}</span>\r\n <span>{{ firstValue }}{{ line?.suffix }}</span>\r\n</div>\r\n\r\n<div class=\"chart\">\r\n <div *untilInView=\"el\" beMicroChartLine [line]=\"line\"></div>\r\n</div>\r\n\r\n<div class=\"bottom-labels\">\r\n <span>{{ lastLabel }}</span>\r\n <span>{{ firstLabel }}</span>\r\n</div>\r\n", styles: [":host{display:block;width:100%;height:100%}.chart{width:100%;height:52%}span{margin:0;font-size:10px}.top-labels{width:100%;height:23%;display:flex;justify-content:space-between}.bottom-labels{width:100%;height:25%;display:flex;justify-content:space-between}\n"] }]
290
- }], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: { line: [{
291
- type: Input
292
- }] } });
293
-
294
- class MicroChartStackbarBaseDirective extends MicroChartBaseDirective {
295
- constructor(_el, renderer2) {
296
- super(_el, renderer2);
297
- this._el = _el;
298
- this.renderer2 = renderer2;
299
- }
300
- setOptions(options) {
301
- this.chartData.data.forEach((dataItem) => {
302
- const dataConfig = this.creatData(dataItem);
303
- options.series.push(dataConfig);
304
- });
305
- }
306
- creatData(dataItem) {
307
- return {
308
- name: 'Direct',
309
- barWidth: 15,
310
- type: 'bar',
311
- stack: 'total',
312
- emphasis: {
313
- focus: 'series'
314
- },
315
- data: [
316
- {
317
- value: dataItem.value,
318
- itemStyle: {
319
- color: dataItem.color
320
- }
321
- }
322
- ],
323
- label: {
324
- show: true,
325
- formatter: (d) => d.data.value.toString() + this.chartData.suffix,
326
- fontSize: 10
327
- }
328
- };
329
- }
330
- }
331
- MicroChartStackbarBaseDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: MicroChartStackbarBaseDirective, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Directive });
332
- MicroChartStackbarBaseDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.7", type: MicroChartStackbarBaseDirective, selector: "[beMicroChartStackbar]", inputs: { chartData: "chartData" }, usesInheritance: true, ngImport: i0 });
333
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: MicroChartStackbarBaseDirective, decorators: [{
334
- type: Directive,
335
- args: [{
336
- selector: '[beMicroChartStackbar]'
337
- }]
338
- }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.Renderer2 }]; }, propDecorators: { chartData: [{
339
- type: Input
340
- }] } });
341
-
342
- class MicroChartStackbarComponent extends BaseComponent {
343
- constructor(el) {
344
- super();
345
- this.el = el;
346
- }
347
- }
348
- MicroChartStackbarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: MicroChartStackbarComponent, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
349
- MicroChartStackbarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.7", type: MicroChartStackbarComponent, selector: "be-micro-chart-stackbar", inputs: { data: "data" }, usesInheritance: true, ngImport: i0, template: "<div *untilInView=\"el\" beMicroChartStackbar class=\"chart\" [chartData]=\"data\"></div>\r\n", styles: [":host{display:block;width:100%;height:100%}.chart{width:100%}\n"], dependencies: [{ kind: "directive", type: i1$1.UntilInViewDirective, selector: "[untilInView]", inputs: ["untilInView", "intersectionDebounce"] }, { kind: "directive", type: MicroChartStackbarBaseDirective, selector: "[beMicroChartStackbar]", inputs: ["chartData"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
350
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: MicroChartStackbarComponent, decorators: [{
351
- type: Component,
352
- args: [{ selector: 'be-micro-chart-stackbar', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div *untilInView=\"el\" beMicroChartStackbar class=\"chart\" [chartData]=\"data\"></div>\r\n", styles: [":host{display:block;width:100%;height:100%}.chart{width:100%}\n"] }]
353
- }], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: { data: [{
354
- type: Input
355
- }] } });
356
-
357
- class MicroChartCircularBaseDirective extends MicroChartBaseDirective {
358
- constructor(_el, renderer2) {
359
- super(_el, renderer2);
360
- this._el = _el;
361
- this.renderer2 = renderer2;
362
- }
363
- setOptions(options) {
364
- // remove extra data from circular chart
365
- this._initSeries(options);
366
- // add data to series
367
- options.series[0].data.push({ value: this.data });
368
- }
369
- _initSeries(options) {
370
- options.series = [
371
- {
372
- type: 'gauge',
373
- progress: {
374
- show: true,
375
- width: 5
376
- },
377
- axisLine: {
378
- lineStyle: {
379
- width: 5
380
- }
381
- },
382
- axisTick: {
383
- show: false
384
- },
385
- splitLine: {
386
- show: false,
387
- length: 15,
388
- lineStyle: {
389
- width: 2,
390
- color: '#999'
391
- }
392
- },
393
- axisLabel: {
394
- distance: 30,
395
- color: '#999',
396
- fontSize: 10,
397
- show: false
398
- },
399
- anchor: {
400
- show: true,
401
- showAbove: true,
402
- size: 15,
403
- itemStyle: {
404
- borderWidth: 1
405
- }
406
- },
407
- title: {
408
- show: false
409
- },
410
- detail: {
411
- valueAnimation: true,
412
- fontSize: 12,
413
- offsetCenter: [0, '70%']
414
- },
415
- data: []
416
- }
417
- ];
418
- }
419
- }
420
- MicroChartCircularBaseDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: MicroChartCircularBaseDirective, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Directive });
421
- MicroChartCircularBaseDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.7", type: MicroChartCircularBaseDirective, selector: "[beMicroChartCircular]", inputs: { data: "data" }, usesInheritance: true, ngImport: i0 });
422
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: MicroChartCircularBaseDirective, decorators: [{
423
- type: Directive,
424
- args: [{ selector: '[beMicroChartCircular]' }]
425
- }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.Renderer2 }]; }, propDecorators: { data: [{
426
- type: Input
427
- }] } });
428
-
429
- class MicroChartCircularComponent extends BaseComponent {
430
- constructor(el) {
431
- super();
432
- this.el = el;
433
- this.data = 50;
434
- }
435
- }
436
- MicroChartCircularComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: MicroChartCircularComponent, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
437
- MicroChartCircularComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.7", type: MicroChartCircularComponent, selector: "be-micro-chart-circular", inputs: { data: "data" }, usesInheritance: true, ngImport: i0, template: "<div *untilInView=\"el\" beMicroChartCircular [data]=\"data\"></div>\r\n", styles: [":host{display:block;width:100%;height:100%}\n"], dependencies: [{ kind: "directive", type: i1$1.UntilInViewDirective, selector: "[untilInView]", inputs: ["untilInView", "intersectionDebounce"] }, { kind: "directive", type: MicroChartCircularBaseDirective, selector: "[beMicroChartCircular]", inputs: ["data"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
438
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: MicroChartCircularComponent, decorators: [{
439
- type: Component,
440
- args: [{ selector: 'be-micro-chart-circular', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div *untilInView=\"el\" beMicroChartCircular [data]=\"data\"></div>\r\n", styles: [":host{display:block;width:100%;height:100%}\n"] }]
441
- }], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: { data: [{
442
- type: Input
443
- }] } });
444
-
445
- class MicroChartComparisonBaseDirective extends MicroChartBaseDirective {
446
- constructor(_el, renderer2) {
447
- super(_el, renderer2);
448
- this._el = _el;
449
- this.renderer2 = renderer2;
450
- }
451
- setOptions(options) {
452
- // initialize series
453
- this._initValues(options);
454
- // set custom xAxis
455
- this.xAxis.type = 'value';
456
- this.xAxis.boundaryGap = ['0%', '50%'];
457
- // set custom yAxis
458
- this.yAxis.type = 'category';
459
- this.yAxis.offset = 6;
460
- this.yAxis.axisLabel = {
461
- show: true,
462
- inside: true,
463
- lineHeight: 16
464
- };
465
- // set custom grid
466
- this.grid.top = 10;
467
- const textStyle = {
468
- verticalAlign: 'bottom',
469
- fontSize: 12,
470
- fontWeight: 'bold'
471
- };
472
- this.chartData.data.forEach((item) => {
473
- var _a, _b;
474
- const seriesData = {
475
- value: item.value,
476
- itemStyle: {
477
- color: item.color
478
- },
479
- label: {
480
- position: ['100', '0%']
481
- }
482
- };
483
- options.series[0].data.push(seriesData);
484
- const yAxisData = { value: item.label, textStyle };
485
- (_b = (_a = this.yAxis) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.push(yAxisData);
486
- });
487
- // if we have double tile
488
- if (this.size === 'l') {
489
- this.grid.left = 50;
490
- this.yAxis.axisLabel.inside = false;
491
- this.yAxis.axisLabel.lineHeight = undefined;
492
- options.series[0].label.position = 'right';
493
- this.yAxis.offset = -2;
494
- options.series[0].showBackground = false;
495
- this.xAxis.max = 112;
496
- options.series[0].data.map((dataItem) => {
497
- delete dataItem.label.offset;
498
- dataItem.label.position = ['100%', '0%'];
499
- });
500
- }
501
- options.series[0].label.formatter = (d) => d.data.value + this.chartData.suffix;
502
- }
503
- _initValues(options) {
504
- var _a;
505
- options.series = [
506
- {
507
- showBackground: true,
508
- barWidth: (_a = this.chartData.barWidth) !== null && _a !== void 0 ? _a : 3,
509
- type: 'bar',
510
- data: [],
511
- label: {
512
- show: true,
513
- position: 'top',
514
- distance: 0,
515
- valueAnimation: true,
516
- fontFamily: 'monospace',
517
- formatter: (d) => d.data.value + '%',
518
- lineHeight: -10
519
- }
520
- }
521
- ];
522
- options.plotOptions = {
523
- bar: {
524
- horizontal: true,
525
- distributed: true
526
- }
527
- };
528
- }
529
- }
530
- MicroChartComparisonBaseDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: MicroChartComparisonBaseDirective, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Directive });
531
- MicroChartComparisonBaseDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.7", type: MicroChartComparisonBaseDirective, selector: "[beMicroChartComparison]", inputs: { size: "size", chartData: "chartData" }, usesInheritance: true, ngImport: i0 });
532
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: MicroChartComparisonBaseDirective, decorators: [{
533
- type: Directive,
534
- args: [{
535
- selector: '[beMicroChartComparison]'
536
- }]
537
- }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.Renderer2 }]; }, propDecorators: { size: [{
538
- type: Input
539
- }], chartData: [{
540
- type: Input
541
- }] } });
542
-
543
- class MicroChartComparisonComponent extends BaseComponent {
544
- constructor(el) {
545
- super();
546
- this.el = el;
547
- }
548
- }
549
- MicroChartComparisonComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: MicroChartComparisonComponent, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
550
- MicroChartComparisonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.7", type: MicroChartComparisonComponent, selector: "be-micro-chart-comparison", inputs: { data: "data", size: "size" }, usesInheritance: true, ngImport: i0, template: "<div *untilInView=\"el\" beMicroChartComparison [chartData]=\"data\" [size]=\"size\"></div>\r\n", styles: [":host{display:block;width:100%;height:100%}\n"], dependencies: [{ kind: "directive", type: i1$1.UntilInViewDirective, selector: "[untilInView]", inputs: ["untilInView", "intersectionDebounce"] }, { kind: "directive", type: MicroChartComparisonBaseDirective, selector: "[beMicroChartComparison]", inputs: ["size", "chartData"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
551
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: MicroChartComparisonComponent, decorators: [{
552
- type: Component,
553
- args: [{ selector: 'be-micro-chart-comparison', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div *untilInView=\"el\" beMicroChartComparison [chartData]=\"data\" [size]=\"size\"></div>\r\n", styles: [":host{display:block;width:100%;height:100%}\n"] }]
554
- }], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: { data: [{
555
- type: Input
556
- }], size: [{
557
- type: Input
558
- }] } });
559
-
560
- class MicroChartAreaBaseDirective extends MicroChartBaseDirective {
561
- constructor(_el, renderer2) {
562
- super(_el, renderer2);
563
- this._el = _el;
564
- this.renderer2 = renderer2;
565
- this.areas = [];
566
- }
567
- /* eslint-disable */
568
- setOptions(options) {
569
- this._scaleDownLineData();
570
- // set custom xAxis
571
- this.xAxis.type = 'category';
572
- this.line.data.forEach((item) => {
573
- var _a, _b;
574
- (_b = (_a = this.xAxis) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.push(item.label);
575
- });
576
- this.xAxis.max = undefined;
577
- this.xAxis.boundaryGap = false;
578
- // set custom yAxis
579
- this.yAxis.splitLine = { show: false };
580
- this.yAxis.type = 'value';
581
- this.yAxis.splitNumber = 3;
582
- this.yAxis.min = 0;
583
- this.yAxis.max = 6;
584
- // handel area
585
- this.areas.forEach((area) => {
586
- const line = this._createItem(area.color, area.data.map((c) => ({
587
- value: c,
588
- symbol: 'none'
589
- })));
590
- this.series.push(line);
591
- });
592
- // handel line
593
- const seriesItem = this._createSeriesItem(this.line.data.map((item) => ({
594
- value: item.value,
595
- symbol: 'none'
596
- })));
597
- this.series.push(seriesItem);
598
- }
599
- _scaleDownLineData() {
600
- const maxValue = Math.max.apply(Math, this.line.data.map((dataItem) => dataItem.value));
601
- return this.line.data.forEach((dataItem) => {
602
- dataItem.value *= 6 / maxValue;
603
- });
604
- }
605
- _createSeriesItem(data) {
606
- var _a;
607
- return {
608
- type: 'line',
609
- data,
610
- lineStyle: { width: 1 },
611
- color: ((_a = this.line) === null || _a === void 0 ? void 0 : _a.color) || 'black',
612
- label: {
613
- show: false
614
- }
615
- };
616
- }
617
- _createItem(color = '', data, name = 'none', stack = 'none') {
618
- return {
619
- name,
620
- type: 'line',
621
- stack,
622
- areaStyle: {
623
- color
624
- },
625
- itemStyle: {
626
- color
627
- },
628
- emphasis: {
629
- focus: 'series'
630
- },
631
- data
632
- };
633
- }
634
- }
635
- MicroChartAreaBaseDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: MicroChartAreaBaseDirective, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Directive });
636
- MicroChartAreaBaseDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.7", type: MicroChartAreaBaseDirective, selector: "[beMicroChartArea]", inputs: { areas: "areas", line: "line" }, usesInheritance: true, ngImport: i0 });
637
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: MicroChartAreaBaseDirective, decorators: [{
638
- type: Directive,
639
- args: [{
640
- selector: '[beMicroChartArea]'
641
- }]
642
- }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.Renderer2 }]; }, propDecorators: { areas: [{
643
- type: Input
644
- }], line: [{
645
- type: Input
646
- }] } });
647
-
648
- class MicroChartAreaComponent extends BaseComponent {
649
- constructor(el) {
650
- super();
651
- this.el = el;
652
- }
653
- ngOnInit() {
654
- var _a, _b;
655
- super.ngOnInit();
656
- this.suffix = (_b = (_a = this.chartData) === null || _a === void 0 ? void 0 : _a.line) === null || _b === void 0 ? void 0 : _b.suffix;
657
- this.getFirstAndLastValues();
658
- }
659
- getFirstAndLastValues() {
660
- const dataLength = this.chartData.line.data.length;
661
- this.firstValue = this.chartData.line.data[0].value.toString();
662
- this.lastValue = this.chartData.line.data[dataLength - 1].value.toString();
663
- this.firstLabel = this.chartData.line.data[0].label;
664
- this.lastLabel = this.chartData.line.data[dataLength - 1].label;
665
- }
666
- }
667
- MicroChartAreaComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: MicroChartAreaComponent, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
668
- MicroChartAreaComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.7", type: MicroChartAreaComponent, selector: "be-micro-chart-area", inputs: { size: "size", chartData: "chartData" }, usesInheritance: true, ngImport: i0, template: "<div class=\"right-labels\" *ngIf=\"size === 'l'\">\r\n <span [style.color]=\"chartData.lastValueColor\">{{ lastValue }}{{ chartData?.line?.suffix }}</span>\r\n <span [style.color]=\"chartData.lastValueColor\">{{ lastLabel }}</span>\r\n</div>\r\n\r\n<div class=\"top-labels\" *ngIf=\"size === 's'\">\r\n <span [style.color]=\"chartData.lastValueColor\">{{ lastValue }}{{ suffix }}</span>\r\n <span [style.color]=\"chartData.firstValueColor\">{{ firstValue }}{{ suffix }}</span>\r\n</div>\r\n\r\n<div *untilInView=\"el\" beMicroChartArea [areas]=\"chartData.areas\" [line]=\"chartData.line\"></div>\r\n\r\n<div class=\"left-labels\" *ngIf=\"size === 'l'\">\r\n <span [style.color]=\"chartData.firstValueColor\">{{ firstValue }}{{ suffix }}</span>\r\n <span [style.color]=\"chartData.firstValueColor\">{{ firstLabel }}</span>\r\n</div>\r\n<div class=\"bottom-labels\" *ngIf=\"size === 's'\">\r\n <span [style.color]=\"chartData.lastValueColor\">{{ lastLabel }}</span>\r\n <span [style.color]=\"chartData.firstValueColor\">{{ firstLabel }}</span>\r\n</div>\r\n", styles: [":host{display:block;width:100%;height:100%}span{margin:0;font-size:10px}.top-labels{width:100%;height:23%;display:flex;justify-content:space-between}.bottom-labels{width:100%;height:25%;display:flex;justify-content:space-between}.right-labels{min-width:40px;display:flex;flex-direction:column;justify-content:space-between;text-align:right}.left-labels{min-width:40px;display:flex;flex-direction:column;justify-content:space-between;text-align:left}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.UntilInViewDirective, selector: "[untilInView]", inputs: ["untilInView", "intersectionDebounce"] }, { kind: "directive", type: MicroChartAreaBaseDirective, selector: "[beMicroChartArea]", inputs: ["areas", "line"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
669
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: MicroChartAreaComponent, decorators: [{
670
- type: Component,
671
- args: [{ selector: 'be-micro-chart-area', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"right-labels\" *ngIf=\"size === 'l'\">\r\n <span [style.color]=\"chartData.lastValueColor\">{{ lastValue }}{{ chartData?.line?.suffix }}</span>\r\n <span [style.color]=\"chartData.lastValueColor\">{{ lastLabel }}</span>\r\n</div>\r\n\r\n<div class=\"top-labels\" *ngIf=\"size === 's'\">\r\n <span [style.color]=\"chartData.lastValueColor\">{{ lastValue }}{{ suffix }}</span>\r\n <span [style.color]=\"chartData.firstValueColor\">{{ firstValue }}{{ suffix }}</span>\r\n</div>\r\n\r\n<div *untilInView=\"el\" beMicroChartArea [areas]=\"chartData.areas\" [line]=\"chartData.line\"></div>\r\n\r\n<div class=\"left-labels\" *ngIf=\"size === 'l'\">\r\n <span [style.color]=\"chartData.firstValueColor\">{{ firstValue }}{{ suffix }}</span>\r\n <span [style.color]=\"chartData.firstValueColor\">{{ firstLabel }}</span>\r\n</div>\r\n<div class=\"bottom-labels\" *ngIf=\"size === 's'\">\r\n <span [style.color]=\"chartData.lastValueColor\">{{ lastLabel }}</span>\r\n <span [style.color]=\"chartData.firstValueColor\">{{ firstLabel }}</span>\r\n</div>\r\n", styles: [":host{display:block;width:100%;height:100%}span{margin:0;font-size:10px}.top-labels{width:100%;height:23%;display:flex;justify-content:space-between}.bottom-labels{width:100%;height:25%;display:flex;justify-content:space-between}.right-labels{min-width:40px;display:flex;flex-direction:column;justify-content:space-between;text-align:right}.left-labels{min-width:40px;display:flex;flex-direction:column;justify-content:space-between;text-align:left}\n"] }]
672
- }], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: { size: [{
673
- type: Input
674
- }], chartData: [{
675
- type: Input
676
- }] } });
677
-
678
- class MicroChartBarBaseDirective extends MicroChartBaseDirective {
679
- constructor(_el, renderer2) {
680
- super(_el, renderer2);
681
- this._el = _el;
682
- this.renderer2 = renderer2;
683
- }
684
- setOptions(options) {
685
- // initialize series
686
- this._initSeries(options);
687
- // set custom grid
688
- this.grid.bottom = 20;
689
- // set custom xAxis
690
- this.xAxis.type = 'category';
691
- this.xAxis.max = undefined;
692
- if (this.xAxis.axisLabel) {
693
- this.xAxis.axisLabel.show = true;
694
- }
695
- this.data.forEach((dataItem) => {
696
- var _a, _b;
697
- (_b = (_a = this === null || this === void 0 ? void 0 : this.xAxis) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.push(dataItem.label);
698
- const dataSeriesItem = { value: dataItem.value, itemStyle: { color: dataItem.color } };
699
- options.series[0].data.push(dataSeriesItem);
700
- });
701
- // set custom yAxis
702
- this.yAxis.type = 'value';
703
- }
704
- _initSeries(options) {
705
- options.series = [
706
- {
707
- type: 'bar',
708
- data: []
709
- }
710
- ];
711
- }
712
- }
713
- MicroChartBarBaseDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: MicroChartBarBaseDirective, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Directive });
714
- MicroChartBarBaseDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.7", type: MicroChartBarBaseDirective, selector: "[beMicroChartBar]", inputs: { data: "data" }, usesInheritance: true, ngImport: i0 });
715
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: MicroChartBarBaseDirective, decorators: [{
716
- type: Directive,
717
- args: [{
718
- selector: '[beMicroChartBar]'
719
- }]
720
- }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.Renderer2 }]; }, propDecorators: { data: [{
721
- type: Input
722
- }] } });
723
-
724
- class MicroChartBarComponent extends BaseComponent {
725
- constructor(el) {
726
- super();
727
- this.el = el;
728
- }
729
- }
730
- MicroChartBarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: MicroChartBarComponent, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
731
- MicroChartBarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.7", type: MicroChartBarComponent, selector: "be-micro-chart-bar", inputs: { data: "data", size: "size", extraData: "extraData" }, usesInheritance: true, ngImport: i0, template: "<div *untilInView=\"el\" beMicroChartBar [ngClass]=\"size === 'l' ? 'flex-50' : 'flex-100'\" [data]=\"data\"></div>\r\n<div class=\"chart-desc\" *ngIf=\"size === 'l'\">\r\n <h2>{{ extraData.value }}{{ extraData.suffix }}</h2>\r\n</div>\r\n", styles: [":host{display:flex;width:100%;height:100%}.flex-50,.flex-100{flex:50%}.chart-desc{flex:50%;display:flex;align-items:flex-end;justify-content:flex-end}.chart-desc h2{margin:0}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.UntilInViewDirective, selector: "[untilInView]", inputs: ["untilInView", "intersectionDebounce"] }, { kind: "directive", type: MicroChartBarBaseDirective, selector: "[beMicroChartBar]", inputs: ["data"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
732
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: MicroChartBarComponent, decorators: [{
733
- type: Component,
734
- args: [{ selector: 'be-micro-chart-bar', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div *untilInView=\"el\" beMicroChartBar [ngClass]=\"size === 'l' ? 'flex-50' : 'flex-100'\" [data]=\"data\"></div>\r\n<div class=\"chart-desc\" *ngIf=\"size === 'l'\">\r\n <h2>{{ extraData.value }}{{ extraData.suffix }}</h2>\r\n</div>\r\n", styles: [":host{display:flex;width:100%;height:100%}.flex-50,.flex-100{flex:50%}.chart-desc{flex:50%;display:flex;align-items:flex-end;justify-content:flex-end}.chart-desc h2{margin:0}\n"] }]
735
- }], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: { data: [{
736
- type: Input
737
- }], size: [{
738
- type: Input
739
- }], extraData: [{
740
- type: Input
741
- }] } });
742
-
743
- class ChartLineTimeBaseDirective extends ChartBaseDirective {
744
- constructor(groupbyPipe, _el, renderer2) {
745
- super(_el, renderer2);
746
- this.groupbyPipe = groupbyPipe;
747
- this._el = _el;
748
- this.renderer2 = renderer2;
749
- this.xAxis = [];
750
- this.yAxis = [];
751
- }
752
- ngOnChanges(changes) {
753
- super.ngOnChanges(changes);
754
- const { chartOption } = changes;
755
- if (chartOption) {
756
- let options = chartOption.currentValue;
757
- options = Object.assign(Object.assign({}, options), { toolbox: {
758
- feature: {
759
- dataZoom: {
760
- yAxisIndex: 'none'
761
- },
762
- restore: {},
763
- saveAsImage: {}
764
- }
765
- } });
766
- this._setTooltipFormatter(options, 'series', 'tooltip');
767
- this._setTooltipFormatter(options, 'xAxis', 'axisLabel');
768
- this._setTooltipFormatter(options, 'yAxis', 'tooltip');
769
- if (!chartOption.firstChange) {
770
- this._renderChart();
771
- }
772
- }
773
- }
774
- setOptions(options) {
775
- this.options = Object.assign(Object.assign(Object.assign({}, options), this.chartOption), { toolbox: {
776
- feature: {
777
- dataZoom: {
778
- yAxisIndex: 'none'
779
- },
780
- restore: {},
781
- saveAsImage: {}
782
- }
783
- } });
784
- // set input data
785
- }
786
- _setTooltipFormatter(options, prop, prop2) {
787
- const arr = options[prop];
788
- if (Array.isArray(arr)) {
789
- arr.forEach((c) => {
790
- const obj2 = c[prop2];
791
- if (obj2 &&
792
- obj2.formatter &&
793
- (obj2.formatter.indexOf('=>') > -1 || obj2.formatter.indexOf('function') > -1)) {
794
- // eslint-disable-next-line no-eval
795
- obj2.formatter = eval(obj2.formatter);
796
- }
797
- });
798
- }
799
- }
800
- }
801
- ChartLineTimeBaseDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: ChartLineTimeBaseDirective, deps: [{ token: i1$1.GroupByPipe }, { token: i0.ElementRef }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Directive });
802
- ChartLineTimeBaseDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.7", type: ChartLineTimeBaseDirective, selector: "[beChartLineTime]", inputs: { chartOption: "chartOption" }, usesInheritance: true, usesOnChanges: true, ngImport: i0 });
803
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: ChartLineTimeBaseDirective, decorators: [{
804
- type: Directive,
805
- args: [{
806
- selector: '[beChartLineTime]'
807
- }]
808
- }], ctorParameters: function () { return [{ type: i1$1.GroupByPipe }, { type: i0.ElementRef }, { type: i0.Renderer2 }]; }, propDecorators: { chartOption: [{
809
- type: Input
810
- }] } });
811
-
812
- const components = [
813
- MicroChartComparisonComponent,
814
- MicroChartAreaComponent,
815
- MicroChartBarComponent,
816
- MicroChartAreaComponent,
817
- MicroChartStackbarComponent,
818
- MicroChartCircularComponent,
819
- MicroChartLineComponent,
820
- MicroChartAreaBaseDirective,
821
- MicroChartLineBaseDirective,
822
- MicroChartStackbarBaseDirective,
823
- MicroChartComparisonBaseDirective,
824
- MicroChartCircularComponent,
825
- MicroChartBarBaseDirective,
826
- MicroChartCircularBaseDirective,
827
- MicroChartBulletComponent,
828
- ChartLineTimeBaseDirective
829
- ];
830
- class BarsaEchartsModule {
831
- }
832
- BarsaEchartsModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: BarsaEchartsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
833
- BarsaEchartsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.7", ngImport: i0, type: BarsaEchartsModule, declarations: [MicroChartComparisonComponent,
834
- MicroChartAreaComponent,
835
- MicroChartBarComponent,
836
- MicroChartAreaComponent,
837
- MicroChartStackbarComponent,
838
- MicroChartCircularComponent,
839
- MicroChartLineComponent,
840
- MicroChartAreaBaseDirective,
841
- MicroChartLineBaseDirective,
842
- MicroChartStackbarBaseDirective,
843
- MicroChartComparisonBaseDirective,
844
- MicroChartCircularComponent,
845
- MicroChartBarBaseDirective,
846
- MicroChartCircularBaseDirective,
847
- MicroChartBulletComponent,
848
- ChartLineTimeBaseDirective], imports: [CommonModule, BarsaNovinRayCoreModule], exports: [MicroChartComparisonComponent,
849
- MicroChartAreaComponent,
850
- MicroChartBarComponent,
851
- MicroChartAreaComponent,
852
- MicroChartStackbarComponent,
853
- MicroChartCircularComponent,
854
- MicroChartLineComponent,
855
- MicroChartAreaBaseDirective,
856
- MicroChartLineBaseDirective,
857
- MicroChartStackbarBaseDirective,
858
- MicroChartComparisonBaseDirective,
859
- MicroChartCircularComponent,
860
- MicroChartBarBaseDirective,
861
- MicroChartCircularBaseDirective,
862
- MicroChartBulletComponent,
863
- ChartLineTimeBaseDirective] });
864
- BarsaEchartsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: BarsaEchartsModule, imports: [CommonModule, BarsaNovinRayCoreModule] });
865
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: BarsaEchartsModule, decorators: [{
866
- type: NgModule,
867
- args: [{
868
- schemas: [NO_ERRORS_SCHEMA, CUSTOM_ELEMENTS_SCHEMA],
869
- imports: [CommonModule, BarsaNovinRayCoreModule],
870
- declarations: [...components],
871
- exports: [...components]
872
- }]
873
- }] });
874
-
875
- /**
876
- * Generated bundle index. Do not edit.
877
- */
878
-
879
- export { BarsaEchartsModule, ChartLineTimeBaseDirective, MicroChartAreaBaseDirective, MicroChartAreaComponent, MicroChartBarBaseDirective, MicroChartBarComponent, MicroChartBulletComponent, MicroChartCircularBaseDirective, MicroChartCircularComponent, MicroChartComparisonBaseDirective, MicroChartComparisonComponent, MicroChartLineBaseDirective, MicroChartLineComponent, MicroChartStackbarBaseDirective, MicroChartStackbarComponent };
880
- //# sourceMappingURL=barsa-echarts.mjs.map