@kiwibit/chart 15.0.0 → 16.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.
@@ -10,374 +10,444 @@ import { TitleComponent, TooltipComponent, GridComponent, LegendComponent, DataZ
10
10
  import { LineChart, ScatterChart } from 'echarts/charts';
11
11
  import { CanvasRenderer } from 'echarts/renderers';
12
12
 
13
- const ADD_POINT_IMG_OFF_LIGHT = "image://data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAABmJLR0QA/wD/AP+gvaeTAAADkUlEQVR4nO2bz0sUYRjHv8/otviDGDuWrhKdskBaQZi57MmLgVpIkJ06bH9AEdF/kF46dEg726liBSGwBEFnTm0oaF3s4lhdh1BhNuTpsDPLu+MvmHXm0ZzP6X2feWfn+3x33nf3fXlfIOV8Q0dd7O3tvaDr+igzDxPRLQCdANqSkRaZHQBbzPyViEqu65bW19crhzU+1ADDMO4S0QSAq3GoTJAfAJ5alvXhoItN4cDY2FiTruuTRPQSQEfc6hLgEoB7uVyu3XGcBQCsXtxngJ/846TUJYjR3d3dsrm5+VkN1nUB/7V/F7rRI6IpAG9bW1vX5ufnd+JW2giDg4Ntu7u7N5h5HEARQFa9rmna6NLSUimo1wzwB7zvqO/zP4loaHl5eTVu4XFgGEYfEc0BuKKEN1zX7Q0GRi2I6ro+ivrkvbOcPADYtr3CzLcBeEr4WkdHx3BQqRnAzMPqzUQ0dZaTD7BtewXAGzWm5lozgIjyaqO9vb2Z2NUlRziX/qCgKcHLaotsNvstTkVJkslk1kKh2pigGtCutlhcXNyOU1SSHJBLLVcN55xmqQcbhjFERNMA9gA8sizro4QOsTdA07TXqI47XQCmxHRIPZiZO5Vql5SOcz8GpAZIC5AmNUBagDSpAdICpEkNkBYgTWqAtABpUgOkBUgTeT3An89PoX7JOTKmafLxrfZDRFvMXIy6nhD5DfDn8yeSfCP40+rI6wnnvgtENoCZi0S0dZJiIuIQUTHqzZHHAL/PRV7JCfd5y7KO3KsQF2kXkBYgTWqAtABpUgOkBUiTGiAtQJrUAGkB0qQGSAuQJjVA6sGhqbQjpUNyg0SwntDQfL5RxPYINbqecFKkY4BSrttLVygU2vGfMDAwcDEU+hMUVAN+qS08z7sep6gkaW5uDufyOyiom6XLagtN0x7ErCtJxkP1L0FB3SxdCjUqGobRF6eqJPBzqPuVYeZarjUDXNctoXrAKCBLRHNn2QTlwMQFJbzhed5sUKlbijZN8w6A96HPqQCYBjCTyWTWTvsm6kKh0F6pVG4S0X1Uv3k1eTDziG3bBxsAAKZpTgJ4ErtSAZj5hW3bz9TYvlNjjuMs5HK5VgBmYsoSgIgmLMt6juOOzQFgx3E+9fT0rDJzP6rn7s4yG8z80LKsVwglDxxzdDafz2daWlpG/DM2eVSPzp72P0jbALYAlJm55HnebLlc/istKuW08g8wjAev/BoR3wAAAABJRU5ErkJggg==";
14
- const ADD_POINT_IMG_OFF_DARK = "image://data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAABmJLR0QA/wD/AP+gvaeTAAADgUlEQVR4nO2bz04TURTGvzNtaQOVB1BgYVhZDbSUDixZYwLoTlzXB5CI8QUM4ANQXeOCqCkJiUuWtpNCIaG6gRWoeyx/CmGOC5hyZ/izmDJzgM5vdefMafudr/femd65BQKaG7rqZKVSadndORhjohGAUwB1AGjzSZtbdgHeBmiFmPNt7bF8IpE4vCz5UgMKhZXnBJoG+KE3On2CsEkmv8kM9n27+LSD+fn5UFdX9xQBr71X5x8E/tCvpyaJyFTjmjPxLhYPAAyaMAqr751xWw846fb44sioMSPHbH5ubY2s9/T07HqstSHW1tba9vaOHmuaNg4gC0bUlkA0puvJfP3QalQqlZbqv8NfjjH/G4RhXU+tea7cAwyj3MsmLwJ4oIQ34veiCWtirA+B3Z2DMVvxhNptLh4AMpnkKmn0FISaEu6uVg9HrIO6ASeXujOYkbvNxVtkMslVmPhkj5rnDQDQp6aETG3OU2U+wsT2Whhpq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ENAWkB0ngGSAuQxjNAWoA0ngHSAqTxDJAWII1ngLQAaTwDBN9b/So9LyVCzoCd9YSqvs9Xi9geoWrXEw4Kbw5Q2pa9dKHRXBOOCTdezp4uC/01GqoBP9WMeq32kpOi3GSjFmW10C+jpRhAWWsO3XdUlYtoNehTjxmcMfuMBjGnYIGincl8h9PinKYzme8Aw3KXIcCs1TRgrbmUAjCn5Pl1nSaPsgnGHyYA+MwgocC0PLFzqJ4Qz99i0Puy1ymBkNQ3MVbk0sxh30QdGs01Ndb4ruiEe9ufvK8spScTC+5uAACE4/kRAg04LVQCAobSseATNVbxHJBdDA4CNOKeLJcgGk4vBp5WhPfKDycKPQQeASPgrDKHIRTAGFAve2v3PoQTmTrgTA8Y3QSEsbXB+bA/IK0AWGAgS0CKaXki2x/ZkBblcVj5D1vBAfS1aXiGAAAAAElFTkSuQmCC";
16
16
 
17
- var TraceType;
18
- (function (TraceType) {
19
- TraceType["LINE"] = "line";
20
- TraceType["SCATTER"] = "scatter";
21
- })(TraceType || (TraceType = {}));
22
- var PointSymbol;
23
- (function (PointSymbol) {
24
- PointSymbol["NONE"] = "none";
25
- PointSymbol["CIRCLE"] = "circle";
26
- PointSymbol["TRIANGLE"] = "triangle";
27
- PointSymbol["PIN"] = "pin";
28
- PointSymbol["DIAMOND"] = "diamond";
29
- })(PointSymbol || (PointSymbol = {}));
30
- var TraceStyle;
31
- (function (TraceStyle) {
32
- TraceStyle["SOLID"] = "solid";
33
- TraceStyle["DASHED"] = "dashed";
34
- TraceStyle["DOTTED"] = "dotted";
35
- })(TraceStyle || (TraceStyle = {}));
36
- var AxisType;
37
- (function (AxisType) {
38
- AxisType["VALUE"] = "value";
39
- })(AxisType || (AxisType = {}));
40
- var ShapeVariant;
41
- (function (ShapeVariant) {
42
- ShapeVariant[ShapeVariant["TRACE"] = 0] = "TRACE";
17
+ var TraceType;
18
+ (function (TraceType) {
19
+ TraceType["LINE"] = "line";
20
+ TraceType["SCATTER"] = "scatter";
21
+ })(TraceType || (TraceType = {}));
22
+ var PointSymbol;
23
+ (function (PointSymbol) {
24
+ PointSymbol["NONE"] = "none";
25
+ PointSymbol["CIRCLE"] = "circle";
26
+ PointSymbol["TRIANGLE"] = "triangle";
27
+ PointSymbol["PIN"] = "pin";
28
+ PointSymbol["DIAMOND"] = "diamond";
29
+ })(PointSymbol || (PointSymbol = {}));
30
+ var TraceStyle;
31
+ (function (TraceStyle) {
32
+ TraceStyle["SOLID"] = "solid";
33
+ TraceStyle["DASHED"] = "dashed";
34
+ TraceStyle["DOTTED"] = "dotted";
35
+ })(TraceStyle || (TraceStyle = {}));
36
+ var AxisType;
37
+ (function (AxisType) {
38
+ AxisType["VALUE"] = "value";
39
+ })(AxisType || (AxisType = {}));
40
+ var ShapeVariant;
41
+ (function (ShapeVariant) {
42
+ ShapeVariant[ShapeVariant["TRACE"] = 0] = "TRACE";
43
43
  })(ShapeVariant || (ShapeVariant = {}));
44
44
 
45
- class KiwiChartComponent {
46
- constructor(cd) {
47
- this.cd = cd;
48
- /**
49
- * The Chart Object rendered by the canvas. For all the available options refer
50
- * to Chart interface in the models folder.
51
- *
52
- * @type {(Chart | null)}
53
- * @memberof KiwiChartComponent
54
- */
55
- this.chart = null;
56
- /**
57
- * Width and Height of the chart area. The dimensions refer to the father component
58
- * into which the kiwi-chart is inserted. For example in an empty page the width/height
59
- * of the chart can take the whole available space in the page.
60
- *
61
- * @type {string}
62
- * @memberof KiwiChartComponent
63
- */
64
- this.width = '100%';
65
- this.height = '480px';
66
- /**
67
- * This property simply activates or not the dark theme of the chart
68
- * defined by the Echarts library. In addition the background color can be custom
69
- * so that the chart can match the background of the application in which it's used.
70
- *
71
- * @type {boolean}
72
- * @memberof KiwiChartComponent
73
- */
74
- this.darkTheme = false;
75
- /**
76
- * Output event used to emit to the father component the coordinates
77
- * of the point clicked in the chart area. This functionality to be used must
78
- * have the property "clickToAddPoint" in the Chart object set to true.
79
- *
80
- * @type {EventEmitter<BasePoint>}
81
- * @memberof KiwiChartComponent
82
- */
83
- this.addPoint = new EventEmitter();
84
- /**
85
- * When the cursor hovers the chart area it emits to the father component the
86
- * x and y coordinates relative to the chart reference system.
87
- *
88
- * @type {EventEmitter<BasePoint>}
89
- * @memberof KiwiChartComponent
90
- */
91
- this.chartHover = new EventEmitter();
92
- /**
93
- * The object used by echarts to initially create the Chart.
94
- *
95
- * @type {EChartsOption}
96
- * @memberof KiwiChartComponent
97
- */
98
- this.chartOption = {};
99
- /**
100
- * The instance of the Chart.
101
- *
102
- * @type {(ECharts | null)}
103
- * @memberof KiwiChartComponent
104
- */
105
- this.echartsInstance = null;
106
- /**
107
- * Used to perform actions (as point addition based on the cursor position) on the chart.
108
- *
109
- * @type {(zrender.ZRenderType | null)}
110
- * @memberof KiwiChartComponent
111
- */
112
- this.zr = null;
113
- /**
114
- * Subject used to unsubscribe once the component gets destroyed.
115
- *
116
- * @private
117
- * @type {Subject<void>}
118
- * @memberof KiwiChartComponent
119
- */
120
- this.destroyed$ = new Subject();
121
- /**
122
- * Default number of decimals that can have
123
- * the values on the x and y axes.
124
- *
125
- * @private
126
- * @type {number}
127
- * @memberof KiwiChartComponent
128
- */
129
- this.MAX_DECIMALS = 3;
130
- }
131
- ngOnInit() {
132
- /**
133
- * This is a manual change detection running every 200ms, the memory should not be much afflicted.
134
- * It's necessary because when interacting with the chart (for example addPoint),
135
- * Angular loses the change detection and the point is not added in the chart canvas.
136
- */
137
- interval(200)
138
- .pipe(takeUntil(this.destroyed$))
139
- .subscribe(() => {
140
- this.cd.detectChanges();
141
- });
142
- }
143
- onChartInit(ec) {
144
- this.echartsInstance = ec;
145
- this.setupZrEventHandler(ec);
146
- }
147
- setupZrEventHandler(ec) {
148
- this.zr = ec.getZr();
149
- /**
150
- * Intercepts the click event on the chart (if the clickToAddPoint property is set to true)
151
- * and emits the point coordinates to the father component.
152
- */
153
- this.zr.on('click', params => {
154
- let option = ec.getOption();
155
- let active = option?.toolbox?.[0]?.feature?.myAddPoint?.iconStatus;
156
- if (active && this.chart?.clickToAddPoint) {
157
- const pointInPixel = [params.offsetX, params.offsetY];
158
- const pointInGrid = ec.convertFromPixel('grid', pointInPixel);
159
- if (ec.containPixel('grid', pointInPixel) && pointInGrid) {
160
- let newPoint = {
161
- x: +pointInGrid[0].toFixed(3),
162
- y: +pointInGrid[1].toFixed(3)
163
- };
164
- this.addPoint.emit(newPoint);
165
- }
166
- }
167
- });
168
- /**
169
- * This is used perform custom actions when the mouse is hovering the chart area
170
- */
171
- this.zr.on('mousemove', params => {
172
- const pointInPixel = [params.offsetX, params.offsetY];
173
- const pointInGrid = ec.convertFromPixel('grid', pointInPixel);
174
- /*
175
- * Logic to emit to the father component the x and y cdinates when the
176
- * cursor is hovering the chart area .
177
- */
178
- if (ec.containPixel('grid', pointInPixel) && pointInGrid) {
179
- let newPoint = {
180
- x: +pointInGrid[0].toFixed(3),
181
- y: +pointInGrid[1].toFixed(3)
182
- };
183
- this.chartHover.emit(newPoint);
184
- }
185
- /* Logic to change the cursor icon when the "Click to Add Point" feature is active and viceversa. */
186
- const option = ec.getOption();
187
- const addPointIsActive = option?.toolbox?.[0]?.feature?.myAddPoint?.iconStatus;
188
- if (addPointIsActive) {
189
- this.zr?.setCursorStyle(ec.containPixel('grid', pointInPixel) ? 'copy' : 'default');
190
- }
191
- });
192
- }
193
- ngOnChanges(changes) {
194
- let chart = changes['chart']?.currentValue;
195
- if (chart) {
196
- this.chartOption = {
197
- title: {
198
- text: chart.title,
199
- },
200
- grid: {
201
- width: '70%'
202
- },
203
- backgroundColor: this.darkTheme ? this.darkThemeBackground ?? '#303030' : 'transparent', tooltip: {
204
- axisPointer: {
205
- type: 'cross',
206
- crossStyle: {
207
- color: '#bebebe'
208
- }
209
- }
210
- },
211
- toolbox: {
212
- orient: 'horizontal',
213
- left: 'center',
214
- feature: {
215
- dataZoom: {
216
- brushStyle: {
217
- borderColor: '#000',
218
- borderWidth: 1,
219
- borderType: 'dashed'
220
- },
221
- },
222
- saveAsImage: {},
223
- restore: {},
224
- myAddPoint: {
225
- show: chart.clickToAddPoint ?? false,
226
- title: chart.addPointCustomName ?? 'Add Point',
227
- icon: this.darkTheme ? ADD_POINT_IMG_OFF_DARK : ADD_POINT_IMG_OFF_LIGHT,
228
- iconStatus: false,
229
- onclick: () => {
230
- let option = this.echartsInstance?.getOption();
231
- let status = option.toolbox[0].feature.myAddPoint.iconStatus;
232
- this.echartsInstance?.setOption({
233
- toolbox: {
234
- feature: {
235
- myAddPoint: {
236
- iconStatus: !status,
237
- icon: !status ? ADD_POINT_IMG_ON : this.darkTheme ? ADD_POINT_IMG_OFF_DARK : ADD_POINT_IMG_OFF_LIGHT
238
- }
239
- }
240
- }
241
- });
242
- }
243
- }
244
- },
245
- },
246
- dataZoom: [
247
- {
248
- type: 'inside',
249
- xAxisIndex: [0],
250
- throttle: 0,
251
- filterMode: 'none',
252
- disabled: !chart.scrollToZoom ?? true
253
- },
254
- {
255
- type: 'inside',
256
- yAxisIndex: [0],
257
- throttle: 0,
258
- filterMode: 'none',
259
- disabled: !chart.scrollToZoom ?? true
260
- },
261
- ],
262
- legend: {
263
- inactiveColor: this.darkTheme ? '#8b8b8b' : '#ccc',
264
- data: chart.shapes.map((shape) => ({
265
- name: shape.name,
266
- icon: 'circle'
267
- })),
268
- selected: chart.shapes.reduce((accumulator, shape) => ({ ...accumulator, [shape.name]: shape.selectedByDefault ?? true }), {}),
269
- show: chart.showLegend ?? false,
270
- orient: 'vertical',
271
- left: 'right',
272
- padding: [60, 20],
273
- type: 'scroll',
274
- textStyle: {
275
- width: 120,
276
- fontWeight: 'bold',
277
- overflow: 'break'
278
- }
279
- },
280
- xAxis: {
281
- type: chart.xAxisType,
282
- name: chart.xAxisUom ? `${chart.xAxisName} [ ${chart.xAxisUom} ]` : chart.xAxisName,
283
- nameLocation: 'middle',
284
- nameGap: 30,
285
- splitLine: {
286
- show: chart.showGrid ?? true,
287
- lineStyle: {
288
- color: this.darkTheme ? '#595959' : '#ccc'
289
- }
290
- },
291
- min: chart.xMin?.toFixed(chart.maxAxesDecimals ?? this.MAX_DECIMALS),
292
- max: chart.xMax?.toFixed(chart.maxAxesDecimals ?? this.MAX_DECIMALS),
293
- },
294
- yAxis: {
295
- type: chart.yAxisType,
296
- name: chart.yAxisUom ? `${chart.yAxisName} [ ${chart.yAxisUom} ]` : chart.yAxisName,
297
- nameLocation: 'middle',
298
- nameGap: 50,
299
- splitLine: {
300
- show: chart.showGrid ?? true,
301
- lineStyle: {
302
- color: this.darkTheme ? '#595959' : '#ccc'
303
- }
304
- },
305
- min: chart.yMin?.toFixed(chart.maxAxesDecimals ?? this.MAX_DECIMALS),
306
- max: chart.yMax?.toFixed(chart.maxAxesDecimals ?? this.MAX_DECIMALS),
307
- },
308
- series: this.createSeries(chart.shapes),
309
- animation: chart.hasAnimations,
310
- animationDuration: chart.animationDuration ?? 500,
311
- animationEasing: 'cubicOut'
312
- };
313
- }
314
- }
315
- createSeries(shapes) {
316
- let series = [];
317
- shapes.forEach((shape) => {
318
- switch (shape.variant) {
319
- case ShapeVariant.TRACE:
320
- series.push(this.createTrace(shape));
321
- break;
322
- default:
323
- break;
324
- }
325
- });
326
- return series;
327
- }
328
- createTrace(trace) {
329
- return {
330
- type: trace.type,
331
- name: trace.name,
332
- data: trace.points.map((point) => ({
333
- value: [point.x, point.y],
334
- symbol: point.symbol ?? 'circle',
335
- name: point.name,
336
- symbolSize: point.symbolSize ?? 2,
337
- itemStyle: {
338
- color: point.color
339
- },
340
- emphasis: {
341
- disabled: true
342
- },
343
- label: {
344
- show: true,
345
- position: 'bottom',
346
- align: 'left',
347
- verticalAlign: 'bottom',
348
- formatter: () => `${point.name ?? ''}`,
349
- fontSize: 13,
350
- padding: [0, 0, 0, 10],
351
- width: 100,
352
- overflow: 'truncate',
353
- ellipsis: '...',
354
- fontWeight: 'bold',
355
- color: this.darkTheme ? '#fff' : '#000'
356
- },
357
- tooltip: {
45
+ // Angular General
46
+ class KiwiChartComponent {
47
+ constructor(cd) {
48
+ this.cd = cd;
49
+ /**
50
+ * The Chart Object rendered by the canvas. For all the available options refer
51
+ * to Chart interface in the models folder.
52
+ *
53
+ * @type {(Chart | null)}
54
+ * @memberof KiwiChartComponent
55
+ */
56
+ this.chart = null;
57
+ /**
58
+ * Width and Height of the chart area. The dimensions refer to the father component
59
+ * into which the kiwi-chart is inserted. For example in an empty page the width/height
60
+ * of the chart can take the whole available space in the page.
61
+ *
62
+ * @type {string}
63
+ * @memberof KiwiChartComponent
64
+ */
65
+ this.width = '100%';
66
+ this.height = '480px';
67
+ /**
68
+ * This property simply activates or not the dark theme of the chart
69
+ * defined by the Echarts library. In addition the background color can be custom
70
+ * so that the chart can match the background of the application in which it's used.
71
+ *
72
+ * @type {boolean}
73
+ * @memberof KiwiChartComponent
74
+ */
75
+ this.darkTheme = false;
76
+ /**
77
+ * Output event used to emit to the father component the coordinates
78
+ * of the point clicked in the chart area. This functionality to be used must
79
+ * have the property "clickToAddPoint" in the Chart object set to true.
80
+ *
81
+ * @type {EventEmitter<BasePoint>}
82
+ * @memberof KiwiChartComponent
83
+ */
84
+ this.addPoint = new EventEmitter();
85
+ /**
86
+ * When the cursor hovers the chart area it emits to the father component the
87
+ * x and y coordinates relative to the chart reference system.
88
+ *
89
+ * @type {EventEmitter<BasePoint>}
90
+ * @memberof KiwiChartComponent
91
+ */
92
+ this.chartHover = new EventEmitter();
93
+ /**
94
+ * The object used by echarts to initially create the Chart.
95
+ * Has a default configuration that can be totally overrided using specific properties.
96
+ *
97
+ * @type {EChartsOption}
98
+ * @memberof KiwiChartComponent
99
+ */
100
+ this.chartOption = {
101
+ title: {
102
+ text: 'Kiwi Chart'
103
+ },
104
+ xAxis: {
105
+ name: 'X'
106
+ },
107
+ yAxis: {
108
+ name: 'Y'
109
+ },
110
+ series: [
111
+ {
112
+ type: TraceType.LINE,
113
+ data: [[0, 0]]
114
+ }
115
+ ]
116
+ };
117
+ /**
118
+ * The instance of the Chart.
119
+ *
120
+ * @type {(ECharts | null)}
121
+ * @memberof KiwiChartComponent
122
+ */
123
+ this.echartsInstance = null;
124
+ /**
125
+ * Used to perform actions (as point addition based on the cursor position) on the chart.
126
+ *
127
+ * @type {(zrender.ZRenderType | null)}
128
+ * @memberof KiwiChartComponent
129
+ */
130
+ this.zr = null;
131
+ /**
132
+ * Subject used to unsubscribe once the component gets destroyed.
133
+ *
134
+ * @private
135
+ * @type {Subject<void>}
136
+ * @memberof KiwiChartComponent
137
+ */
138
+ this.destroyed$ = new Subject();
139
+ /**
140
+ * Default number of decimals that can have
141
+ * the values on the x and y axes.
142
+ *
143
+ * @private
144
+ * @type {number}
145
+ * @memberof KiwiChartComponent
146
+ */
147
+ this.MAX_DECIMALS = 3;
148
+ this.legendSelected = {};
149
+ this.isLegendClicked = false;
150
+ }
151
+ ngOnInit() {
152
+ /**
153
+ * This is a manual change detection running every 200ms, the memory should not be much afflicted.
154
+ * It's necessary because when interacting with the chart (for example addPoint),
155
+ * Angular loses the change detection and the point is not added in the chart canvas.
156
+ */
157
+ interval(200)
158
+ .pipe(takeUntil(this.destroyed$))
159
+ .subscribe({
160
+ next: () => {
161
+ this.cd.detectChanges();
162
+ }
163
+ });
164
+ }
165
+ onChartInit(ec) {
166
+ this.echartsInstance = ec;
167
+ this.setupZrEventHandler(ec);
168
+ this.setupLegendEventHandler(ec);
169
+ }
170
+ /**
171
+ * intercept a selection change event on the legend and save the state
172
+ * of all selections on the supporting variable legendSelected
173
+ *
174
+ * @param ec
175
+ */
176
+ setupLegendEventHandler(ec) {
177
+ if (this.echartsInstance != null) {
178
+ this.echartsInstance.on('legendselectchanged', (params) => {
179
+ this.isLegendClicked = true;
180
+ this.legendSelected = params.selected;
181
+ });
182
+ }
183
+ }
184
+ setupZrEventHandler(ec) {
185
+ this.zr = ec.getZr();
186
+ /**
187
+ * Intercepts the click event on the chart (if the clickToAddPoint property is set to true)
188
+ * and emits the point coordinates to the father component.
189
+ */
190
+ this.zr.on('click', params => {
191
+ let option = ec.getOption();
192
+ let active = option?.toolbox?.[0]?.feature?.myAddPoint?.iconStatus;
193
+ if (active && this.chart?.clickToAddPoint) {
194
+ const pointInPixel = [params.offsetX, params.offsetY];
195
+ const pointInGrid = ec.convertFromPixel('grid', pointInPixel);
196
+ if (ec.containPixel('grid', pointInPixel) && pointInGrid) {
197
+ let newPoint = {
198
+ x: +pointInGrid[0].toFixed(3),
199
+ y: +pointInGrid[1].toFixed(3)
200
+ };
201
+ this.addPoint.emit(newPoint);
202
+ }
203
+ }
204
+ });
205
+ /**
206
+ * This is used perform custom actions when the mouse is hovering the chart area
207
+ */
208
+ this.zr.on('mousemove', params => {
209
+ const pointInPixel = [params.offsetX, params.offsetY];
210
+ const pointInGrid = ec.convertFromPixel('grid', pointInPixel);
211
+ /*
212
+ * Logic to emit to the father component the x and y cdinates when the
213
+ * cursor is hovering the chart area .
214
+ */
215
+ if (ec.containPixel('grid', pointInPixel) && pointInGrid) {
216
+ let newPoint = {
217
+ x: +pointInGrid[0].toFixed(3),
218
+ y: +pointInGrid[1].toFixed(3)
219
+ };
220
+ this.chartHover.emit(newPoint);
221
+ }
222
+ /* Logic to change the cursor icon when the "Click to Add Point" feature is active and viceversa. */
223
+ const option = ec.getOption();
224
+ const addPointIsActive = option?.toolbox?.[0]?.feature?.myAddPoint?.iconStatus;
225
+ if (addPointIsActive) {
226
+ this.zr?.setCursorStyle(ec.containPixel('grid', pointInPixel) ? 'copy' : 'default');
227
+ }
228
+ });
229
+ }
230
+ getLegendItemSelection(shape) {
231
+ if (this.isLegendClicked) {
232
+ return this.legendSelected[shape.name] ?? true;
233
+ }
234
+ else {
235
+ return shape.selectedByDefault ?? true;
236
+ }
237
+ }
238
+ ngOnChanges(changes) {
239
+ let chart = changes['chart']?.currentValue;
240
+ if (chart) {
241
+ this.chartOption = {
242
+ title: {
243
+ text: chart.title,
244
+ },
245
+ grid: {
246
+ width: '70%'
247
+ },
248
+ backgroundColor: this.darkTheme ? this.darkThemeBackground ?? '#303030' : 'transparent', tooltip: {
249
+ axisPointer: {
250
+ type: 'cross',
251
+ crossStyle: {
252
+ color: '#bebebe'
253
+ }
254
+ }
255
+ },
256
+ toolbox: {
257
+ orient: 'horizontal',
258
+ left: 'center',
259
+ top: '25px',
260
+ feature: {
261
+ dataZoom: {
262
+ brushStyle: {
263
+ borderColor: '#000',
264
+ borderWidth: 1,
265
+ borderType: 'dashed'
266
+ },
267
+ emphasis: {
268
+ iconStyle: {
269
+ textPosition: 'top'
270
+ }
271
+ }
272
+ },
273
+ saveAsImage: {
274
+ emphasis: {
275
+ iconStyle: {
276
+ textPosition: 'top'
277
+ }
278
+ }
279
+ },
280
+ restore: {
281
+ emphasis: {
282
+ iconStyle: {
283
+ textPosition: 'top'
284
+ }
285
+ }
286
+ },
287
+ myAddPoint: {
288
+ show: chart.clickToAddPoint ?? false,
289
+ title: chart.addPointCustomName ?? 'Add Point',
290
+ icon: this.darkTheme ? ADD_POINT_IMG_OFF_DARK : ADD_POINT_IMG_OFF_LIGHT,
291
+ iconStatus: false,
292
+ onclick: () => {
293
+ let option = this.echartsInstance?.getOption();
294
+ let status = option.toolbox[0].feature.myAddPoint.iconStatus;
295
+ this.echartsInstance?.setOption({
296
+ toolbox: {
297
+ feature: {
298
+ myAddPoint: {
299
+ iconStatus: !status,
300
+ icon: !status ? ADD_POINT_IMG_ON : this.darkTheme ? ADD_POINT_IMG_OFF_DARK : ADD_POINT_IMG_OFF_LIGHT
301
+ }
302
+ }
303
+ }
304
+ });
305
+ },
306
+ emphasis: {
307
+ iconStyle: {
308
+ textPosition: 'top'
309
+ }
310
+ }
311
+ }
312
+ },
313
+ },
314
+ dataZoom: [
315
+ {
316
+ type: 'inside',
317
+ xAxisIndex: [0],
318
+ throttle: 0,
319
+ filterMode: 'none',
320
+ disabled: !chart.scrollToZoom ?? true
321
+ },
322
+ {
323
+ type: 'inside',
324
+ yAxisIndex: [0],
325
+ throttle: 0,
326
+ filterMode: 'none',
327
+ disabled: !chart.scrollToZoom ?? true
328
+ },
329
+ ],
330
+ legend: {
331
+ inactiveColor: this.darkTheme ? '#8b8b8b' : '#ccc',
332
+ data: chart.shapes.map((shape) => ({
333
+ name: shape.name,
334
+ icon: 'circle',
335
+ })),
336
+ selected: chart.shapes.reduce((accumulator, shape) => ({
337
+ ...accumulator,
338
+ [shape.name]: this.getLegendItemSelection(shape),
339
+ }), {}),
340
+ show: chart.showLegend ?? false,
341
+ orient: 'vertical',
342
+ left: 'right',
343
+ padding: [60, 20],
344
+ type: 'scroll',
345
+ textStyle: {
346
+ width: 120,
347
+ fontWeight: 'bold',
348
+ overflow: 'break'
349
+ }
350
+ },
351
+ xAxis: {
352
+ type: chart.xAxisType,
353
+ name: chart.xAxisUom ? `${chart.xAxisName} [ ${chart.xAxisUom} ]` : chart.xAxisName,
354
+ nameLocation: 'middle',
355
+ nameGap: 30,
356
+ splitLine: {
357
+ show: chart.showGrid ?? true,
358
+ lineStyle: {
359
+ color: this.darkTheme ? '#595959' : '#ccc'
360
+ }
361
+ },
362
+ min: chart.xMin?.toFixed(chart.maxAxesDecimals ?? this.MAX_DECIMALS),
363
+ max: chart.xMax?.toFixed(chart.maxAxesDecimals ?? this.MAX_DECIMALS),
364
+ },
365
+ yAxis: {
366
+ type: chart.yAxisType,
367
+ name: chart.yAxisUom ? `${chart.yAxisName} [ ${chart.yAxisUom} ]` : chart.yAxisName,
368
+ nameLocation: 'middle',
369
+ nameGap: 50,
370
+ splitLine: {
371
+ show: chart.showGrid ?? true,
372
+ lineStyle: {
373
+ color: this.darkTheme ? '#595959' : '#ccc'
374
+ }
375
+ },
376
+ min: chart.yMin?.toFixed(chart.maxAxesDecimals ?? this.MAX_DECIMALS),
377
+ max: chart.yMax?.toFixed(chart.maxAxesDecimals ?? this.MAX_DECIMALS),
378
+ },
379
+ series: this.createSeries(chart.shapes),
380
+ animation: chart.hasAnimations,
381
+ animationDuration: chart.animationDuration ?? 500,
382
+ animationEasing: 'cubicOut'
383
+ };
384
+ }
385
+ }
386
+ createSeries(shapes) {
387
+ let series = [];
388
+ shapes.forEach((shape) => {
389
+ switch (shape.variant) {
390
+ case ShapeVariant.TRACE:
391
+ series.push(this.createTrace(shape));
392
+ break;
393
+ default:
394
+ break;
395
+ }
396
+ });
397
+ return series;
398
+ }
399
+ createTrace(trace) {
400
+ return {
401
+ type: trace.type,
402
+ name: trace.name,
403
+ data: trace.points.map((point) => ({
404
+ value: [point.x, point.y],
405
+ symbol: point.symbol ?? 'circle',
406
+ name: point.name,
407
+ symbolSize: point.symbolSize ?? 2,
408
+ itemStyle: {
409
+ color: point.color
410
+ },
411
+ emphasis: {
412
+ disabled: true
413
+ },
414
+ label: {
415
+ show: true,
416
+ position: 'bottom',
417
+ align: 'left',
418
+ verticalAlign: 'bottom',
419
+ formatter: () => `${point.name ?? ''}`,
420
+ fontSize: 13,
421
+ padding: [0, 0, 0, 10],
422
+ width: 100,
423
+ overflow: 'truncate',
424
+ ellipsis: '...',
425
+ fontWeight: 'bold',
426
+ color: this.darkTheme ? '#fff' : '#000'
427
+ },
428
+ tooltip: {
358
429
  formatter: ({ value }) => `
359
430
  <strong>${this.chart?.xAxisName}:</strong> ${value[0].toFixed(3).replace(/[.,]000$/, "")}
360
431
  <br>
361
432
  <strong>${this.chart?.yAxisName}:</strong> ${value[1].toFixed(3).replace(/[.,]000$/, "")}
362
- `
363
- }
364
- })),
365
- color: trace.color,
366
- lineStyle: {
367
- width: trace.width,
368
- type: trace.style,
369
- opacity: trace.opacity ?? 1
370
- },
371
- smooth: trace.smooth ?? false
372
- };
373
- }
374
- ngOnDestroy() {
375
- this.destroyed$.next();
376
- this.destroyed$.complete();
377
- }
378
- }
379
- KiwiChartComponentfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.1", ngImport: i0, type: KiwiChartComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
380
- KiwiChartComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.1", type: KiwiChartComponent, selector: "kiwi-chart", inputs: { chart: "chart", width: "width", height: "height", darkTheme: "darkTheme", darkThemeBackground: "darkThemeBackground" }, outputs: { addPoint: "addPoint", chartHover: "chartHover" }, usesOnChanges: true, ngImport: i0, template: `
433
+ `
434
+ }
435
+ })),
436
+ color: trace.color,
437
+ lineStyle: {
438
+ width: trace.width,
439
+ type: trace.style,
440
+ opacity: trace.opacity ?? 1
441
+ },
442
+ smooth: trace.smooth ?? false
443
+ };
444
+ }
445
+ ngOnDestroy() {
446
+ this.destroyed$.next();
447
+ this.destroyed$.complete();
448
+ }
449
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: KiwiChartComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
450
+ static { thiscmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: KiwiChartComponent, selector: "kiwi-chart", inputs: { chart: "chart", width: "width", height: "height", darkTheme: "darkTheme", darkThemeBackground: "darkThemeBackground" }, outputs: { addPoint: "addPoint", chartHover: "chartHover" }, usesOnChanges: true, ngImport: i0, template: `
381
451
  <div
382
452
  echarts
383
453
  [options]="chartOption"
@@ -388,9 +458,10 @@ KiwiChartComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", ver
388
458
  (chartInit)="onChartInit($event)"
389
459
  [theme]="darkTheme ? 'dark' : ''"
390
460
  ></div>
391
- `, isInline: true, styles: [""], dependencies: [{ kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i2.NgxEchartsDirective, selector: "echarts, [echarts]", inputs: ["options", "theme", "loading", "initOpts", "merge", "autoResize", "loadingType", "loadingOpts"], outputs: ["chartInit", "optionsError", "chartClick", "chartDblClick", "chartMouseDown", "chartMouseMove", "chartMouseUp", "chartMouseOver", "chartMouseOut", "chartGlobalOut", "chartContextMenu", "chartLegendSelectChanged", "chartLegendSelected", "chartLegendUnselected", "chartLegendScroll", "chartDataZoom", "chartDataRangeSelected", "chartTimelineChanged", "chartTimelinePlayChanged", "chartRestore", "chartDataViewChanged", "chartMagicTypeChanged", "chartPieSelectChanged", "chartPieSelected", "chartPieUnselected", "chartMapSelectChanged", "chartMapSelected", "chartMapUnselected", "chartAxisAreaSelected", "chartFocusNodeAdjacency", "chartUnfocusNodeAdjacency", "chartBrush", "chartBrushEnd", "chartBrushSelected", "chartRendered", "chartFinished"], exportAs: ["echarts"] }] });
392
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.1", ngImport: i0, type: KiwiChartComponent, decorators: [{
393
- type: Component,
461
+ `, isInline: true, styles: [""], dependencies: [{ kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i2.NgxEchartsDirective, selector: "echarts, [echarts]", inputs: ["options", "theme", "initOpts", "merge", "autoResize", "loading", "loadingType", "loadingOpts"], outputs: ["chartInit", "optionsError", "chartClick", "chartDblClick", "chartMouseDown", "chartMouseMove", "chartMouseUp", "chartMouseOver", "chartMouseOut", "chartGlobalOut", "chartContextMenu", "chartHighlight", "chartDownplay", "chartSelectChanged", "chartLegendSelectChanged", "chartLegendSelected", "chartLegendUnselected", "chartLegendLegendSelectAll", "chartLegendLegendInverseSelect", "chartLegendScroll", "chartDataZoom", "chartDataRangeSelected", "chartGraphRoam", "chartGeoRoam", "chartTreeRoam", "chartTimelineChanged", "chartTimelinePlayChanged", "chartRestore", "chartDataViewChanged", "chartMagicTypeChanged", "chartGeoSelectChanged", "chartGeoSelected", "chartGeoUnselected", "chartAxisAreaSelected", "chartBrush", "chartBrushEnd", "chartBrushSelected", "chartGlobalCursorTaken", "chartRendered", "chartFinished"], exportAs: ["echarts"] }] }); }
462
+ }
463
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: KiwiChartComponent, decorators: [{
464
+ type: Component,
394
465
  args: [{ selector: 'kiwi-chart', template: `
395
466
  <div
396
467
  echarts
@@ -402,64 +473,63 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.1", ngImpor
402
473
  (chartInit)="onChartInit($event)"
403
474
  [theme]="darkTheme ? 'dark' : ''"
404
475
  ></div>
405
- ` }]
406
- }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { chart: [{
407
- type: Input
408
- }], width: [{
409
- type: Input
410
- }], height: [{
411
- type: Input
412
- }], darkTheme: [{
413
- type: Input
414
- }], darkThemeBackground: [{
415
- type: Input
416
- }], addPoint: [{
417
- type: Output
418
- }], chartHover: [{
419
- type: Output
476
+ ` }]
477
+ }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { chart: [{
478
+ type: Input
479
+ }], width: [{
480
+ type: Input
481
+ }], height: [{
482
+ type: Input
483
+ }], darkTheme: [{
484
+ type: Input
485
+ }], darkThemeBackground: [{
486
+ type: Input
487
+ }], addPoint: [{
488
+ type: Output
489
+ }], chartHover: [{
490
+ type: Output
420
491
  }] } });
421
492
 
422
- echarts.use([
423
- TitleComponent,
424
- TooltipComponent,
425
- GridComponent,
426
- LineChart,
427
- CanvasRenderer,
428
- LegendComponent,
429
- DataZoomComponent,
430
- ToolboxComponent,
431
- ScatterChart
432
- ]);
433
- class KiwiChartModule {
434
- }
435
- KiwiChartModulefac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.1", ngImport: i0, type: KiwiChartModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
436
- KiwiChartModulemod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.0.1", ngImport: i0, type: KiwiChartModule, declarations: [KiwiChartComponent], imports: [CommonModule, i2.NgxEchartsModule], exports: [KiwiChartComponent] });
437
- KiwiChartModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.0.1", ngImport: i0, type: KiwiChartModule, imports: [CommonModule,
438
- NgxEchartsModule.forRoot({ echarts })] });
439
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.1", ngImport: i0, type: KiwiChartModule, decorators: [{
440
- type: NgModule,
441
- args: [{
442
- declarations: [
443
- KiwiChartComponent
444
- ],
445
- imports: [
446
- CommonModule,
447
- NgxEchartsModule.forRoot({ echarts })
448
- ],
449
- exports: [
450
- KiwiChartComponent
451
- ]
452
- }]
493
+ echarts.use([
494
+ TitleComponent,
495
+ TooltipComponent,
496
+ GridComponent,
497
+ LineChart,
498
+ CanvasRenderer,
499
+ LegendComponent,
500
+ DataZoomComponent,
501
+ ToolboxComponent,
502
+ ScatterChart
503
+ ]);
504
+ class KiwiChartModule {
505
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: KiwiChartModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
506
+ static { thismod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: KiwiChartModule, declarations: [KiwiChartComponent], imports: [CommonModule, i2.NgxEchartsModule], exports: [KiwiChartComponent] }); }
507
+ static { thisinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: KiwiChartModule, imports: [CommonModule,
508
+ NgxEchartsModule.forRoot({ echarts })] }); }
509
+ }
510
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: KiwiChartModule, decorators: [{
511
+ type: NgModule,
512
+ args: [{
513
+ declarations: [
514
+ KiwiChartComponent
515
+ ],
516
+ imports: [
517
+ CommonModule,
518
+ NgxEchartsModule.forRoot({ echarts })
519
+ ],
520
+ exports: [
521
+ KiwiChartComponent
522
+ ]
523
+ }]
453
524
  }] });
454
525
 
455
- /*
456
- * Public API Surface of chart
526
+ /*
527
+ * Public API Surface of chart
457
528
  */
458
529
 
459
- /**
460
- * Generated bundle index. Do not edit.
530
+ /**
531
+ * Generated bundle index. Do not edit.
461
532
  */
462
533
 
463
534
  export { ADD_POINT_IMG_OFF_DARK, ADD_POINT_IMG_OFF_LIGHT, ADD_POINT_IMG_ON, AxisType, KiwiChartComponent, KiwiChartModule, PointSymbol, ShapeVariant, TraceStyle, TraceType };
464
535
  //# sourceMappingURL=kiwibit-chart.mjs.map
465
- //# sourceMappingURL=kiwibit-chart.mjs.map