@visionaris-bruno/vs-echarts 6.1.2 → 6.3.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.
package/index.d.ts CHANGED
@@ -1,9 +1,9 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { OnChanges, OnDestroy, ElementRef, EventEmitter, SimpleChanges } from '@angular/core';
3
3
  import * as echarts from 'echarts';
4
- import { LineSeriesOption, BarSeriesOption, PieSeriesOption, EChartsOption, SeriesOption } from 'echarts';
4
+ import { LineSeriesOption, BarSeriesOption, PieSeriesOption, ScatterSeriesOption, EChartsOption, SeriesOption } from 'echarts';
5
5
  import { CategoryAxisBaseOption, ValueAxisBaseOption } from 'echarts/types/src/coord/axisCommonTypes.js';
6
- import { TooltipOption, ECBasicOption } from 'echarts/types/dist/shared';
6
+ import { TooltipOption } from 'echarts/types/dist/shared';
7
7
 
8
8
  type ChartKey = keyof Omit<IOptionsOverridesWrapper, "axis" | "tooltip">;
9
9
  /** los recibira el director
@@ -17,7 +17,7 @@ interface IEChartBuilder {
17
17
  /** producto base */
18
18
  baseProduct: VSEChartProduct;
19
19
  reset(): void;
20
- addSeries(data: IEChartData, overrides: SeriesOption & BarSeriesOption & LineSeriesOption): void;
20
+ addSeries(data: IEChartData, overrides: SeriesOption & BarSeriesOption & LineSeriesOption & ScatterSeriesOption): void;
21
21
  addTooltip(data: IEChartData, overrides: ITooltipOptionsOverrides): void;
22
22
  addPolar(): void;
23
23
  addXAxis(data: {
@@ -61,6 +61,9 @@ interface IBarOptionsOverrides {
61
61
  interface IRingOptionsOverrides {
62
62
  series?: Partial<PieSeriesOption>;
63
63
  }
64
+ interface IScatterOptionsOverrides {
65
+ series?: Partial<ScatterSeriesOption>;
66
+ }
64
67
  interface IAxisOptionsOverrides {
65
68
  categoryAxis: CategoryAxisBaseOption[];
66
69
  valueAxis: ValueAxisBaseOption[];
@@ -81,7 +84,26 @@ interface IOptionsOverrides {
81
84
  bar: IBarOptionsOverrides;
82
85
  /** ring options overrides */
83
86
  ring: IRingOptionsOverrides;
87
+ /** scatter options overrides */
88
+ scatter: IScatterOptionsOverrides;
84
89
  }
90
+ type NGXEchartsSelectChangeEventData = {
91
+ type: string;
92
+ fromAction: string;
93
+ fromActionPayload: {
94
+ dataIndexInside: number;
95
+ dataType: unknown;
96
+ isFromClick: boolean;
97
+ seriesIndex: number;
98
+ type: string;
99
+ };
100
+ isFromClick: boolean;
101
+ selected: {
102
+ dataIndex: number[];
103
+ seriesIndex: number;
104
+ }[];
105
+ escapeConnect: unknown;
106
+ };
85
107
 
86
108
  /**
87
109
  * IEChartSeries
@@ -149,6 +171,7 @@ type MakeOpts = {
149
171
  };
150
172
  type MakeBarOpts = MakeOpts;
151
173
  type MakeLineOpts = MakeOpts;
174
+ type MakeScatterOpts = MakeOpts;
152
175
  /**
153
176
  * Director de Builds.
154
177
  */
@@ -158,6 +181,7 @@ declare class VSECDirector {
158
181
  makeBar(data: IEChartData, overrides: IOptionsOverridesWrapper, opts?: MakeBarOpts): void;
159
182
  makeBarRadial(data: IEChartData, overrides: IOptionsOverridesWrapper, opts?: MakeBarOpts): void;
160
183
  makeLine(data: IEChartData, overrides: IOptionsOverridesWrapper, opts?: MakeLineOpts): void;
184
+ makeScatter(data: IEChartData, overrides: IOptionsOverridesWrapper, opts?: MakeScatterOpts): void;
161
185
  makeRing(data: IEChartData, overrides: IOptionsOverridesWrapper, opts?: MakeOpts): void;
162
186
  }
163
187
 
@@ -199,11 +223,14 @@ declare abstract class BaseEchartsComponent implements OnChanges, OnDestroy {
199
223
  * necesarias para el dibujado de las series del grafico.
200
224
  */
201
225
  protected abstract baseSeriesOptions: SeriesOption;
226
+ /** Construye y setea o actualiza las opciones.
227
+ *
228
+ * Utilizar cuando requiera un redibujo completo.
229
+ *
230
+ * Ej: Cambio en la data o estructural.
231
+ */
232
+ protected abstract updateChartOptions(): void;
202
233
  protected chartInstance?: echarts.ECharts;
203
- protected currentLegendSelected: any;
204
- /** Estado de selección para filtros cruzados */
205
- protected selectedCategoryIndex: number | null;
206
- protected selectedSeriesIndex: number | null;
207
234
  /** Opciones de inicializacion de echarts
208
235
  *
209
236
  * NgxEchartsDirective.initOpts
@@ -211,38 +238,18 @@ declare abstract class BaseEchartsComponent implements OnChanges, OnDestroy {
211
238
  initOptions: {
212
239
  renderer: string;
213
240
  };
214
- /** Opciones configuradas para ngx-echarts */
215
- chartOptions: any;
216
- mergeOptions: ECBasicOption;
217
241
  constructor();
218
242
  ngOnChanges(changes: SimpleChanges): void;
219
243
  ngOnDestroy(): void;
220
- /**
221
- * Captura la instancia de echarts (usado por ngx-echarts)
222
- */
223
- onChartInit(instance: any): void;
224
- /**
225
- * Configura interacciones base como el clic en el fondo para limpiar selección.
226
- */
227
- private setupBaseInteractions;
228
- onChartClick(event: any): void;
229
- /**
230
- * Maneja la lógica de alternancia de selección.
231
- */
232
- protected handleSelection(dataIndex: number, seriesIndex: number): void;
233
- /**
234
- * Limpia el estado de selección actual.
235
- */
236
- protected clearSelection(): void;
237
- dispatchAction(type: string, d: {
244
+ /** setear/actualizar opciones del chart
245
+ *
246
+ * Ver: https://echarts.apache.org/en/api.html#echartsInstance.setOption
247
+ */
248
+ private setOptions;
249
+ protected dispatchAction(type: string, d: {
238
250
  seriesIndex?: number[];
239
251
  dataIndex?: number[];
240
252
  }): void;
241
- /**
242
- * Maneja clics en la leyenda para persistir filtros.
243
- */
244
- onLegendSelectChanged(event: any): void;
245
- private updateOptions;
246
253
  /**
247
254
  * Hook de template method invocado por `ngOnChanges`.
248
255
  * Las subclases lo sobreescriben para añadir lógica propia
@@ -250,16 +257,26 @@ declare abstract class BaseEchartsComponent implements OnChanges, OnDestroy {
250
257
  * el comportamiento base (detectar inputs relevantes y actualizar el chart).
251
258
  */
252
259
  protected onInputChanges(changes: SimpleChanges): void;
253
- protected abstract updateChartOptions(opts?: {
254
- notMerge?: boolean;
255
- }): void;
256
260
  /**
257
- * Gatilla actualización en ngx-echarts
261
+ * Gatilla actualización.
262
+ *
258
263
  */
259
- protected triggerUpdate(options: echarts.EChartsOption): void;
264
+ protected triggerUpdate(options: EChartsOption): void;
260
265
  /**
261
- * Método público para forzar el redimensionado desde el padre
266
+ * Captura la instancia de echarts (usado por ngx-echarts)
262
267
  */
268
+ onChartInit(instance: any): void;
269
+ onChartClick(event: any): void;
270
+ /**
271
+ * Seleccion y des seleccion de item.
272
+ *
273
+ * Para hacer uso de esta funcion las opciones de series
274
+ * del grafico deben tener seteado 'selectMode'.
275
+ */
276
+ onChartSelectChanged(event: NGXEchartsSelectChangeEventData): void;
277
+ /**
278
+ * Método público para forzar el redimensionado desde el padre
279
+ */
263
280
  resize(): void;
264
281
  static ɵfac: i0.ɵɵFactoryDeclaration<BaseEchartsComponent, never>;
265
282
  static ɵdir: i0.ɵɵDirectiveDeclaration<BaseEchartsComponent, never, never, { "data": { "alias": "data"; "required": false; }; "optionsOverrides": { "alias": "optionsOverrides"; "required": false; }; "palette": { "alias": "palette"; "required": false; }; "colorResolver": { "alias": "colorResolver"; "required": false; }; "valueFormatter": { "alias": "valueFormatter"; "required": false; }; }, { "chartClick": "chartClick"; }, never, never, true, never>;
@@ -326,17 +343,12 @@ declare class EchartsRingComponent extends BaseEchartsComponent {
326
343
  onChartClick(event: any): void;
327
344
  onChartMouseOver(event: any): void;
328
345
  onChartMouseOut(event: any): void;
329
- /**
330
- * Captura los cambios en la selección de la leyenda para persistirlos.
331
- */
332
- onLegendSelectChanged(event: any): void;
346
+ onChartSelectChangedParcheado(e: NGXEchartsSelectChangeEventData): void;
333
347
  /**
334
348
  * Actualiza el texto del Graphic central y persiste la selección en el modelo de opciones.
335
349
  */
336
350
  private setGraphicText;
337
- protected updateChartOptions(opts?: {
338
- notMerge?: boolean;
339
- }): void;
351
+ protected updateChartOptions(): void;
340
352
  static ɵfac: i0.ɵɵFactoryDeclaration<EchartsRingComponent, never>;
341
353
  static ɵcmp: i0.ɵɵComponentDeclaration<EchartsRingComponent, "vs-echarts-ring", never, {}, {}, never, never, true, never>;
342
354
  }
@@ -363,7 +375,7 @@ declare class EChartBuilder implements IEChartBuilder {
363
375
  * @param overrides
364
376
  * @returns
365
377
  */
366
- addSeries(data: IEChartData, overrides: SeriesOption & BarSeriesOption & LineSeriesOption): void;
378
+ addSeries(data: IEChartData, overrides: SeriesOption & BarSeriesOption & LineSeriesOption & ScatterSeriesOption): void;
367
379
  /**
368
380
  * TODO: Mejorar funcion, no me convence como se implemento el tooltip formatter.
369
381
  * @param data
@@ -422,12 +434,6 @@ declare abstract class EchartsBarComponent extends BaseEchartsComponent {
422
434
  constructor();
423
435
  protected make(makeOpts: MakeBarOpts): void;
424
436
  protected updateChartOptions(): void;
425
- onChartInit(instance: any): void;
426
- protected onInputChanges(changes: SimpleChanges): void;
427
- private setupAdditionalInteractions;
428
- private highlightSector;
429
- private clearHighlight;
430
- onLegendSelectChanged(event: any): void;
431
437
  static ɵfac: i0.ɵɵFactoryDeclaration<EchartsBarComponent, never>;
432
438
  static ɵcmp: i0.ɵɵComponentDeclaration<EchartsBarComponent, "vs-echarts-bar", never, {}, {}, never, never, true, never>;
433
439
  }
@@ -482,7 +488,6 @@ declare abstract class EchartsLineComponent extends BaseEchartsComponent {
482
488
  */
483
489
  protected abstract variantBaseProduct: VSEChartProduct;
484
490
  constructor();
485
- protected onInputChanges(changes: SimpleChanges): void;
486
491
  protected make(makeOpts: MakeLineOpts): void;
487
492
  protected updateChartOptions(): void;
488
493
  static ɵfac: i0.ɵɵFactoryDeclaration<EchartsLineComponent, never>;
@@ -507,5 +512,25 @@ declare class EChartsAreaStackComponent extends EchartsLineComponent {
507
512
  static ɵcmp: i0.ɵɵComponentDeclaration<EChartsAreaStackComponent, "vs-echarts-bar", never, {}, {}, never, never, true, never>;
508
513
  }
509
514
 
510
- export { BaseEchartsComponent, EChartsAreaComponent, EChartsAreaStackComponent, EChartsBarStackedComponent, EChartsBarStackedRadialComponent, EChartsHBarComponent, EChartsHBarStackedComponent, EchartsBarComponent, EchartsLineComponent, EchartsRingComponent, defaultOptionsOverrides, initializeEcharts, provideVSEcharts };
511
- export type { ChartColorResolver, ChartOrientation, EChartClickType, EChartValueFormatter, IAreaOptionsOverrides, IAreaStackOptionsOverrides, IAxisOptionsOverrides, IBarOptionsOverrides, IBarStackedOptionsOverrides, IBarStackedRadialOptionsOverrides, IEChartBuilder, IEChartData, IEChartSeries, IHBarOptionsOverrides, IHBarStackedOptionsOverrides, ILineOptionsOverrides, IOptionsOverrides, IOptionsOverridesWrapper, IRingOptionsOverrides, ITooltipOptionsOverrides, VSEChartProduct };
515
+ declare abstract class EchartsScatterComponent extends BaseEchartsComponent {
516
+ /**
517
+ * Opciones esenciales inmutables estáticas comunes a todos los charts de dispersión.
518
+ */
519
+ protected baseSeriesOptions: ScatterSeriesOption;
520
+ /** variante de producto base/inicial para el builder.
521
+ *
522
+ * Utilizar para crear una variante (extender) un base producto.
523
+ */
524
+ protected abstract variantBaseProduct: VSEChartProduct;
525
+ protected baseProduct: VSEChartProduct;
526
+ protected builder: EChartBuilder;
527
+ protected director: VSECDirector;
528
+ constructor();
529
+ protected make(makeOpts: MakeScatterOpts): void;
530
+ protected updateChartOptions(): void;
531
+ static ɵfac: i0.ɵɵFactoryDeclaration<EchartsScatterComponent, never>;
532
+ static ɵcmp: i0.ɵɵComponentDeclaration<EchartsScatterComponent, "vs-echarts-scatter", never, {}, {}, never, never, true, never>;
533
+ }
534
+
535
+ export { BaseEchartsComponent, EChartsAreaComponent, EChartsAreaStackComponent, EChartsBarStackedComponent, EChartsBarStackedRadialComponent, EChartsHBarComponent, EChartsHBarStackedComponent, EchartsBarComponent, EchartsLineComponent, EchartsRingComponent, EchartsScatterComponent, defaultOptionsOverrides, initializeEcharts, provideVSEcharts };
536
+ export type { ChartColorResolver, ChartOrientation, EChartClickType, EChartValueFormatter, IAreaOptionsOverrides, IAreaStackOptionsOverrides, IAxisOptionsOverrides, IBarOptionsOverrides, IBarStackedOptionsOverrides, IBarStackedRadialOptionsOverrides, IEChartBuilder, IEChartData, IEChartSeries, IHBarOptionsOverrides, IHBarStackedOptionsOverrides, ILineOptionsOverrides, IOptionsOverrides, IOptionsOverridesWrapper, IRingOptionsOverrides, IScatterOptionsOverrides, ITooltipOptionsOverrides, NGXEchartsSelectChangeEventData, VSEChartProduct };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@visionaris-bruno/vs-echarts",
3
- "version": "6.1.2",
3
+ "version": "6.3.0",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^20.3.0",
6
6
  "@angular/core": "^20.3.0",