@visionaris-bruno/vs-echarts 6.5.2 → 7.1.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,7 +1,7 @@
|
|
|
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, ScatterSeriesOption, FunnelSeriesOption, EChartsOption, SeriesOption } from 'echarts';
|
|
4
|
+
import { LineSeriesOption, BarSeriesOption, PieSeriesOption, ScatterSeriesOption, FunnelSeriesOption, SunburstSeriesOption, EChartsOption, SeriesOption } from 'echarts';
|
|
5
5
|
import { CategoryAxisBaseOption, ValueAxisBaseOption } from 'echarts/types/src/coord/axisCommonTypes.js';
|
|
6
6
|
import { TooltipOption } from 'echarts/types/dist/shared';
|
|
7
7
|
|
|
@@ -13,11 +13,16 @@ type VSEChartProduct = {
|
|
|
13
13
|
chartKey: ChartKey;
|
|
14
14
|
baseOptions: EChartsOption;
|
|
15
15
|
};
|
|
16
|
-
interface IEChartBuilder {
|
|
16
|
+
interface IEChartBuilder<SeriesType = SeriesOption> {
|
|
17
17
|
/** producto base */
|
|
18
18
|
baseProduct: VSEChartProduct;
|
|
19
19
|
reset(): void;
|
|
20
|
-
|
|
20
|
+
/**
|
|
21
|
+
* TODO: addSeries debe recibir el tipo de overrides por parametro SeriesType
|
|
22
|
+
* @param data
|
|
23
|
+
* @param overrides
|
|
24
|
+
*/
|
|
25
|
+
addSeries(data: IEChartData, overrides: SeriesOption & BarSeriesOption & LineSeriesOption & ScatterSeriesOption & SunburstSeriesOption): void;
|
|
21
26
|
addTooltip(data: IEChartData, overrides: ITooltipOptionsOverrides): void;
|
|
22
27
|
addPolar(): void;
|
|
23
28
|
addXAxis(data: {
|
|
@@ -70,6 +75,9 @@ interface IScatterOptionsOverrides {
|
|
|
70
75
|
interface IFunnelOptionsOverrides {
|
|
71
76
|
series?: Partial<FunnelSeriesOption>;
|
|
72
77
|
}
|
|
78
|
+
interface ISunburstOptionsOverrides {
|
|
79
|
+
series?: Partial<SunburstSeriesOption>;
|
|
80
|
+
}
|
|
73
81
|
interface IAxisOptionsOverrides {
|
|
74
82
|
categoryAxis: CategoryAxisBaseOption[];
|
|
75
83
|
valueAxis: ValueAxisBaseOption[];
|
|
@@ -96,6 +104,8 @@ interface IOptionsOverrides {
|
|
|
96
104
|
scatter: IScatterOptionsOverrides;
|
|
97
105
|
/** funnel options overrides */
|
|
98
106
|
funnel: IFunnelOptionsOverrides;
|
|
107
|
+
/** sunburst options overrides */
|
|
108
|
+
sunburst: ISunburstOptionsOverrides;
|
|
99
109
|
}
|
|
100
110
|
type NGXEchartsSelectChangeEventData = {
|
|
101
111
|
type: string;
|
|
@@ -116,14 +126,25 @@ type NGXEchartsSelectChangeEventData = {
|
|
|
116
126
|
};
|
|
117
127
|
|
|
118
128
|
/**
|
|
119
|
-
*
|
|
129
|
+
* IEChartCategoryNode
|
|
120
130
|
*
|
|
121
|
-
*
|
|
131
|
+
* Representa un nodo en el árbol de categorías (filas).
|
|
122
132
|
*/
|
|
123
|
-
interface
|
|
133
|
+
interface IEChartCategoryNode {
|
|
134
|
+
name: string;
|
|
135
|
+
key?: string;
|
|
136
|
+
children?: IEChartCategoryNode[];
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* IEChartSeriesNode
|
|
140
|
+
*
|
|
141
|
+
* Representa un nodo en el árbol de series (columnas/medidas).
|
|
142
|
+
*/
|
|
143
|
+
interface IEChartSeriesNode {
|
|
124
144
|
name: string;
|
|
125
|
-
data: number[];
|
|
126
145
|
originalKey?: string;
|
|
146
|
+
data: number[];
|
|
147
|
+
children?: IEChartSeriesNode[];
|
|
127
148
|
}
|
|
128
149
|
/**
|
|
129
150
|
* IEChartData
|
|
@@ -132,9 +153,8 @@ interface IEChartSeries {
|
|
|
132
153
|
*
|
|
133
154
|
*/
|
|
134
155
|
interface IEChartData {
|
|
135
|
-
categories:
|
|
136
|
-
|
|
137
|
-
series: IEChartSeries[];
|
|
156
|
+
categories: IEChartCategoryNode[];
|
|
157
|
+
series: IEChartSeriesNode[];
|
|
138
158
|
}
|
|
139
159
|
/**
|
|
140
160
|
* EChartValueFormatter
|
|
@@ -195,6 +215,7 @@ declare class VSECDirector {
|
|
|
195
215
|
makeRing(data: IEChartData, overrides: IOptionsOverridesWrapper, opts?: MakeOpts): void;
|
|
196
216
|
makePie(data: IEChartData, overrides: IOptionsOverridesWrapper, opts?: MakeOpts): void;
|
|
197
217
|
makeFunnel(data: IEChartData, overrides: IOptionsOverridesWrapper, opts?: MakeOpts): void;
|
|
218
|
+
makeSunburst(data: IEChartData, overrides: IOptionsOverridesWrapper, opts?: MakeOpts): void;
|
|
198
219
|
}
|
|
199
220
|
|
|
200
221
|
declare abstract class BaseEchartsComponent implements OnChanges, OnDestroy {
|
|
@@ -229,7 +250,7 @@ declare abstract class BaseEchartsComponent implements OnChanges, OnDestroy {
|
|
|
229
250
|
* Ver: https://refactoring.guru/es/design-patterns/builder
|
|
230
251
|
*/
|
|
231
252
|
protected abstract director: VSECDirector;
|
|
232
|
-
protected abstract make(makeOpts
|
|
253
|
+
protected abstract make(makeOpts?: MakeOpts): void;
|
|
233
254
|
/**
|
|
234
255
|
* Opciones de series escenciales, inmutables y estaticas minimas
|
|
235
256
|
* necesarias para el dibujado de las series del grafico.
|
|
@@ -652,5 +673,53 @@ declare abstract class EchartsScatterComponent extends BaseEchartsComponent {
|
|
|
652
673
|
static ɵcmp: i0.ɵɵComponentDeclaration<EchartsScatterComponent, "vs-echarts-scatter", never, {}, {}, never, never, true, never>;
|
|
653
674
|
}
|
|
654
675
|
|
|
655
|
-
|
|
656
|
-
|
|
676
|
+
declare class SunburstBuilder implements IEChartBuilder<SunburstSeriesOption> {
|
|
677
|
+
baseProduct: VSEChartProduct;
|
|
678
|
+
protected valueFormatter: EChartValueFormatter;
|
|
679
|
+
protected palette: string[];
|
|
680
|
+
protected colorResolver?: ChartColorResolver;
|
|
681
|
+
protected result: EChartsOption;
|
|
682
|
+
constructor(baseProduct: VSEChartProduct);
|
|
683
|
+
reset(): void;
|
|
684
|
+
addSeries(data: IEChartData, overrides: SunburstSeriesOption): void;
|
|
685
|
+
addTooltip(data: IEChartData, overrides: ITooltipOptionsOverrides): void;
|
|
686
|
+
addPolar(): void;
|
|
687
|
+
addXAxis(data: {
|
|
688
|
+
categories: IEChartData["categories"];
|
|
689
|
+
}, overrides: IOptionsOverrides["axis"], type: "category" | "value"): void;
|
|
690
|
+
addYAxis(data: {
|
|
691
|
+
categories: IEChartData["categories"];
|
|
692
|
+
}, overrides: IOptionsOverrides["axis"], type: "category" | "value"): void;
|
|
693
|
+
addRadiusAxis(data: IEChartData, overrides: IOptionsOverrides["axis"]): void;
|
|
694
|
+
addAngleAxis(data: IEChartData, overrides: IOptionsOverrides["axis"]): void;
|
|
695
|
+
addLegend(): void;
|
|
696
|
+
addCommons(): void;
|
|
697
|
+
addGraphic(): void;
|
|
698
|
+
getResult(): EChartsOption;
|
|
699
|
+
/**
|
|
700
|
+
* Permite inyectar un formateador de valores externo.
|
|
701
|
+
*/
|
|
702
|
+
setValueFormatter(formatter: EChartValueFormatter): void;
|
|
703
|
+
/**
|
|
704
|
+
* Permite inyectar una paleta de colores básica.
|
|
705
|
+
*/
|
|
706
|
+
setPalette(palette: string[]): void;
|
|
707
|
+
/**
|
|
708
|
+
* Permite inyectar un resolver de colores dinámico.
|
|
709
|
+
*/
|
|
710
|
+
setColorResolver(resolver: ChartColorResolver): void;
|
|
711
|
+
}
|
|
712
|
+
|
|
713
|
+
declare class EChartsSunburstComponent extends BaseEchartsComponent {
|
|
714
|
+
protected baseSeriesOptions: SunburstSeriesOption;
|
|
715
|
+
protected baseProduct: VSEChartProduct;
|
|
716
|
+
protected builder: SunburstBuilder;
|
|
717
|
+
protected director: VSECDirector;
|
|
718
|
+
protected make(): void;
|
|
719
|
+
protected updateChartOptions(): void;
|
|
720
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<EChartsSunburstComponent, never>;
|
|
721
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<EChartsSunburstComponent, "vs-echarts-sunburst", never, {}, {}, never, never, true, never>;
|
|
722
|
+
}
|
|
723
|
+
|
|
724
|
+
export { BaseEchartsComponent, EChartsAreaComponent, EChartsAreaStackComponent, EChartsBarStackedComponent, EChartsBarStackedRadialComponent, EChartsHBarComponent, EChartsHBarStackedComponent, EChartsSunburstComponent, EchartsBarComponent, EchartsFunnelComponent, EchartsLineComponent, EchartsPieComponent, EchartsRingComponent, EchartsScatterComponent, defaultOptionsOverrides, initializeEcharts, provideVSEcharts };
|
|
725
|
+
export type { ChartColorResolver, ChartOrientation, EChartClickType, EChartValueFormatter, IAreaOptionsOverrides, IAreaStackOptionsOverrides, IAxisOptionsOverrides, IBarOptionsOverrides, IBarStackedOptionsOverrides, IBarStackedRadialOptionsOverrides, IEChartBuilder, IEChartCategoryNode, IEChartData, IEChartSeriesNode, IFunnelOptionsOverrides, IHBarOptionsOverrides, IHBarStackedOptionsOverrides, ILineOptionsOverrides, IOptionsOverrides, IOptionsOverridesWrapper, IPieOptionsOverrides, IRingOptionsOverrides, IScatterOptionsOverrides, ISunburstOptionsOverrides, ITooltipOptionsOverrides, NGXEchartsSelectChangeEventData, VSEChartProduct };
|