@univerjs-pro/engine-chart 1.0.0-alpha.0 → 1.0.0-alpha.2
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/lib/cjs/index.js +1 -1
- package/lib/es/index.js +1 -1
- package/lib/index.js +1 -1
- package/lib/types/index.d.ts +6 -3
- package/lib/types/models/chart-data-operators/operators.d.ts +1 -2
- package/lib/types/models/chart-model.d.ts +45 -0
- package/lib/types/models/chart-runtime-style.d.ts +1 -0
- package/lib/types/models/echart-render-model.d.ts +7 -3
- package/lib/types/models/image-chart-host.d.ts +17 -0
- package/lib/types/models/mode-converter/render-spec-operators/legend-size.d.ts +2 -0
- package/lib/types/models/offscreen-chart-host.d.ts +7 -0
- package/lib/types/types.d.ts +93 -1
- package/lib/types/utils/echarts.d.ts +1 -1
- package/lib/types/wordcloud-chart/adapters/echarts/install.d.ts +1 -0
- package/lib/types/wordcloud-chart/adapters/echarts/runtime-cache.d.ts +29 -0
- package/lib/umd/index.js +1 -1
- package/package.json +4 -4
package/lib/types/index.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
export { AreaLineStyle, AxisAlignEnum, AxisValueType, CategoryType, ChartAttributeBits, ChartBorderDashType, ChartSourceDataTypeEnum, ChartTrendlineType, ChartTypeBits, DataOrientation, InvalidValueType, IRuntimeAxisPosition, IRuntimeAxisPriority, LabelAlignEnum, LabelContentType, LegendPositionEnum, LinePointShape, PieLabelPosition, RadarShape, RelationChartLayoutEnum, SelectModeEnum, SeriesLabelPosition, StackType, TextAlign, TextVerticalAlign, TitlePositionEnum, WaterfallSeriesTypeEnum, WaterfallStackTypeEnum, WordCloudShapeEnum, } from './enum';
|
|
2
2
|
export { buildChartData } from './models/chart-data-operators/build-chart-data';
|
|
3
|
-
export { defaultChartContextOperators, findCategoryIndexes,
|
|
3
|
+
export { defaultChartContextOperators, findCategoryIndexes, findSeriesOperator, generateChartModelContextByOperators, inferChartContextOperator, pieSeriesFilterOperator, } from './models/chart-data-operators/operators';
|
|
4
4
|
export type { IChartLocaleTexts } from './models/chart-locale-texts';
|
|
5
5
|
export { getDefaultChartLocaleTexts, replaceLocaleParams } from './models/chart-locale-texts';
|
|
6
6
|
export { ChartModel } from './models/chart-model';
|
|
7
7
|
export { CHART_DEBOUNCE_TIME } from './models/chart-model';
|
|
8
|
-
export { resolveChartRuntimeStyle } from './models/chart-runtime-style';
|
|
8
|
+
export { resolveChartRuntimeStyle, resolveChartStyleBackgroundColor } from './models/chart-runtime-style';
|
|
9
9
|
export { ChartThemeService, registerChartThemeService } from './models/chart-theme.service';
|
|
10
10
|
export { getThemeAxesByType } from './models/constants/build-in-theme';
|
|
11
11
|
export { themeDefault, UniverTheme1, UniverTheme2, UniverTheme3, UniverTheme4, UniverTheme5, UniverTheme6, UniverThemeGradient1, UniverThemeGradient2, UniverThemeGradient3, UniverThemeGradient4, UniverThemeGradient5, UniverThemeGradient6, } from './models/constants/build-in-theme';
|
|
@@ -16,12 +16,15 @@ export { defaultChartConfig, RTLChartStyle, themeColors } from './models/constan
|
|
|
16
16
|
export { EChartRenderModel } from './models/echart-render-model';
|
|
17
17
|
export type { IEChartRenderModelOptions } from './models/echart-render-model';
|
|
18
18
|
export { echartToChartModelInit, isChartModelInit } from './models/echart-to-chart-model-init';
|
|
19
|
+
export { chartImageSourceToDataUrl, ImageChartHost } from './models/image-chart-host';
|
|
19
20
|
export type { IChartModelInitParams } from './models/mode-converter/mode-converter';
|
|
20
21
|
export { convertModelFromInitData, convertModelToSpec, generateChartModelContext } from './models/mode-converter/mode-converter';
|
|
22
|
+
export { OffscreenChartHost } from './models/offscreen-chart-host';
|
|
21
23
|
export { registerWordCloudChartMakImageService, WordCloudMuskImageService } from './models/word-cloud-musk-image.service';
|
|
22
24
|
export { ChartDataSource } from './source/chart-source';
|
|
23
25
|
export { StaticChartSource } from './source/static-chart-source';
|
|
24
|
-
export
|
|
26
|
+
export { ChartImageSourceType } from './types';
|
|
27
|
+
export type { ChartDataSourceValue, ChartDataSourceValues, ChartHostRenderMode, ChartImageSource, DimensionDefinitionLoose, IChartDataSource, IChartHost, IChartHostLease, IChartHostStyle, IChartRenderAsImageOptions, IChartRenderInput, IChartRenderInstance, IChartRenderInstanceCreateContext, IChartRenderInstanceSpecInput, IChartRenderInstanceStyleInput, IDimensionDefinition, IDomChartHost, IImageChartHost, IUniverDataSet, OptionDataValue, } from './types';
|
|
25
28
|
export type { ChartDirection, ChartStyle, DeepPartial, IAllSeriesStyle, IAxisOptions, IChartConfig, IChartContext, IChartData, IChartDataAggregation, IChartDataCategory, IChartDataSeries, IChartHostRect, IChartInstance, IChartRenderModel, IChartSnapshot, IChartStyle, IGridLineStyle, ILabelStyle, ILegendStyle, IPieLabelStyle, IPointStyle, IRelationForceOptions, IRuntimeAxis, ISeriesLabelStyle, ISeriesStyle, ITrendLine, RightYAxisOptions, } from './types';
|
|
26
29
|
export { chartBitsUtils, chartTypeCanUseTrendLine } from './util';
|
|
27
30
|
export * from './utils/echarts';
|
|
@@ -12,8 +12,7 @@ export declare function countTypesFromArray(arrayData: Array<OptionDataValue | u
|
|
|
12
12
|
};
|
|
13
13
|
export declare function toColumnOrient<T = any>(dataSource: T[][]): T[][];
|
|
14
14
|
export declare function findCategoryIndexes(dataSource: ChartDataSource): number[];
|
|
15
|
-
export declare const
|
|
16
|
-
export declare const findCategoryOperator: IChartContextOperator;
|
|
15
|
+
export declare const inferChartContextOperator: IChartContextOperator;
|
|
17
16
|
export declare const findSeriesOperator: IChartContextOperator;
|
|
18
17
|
export declare const pieSeriesFilterOperator: IChartContextOperator;
|
|
19
18
|
export declare const defaultChartContextOperators: IChartContextOperator[];
|
|
@@ -438,6 +438,7 @@ export declare class ChartModel extends Disposable {
|
|
|
438
438
|
} | undefined;
|
|
439
439
|
dataPoints?: {
|
|
440
440
|
[x: number]: {
|
|
441
|
+
fillOpacity?: number | undefined;
|
|
441
442
|
shape?: import("..").LinePointShape | undefined;
|
|
442
443
|
size?: number | undefined;
|
|
443
444
|
color?: import("@univerjs/core").Nullable<string>;
|
|
@@ -483,6 +484,7 @@ export declare class ChartModel extends Disposable {
|
|
|
483
484
|
} | undefined;
|
|
484
485
|
dataPoints?: {
|
|
485
486
|
[x: number]: {
|
|
487
|
+
fillOpacity?: number | undefined;
|
|
486
488
|
shape?: import("..").LinePointShape | undefined;
|
|
487
489
|
size?: number | undefined;
|
|
488
490
|
color?: import("@univerjs/core").Nullable<string>;
|
|
@@ -528,6 +530,7 @@ export declare class ChartModel extends Disposable {
|
|
|
528
530
|
} | undefined;
|
|
529
531
|
dataPoints?: {
|
|
530
532
|
[x: number]: {
|
|
533
|
+
fillOpacity?: number | undefined;
|
|
531
534
|
shape?: import("..").LinePointShape | undefined;
|
|
532
535
|
size?: number | undefined;
|
|
533
536
|
color?: import("@univerjs/core").Nullable<string>;
|
|
@@ -576,6 +579,7 @@ export declare class ChartModel extends Disposable {
|
|
|
576
579
|
} | undefined;
|
|
577
580
|
dataPoints?: {
|
|
578
581
|
[x: number]: {
|
|
582
|
+
fillOpacity?: number | undefined;
|
|
579
583
|
shape?: import("..").LinePointShape | undefined;
|
|
580
584
|
size?: number | undefined;
|
|
581
585
|
color?: import("@univerjs/core").Nullable<string>;
|
|
@@ -619,6 +623,7 @@ export declare class ChartModel extends Disposable {
|
|
|
619
623
|
} | undefined;
|
|
620
624
|
dataPoints?: {
|
|
621
625
|
[x: number]: {
|
|
626
|
+
fillOpacity?: number | undefined;
|
|
622
627
|
shape?: import("..").LinePointShape | undefined;
|
|
623
628
|
size?: number | undefined;
|
|
624
629
|
color?: import("@univerjs/core").Nullable<string>;
|
|
@@ -664,6 +669,7 @@ export declare class ChartModel extends Disposable {
|
|
|
664
669
|
} | undefined;
|
|
665
670
|
dataPoints?: {
|
|
666
671
|
[x: number]: {
|
|
672
|
+
fillOpacity?: number | undefined;
|
|
667
673
|
shape?: import("..").LinePointShape | undefined;
|
|
668
674
|
size?: number | undefined;
|
|
669
675
|
color?: import("@univerjs/core").Nullable<string>;
|
|
@@ -709,6 +715,7 @@ export declare class ChartModel extends Disposable {
|
|
|
709
715
|
} | undefined;
|
|
710
716
|
dataPoints?: {
|
|
711
717
|
[x: number]: {
|
|
718
|
+
fillOpacity?: number | undefined;
|
|
712
719
|
shape?: import("..").LinePointShape | undefined;
|
|
713
720
|
size?: number | undefined;
|
|
714
721
|
color?: import("@univerjs/core").Nullable<string>;
|
|
@@ -827,6 +834,7 @@ export declare class ChartModel extends Disposable {
|
|
|
827
834
|
} | undefined;
|
|
828
835
|
dataPoints?: {
|
|
829
836
|
[x: number]: {
|
|
837
|
+
fillOpacity?: number | undefined;
|
|
830
838
|
shape?: import("..").LinePointShape | undefined;
|
|
831
839
|
size?: number | undefined;
|
|
832
840
|
color?: import("@univerjs/core").Nullable<string>;
|
|
@@ -870,6 +878,7 @@ export declare class ChartModel extends Disposable {
|
|
|
870
878
|
} | undefined;
|
|
871
879
|
dataPoints?: {
|
|
872
880
|
[x: number]: {
|
|
881
|
+
fillOpacity?: number | undefined;
|
|
873
882
|
shape?: import("..").LinePointShape | undefined;
|
|
874
883
|
size?: number | undefined;
|
|
875
884
|
color?: import("@univerjs/core").Nullable<string>;
|
|
@@ -915,6 +924,7 @@ export declare class ChartModel extends Disposable {
|
|
|
915
924
|
} | undefined;
|
|
916
925
|
dataPoints?: {
|
|
917
926
|
[x: number]: {
|
|
927
|
+
fillOpacity?: number | undefined;
|
|
918
928
|
shape?: import("..").LinePointShape | undefined;
|
|
919
929
|
size?: number | undefined;
|
|
920
930
|
color?: import("@univerjs/core").Nullable<string>;
|
|
@@ -960,6 +970,7 @@ export declare class ChartModel extends Disposable {
|
|
|
960
970
|
} | undefined;
|
|
961
971
|
dataPoints?: {
|
|
962
972
|
[x: number]: {
|
|
973
|
+
fillOpacity?: number | undefined;
|
|
963
974
|
shape?: import("..").LinePointShape | undefined;
|
|
964
975
|
size?: number | undefined;
|
|
965
976
|
color?: import("@univerjs/core").Nullable<string>;
|
|
@@ -1007,6 +1018,7 @@ export declare class ChartModel extends Disposable {
|
|
|
1007
1018
|
} | undefined;
|
|
1008
1019
|
dataPoints?: {
|
|
1009
1020
|
[x: number]: {
|
|
1021
|
+
fillOpacity?: number | undefined;
|
|
1010
1022
|
shape?: import("..").LinePointShape | undefined;
|
|
1011
1023
|
size?: number | undefined;
|
|
1012
1024
|
color?: import("@univerjs/core").Nullable<string>;
|
|
@@ -1050,6 +1062,7 @@ export declare class ChartModel extends Disposable {
|
|
|
1050
1062
|
} | undefined;
|
|
1051
1063
|
dataPoints?: {
|
|
1052
1064
|
[x: number]: {
|
|
1065
|
+
fillOpacity?: number | undefined;
|
|
1053
1066
|
shape?: import("..").LinePointShape | undefined;
|
|
1054
1067
|
size?: number | undefined;
|
|
1055
1068
|
color?: import("@univerjs/core").Nullable<string>;
|
|
@@ -1095,6 +1108,7 @@ export declare class ChartModel extends Disposable {
|
|
|
1095
1108
|
} | undefined;
|
|
1096
1109
|
dataPoints?: {
|
|
1097
1110
|
[x: number]: {
|
|
1111
|
+
fillOpacity?: number | undefined;
|
|
1098
1112
|
shape?: import("..").LinePointShape | undefined;
|
|
1099
1113
|
size?: number | undefined;
|
|
1100
1114
|
color?: import("@univerjs/core").Nullable<string>;
|
|
@@ -1140,6 +1154,7 @@ export declare class ChartModel extends Disposable {
|
|
|
1140
1154
|
} | undefined;
|
|
1141
1155
|
dataPoints?: {
|
|
1142
1156
|
[x: number]: {
|
|
1157
|
+
fillOpacity?: number | undefined;
|
|
1143
1158
|
shape?: import("..").LinePointShape | undefined;
|
|
1144
1159
|
size?: number | undefined;
|
|
1145
1160
|
color?: import("@univerjs/core").Nullable<string>;
|
|
@@ -1558,6 +1573,7 @@ export declare class ChartModel extends Disposable {
|
|
|
1558
1573
|
} | undefined;
|
|
1559
1574
|
dataPoints?: {
|
|
1560
1575
|
[x: number]: {
|
|
1576
|
+
fillOpacity?: number | undefined;
|
|
1561
1577
|
shape?: import("..").LinePointShape | undefined;
|
|
1562
1578
|
size?: number | undefined;
|
|
1563
1579
|
color?: import("@univerjs/core").Nullable<string>;
|
|
@@ -1603,6 +1619,7 @@ export declare class ChartModel extends Disposable {
|
|
|
1603
1619
|
} | undefined;
|
|
1604
1620
|
dataPoints?: {
|
|
1605
1621
|
[x: number]: {
|
|
1622
|
+
fillOpacity?: number | undefined;
|
|
1606
1623
|
shape?: import("..").LinePointShape | undefined;
|
|
1607
1624
|
size?: number | undefined;
|
|
1608
1625
|
color?: import("@univerjs/core").Nullable<string>;
|
|
@@ -1648,6 +1665,7 @@ export declare class ChartModel extends Disposable {
|
|
|
1648
1665
|
} | undefined;
|
|
1649
1666
|
dataPoints?: {
|
|
1650
1667
|
[x: number]: {
|
|
1668
|
+
fillOpacity?: number | undefined;
|
|
1651
1669
|
shape?: import("..").LinePointShape | undefined;
|
|
1652
1670
|
size?: number | undefined;
|
|
1653
1671
|
color?: import("@univerjs/core").Nullable<string>;
|
|
@@ -1696,6 +1714,7 @@ export declare class ChartModel extends Disposable {
|
|
|
1696
1714
|
} | undefined;
|
|
1697
1715
|
dataPoints?: {
|
|
1698
1716
|
[x: number]: {
|
|
1717
|
+
fillOpacity?: number | undefined;
|
|
1699
1718
|
shape?: import("..").LinePointShape | undefined;
|
|
1700
1719
|
size?: number | undefined;
|
|
1701
1720
|
color?: import("@univerjs/core").Nullable<string>;
|
|
@@ -1739,6 +1758,7 @@ export declare class ChartModel extends Disposable {
|
|
|
1739
1758
|
} | undefined;
|
|
1740
1759
|
dataPoints?: {
|
|
1741
1760
|
[x: number]: {
|
|
1761
|
+
fillOpacity?: number | undefined;
|
|
1742
1762
|
shape?: import("..").LinePointShape | undefined;
|
|
1743
1763
|
size?: number | undefined;
|
|
1744
1764
|
color?: import("@univerjs/core").Nullable<string>;
|
|
@@ -1784,6 +1804,7 @@ export declare class ChartModel extends Disposable {
|
|
|
1784
1804
|
} | undefined;
|
|
1785
1805
|
dataPoints?: {
|
|
1786
1806
|
[x: number]: {
|
|
1807
|
+
fillOpacity?: number | undefined;
|
|
1787
1808
|
shape?: import("..").LinePointShape | undefined;
|
|
1788
1809
|
size?: number | undefined;
|
|
1789
1810
|
color?: import("@univerjs/core").Nullable<string>;
|
|
@@ -1829,6 +1850,7 @@ export declare class ChartModel extends Disposable {
|
|
|
1829
1850
|
} | undefined;
|
|
1830
1851
|
dataPoints?: {
|
|
1831
1852
|
[x: number]: {
|
|
1853
|
+
fillOpacity?: number | undefined;
|
|
1832
1854
|
shape?: import("..").LinePointShape | undefined;
|
|
1833
1855
|
size?: number | undefined;
|
|
1834
1856
|
color?: import("@univerjs/core").Nullable<string>;
|
|
@@ -1947,6 +1969,7 @@ export declare class ChartModel extends Disposable {
|
|
|
1947
1969
|
} | undefined;
|
|
1948
1970
|
dataPoints?: {
|
|
1949
1971
|
[x: number]: {
|
|
1972
|
+
fillOpacity?: number | undefined;
|
|
1950
1973
|
shape?: import("..").LinePointShape | undefined;
|
|
1951
1974
|
size?: number | undefined;
|
|
1952
1975
|
color?: import("@univerjs/core").Nullable<string>;
|
|
@@ -1990,6 +2013,7 @@ export declare class ChartModel extends Disposable {
|
|
|
1990
2013
|
} | undefined;
|
|
1991
2014
|
dataPoints?: {
|
|
1992
2015
|
[x: number]: {
|
|
2016
|
+
fillOpacity?: number | undefined;
|
|
1993
2017
|
shape?: import("..").LinePointShape | undefined;
|
|
1994
2018
|
size?: number | undefined;
|
|
1995
2019
|
color?: import("@univerjs/core").Nullable<string>;
|
|
@@ -2035,6 +2059,7 @@ export declare class ChartModel extends Disposable {
|
|
|
2035
2059
|
} | undefined;
|
|
2036
2060
|
dataPoints?: {
|
|
2037
2061
|
[x: number]: {
|
|
2062
|
+
fillOpacity?: number | undefined;
|
|
2038
2063
|
shape?: import("..").LinePointShape | undefined;
|
|
2039
2064
|
size?: number | undefined;
|
|
2040
2065
|
color?: import("@univerjs/core").Nullable<string>;
|
|
@@ -2080,6 +2105,7 @@ export declare class ChartModel extends Disposable {
|
|
|
2080
2105
|
} | undefined;
|
|
2081
2106
|
dataPoints?: {
|
|
2082
2107
|
[x: number]: {
|
|
2108
|
+
fillOpacity?: number | undefined;
|
|
2083
2109
|
shape?: import("..").LinePointShape | undefined;
|
|
2084
2110
|
size?: number | undefined;
|
|
2085
2111
|
color?: import("@univerjs/core").Nullable<string>;
|
|
@@ -2127,6 +2153,7 @@ export declare class ChartModel extends Disposable {
|
|
|
2127
2153
|
} | undefined;
|
|
2128
2154
|
dataPoints?: {
|
|
2129
2155
|
[x: number]: {
|
|
2156
|
+
fillOpacity?: number | undefined;
|
|
2130
2157
|
shape?: import("..").LinePointShape | undefined;
|
|
2131
2158
|
size?: number | undefined;
|
|
2132
2159
|
color?: import("@univerjs/core").Nullable<string>;
|
|
@@ -2170,6 +2197,7 @@ export declare class ChartModel extends Disposable {
|
|
|
2170
2197
|
} | undefined;
|
|
2171
2198
|
dataPoints?: {
|
|
2172
2199
|
[x: number]: {
|
|
2200
|
+
fillOpacity?: number | undefined;
|
|
2173
2201
|
shape?: import("..").LinePointShape | undefined;
|
|
2174
2202
|
size?: number | undefined;
|
|
2175
2203
|
color?: import("@univerjs/core").Nullable<string>;
|
|
@@ -2215,6 +2243,7 @@ export declare class ChartModel extends Disposable {
|
|
|
2215
2243
|
} | undefined;
|
|
2216
2244
|
dataPoints?: {
|
|
2217
2245
|
[x: number]: {
|
|
2246
|
+
fillOpacity?: number | undefined;
|
|
2218
2247
|
shape?: import("..").LinePointShape | undefined;
|
|
2219
2248
|
size?: number | undefined;
|
|
2220
2249
|
color?: import("@univerjs/core").Nullable<string>;
|
|
@@ -2260,6 +2289,7 @@ export declare class ChartModel extends Disposable {
|
|
|
2260
2289
|
} | undefined;
|
|
2261
2290
|
dataPoints?: {
|
|
2262
2291
|
[x: number]: {
|
|
2292
|
+
fillOpacity?: number | undefined;
|
|
2263
2293
|
shape?: import("..").LinePointShape | undefined;
|
|
2264
2294
|
size?: number | undefined;
|
|
2265
2295
|
color?: import("@univerjs/core").Nullable<string>;
|
|
@@ -2678,6 +2708,7 @@ export declare class ChartModel extends Disposable {
|
|
|
2678
2708
|
} | undefined;
|
|
2679
2709
|
dataPoints?: {
|
|
2680
2710
|
[x: number]: {
|
|
2711
|
+
fillOpacity?: number | undefined;
|
|
2681
2712
|
shape?: import("..").LinePointShape | undefined;
|
|
2682
2713
|
size?: number | undefined;
|
|
2683
2714
|
color?: import("@univerjs/core").Nullable<string>;
|
|
@@ -2723,6 +2754,7 @@ export declare class ChartModel extends Disposable {
|
|
|
2723
2754
|
} | undefined;
|
|
2724
2755
|
dataPoints?: {
|
|
2725
2756
|
[x: number]: {
|
|
2757
|
+
fillOpacity?: number | undefined;
|
|
2726
2758
|
shape?: import("..").LinePointShape | undefined;
|
|
2727
2759
|
size?: number | undefined;
|
|
2728
2760
|
color?: import("@univerjs/core").Nullable<string>;
|
|
@@ -2768,6 +2800,7 @@ export declare class ChartModel extends Disposable {
|
|
|
2768
2800
|
} | undefined;
|
|
2769
2801
|
dataPoints?: {
|
|
2770
2802
|
[x: number]: {
|
|
2803
|
+
fillOpacity?: number | undefined;
|
|
2771
2804
|
shape?: import("..").LinePointShape | undefined;
|
|
2772
2805
|
size?: number | undefined;
|
|
2773
2806
|
color?: import("@univerjs/core").Nullable<string>;
|
|
@@ -2816,6 +2849,7 @@ export declare class ChartModel extends Disposable {
|
|
|
2816
2849
|
} | undefined;
|
|
2817
2850
|
dataPoints?: {
|
|
2818
2851
|
[x: number]: {
|
|
2852
|
+
fillOpacity?: number | undefined;
|
|
2819
2853
|
shape?: import("..").LinePointShape | undefined;
|
|
2820
2854
|
size?: number | undefined;
|
|
2821
2855
|
color?: import("@univerjs/core").Nullable<string>;
|
|
@@ -2859,6 +2893,7 @@ export declare class ChartModel extends Disposable {
|
|
|
2859
2893
|
} | undefined;
|
|
2860
2894
|
dataPoints?: {
|
|
2861
2895
|
[x: number]: {
|
|
2896
|
+
fillOpacity?: number | undefined;
|
|
2862
2897
|
shape?: import("..").LinePointShape | undefined;
|
|
2863
2898
|
size?: number | undefined;
|
|
2864
2899
|
color?: import("@univerjs/core").Nullable<string>;
|
|
@@ -2904,6 +2939,7 @@ export declare class ChartModel extends Disposable {
|
|
|
2904
2939
|
} | undefined;
|
|
2905
2940
|
dataPoints?: {
|
|
2906
2941
|
[x: number]: {
|
|
2942
|
+
fillOpacity?: number | undefined;
|
|
2907
2943
|
shape?: import("..").LinePointShape | undefined;
|
|
2908
2944
|
size?: number | undefined;
|
|
2909
2945
|
color?: import("@univerjs/core").Nullable<string>;
|
|
@@ -2949,6 +2985,7 @@ export declare class ChartModel extends Disposable {
|
|
|
2949
2985
|
} | undefined;
|
|
2950
2986
|
dataPoints?: {
|
|
2951
2987
|
[x: number]: {
|
|
2988
|
+
fillOpacity?: number | undefined;
|
|
2952
2989
|
shape?: import("..").LinePointShape | undefined;
|
|
2953
2990
|
size?: number | undefined;
|
|
2954
2991
|
color?: import("@univerjs/core").Nullable<string>;
|
|
@@ -3067,6 +3104,7 @@ export declare class ChartModel extends Disposable {
|
|
|
3067
3104
|
} | undefined;
|
|
3068
3105
|
dataPoints?: {
|
|
3069
3106
|
[x: number]: {
|
|
3107
|
+
fillOpacity?: number | undefined;
|
|
3070
3108
|
shape?: import("..").LinePointShape | undefined;
|
|
3071
3109
|
size?: number | undefined;
|
|
3072
3110
|
color?: import("@univerjs/core").Nullable<string>;
|
|
@@ -3110,6 +3148,7 @@ export declare class ChartModel extends Disposable {
|
|
|
3110
3148
|
} | undefined;
|
|
3111
3149
|
dataPoints?: {
|
|
3112
3150
|
[x: number]: {
|
|
3151
|
+
fillOpacity?: number | undefined;
|
|
3113
3152
|
shape?: import("..").LinePointShape | undefined;
|
|
3114
3153
|
size?: number | undefined;
|
|
3115
3154
|
color?: import("@univerjs/core").Nullable<string>;
|
|
@@ -3155,6 +3194,7 @@ export declare class ChartModel extends Disposable {
|
|
|
3155
3194
|
} | undefined;
|
|
3156
3195
|
dataPoints?: {
|
|
3157
3196
|
[x: number]: {
|
|
3197
|
+
fillOpacity?: number | undefined;
|
|
3158
3198
|
shape?: import("..").LinePointShape | undefined;
|
|
3159
3199
|
size?: number | undefined;
|
|
3160
3200
|
color?: import("@univerjs/core").Nullable<string>;
|
|
@@ -3200,6 +3240,7 @@ export declare class ChartModel extends Disposable {
|
|
|
3200
3240
|
} | undefined;
|
|
3201
3241
|
dataPoints?: {
|
|
3202
3242
|
[x: number]: {
|
|
3243
|
+
fillOpacity?: number | undefined;
|
|
3203
3244
|
shape?: import("..").LinePointShape | undefined;
|
|
3204
3245
|
size?: number | undefined;
|
|
3205
3246
|
color?: import("@univerjs/core").Nullable<string>;
|
|
@@ -3247,6 +3288,7 @@ export declare class ChartModel extends Disposable {
|
|
|
3247
3288
|
} | undefined;
|
|
3248
3289
|
dataPoints?: {
|
|
3249
3290
|
[x: number]: {
|
|
3291
|
+
fillOpacity?: number | undefined;
|
|
3250
3292
|
shape?: import("..").LinePointShape | undefined;
|
|
3251
3293
|
size?: number | undefined;
|
|
3252
3294
|
color?: import("@univerjs/core").Nullable<string>;
|
|
@@ -3290,6 +3332,7 @@ export declare class ChartModel extends Disposable {
|
|
|
3290
3332
|
} | undefined;
|
|
3291
3333
|
dataPoints?: {
|
|
3292
3334
|
[x: number]: {
|
|
3335
|
+
fillOpacity?: number | undefined;
|
|
3293
3336
|
shape?: import("..").LinePointShape | undefined;
|
|
3294
3337
|
size?: number | undefined;
|
|
3295
3338
|
color?: import("@univerjs/core").Nullable<string>;
|
|
@@ -3335,6 +3378,7 @@ export declare class ChartModel extends Disposable {
|
|
|
3335
3378
|
} | undefined;
|
|
3336
3379
|
dataPoints?: {
|
|
3337
3380
|
[x: number]: {
|
|
3381
|
+
fillOpacity?: number | undefined;
|
|
3338
3382
|
shape?: import("..").LinePointShape | undefined;
|
|
3339
3383
|
size?: number | undefined;
|
|
3340
3384
|
color?: import("@univerjs/core").Nullable<string>;
|
|
@@ -3380,6 +3424,7 @@ export declare class ChartModel extends Disposable {
|
|
|
3380
3424
|
} | undefined;
|
|
3381
3425
|
dataPoints?: {
|
|
3382
3426
|
[x: number]: {
|
|
3427
|
+
fillOpacity?: number | undefined;
|
|
3383
3428
|
shape?: import("..").LinePointShape | undefined;
|
|
3384
3429
|
size?: number | undefined;
|
|
3385
3430
|
color?: import("@univerjs/core").Nullable<string>;
|
|
@@ -10,3 +10,4 @@ import { ChartTypeBits } from '../enum';
|
|
|
10
10
|
* the runtime render style consumed by physical-position operators.
|
|
11
11
|
*/
|
|
12
12
|
export declare function resolveChartRuntimeStyle(style: ChartStyle, chartType?: ChartTypeBits): ChartStyle;
|
|
13
|
+
export declare function resolveChartStyleBackgroundColor(style?: Pick<ChartStyle, 'backgroundColor'> | null): string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ChartStyle, EChartInstance, EChartSpec, IChartConfig, IChartHostRect, IChartInstance, IChartRenderModel, IChartRenderModelStylizeInit } from '../types';
|
|
1
|
+
import type { ChartHostRenderMode, ChartImageSource, ChartStyle, EChartInstance, EChartSpec, IChartConfig, IChartHostRect, IChartInstance, IChartRenderAsImageOptions, IChartRenderInstance, IChartRenderInstanceCreateContext, IChartRenderModel, IChartRenderModelStylizeInit, IChartRenderRuntimeOptions } from '../types';
|
|
2
2
|
import type { IWordCloudRenderConfig } from '../wordcloud-chart/word-cloud-render-config';
|
|
3
3
|
import { Disposable } from '@univerjs/core';
|
|
4
4
|
export interface IEChartRenderModelOptions {
|
|
@@ -14,6 +14,10 @@ export declare class EChartRenderModel extends Disposable implements IChartRende
|
|
|
14
14
|
private _addSpecConverters;
|
|
15
15
|
private _addSpecOperators;
|
|
16
16
|
createChartInstance(): IChartInstance<EChartSpec>;
|
|
17
|
+
createChartInstance(mode: ChartHostRenderMode, context?: IChartRenderInstanceCreateContext<EChartSpec>): IChartRenderInstance;
|
|
18
|
+
clearRuntimeCache(chartId: string): void;
|
|
19
|
+
clearAllRuntimeCache(): void;
|
|
20
|
+
dispose(): void;
|
|
17
21
|
toSpec(config: IChartConfig, style: ChartStyle): import("echarts").EChartsOption;
|
|
18
22
|
stylizeSpec(spec: EChartSpec, stylizeInit: IChartRenderModelStylizeInit<EChartSpec>, rect: IChartHostRect): import("echarts").EChartsOption | {
|
|
19
23
|
backgroundColor: string;
|
|
@@ -30,8 +34,8 @@ export declare class EChartRenderEngine extends Disposable implements EChartInst
|
|
|
30
34
|
resize(echartsProvider?: any): void;
|
|
31
35
|
private _ensureChartInstance;
|
|
32
36
|
get containerElement(): HTMLElement | null;
|
|
33
|
-
render(spec: EChartSpec,
|
|
37
|
+
render(spec: EChartSpec, echartsProviderOrOptions?: any | IChartRenderRuntimeOptions): void;
|
|
38
|
+
renderAsImage(spec: EChartSpec, options: IChartRenderAsImageOptions): Promise<ChartImageSource>;
|
|
34
39
|
exportImg(echartsProvider?: any): Promise<string>;
|
|
35
|
-
onDispose(): void;
|
|
36
40
|
dispose(): void;
|
|
37
41
|
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { ChartImageSource, IChartHostLease, IChartHostRect, IChartHostStyle, IImageChartHost } from '../types';
|
|
2
|
+
import { Disposable } from '@univerjs/core';
|
|
3
|
+
export declare function chartImageSourceToDataUrl(image: ChartImageSource): string;
|
|
4
|
+
export declare abstract class ImageChartHost extends Disposable implements IImageChartHost {
|
|
5
|
+
readonly chartId: string;
|
|
6
|
+
readonly mode: "image";
|
|
7
|
+
private readonly _offscreenChartHost;
|
|
8
|
+
constructor(chartId: string);
|
|
9
|
+
abstract getRect(): IChartHostRect | null;
|
|
10
|
+
abstract setStyle(style: IChartHostStyle): void;
|
|
11
|
+
abstract nextVersion(): number;
|
|
12
|
+
abstract commitSnapshot(image: ChartImageSource, version: number): boolean;
|
|
13
|
+
abstract requestPaint(): void;
|
|
14
|
+
abstract invalidateSnapshot(): void;
|
|
15
|
+
acquireOffscreenHost(rect: IChartHostRect): IChartHostLease;
|
|
16
|
+
dispose(): void;
|
|
17
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { IChartHostLease, IChartHostRect } from '../types';
|
|
2
|
+
import { Disposable } from '@univerjs/core';
|
|
3
|
+
export declare class OffscreenChartHost extends Disposable {
|
|
4
|
+
private readonly _leases;
|
|
5
|
+
acquire(rect: IChartHostRect): IChartHostLease;
|
|
6
|
+
dispose(): void;
|
|
7
|
+
}
|
package/lib/types/types.d.ts
CHANGED
|
@@ -238,12 +238,15 @@ export interface IPointStyle {
|
|
|
238
238
|
color: Nullable<string>;
|
|
239
239
|
}
|
|
240
240
|
export interface IDataPointStyle extends IPointStyle {
|
|
241
|
+
/** Fill opacity for this data point, from 0 (transparent) to 1 (opaque). */
|
|
242
|
+
fillOpacity?: number;
|
|
241
243
|
}
|
|
242
244
|
export interface ISeriesStyle {
|
|
243
245
|
chartType?: ChartTypeBits.Line | ChartTypeBits.Column | ChartTypeBits.Area;
|
|
244
246
|
/** Compatibility switch for placing this series on the secondary vertical axis. It does not change the yAxis/rightYAxis option bucket semantics. */
|
|
245
247
|
rightYAxis?: boolean;
|
|
246
248
|
color: Nullable<string>;
|
|
249
|
+
/** Fill opacity for this series, from 0 (transparent) to 1 (opaque). */
|
|
247
250
|
fillOpacity: number;
|
|
248
251
|
border: {
|
|
249
252
|
opacity: number;
|
|
@@ -410,6 +413,63 @@ export interface IChartRenderSpecConverter<ChartRenderSpec = Record<string, any>
|
|
|
410
413
|
}
|
|
411
414
|
export type ChartConfigInterceptor = (config: IChartConfig) => IChartConfig;
|
|
412
415
|
export type RenderSpecOperator<ChartRenderSpec> = (spec: ChartRenderSpec, style: ChartStyle, config: IChartConfig, instance: IChartInstance) => void;
|
|
416
|
+
export type ChartHostRenderMode = 'image' | 'dom';
|
|
417
|
+
export interface IChartHostStyle {
|
|
418
|
+
stroke?: string;
|
|
419
|
+
fill?: string;
|
|
420
|
+
[key: string]: any;
|
|
421
|
+
}
|
|
422
|
+
export interface IChartHostLease extends IDisposable {
|
|
423
|
+
readonly mountNode: HTMLElement;
|
|
424
|
+
}
|
|
425
|
+
export interface IChartHost extends IDisposable {
|
|
426
|
+
readonly chartId: string;
|
|
427
|
+
readonly mode: ChartHostRenderMode;
|
|
428
|
+
getRect(): IChartHostRect | null;
|
|
429
|
+
setStyle(style: IChartHostStyle): void;
|
|
430
|
+
}
|
|
431
|
+
export interface IImageChartHost extends IChartHost {
|
|
432
|
+
readonly mode: 'image';
|
|
433
|
+
nextVersion(): number;
|
|
434
|
+
commitSnapshot(image: ChartImageSource, version: number): boolean;
|
|
435
|
+
requestPaint(): void;
|
|
436
|
+
invalidateSnapshot(): void;
|
|
437
|
+
acquireOffscreenHost(rect: IChartHostRect): IChartHostLease;
|
|
438
|
+
}
|
|
439
|
+
export interface IDomChartHost extends IChartHost {
|
|
440
|
+
readonly mode: 'dom';
|
|
441
|
+
ensureMount(): Promise<HTMLElement | null>;
|
|
442
|
+
checkMounted(): boolean;
|
|
443
|
+
syncLayout(): void;
|
|
444
|
+
markReady(): void;
|
|
445
|
+
markNotReady(): void;
|
|
446
|
+
}
|
|
447
|
+
export interface IChartRenderInput {
|
|
448
|
+
chartId: string;
|
|
449
|
+
config: IChartConfig;
|
|
450
|
+
style: ChartStyle;
|
|
451
|
+
}
|
|
452
|
+
export interface IChartRenderInstance extends IDisposable {
|
|
453
|
+
readonly mode: ChartHostRenderMode;
|
|
454
|
+
bind(host: IChartHost): void;
|
|
455
|
+
render(input: IChartRenderInput): Promise<void>;
|
|
456
|
+
resize(): void;
|
|
457
|
+
}
|
|
458
|
+
export interface IChartRenderInstanceStyleInput<Spec = Record<string, any>> extends IChartRenderInput {
|
|
459
|
+
mode: ChartHostRenderMode;
|
|
460
|
+
spec?: Spec;
|
|
461
|
+
}
|
|
462
|
+
export interface IChartRenderInstanceSpecInput<Spec = Record<string, any>> extends IChartRenderInput {
|
|
463
|
+
mode: ChartHostRenderMode;
|
|
464
|
+
spec: Spec;
|
|
465
|
+
}
|
|
466
|
+
export interface IChartRenderInstanceCreateContext<Spec = Record<string, any>> {
|
|
467
|
+
resolveHostStyle?: (input: IChartRenderInstanceStyleInput<Spec>) => IChartHostStyle;
|
|
468
|
+
resolveRenderBackgroundColor?: (input: IChartRenderInstanceStyleInput<Spec> & {
|
|
469
|
+
hostStyle: IChartHostStyle;
|
|
470
|
+
}) => string | undefined;
|
|
471
|
+
prepareSpec?: (input: IChartRenderInstanceSpecInput<Spec>) => Spec;
|
|
472
|
+
}
|
|
413
473
|
export interface IChartRenderModelStylizeInit<Spec> {
|
|
414
474
|
chartStyle: ChartStyle;
|
|
415
475
|
chartConfig: IChartConfig;
|
|
@@ -420,17 +480,49 @@ export interface IChartRenderModel<Spec extends Record<string, any> = Record<str
|
|
|
420
480
|
stylizeSpec(spec: Spec, stylizeInit: IChartRenderModelStylizeInit<Spec>, rect: IChartHostRect): Spec;
|
|
421
481
|
updateWatermark(addWatermark: boolean): void;
|
|
422
482
|
createChartInstance(): IChartInstance<Spec>;
|
|
483
|
+
createChartInstance(mode: ChartHostRenderMode, context?: IChartRenderInstanceCreateContext<Spec>): IChartRenderInstance;
|
|
484
|
+
clearRuntimeCache?(chartId: string): void;
|
|
485
|
+
clearAllRuntimeCache?(): void;
|
|
423
486
|
dispose(): void;
|
|
424
487
|
}
|
|
425
488
|
export interface IChartThemeOptions {
|
|
426
489
|
colors: string[];
|
|
427
490
|
}
|
|
491
|
+
export declare enum ChartImageSourceType {
|
|
492
|
+
Url = "url",
|
|
493
|
+
Canvas = "canvas",
|
|
494
|
+
ImageBitmap = "imageBitmap"
|
|
495
|
+
}
|
|
496
|
+
export type ChartImageSource = {
|
|
497
|
+
type: ChartImageSourceType.Url;
|
|
498
|
+
url: string;
|
|
499
|
+
} | {
|
|
500
|
+
type: ChartImageSourceType.Canvas;
|
|
501
|
+
canvas: HTMLCanvasElement;
|
|
502
|
+
} | {
|
|
503
|
+
type: ChartImageSourceType.ImageBitmap;
|
|
504
|
+
imageBitmap: ImageBitmap;
|
|
505
|
+
};
|
|
506
|
+
export interface IChartRenderAsImageOptions {
|
|
507
|
+
width: number;
|
|
508
|
+
height: number;
|
|
509
|
+
pixelRatio?: number;
|
|
510
|
+
backgroundColor?: string;
|
|
511
|
+
echartsProvider?: any;
|
|
512
|
+
chartId?: string;
|
|
513
|
+
host: HTMLElement;
|
|
514
|
+
}
|
|
515
|
+
export interface IChartRenderRuntimeOptions {
|
|
516
|
+
echartsProvider?: any;
|
|
517
|
+
chartId?: string;
|
|
518
|
+
}
|
|
428
519
|
export interface IChartInstance<Spec = Record<string, any>> extends IDisposable {
|
|
429
520
|
container: HTMLElement | string;
|
|
430
521
|
mount(id: string | HTMLElement): void;
|
|
431
522
|
render(spec: Spec, echartsProvider?: any): void;
|
|
523
|
+
render(spec: Spec, options?: IChartRenderRuntimeOptions): void;
|
|
524
|
+
renderAsImage(spec: Spec, options: IChartRenderAsImageOptions): Promise<ChartImageSource>;
|
|
432
525
|
exportImg(): Promise<string>;
|
|
433
|
-
onDispose?(dispose: () => void): void;
|
|
434
526
|
resize(): void;
|
|
435
527
|
}
|
|
436
528
|
export interface IChartInstanceConstructor<Spec> {
|
|
@@ -14,4 +14,4 @@ export declare const echarts: {
|
|
|
14
14
|
registerPreprocessor: typeof registerPreprocessor;
|
|
15
15
|
util: typeof util;
|
|
16
16
|
};
|
|
17
|
-
export type { BarSeriesOption, DatasetComponentOption, ECharts, EChartsInitOpts, EChartsOption, FunnelSeriesOption, LegendComponentOption, LineSeriesOption, XAXisComponentOption, } from 'echarts';
|
|
17
|
+
export type { BarSeriesOption, DatasetComponentOption, ECharts, EChartsInitOpts, EChartsOption, FunnelSeriesOption, LegendComponentOption, LineSeriesOption, PieSeriesOption, XAXisComponentOption, } from 'echarts';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { echarts as EchartsType } from '../../../utils/echarts';
|
|
2
2
|
import type { IWordCloudEChartsSeriesOption } from '../../types';
|
|
3
3
|
export declare function registerWordCloudChart(echarts: typeof EchartsType): typeof EchartsType;
|
|
4
|
+
export declare function waitForWordCloudImageResourcesReady(spec: unknown, timeout?: number): Promise<void>;
|
|
4
5
|
export type { IWordCloudEChartsSeriesOption };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { IWordCloudEncodedWord } from '../../types';
|
|
2
|
+
import type { IEChartsWordCloudRenderLayout } from './layout';
|
|
3
|
+
import type { IEChartsWordCloudDesignWordsBuildResult } from './words';
|
|
4
|
+
export interface IWordCloudRuntimeContext {
|
|
5
|
+
chartId?: string;
|
|
6
|
+
}
|
|
7
|
+
export interface IWordCloudFinalLayoutCachePayload {
|
|
8
|
+
placed: IEChartsWordCloudRenderLayout[];
|
|
9
|
+
}
|
|
10
|
+
interface ICacheCounter {
|
|
11
|
+
hit: number;
|
|
12
|
+
miss: number;
|
|
13
|
+
}
|
|
14
|
+
export interface IWordCloudRuntimeCacheStats {
|
|
15
|
+
designWords: ICacheCounter;
|
|
16
|
+
layoutWords: ICacheCounter;
|
|
17
|
+
finalLayout: ICacheCounter;
|
|
18
|
+
}
|
|
19
|
+
export declare function withWordCloudRuntimeContext<T>(context: IWordCloudRuntimeContext, fn: () => T): T;
|
|
20
|
+
export declare function getCurrentWordCloudRuntimeContext(): IWordCloudRuntimeContext | undefined;
|
|
21
|
+
export declare function getOrCreateCachedWordCloudDesignWords(chartId: string | undefined, key: string, factory: () => IEChartsWordCloudDesignWordsBuildResult): IEChartsWordCloudDesignWordsBuildResult;
|
|
22
|
+
export declare function getOrCreateCachedWordCloudLayoutWords(chartId: string | undefined, key: string, factory: () => IWordCloudEncodedWord[]): IWordCloudEncodedWord[];
|
|
23
|
+
export declare function getCachedWordCloudFinalLayout(chartId: string | undefined, key: string): IWordCloudFinalLayoutCachePayload | undefined;
|
|
24
|
+
export declare function setCachedWordCloudFinalLayout(chartId: string | undefined, key: string, value: IWordCloudFinalLayoutCachePayload): void;
|
|
25
|
+
export declare function clearWordCloudRuntimeCache(chartId: string): void;
|
|
26
|
+
export declare function clearAllWordCloudRuntimeCache(): void;
|
|
27
|
+
export declare function getWordCloudRuntimeCacheStats(chartId?: string): IWordCloudRuntimeCacheStats;
|
|
28
|
+
export declare function createStableWordCloudCacheKey(parts: readonly unknown[]): string;
|
|
29
|
+
export {};
|