@visionaris-bruno/vs-echarts 8.4.2 → 8.6.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,18 +1,19 @@
|
|
|
1
|
-
import * as i0 from '@angular/core';
|
|
2
|
-
import { OnChanges, OnDestroy, ElementRef, EventEmitter, SimpleChanges } from '@angular/core';
|
|
3
1
|
import * as echarts from 'echarts';
|
|
4
2
|
import { LineSeriesOption, BarSeriesOption, PieSeriesOption, ScatterSeriesOption, FunnelSeriesOption, SunburstSeriesOption, SankeySeriesOption, BoxplotSeriesOption, EChartsOption, SeriesOption } from 'echarts';
|
|
5
3
|
import { CategoryAxisBaseOption, ValueAxisBaseOption } from 'echarts/types/src/coord/axisCommonTypes.js';
|
|
6
4
|
import { TooltipOption } from 'echarts/types/dist/shared';
|
|
5
|
+
import * as i0 from '@angular/core';
|
|
6
|
+
import { OnChanges, OnDestroy, ElementRef, EventEmitter, SimpleChanges } from '@angular/core';
|
|
7
|
+
import * as _visionaris_bruno_vs_echarts from '@visionaris-bruno/vs-echarts';
|
|
7
8
|
|
|
8
|
-
|
|
9
|
-
type ISeriesLayoutOpts = {
|
|
9
|
+
interface ISeriesLayoutOpts {
|
|
10
10
|
coordinateSystem?: 'cartesian2d' | 'polar';
|
|
11
11
|
axisTypes?: {
|
|
12
12
|
x: 'category' | 'value';
|
|
13
13
|
y: 'category' | 'value';
|
|
14
14
|
};
|
|
15
|
-
}
|
|
15
|
+
}
|
|
16
|
+
type ChartKey = keyof Omit<IOptionsOverridesWrapper, "axis" | "tooltip">;
|
|
16
17
|
/** los recibira el director
|
|
17
18
|
*
|
|
18
19
|
*/
|
|
@@ -20,12 +21,12 @@ type VSEChartProduct = {
|
|
|
20
21
|
chartKey: ChartKey;
|
|
21
22
|
baseOptions: EChartsOption;
|
|
22
23
|
};
|
|
23
|
-
interface IEChartBuilder<SeriesType = SeriesOption,
|
|
24
|
+
interface IEChartBuilder<SeriesType = SeriesOption, OptsType = any, DatasetConfigOptions = any> {
|
|
24
25
|
/** producto base */
|
|
25
26
|
baseProduct: VSEChartProduct;
|
|
26
27
|
reset(): void;
|
|
27
28
|
addDataset(data: IEChartData, opts?: DatasetConfigOptions): void;
|
|
28
|
-
addSeries(data: IEChartData, overrides: SeriesType, opts?:
|
|
29
|
+
addSeries(data: IEChartData, overrides: SeriesType, opts?: OptsType): void;
|
|
29
30
|
addTooltip(data: IEChartData, overrides: ITooltipOptionsOverrides): void;
|
|
30
31
|
addPolar(): void;
|
|
31
32
|
addXAxis(data: IEChartData, overrides: IOptionsOverrides["axis"], type?: 'category' | 'value'): void;
|
|
@@ -36,9 +37,9 @@ interface IEChartBuilder<SeriesType = SeriesOption, SeriesConfigOptions = any, D
|
|
|
36
37
|
addCommons(): void;
|
|
37
38
|
addGraphic(): void;
|
|
38
39
|
addDataZoom(): void;
|
|
39
|
-
setValueFormatter(formatter: EChartValueFormatter): void;
|
|
40
|
-
setPalette(palette: string[]): void;
|
|
41
|
-
setColorResolver(resolver: ChartColorResolver): void;
|
|
40
|
+
setValueFormatter(formatter: EChartValueFormatter | undefined): void;
|
|
41
|
+
setPalette(palette: string[] | undefined): void;
|
|
42
|
+
setColorResolver(resolver: ChartColorResolver | undefined): void;
|
|
42
43
|
getResult(): EChartsOption;
|
|
43
44
|
}
|
|
44
45
|
type EChartClickType = 'cross-filter';
|
|
@@ -137,13 +138,11 @@ type NGXEchartsSelectChangeEventData = {
|
|
|
137
138
|
}[];
|
|
138
139
|
escapeConnect: unknown;
|
|
139
140
|
};
|
|
140
|
-
type
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
max: string;
|
|
146
|
-
};
|
|
141
|
+
type VSEchartsLocale = 'ZH' | 'EN' | 'AR' | 'CS' | 'DE' | 'EL' | 'ES' | 'FA' | 'FI' | 'FR' | 'HU' | 'IT' | 'JA' | 'KO' | 'LV' | 'nb-NO' | 'NL' | 'PL' | 'PT-br' | 'RO' | 'RU' | 'SI' | 'SV' | 'TH' | 'TR' | 'UK' | 'VI';
|
|
142
|
+
interface VSEchartsConfig {
|
|
143
|
+
renderer?: 'canvas' | 'svg';
|
|
144
|
+
locale?: VSEchartsLocale;
|
|
145
|
+
}
|
|
147
146
|
|
|
148
147
|
/**
|
|
149
148
|
* IEChartDataNode
|
|
@@ -196,14 +195,17 @@ interface IOptionsOverridesWrapper extends IOptionsOverrides {
|
|
|
196
195
|
hBoxplot: IHBoxplotOptionsOverrides;
|
|
197
196
|
}
|
|
198
197
|
|
|
199
|
-
declare function initializeEcharts(): void;
|
|
200
|
-
/**
|
|
201
|
-
* Provee la configuración de ECharts para ngx-echarts.
|
|
202
|
-
* Llama automáticamente a la inicialización de módulos.
|
|
203
|
-
*/
|
|
204
|
-
declare function provideVSEcharts(): i0.Provider;
|
|
205
198
|
declare function defaultOptionsOverrides(): IOptionsOverridesWrapper;
|
|
206
199
|
|
|
200
|
+
declare class VSEchartsConfigService {
|
|
201
|
+
private vsEchartsConfig;
|
|
202
|
+
private readonly mapping;
|
|
203
|
+
constructor(vsEchartsConfig: VSEchartsConfig);
|
|
204
|
+
setLocale(language: string): void;
|
|
205
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<VSEchartsConfigService, never>;
|
|
206
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<VSEchartsConfigService>;
|
|
207
|
+
}
|
|
208
|
+
|
|
207
209
|
type MakeOpts = {
|
|
208
210
|
valueFormatter?: EChartValueFormatter;
|
|
209
211
|
palette?: string[];
|
|
@@ -216,15 +218,13 @@ type MakeOpts = {
|
|
|
216
218
|
type MakeBarOpts = MakeOpts;
|
|
217
219
|
type MakeLineOpts = MakeOpts;
|
|
218
220
|
type MakeScatterOpts = MakeOpts;
|
|
219
|
-
type MakeBoxplotOpts = MakeOpts & {
|
|
220
|
-
statisticsKeys?: BoxplotStatisticsKeys;
|
|
221
|
-
};
|
|
221
|
+
type MakeBoxplotOpts = MakeOpts & {};
|
|
222
222
|
/**
|
|
223
223
|
* Director de Builds.
|
|
224
224
|
*/
|
|
225
225
|
declare class VSECDirector {
|
|
226
226
|
private builder;
|
|
227
|
-
constructor(builder: IEChartBuilder);
|
|
227
|
+
constructor(builder: IEChartBuilder<any, ISeriesLayoutOpts>);
|
|
228
228
|
makeBar(data: IEChartData, overrides: IOptionsOverridesWrapper, opts?: MakeBarOpts): void;
|
|
229
229
|
makeBarRadial(data: IEChartData, overrides: IOptionsOverridesWrapper, opts?: MakeBarOpts): void;
|
|
230
230
|
makeLine(data: IEChartData, overrides: IOptionsOverridesWrapper, opts?: MakeLineOpts): void;
|
|
@@ -243,11 +243,11 @@ declare abstract class BaseEchartsComponent implements OnChanges, OnDestroy {
|
|
|
243
243
|
data: IEChartData;
|
|
244
244
|
optionsOverrides: IOptionsOverridesWrapper;
|
|
245
245
|
/** Paleta de colores básica */
|
|
246
|
-
palette
|
|
246
|
+
palette?: string[];
|
|
247
247
|
/** Resolver de colores dinámico (Callback) */
|
|
248
248
|
colorResolver?: ChartColorResolver;
|
|
249
249
|
/** Formateador de valores para etiquetas y tooltips */
|
|
250
|
-
valueFormatter
|
|
250
|
+
valueFormatter?: EChartValueFormatter;
|
|
251
251
|
chartClick: EventEmitter<{
|
|
252
252
|
type: EChartClickType;
|
|
253
253
|
data: any;
|
|
@@ -276,12 +276,14 @@ declare abstract class BaseEchartsComponent implements OnChanges, OnDestroy {
|
|
|
276
276
|
*/
|
|
277
277
|
protected abstract baseSeriesOptions: SeriesOption;
|
|
278
278
|
protected chartInstance?: echarts.ECharts;
|
|
279
|
+
protected vsEchartsConfig: _visionaris_bruno_vs_echarts.VSEchartsConfig | null;
|
|
279
280
|
/** Opciones de inicializacion de echarts
|
|
280
281
|
*
|
|
281
282
|
* NgxEchartsDirective.initOpts
|
|
282
283
|
*/
|
|
283
284
|
initOptions: {
|
|
284
|
-
renderer:
|
|
285
|
+
renderer: "canvas" | "svg";
|
|
286
|
+
locale: _visionaris_bruno_vs_echarts.VSEchartsLocale | undefined;
|
|
285
287
|
};
|
|
286
288
|
constructor();
|
|
287
289
|
ngOnChanges(changes: SimpleChanges): void;
|
|
@@ -359,9 +361,9 @@ declare class RingBuilder implements IEChartBuilder<PieSeriesOption> {
|
|
|
359
361
|
addAngleAxis(data: IEChartData, overrides: IOptionsOverrides["axis"]): void;
|
|
360
362
|
addDataZoom(): void;
|
|
361
363
|
addDataset(data: IEChartData, opts?: any): void;
|
|
362
|
-
setValueFormatter(formatter: EChartValueFormatter): void;
|
|
363
|
-
setPalette(palette: string[]): void;
|
|
364
|
-
setColorResolver(resolver: ChartColorResolver): void;
|
|
364
|
+
setValueFormatter(formatter: EChartValueFormatter | undefined): void;
|
|
365
|
+
setPalette(palette: string[] | undefined): void;
|
|
366
|
+
setColorResolver(resolver: ChartColorResolver | undefined): void;
|
|
365
367
|
getResult(): EChartsOption;
|
|
366
368
|
private formatCellValue;
|
|
367
369
|
}
|
|
@@ -425,9 +427,9 @@ declare class PieBuilder implements IEChartBuilder<PieSeriesOption> {
|
|
|
425
427
|
addGraphic(): void;
|
|
426
428
|
addDataZoom(): void;
|
|
427
429
|
addDataset(data: IEChartData, opts?: any): void;
|
|
428
|
-
setValueFormatter(formatter: EChartValueFormatter): void;
|
|
429
|
-
setPalette(palette: string[]): void;
|
|
430
|
-
setColorResolver(resolver: ChartColorResolver): void;
|
|
430
|
+
setValueFormatter(formatter: EChartValueFormatter | undefined): void;
|
|
431
|
+
setPalette(palette: string[] | undefined): void;
|
|
432
|
+
setColorResolver(resolver: ChartColorResolver | undefined): void;
|
|
431
433
|
getResult(): EChartsOption;
|
|
432
434
|
private formatCellValue;
|
|
433
435
|
}
|
|
@@ -498,7 +500,6 @@ declare class EchartsFunnelComponent extends BaseEchartsComponent {
|
|
|
498
500
|
static ɵcmp: i0.ɵɵComponentDeclaration<EchartsFunnelComponent, "vs-echarts-funnel", never, {}, {}, never, never, true, never>;
|
|
499
501
|
}
|
|
500
502
|
|
|
501
|
-
type EChartBuilderSeriesConfigOpts = ISeriesLayoutOpts & {};
|
|
502
503
|
/**
|
|
503
504
|
* Builder principal.
|
|
504
505
|
*
|
|
@@ -506,7 +507,7 @@ type EChartBuilderSeriesConfigOpts = ISeriesLayoutOpts & {};
|
|
|
506
507
|
*
|
|
507
508
|
* Puede verse utilizado en graficos como Lineas y Bars. Siempre que se pueda priorizar utilizar este.
|
|
508
509
|
*/
|
|
509
|
-
declare class EChartBuilder implements IEChartBuilder<SeriesOption & BarSeriesOption & LineSeriesOption & ScatterSeriesOption,
|
|
510
|
+
declare class EChartBuilder implements IEChartBuilder<SeriesOption & BarSeriesOption & LineSeriesOption & ScatterSeriesOption, ISeriesLayoutOpts> {
|
|
510
511
|
baseProduct: VSEChartProduct;
|
|
511
512
|
protected valueFormatter: EChartValueFormatter;
|
|
512
513
|
protected palette: string[];
|
|
@@ -521,7 +522,7 @@ declare class EChartBuilder implements IEChartBuilder<SeriesOption & BarSeriesOp
|
|
|
521
522
|
* @param overrides
|
|
522
523
|
* @returns
|
|
523
524
|
*/
|
|
524
|
-
addSeries(data: IEChartData, overrides: BarSeriesOption & LineSeriesOption & ScatterSeriesOption, opts?: ISeriesLayoutOpts): void;
|
|
525
|
+
addSeries(data: IEChartData, overrides: SeriesOption & BarSeriesOption & LineSeriesOption & ScatterSeriesOption, opts?: ISeriesLayoutOpts): void;
|
|
525
526
|
/**
|
|
526
527
|
* TODO: Mejorar funcion, no me convence como se implemento el tooltip formatter.
|
|
527
528
|
* @param data
|
|
@@ -535,7 +536,7 @@ declare class EChartBuilder implements IEChartBuilder<SeriesOption & BarSeriesOp
|
|
|
535
536
|
addAngleAxis(data: IEChartData, overrides: IOptionsOverrides["axis"]): void;
|
|
536
537
|
addLegend(): void;
|
|
537
538
|
addGraphic(): void;
|
|
538
|
-
addDataset(data: IEChartData): void;
|
|
539
|
+
addDataset(data: IEChartData, opts?: any): void;
|
|
539
540
|
addDataZoom(): void;
|
|
540
541
|
getResult(): EChartsOption;
|
|
541
542
|
/**
|
|
@@ -554,8 +555,8 @@ declare class EChartBuilder implements IEChartBuilder<SeriesOption & BarSeriesOp
|
|
|
554
555
|
* Permite inyectar un resolver de colores dinámico.
|
|
555
556
|
*/
|
|
556
557
|
setColorResolver(resolver: ChartColorResolver): void;
|
|
557
|
-
|
|
558
|
-
|
|
558
|
+
protected getCategoryAxisOptions(data: IEChartData, overrides: IOptionsOverrides["axis"]): CategoryAxisBaseOption;
|
|
559
|
+
protected getValueAxisOptions(data: IEChartData, overrides: IOptionsOverrides["axis"]): any;
|
|
559
560
|
}
|
|
560
561
|
|
|
561
562
|
declare abstract class EchartsBarComponent extends BaseEchartsComponent {
|
|
@@ -680,6 +681,7 @@ declare class SunburstBuilder implements IEChartBuilder<SunburstSeriesOption> {
|
|
|
680
681
|
addSeries(data: IEChartData, overrides: SunburstSeriesOption): void;
|
|
681
682
|
addTooltip(data: IEChartData, overrides: ITooltipOptionsOverrides): void;
|
|
682
683
|
addCommons(): void;
|
|
684
|
+
addGraphic(): void;
|
|
683
685
|
getResult(): EChartsOption;
|
|
684
686
|
addPolar(): void;
|
|
685
687
|
addXAxis(data: IEChartData, overrides: IOptionsOverrides["axis"], type: "category" | "value"): void;
|
|
@@ -689,7 +691,6 @@ declare class SunburstBuilder implements IEChartBuilder<SunburstSeriesOption> {
|
|
|
689
691
|
addLegend(): void;
|
|
690
692
|
addDataZoom(): void;
|
|
691
693
|
addDataset(data: IEChartData, opts?: any): void;
|
|
692
|
-
addGraphic(): void;
|
|
693
694
|
/**
|
|
694
695
|
* Permite inyectar un formateador de valores externo.
|
|
695
696
|
*/
|
|
@@ -740,9 +741,9 @@ declare class SankeyBuilder implements IEChartBuilder<SankeySeriesOption> {
|
|
|
740
741
|
addCommons(): void;
|
|
741
742
|
addGraphic(): void;
|
|
742
743
|
getResult(): EChartsOption;
|
|
743
|
-
setValueFormatter(formatter: EChartValueFormatter): void;
|
|
744
|
-
setPalette(palette: string[]): void;
|
|
745
|
-
setColorResolver(resolver: ChartColorResolver): void;
|
|
744
|
+
setValueFormatter(formatter: EChartValueFormatter | undefined): void;
|
|
745
|
+
setPalette(palette: string[] | undefined): void;
|
|
746
|
+
setColorResolver(resolver: ChartColorResolver | undefined): void;
|
|
746
747
|
}
|
|
747
748
|
|
|
748
749
|
declare class EchartsSankeyComponent extends BaseEchartsComponent {
|
|
@@ -765,5 +766,5 @@ declare class EChartsHBoxplotComponent extends BaseEchartsComponent {
|
|
|
765
766
|
static ɵcmp: i0.ɵɵComponentDeclaration<EChartsHBoxplotComponent, "vs-echarts-hboxplot", never, {}, {}, never, never, true, never>;
|
|
766
767
|
}
|
|
767
768
|
|
|
768
|
-
export { BaseEchartsComponent, EChartsAreaComponent, EChartsAreaStackComponent, EChartsBarStackedComponent, EChartsBarStackedRadialComponent, EChartsHBarComponent, EChartsHBarStackedComponent, EChartsHBoxplotComponent, EChartsSunburstComponent, EchartsBarComponent, EchartsFunnelComponent, EchartsLineComponent, EchartsPieComponent, EchartsRingComponent, EchartsSankeyComponent, EchartsScatterComponent,
|
|
769
|
-
export type {
|
|
769
|
+
export { BaseEchartsComponent, EChartsAreaComponent, EChartsAreaStackComponent, EChartsBarStackedComponent, EChartsBarStackedRadialComponent, EChartsHBarComponent, EChartsHBarStackedComponent, EChartsHBoxplotComponent, EChartsSunburstComponent, EchartsBarComponent, EchartsFunnelComponent, EchartsLineComponent, EchartsPieComponent, EchartsRingComponent, EchartsSankeyComponent, EchartsScatterComponent, VSEchartsConfigService, defaultOptionsOverrides };
|
|
770
|
+
export type { ChartColorResolver, ChartOrientation, EChartClickType, EChartValueFormatter, IAreaOptionsOverrides, IAreaStackOptionsOverrides, IAxisOptionsOverrides, IBarOptionsOverrides, IBarStackedOptionsOverrides, IBarStackedRadialOptionsOverrides, IBoxplotOptionsOverrides, IEChartBuilder, IEChartData, IEChartDataNode, IEChartDimension, IFunnelOptionsOverrides, IHBarOptionsOverrides, IHBarStackedOptionsOverrides, IHBoxplotOptionsOverrides, ILineOptionsOverrides, IOptionsOverrides, IOptionsOverridesWrapper, IPieOptionsOverrides, IRingOptionsOverrides, ISankeyOptionsOverrides, IScatterOptionsOverrides, ISeriesLayoutOpts, ISunburstOptionsOverrides, ITooltipOptionsOverrides, NGXEchartsSelectChangeEventData, VSEChartProduct, VSEchartsConfig, VSEchartsLocale };
|
package/package.json
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@visionaris-bruno/vs-echarts",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.6.0",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"@angular/common": "^20.3.0",
|
|
6
6
|
"@angular/core": "^20.3.0",
|
|
7
|
+
"@ngx-translate/core": "^15.0.0",
|
|
7
8
|
"echarts": "^6.0.0",
|
|
8
9
|
"lodash": "^4.17.21",
|
|
9
10
|
"ngx-echarts": "^20.0.1",
|