@univerjs-pro/engine-chart 1.0.0-beta.0 → 1.0.0-beta.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/README.md +9 -0
- package/lib/cjs/facade.js +1 -1
- package/lib/cjs/index.js +1 -1
- package/lib/cjs/locale/ar-SA.js +1 -1
- package/lib/cjs/locale/ca-ES.js +1 -1
- package/lib/cjs/locale/de-DE.js +1 -1
- package/lib/cjs/locale/en-US.js +1 -1
- package/lib/cjs/locale/es-ES.js +1 -1
- package/lib/cjs/locale/fa-IR.js +1 -1
- package/lib/cjs/locale/fr-FR.js +1 -1
- package/lib/cjs/locale/id-ID.js +1 -1
- package/lib/cjs/locale/it-IT.js +1 -1
- package/lib/cjs/locale/ja-JP.js +1 -1
- package/lib/cjs/locale/ko-KR.js +1 -1
- package/lib/cjs/locale/pl-PL.js +1 -1
- package/lib/cjs/locale/pt-BR.js +1 -1
- package/lib/cjs/locale/ru-RU.js +1 -1
- package/lib/cjs/locale/sk-SK.js +1 -1
- package/lib/cjs/locale/vi-VN.js +1 -1
- package/lib/cjs/locale/zh-CN.js +1 -1
- package/lib/cjs/locale/zh-HK.js +1 -1
- package/lib/cjs/locale/zh-TW.js +1 -1
- package/lib/es/facade.js +1 -1
- package/lib/es/index.js +1 -1
- package/lib/es/locale/ar-SA.js +1 -1
- package/lib/es/locale/ca-ES.js +1 -1
- package/lib/es/locale/de-DE.js +1 -1
- package/lib/es/locale/en-US.js +1 -1
- package/lib/es/locale/es-ES.js +1 -1
- package/lib/es/locale/fa-IR.js +1 -1
- package/lib/es/locale/fr-FR.js +1 -1
- package/lib/es/locale/id-ID.js +1 -1
- package/lib/es/locale/it-IT.js +1 -1
- package/lib/es/locale/ja-JP.js +1 -1
- package/lib/es/locale/ko-KR.js +1 -1
- package/lib/es/locale/pl-PL.js +1 -1
- package/lib/es/locale/pt-BR.js +1 -1
- package/lib/es/locale/ru-RU.js +1 -1
- package/lib/es/locale/sk-SK.js +1 -1
- package/lib/es/locale/vi-VN.js +1 -1
- package/lib/es/locale/zh-CN.js +1 -1
- package/lib/es/locale/zh-HK.js +1 -1
- package/lib/es/locale/zh-TW.js +1 -1
- package/lib/facade.js +1 -1
- package/lib/index.js +1 -1
- package/lib/locale/ar-SA.js +1 -1
- package/lib/locale/ca-ES.js +1 -1
- package/lib/locale/de-DE.js +1 -1
- package/lib/locale/en-US.js +1 -1
- package/lib/locale/es-ES.js +1 -1
- package/lib/locale/fa-IR.js +1 -1
- package/lib/locale/fr-FR.js +1 -1
- package/lib/locale/id-ID.js +1 -1
- package/lib/locale/it-IT.js +1 -1
- package/lib/locale/ja-JP.js +1 -1
- package/lib/locale/ko-KR.js +1 -1
- package/lib/locale/pl-PL.js +1 -1
- package/lib/locale/pt-BR.js +1 -1
- package/lib/locale/ru-RU.js +1 -1
- package/lib/locale/sk-SK.js +1 -1
- package/lib/locale/vi-VN.js +1 -1
- package/lib/locale/zh-CN.js +1 -1
- package/lib/locale/zh-HK.js +1 -1
- package/lib/locale/zh-TW.js +1 -1
- package/lib/types/chart-builder/chart-builder-adapter.d.ts +1 -3
- package/lib/types/chart-builder/chart-builder.d.ts +2 -5
- package/lib/types/chart-builder/chart-live-adapter.d.ts +15 -0
- package/lib/types/chart-builder/chart-types.d.ts +21 -0
- package/lib/types/chart-builder/configuration/cartesian-series.d.ts +1 -0
- package/lib/types/chart-builder/configuration/chart-config-group.d.ts +38 -0
- package/lib/types/chart-builder/configuration/chart-config-operation.d.ts +1 -38
- package/lib/types/chart-builder/configuration/gauge.d.ts +1 -1
- package/lib/types/chart-builder/conversion/chart-config-converter.d.ts +24 -11
- package/lib/types/chart-builder/conversion/chart-create-config.d.ts +6 -0
- package/lib/types/chart-builder/conversion/chart-model-fields.d.ts +20 -0
- package/lib/types/chart-builder/conversion/chart-type-converter.d.ts +1 -3
- package/lib/types/chart-builder/conversion/describe-chart-model.d.ts +0 -127
- package/lib/types/chart-builder/detached-chart-builder-adapter.d.ts +1 -10
- package/lib/types/chart-builder/internal/apply-pending-to-description.d.ts +2 -0
- package/lib/types/chart-builder/internal/chart-host-config-adapter.d.ts +3 -0
- package/lib/types/chart-builder/internal/chart-pending-patch.d.ts +11 -0
- package/lib/types/chart-builder/internal/patch-interpreter.d.ts +17 -0
- package/lib/types/facade/builders/f-area-chart-builder.d.ts +52 -7
- package/lib/types/facade/builders/f-boxplot-chart-builder.d.ts +88 -3
- package/lib/types/facade/builders/f-bubble-chart-builder.d.ts +59 -6
- package/lib/types/facade/builders/f-candlestick-chart-builder.d.ts +90 -31
- package/lib/types/facade/builders/f-chord-chart-builder.d.ts +180 -8
- package/lib/types/facade/builders/f-combination-chart-builder.d.ts +55 -10
- package/lib/types/facade/builders/f-funnel-chart-builder.d.ts +55 -9
- package/lib/types/facade/builders/f-gauge-chart-builder.d.ts +378 -10
- package/lib/types/facade/builders/f-heatmap-chart-builder.d.ts +83 -26
- package/lib/types/facade/builders/f-histogram-chart-builder.d.ts +142 -16
- package/lib/types/facade/builders/f-line-chart-builder.d.ts +51 -6
- package/lib/types/facade/builders/f-pareto-chart-builder.d.ts +83 -20
- package/lib/types/facade/builders/f-pie-chart-builder.d.ts +131 -47
- package/lib/types/facade/builders/f-radar-chart-builder.d.ts +64 -11
- package/lib/types/facade/builders/f-relation-chart-builder.d.ts +72 -38
- package/lib/types/facade/builders/f-scatter-chart-builder.d.ts +58 -6
- package/lib/types/facade/builders/f-sunburst-chart-builder.d.ts +122 -8
- package/lib/types/facade/builders/f-treemap-chart-builder.d.ts +115 -13
- package/lib/types/facade/builders/f-waterfall-chart-builder.d.ts +87 -53
- package/lib/types/facade/builders/f-word-cloud-chart-builder.d.ts +64 -15
- package/lib/types/facade/chart-builder-registry.d.ts +4 -4
- package/lib/types/facade/chart-builder-type-map.d.ts +35 -32
- package/lib/types/facade/chart-host-builder-types.d.ts +2 -21
- package/lib/types/facade/create-chart-builder.d.ts +46 -0
- package/lib/types/facade/f-axis-chart-builder.d.ts +21 -38
- package/lib/types/facade/f-cartesian-chart-builder.d.ts +32 -20
- package/lib/types/facade/f-chart-builder-base.d.ts +240 -73
- package/lib/types/facade/f-chart.d.ts +686 -0
- package/lib/types/facade/f-enum.d.ts +684 -31
- package/lib/types/facade/f-univer.d.ts +51 -0
- package/lib/types/facade/index.d.ts +7 -9
- package/lib/types/facade/internal/category-fields.d.ts +3 -0
- package/lib/types/facade/internal/chart-builder-facade-context.d.ts +11 -10
- package/lib/types/index.d.ts +28 -17
- package/lib/types/models/chart-context/chart-field-selection.d.ts +1 -1
- package/lib/types/models/chart-context/resolve-chart-context.d.ts +3 -0
- package/lib/types/models/chart-data/chart-field-consumption-validator.d.ts +1 -1
- package/lib/types/models/chart-data/internal/category-series-aggregation.d.ts +1 -2
- package/lib/types/models/chart-data/internal/data-set-category-spans.d.ts +7 -0
- package/lib/types/models/chart-data/internal/multi-level-category-axis.d.ts +10 -0
- package/lib/types/models/chart-host/config/chart-config-interpreter.d.ts +13 -0
- package/lib/types/models/chart-host/resource/chart-data-source-resolver.d.ts +58 -0
- package/lib/types/models/chart-host/resource/chart-resource-repository.d.ts +111 -0
- package/lib/types/models/chart-host/resource/chart-resource-serializer.d.ts +2 -1
- package/lib/types/models/chart-host/resource/inline-chart-table.d.ts +4 -3
- package/lib/types/models/chart-host/resource/persisted-chart-style.d.ts +3 -0
- package/lib/types/models/chart-host/resource/resource-ref-chart-data-source.adapter.d.ts +22 -0
- package/lib/types/models/chart-host/resource/resource-ref-chart-data-source.provider.d.ts +12 -0
- package/lib/types/models/chart-host/static/chart-model-store.d.ts +56 -0
- package/lib/types/models/chart-host/static/{static-chart-runtime.d.ts → chart-runtime.d.ts} +6 -5
- package/lib/types/models/chart-model/chart-model.d.ts +2 -383
- package/lib/types/models/chart-render/axes/chart-runtime-axes.d.ts +2 -2
- package/lib/types/models/chart-render/chart-render-input-resolver.d.ts +2 -2
- package/lib/types/models/chart-render/converter/category-axis-domain.d.ts +6 -0
- package/lib/types/models/chart-render/converter/converters/gauge-chart-converter.d.ts +5 -3
- package/lib/types/models/chart-render/converter/echart-text-overflow.d.ts +7 -0
- package/lib/types/models/chart-render/converter/render-spec-operators/grid-operator.d.ts +3 -3
- package/lib/types/models/chart-render/converter/render-spec-operators/legend-size.d.ts +1 -2
- package/lib/types/models/chart-render/converter/render-spec-operators/multi-level-category-axis-grid.operator.d.ts +2 -0
- package/lib/types/models/chart-render/converter/render-spec-operators/multi-level-category-axis-layout.d.ts +23 -0
- package/lib/types/models/chart-render/converter/render-spec-operators/multi-level-category-axis-overlay.operator.d.ts +12 -0
- package/lib/types/models/chart-render/converter/render-spec-operators/series-style-operator/series-style-operator.d.ts +2 -2
- package/lib/types/models/chart-render/converter/render-spec-operators/tool-tip-operator.d.ts +3 -13
- package/lib/types/models/chart-render/converter/render-spec-operators/tools.d.ts +4 -4
- package/lib/types/models/chart-render/converter/render-spec-operators/visual-map-operator.d.ts +4 -0
- package/lib/types/models/chart-render/echart-render-model.d.ts +7 -3
- package/lib/types/models/chart-render/edit-overlay/chart-element-edit-overlay.d.ts +1 -1
- package/lib/types/models/chart-render/edit-overlay/resolve-chart-element-hit-layout.d.ts +1 -1
- package/lib/types/models/chart-render/style/chart-runtime-style.d.ts +0 -1
- package/lib/types/models/common/constants/default-chart-style.d.ts +53 -53
- package/lib/types/models/common/constants/default.d.ts +3 -2
- package/lib/types/plugin.d.ts +1 -1
- package/lib/types/types.d.ts +46 -6
- package/lib/types/util.d.ts +0 -1
- package/lib/types/utils/compact.d.ts +6 -0
- package/lib/types/utils/device-pixel-ratio.d.ts +1 -0
- package/lib/umd/facade.js +1 -1
- package/lib/umd/index.js +1 -1
- package/lib/umd/locale/ar-SA.js +1 -1
- package/lib/umd/locale/ca-ES.js +1 -1
- package/lib/umd/locale/de-DE.js +1 -1
- package/lib/umd/locale/en-US.js +1 -1
- package/lib/umd/locale/es-ES.js +1 -1
- package/lib/umd/locale/fa-IR.js +1 -1
- package/lib/umd/locale/fr-FR.js +1 -1
- package/lib/umd/locale/id-ID.js +1 -1
- package/lib/umd/locale/it-IT.js +1 -1
- package/lib/umd/locale/ja-JP.js +1 -1
- package/lib/umd/locale/ko-KR.js +1 -1
- package/lib/umd/locale/pl-PL.js +1 -1
- package/lib/umd/locale/pt-BR.js +1 -1
- package/lib/umd/locale/ru-RU.js +1 -1
- package/lib/umd/locale/sk-SK.js +1 -1
- package/lib/umd/locale/vi-VN.js +1 -1
- package/lib/umd/locale/zh-CN.js +1 -1
- package/lib/umd/locale/zh-HK.js +1 -1
- package/lib/umd/locale/zh-TW.js +1 -1
- package/package.json +7 -6
- package/lib/types/chart-builder/internal/host-builder-runtime.d.ts +0 -3
- package/lib/types/chart-builder/internal/merge-description.d.ts +0 -2
- package/lib/types/facade/f-chart-base.d.ts +0 -82
- package/lib/types/facade/f-charts-base.d.ts +0 -74
- package/lib/types/facade/internal/host-builder-composer.d.ts +0 -16
- package/lib/types/models/chart-host/resource/static-chart-resource-repository.d.ts +0 -75
- package/lib/types/models/chart-host/static/static-chart-model-store.d.ts +0 -43
|
@@ -20,6 +20,13 @@ export declare class EChartRenderModel extends Disposable implements IChartRende
|
|
|
20
20
|
clearAllRuntimeCache(): void;
|
|
21
21
|
dispose(): void;
|
|
22
22
|
toSpec(config: IChartConfig, style: ChartRuntimeStyle): import("echarts").EChartsOption;
|
|
23
|
+
/**
|
|
24
|
+
* Determine whether to show an empty state for the chart.
|
|
25
|
+
* @param chartConfig The chart configuration object.
|
|
26
|
+
* @param chartStyle The chart style object.
|
|
27
|
+
* @returns A boolean indicating whether to show an empty state.
|
|
28
|
+
*/
|
|
29
|
+
private _getShowEmpty;
|
|
23
30
|
stylizeSpec(spec: EChartSpec, stylizeInit: IChartRenderModelStylizeInit<EChartSpec>, rect: IChartHostRect): import("echarts").EChartsOption | {
|
|
24
31
|
backgroundColor: string;
|
|
25
32
|
};
|
|
@@ -35,7 +42,6 @@ export declare class EChartRenderEngine extends Disposable implements EChartInst
|
|
|
35
42
|
static engineName: string;
|
|
36
43
|
private _instance;
|
|
37
44
|
container: HTMLElement | string;
|
|
38
|
-
private _devicePixelRatio;
|
|
39
45
|
private _lastSpec;
|
|
40
46
|
private readonly _eventHandlers;
|
|
41
47
|
private readonly _nativeEventHandlers;
|
|
@@ -48,7 +54,6 @@ export declare class EChartRenderEngine extends Disposable implements EChartInst
|
|
|
48
54
|
private readonly _emittedElementEventKeys;
|
|
49
55
|
private _emittedElementEventKeysClearQueued;
|
|
50
56
|
constructor();
|
|
51
|
-
getDevicePixelRatio(): 1 | 2 | undefined;
|
|
52
57
|
mount(id: string | HTMLElement): void;
|
|
53
58
|
resize(echartsProviderOrOptions?: any | IChartRenderRuntimeOptions): void;
|
|
54
59
|
private _ensureChartInstance;
|
|
@@ -72,7 +77,6 @@ export declare class EChartRenderEngine extends Disposable implements EChartInst
|
|
|
72
77
|
private _handleElementEditZrHover;
|
|
73
78
|
private _handleElementEditClick;
|
|
74
79
|
private _handleElementEditZrClick;
|
|
75
|
-
private _hideTooltip;
|
|
76
80
|
private _ensureEditOverlay;
|
|
77
81
|
private _removeEditOverlay;
|
|
78
82
|
private _clearHoverBorder;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { IChartElementBounds, IChartElementHit } from '../../../types';
|
|
2
1
|
import type { ECharts } from 'echarts';
|
|
2
|
+
import type { IChartElementBounds, IChartElementHit } from '../../../types';
|
|
3
3
|
import type { ChartElementEditBorderType, IChartElementEditOverlayPalette } from './types';
|
|
4
4
|
export declare class ChartElementEditOverlay {
|
|
5
5
|
private readonly _getInstance;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { IChartElementBounds, IChartElementHit } from '../../../types';
|
|
2
1
|
import type { ECharts } from 'echarts';
|
|
2
|
+
import type { IChartElementBounds, IChartElementHit } from '../../../types';
|
|
3
3
|
import type { IChartElementHitLayout, IResolvedChartElementOverlay } from './types';
|
|
4
4
|
export declare function toChartElementFiniteNumber(value: unknown): number | undefined;
|
|
5
5
|
export declare function getChartElementTarget(params: any): any;
|
|
@@ -10,5 +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: ChartRuntimeStyle, chartType?: ChartTypeBits): ChartRuntimeStyle;
|
|
13
|
-
export declare function resolveChartRuntimeStyle(style: ChartStyle, chartType?: ChartTypeBits): ChartStyle;
|
|
14
13
|
export declare function resolveChartStyleBackgroundColor(style?: Pick<ChartStyle, 'backgroundColor'> | null): string;
|
|
@@ -20,19 +20,19 @@ export declare const MODERN_GAUGE_STYLE: {
|
|
|
20
20
|
readonly axisTick: {
|
|
21
21
|
readonly visible: false;
|
|
22
22
|
readonly splitNumber: 2;
|
|
23
|
-
readonly length:
|
|
23
|
+
readonly length: 5;
|
|
24
24
|
readonly width: 1;
|
|
25
25
|
readonly color: "gray.700";
|
|
26
26
|
};
|
|
27
27
|
readonly splitLine: {
|
|
28
28
|
readonly visible: false;
|
|
29
|
-
readonly length:
|
|
29
|
+
readonly length: 8;
|
|
30
30
|
readonly width: 2;
|
|
31
31
|
readonly color: "gray.700";
|
|
32
32
|
};
|
|
33
33
|
readonly axisLabel: {
|
|
34
34
|
readonly visible: false;
|
|
35
|
-
readonly distance:
|
|
35
|
+
readonly distance: 12;
|
|
36
36
|
readonly color: "gray.700";
|
|
37
37
|
readonly fontSize: 12;
|
|
38
38
|
readonly bold: false;
|
|
@@ -61,18 +61,18 @@ export declare const MODERN_GAUGE_STYLE: {
|
|
|
61
61
|
};
|
|
62
62
|
readonly title: {
|
|
63
63
|
readonly visible: true;
|
|
64
|
-
readonly offsetY: 0.
|
|
64
|
+
readonly offsetY: 0.95;
|
|
65
65
|
readonly color: "gray.700";
|
|
66
|
-
readonly fontSize:
|
|
66
|
+
readonly fontSize: 12;
|
|
67
67
|
readonly bold: false;
|
|
68
68
|
readonly italic: false;
|
|
69
69
|
readonly family: "Arial";
|
|
70
70
|
};
|
|
71
71
|
readonly detail: {
|
|
72
72
|
readonly visible: true;
|
|
73
|
-
readonly offsetY: 0.
|
|
73
|
+
readonly offsetY: 0.65;
|
|
74
74
|
readonly color: "gray.700";
|
|
75
|
-
readonly fontSize:
|
|
75
|
+
readonly fontSize: 14;
|
|
76
76
|
readonly bold: true;
|
|
77
77
|
readonly italic: false;
|
|
78
78
|
readonly family: "Arial";
|
|
@@ -98,19 +98,19 @@ export declare const CLASSIC_GAUGE_STYLE: {
|
|
|
98
98
|
readonly axisTick: {
|
|
99
99
|
readonly visible: true;
|
|
100
100
|
readonly splitNumber: 5;
|
|
101
|
-
readonly length:
|
|
101
|
+
readonly length: 8;
|
|
102
102
|
readonly width: 1;
|
|
103
103
|
readonly color: "gray.700";
|
|
104
104
|
};
|
|
105
105
|
readonly splitLine: {
|
|
106
106
|
readonly visible: true;
|
|
107
|
-
readonly length:
|
|
107
|
+
readonly length: 12;
|
|
108
108
|
readonly width: 2;
|
|
109
109
|
readonly color: "gray.700";
|
|
110
110
|
};
|
|
111
111
|
readonly axisLabel: {
|
|
112
112
|
readonly visible: true;
|
|
113
|
-
readonly distance:
|
|
113
|
+
readonly distance: 12;
|
|
114
114
|
readonly color: "gray.700";
|
|
115
115
|
readonly fontSize: 12;
|
|
116
116
|
readonly bold: false;
|
|
@@ -139,18 +139,18 @@ export declare const CLASSIC_GAUGE_STYLE: {
|
|
|
139
139
|
};
|
|
140
140
|
readonly title: {
|
|
141
141
|
readonly visible: true;
|
|
142
|
-
readonly offsetY: 0.
|
|
142
|
+
readonly offsetY: 0.95;
|
|
143
143
|
readonly color: "gray.700";
|
|
144
|
-
readonly fontSize:
|
|
144
|
+
readonly fontSize: 12;
|
|
145
145
|
readonly bold: false;
|
|
146
146
|
readonly italic: false;
|
|
147
147
|
readonly family: "Arial";
|
|
148
148
|
};
|
|
149
149
|
readonly detail: {
|
|
150
150
|
readonly visible: true;
|
|
151
|
-
readonly offsetY: 0.
|
|
151
|
+
readonly offsetY: 0.65;
|
|
152
152
|
readonly color: "gray.700";
|
|
153
|
-
readonly fontSize:
|
|
153
|
+
readonly fontSize: 14;
|
|
154
154
|
readonly bold: true;
|
|
155
155
|
readonly italic: false;
|
|
156
156
|
readonly family: "Arial";
|
|
@@ -175,7 +175,7 @@ export declare const STATUS_DIAL_GAUGE_STYLE: {
|
|
|
175
175
|
};
|
|
176
176
|
readonly axisLabel: {
|
|
177
177
|
readonly visible: true;
|
|
178
|
-
readonly distance:
|
|
178
|
+
readonly distance: 12;
|
|
179
179
|
readonly color: "gray.700";
|
|
180
180
|
readonly fontSize: 12;
|
|
181
181
|
readonly bold: false;
|
|
@@ -203,19 +203,19 @@ export declare const STATUS_DIAL_GAUGE_STYLE: {
|
|
|
203
203
|
readonly rounded: true;
|
|
204
204
|
};
|
|
205
205
|
readonly title: {
|
|
206
|
-
readonly offsetY: 0.
|
|
206
|
+
readonly offsetY: 0.95;
|
|
207
207
|
readonly visible: true;
|
|
208
208
|
readonly color: "gray.700";
|
|
209
|
-
readonly fontSize:
|
|
209
|
+
readonly fontSize: 12;
|
|
210
210
|
readonly bold: false;
|
|
211
211
|
readonly italic: false;
|
|
212
212
|
readonly family: "Arial";
|
|
213
213
|
};
|
|
214
214
|
readonly detail: {
|
|
215
|
-
readonly offsetY: 0.
|
|
216
|
-
readonly fontSize: 24;
|
|
215
|
+
readonly offsetY: 0.65;
|
|
217
216
|
readonly visible: true;
|
|
218
217
|
readonly color: "gray.700";
|
|
218
|
+
readonly fontSize: 14;
|
|
219
219
|
readonly bold: true;
|
|
220
220
|
readonly italic: false;
|
|
221
221
|
readonly family: "Arial";
|
|
@@ -229,7 +229,7 @@ export declare const STATUS_DIAL_GAUGE_STYLE: {
|
|
|
229
229
|
readonly axisTick: {
|
|
230
230
|
readonly visible: false;
|
|
231
231
|
readonly splitNumber: 2;
|
|
232
|
-
readonly length:
|
|
232
|
+
readonly length: 5;
|
|
233
233
|
readonly width: 1;
|
|
234
234
|
readonly color: "gray.700";
|
|
235
235
|
};
|
|
@@ -273,18 +273,18 @@ export declare const PROGRESS_GAUGE_STYLE: {
|
|
|
273
273
|
};
|
|
274
274
|
readonly title: {
|
|
275
275
|
readonly visible: true;
|
|
276
|
-
readonly offsetY: 0.
|
|
276
|
+
readonly offsetY: 0.95;
|
|
277
277
|
readonly color: "gray.700";
|
|
278
|
-
readonly fontSize:
|
|
278
|
+
readonly fontSize: 12;
|
|
279
279
|
readonly bold: false;
|
|
280
280
|
readonly italic: false;
|
|
281
281
|
readonly family: "Arial";
|
|
282
282
|
};
|
|
283
283
|
readonly detail: {
|
|
284
284
|
readonly visible: true;
|
|
285
|
-
readonly offsetY: 0.
|
|
285
|
+
readonly offsetY: 0.65;
|
|
286
286
|
readonly color: "gray.700";
|
|
287
|
-
readonly fontSize:
|
|
287
|
+
readonly fontSize: 14;
|
|
288
288
|
readonly bold: true;
|
|
289
289
|
readonly italic: false;
|
|
290
290
|
readonly family: "Arial";
|
|
@@ -330,9 +330,9 @@ export declare const MINIMAL_GAUGE_STYLE: {
|
|
|
330
330
|
};
|
|
331
331
|
readonly detail: {
|
|
332
332
|
readonly visible: true;
|
|
333
|
-
readonly offsetY: 0.
|
|
333
|
+
readonly offsetY: 0.65;
|
|
334
334
|
readonly color: "gray.700";
|
|
335
|
-
readonly fontSize:
|
|
335
|
+
readonly fontSize: 14;
|
|
336
336
|
readonly bold: true;
|
|
337
337
|
readonly italic: false;
|
|
338
338
|
readonly family: "Arial";
|
|
@@ -359,19 +359,19 @@ export declare const GAUGE_STYLE_TEMPLATES: {
|
|
|
359
359
|
readonly axisTick: {
|
|
360
360
|
readonly visible: false;
|
|
361
361
|
readonly splitNumber: 2;
|
|
362
|
-
readonly length:
|
|
362
|
+
readonly length: 5;
|
|
363
363
|
readonly width: 1;
|
|
364
364
|
readonly color: "gray.700";
|
|
365
365
|
};
|
|
366
366
|
readonly splitLine: {
|
|
367
367
|
readonly visible: false;
|
|
368
|
-
readonly length:
|
|
368
|
+
readonly length: 8;
|
|
369
369
|
readonly width: 2;
|
|
370
370
|
readonly color: "gray.700";
|
|
371
371
|
};
|
|
372
372
|
readonly axisLabel: {
|
|
373
373
|
readonly visible: false;
|
|
374
|
-
readonly distance:
|
|
374
|
+
readonly distance: 12;
|
|
375
375
|
readonly color: "gray.700";
|
|
376
376
|
readonly fontSize: 12;
|
|
377
377
|
readonly bold: false;
|
|
@@ -400,18 +400,18 @@ export declare const GAUGE_STYLE_TEMPLATES: {
|
|
|
400
400
|
};
|
|
401
401
|
readonly title: {
|
|
402
402
|
readonly visible: true;
|
|
403
|
-
readonly offsetY: 0.
|
|
403
|
+
readonly offsetY: 0.95;
|
|
404
404
|
readonly color: "gray.700";
|
|
405
|
-
readonly fontSize:
|
|
405
|
+
readonly fontSize: 12;
|
|
406
406
|
readonly bold: false;
|
|
407
407
|
readonly italic: false;
|
|
408
408
|
readonly family: "Arial";
|
|
409
409
|
};
|
|
410
410
|
readonly detail: {
|
|
411
411
|
readonly visible: true;
|
|
412
|
-
readonly offsetY: 0.
|
|
412
|
+
readonly offsetY: 0.65;
|
|
413
413
|
readonly color: "gray.700";
|
|
414
|
-
readonly fontSize:
|
|
414
|
+
readonly fontSize: 14;
|
|
415
415
|
readonly bold: true;
|
|
416
416
|
readonly italic: false;
|
|
417
417
|
readonly family: "Arial";
|
|
@@ -437,19 +437,19 @@ export declare const GAUGE_STYLE_TEMPLATES: {
|
|
|
437
437
|
readonly axisTick: {
|
|
438
438
|
readonly visible: true;
|
|
439
439
|
readonly splitNumber: 5;
|
|
440
|
-
readonly length:
|
|
440
|
+
readonly length: 8;
|
|
441
441
|
readonly width: 1;
|
|
442
442
|
readonly color: "gray.700";
|
|
443
443
|
};
|
|
444
444
|
readonly splitLine: {
|
|
445
445
|
readonly visible: true;
|
|
446
|
-
readonly length:
|
|
446
|
+
readonly length: 12;
|
|
447
447
|
readonly width: 2;
|
|
448
448
|
readonly color: "gray.700";
|
|
449
449
|
};
|
|
450
450
|
readonly axisLabel: {
|
|
451
451
|
readonly visible: true;
|
|
452
|
-
readonly distance:
|
|
452
|
+
readonly distance: 12;
|
|
453
453
|
readonly color: "gray.700";
|
|
454
454
|
readonly fontSize: 12;
|
|
455
455
|
readonly bold: false;
|
|
@@ -478,18 +478,18 @@ export declare const GAUGE_STYLE_TEMPLATES: {
|
|
|
478
478
|
};
|
|
479
479
|
readonly title: {
|
|
480
480
|
readonly visible: true;
|
|
481
|
-
readonly offsetY: 0.
|
|
481
|
+
readonly offsetY: 0.95;
|
|
482
482
|
readonly color: "gray.700";
|
|
483
|
-
readonly fontSize:
|
|
483
|
+
readonly fontSize: 12;
|
|
484
484
|
readonly bold: false;
|
|
485
485
|
readonly italic: false;
|
|
486
486
|
readonly family: "Arial";
|
|
487
487
|
};
|
|
488
488
|
readonly detail: {
|
|
489
489
|
readonly visible: true;
|
|
490
|
-
readonly offsetY: 0.
|
|
490
|
+
readonly offsetY: 0.65;
|
|
491
491
|
readonly color: "gray.700";
|
|
492
|
-
readonly fontSize:
|
|
492
|
+
readonly fontSize: 14;
|
|
493
493
|
readonly bold: true;
|
|
494
494
|
readonly italic: false;
|
|
495
495
|
readonly family: "Arial";
|
|
@@ -534,18 +534,18 @@ export declare const GAUGE_STYLE_TEMPLATES: {
|
|
|
534
534
|
};
|
|
535
535
|
readonly title: {
|
|
536
536
|
readonly visible: true;
|
|
537
|
-
readonly offsetY: 0.
|
|
537
|
+
readonly offsetY: 0.95;
|
|
538
538
|
readonly color: "gray.700";
|
|
539
|
-
readonly fontSize:
|
|
539
|
+
readonly fontSize: 12;
|
|
540
540
|
readonly bold: false;
|
|
541
541
|
readonly italic: false;
|
|
542
542
|
readonly family: "Arial";
|
|
543
543
|
};
|
|
544
544
|
readonly detail: {
|
|
545
545
|
readonly visible: true;
|
|
546
|
-
readonly offsetY: 0.
|
|
546
|
+
readonly offsetY: 0.65;
|
|
547
547
|
readonly color: "gray.700";
|
|
548
|
-
readonly fontSize:
|
|
548
|
+
readonly fontSize: 14;
|
|
549
549
|
readonly bold: true;
|
|
550
550
|
readonly italic: false;
|
|
551
551
|
readonly family: "Arial";
|
|
@@ -591,9 +591,9 @@ export declare const GAUGE_STYLE_TEMPLATES: {
|
|
|
591
591
|
};
|
|
592
592
|
readonly detail: {
|
|
593
593
|
readonly visible: true;
|
|
594
|
-
readonly offsetY: 0.
|
|
594
|
+
readonly offsetY: 0.65;
|
|
595
595
|
readonly color: "gray.700";
|
|
596
|
-
readonly fontSize:
|
|
596
|
+
readonly fontSize: 14;
|
|
597
597
|
readonly bold: true;
|
|
598
598
|
readonly italic: false;
|
|
599
599
|
readonly family: "Arial";
|
|
@@ -822,19 +822,19 @@ export declare const defaultChartConfig: {
|
|
|
822
822
|
readonly axisTick: {
|
|
823
823
|
readonly visible: true;
|
|
824
824
|
readonly splitNumber: 5;
|
|
825
|
-
readonly length:
|
|
825
|
+
readonly length: 8;
|
|
826
826
|
readonly width: 1;
|
|
827
827
|
readonly color: "gray.700";
|
|
828
828
|
};
|
|
829
829
|
readonly splitLine: {
|
|
830
830
|
readonly visible: true;
|
|
831
|
-
readonly length:
|
|
831
|
+
readonly length: 12;
|
|
832
832
|
readonly width: 2;
|
|
833
833
|
readonly color: "gray.700";
|
|
834
834
|
};
|
|
835
835
|
readonly axisLabel: {
|
|
836
836
|
readonly visible: true;
|
|
837
|
-
readonly distance:
|
|
837
|
+
readonly distance: 12;
|
|
838
838
|
readonly color: "gray.700";
|
|
839
839
|
readonly fontSize: 12;
|
|
840
840
|
readonly bold: false;
|
|
@@ -863,18 +863,18 @@ export declare const defaultChartConfig: {
|
|
|
863
863
|
};
|
|
864
864
|
readonly title: {
|
|
865
865
|
readonly visible: true;
|
|
866
|
-
readonly offsetY: 0.
|
|
866
|
+
readonly offsetY: 0.95;
|
|
867
867
|
readonly color: "gray.700";
|
|
868
|
-
readonly fontSize:
|
|
868
|
+
readonly fontSize: 12;
|
|
869
869
|
readonly bold: false;
|
|
870
870
|
readonly italic: false;
|
|
871
871
|
readonly family: "Arial";
|
|
872
872
|
};
|
|
873
873
|
readonly detail: {
|
|
874
874
|
readonly visible: true;
|
|
875
|
-
readonly offsetY: 0.
|
|
875
|
+
readonly offsetY: 0.65;
|
|
876
876
|
readonly color: "gray.700";
|
|
877
|
-
readonly fontSize:
|
|
877
|
+
readonly fontSize: 14;
|
|
878
878
|
readonly bold: true;
|
|
879
879
|
readonly italic: false;
|
|
880
880
|
readonly family: "Arial";
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ChartDirection, ChartRuntimeStyle } from '../../../types';
|
|
2
|
+
export declare const DEFAULT_CHART_DIRECTION: ChartDirection;
|
|
2
3
|
export declare const EChartRenderEngineName = "EChartRenderEngine";
|
|
3
4
|
export declare const defaultChartWidth = 468;
|
|
4
5
|
export declare const defaultChartHeight = 369;
|
|
@@ -6,7 +7,7 @@ export declare const LegendPadding = 15;
|
|
|
6
7
|
export declare const TitleOrLegendPadding = 12;
|
|
7
8
|
export declare const TitleDefaultStartPosition = 8;
|
|
8
9
|
export declare const DEFAULT_CHART_LAYOUT_PADDING = 14;
|
|
9
|
-
export declare function getChartLayoutPadding(style
|
|
10
|
+
export declare function getChartLayoutPadding(style: ChartRuntimeStyle): number;
|
|
10
11
|
export declare const TitleLineHeightBase = 1.2;
|
|
11
12
|
export declare const AxisLabelMaxPercent = 0.15;
|
|
12
13
|
export declare const defaultBubbleSize = 0.12;
|
package/lib/types/plugin.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { IConfigService, Injector, Plugin, UniverInstanceType } from '@univerjs/core';
|
|
2
1
|
import type { IUniverChartConfig } from './config/config';
|
|
2
|
+
import { IConfigService, Injector, Plugin, UniverInstanceType } from '@univerjs/core';
|
|
3
3
|
/** Registers the shared chart rendering runtime used by every chart host. */
|
|
4
4
|
export declare class UniverChartPlugin extends Plugin {
|
|
5
5
|
private readonly _config;
|
package/lib/types/types.d.ts
CHANGED
|
@@ -35,6 +35,11 @@ export interface IDimensionDefinition {
|
|
|
35
35
|
export type DimensionDefinitionLoose = IDimensionDefinition['name'] | IDimensionDefinition;
|
|
36
36
|
export type OptionDataValue = string | number | Date | null | undefined;
|
|
37
37
|
export type ChartDataSourceValues = OptionDataValue[][];
|
|
38
|
+
export interface IUniverDataSetCategorySpan {
|
|
39
|
+
fieldIndex: number;
|
|
40
|
+
startIndex: number;
|
|
41
|
+
endIndex: number;
|
|
42
|
+
}
|
|
38
43
|
/**
|
|
39
44
|
* Canonical chart dataset used by chart context operators and chart-data builders.
|
|
40
45
|
*
|
|
@@ -51,6 +56,11 @@ export interface IUniverDataSet {
|
|
|
51
56
|
dimensions: Array<DimensionDefinitionLoose>;
|
|
52
57
|
sourceType?: ChartSourceDataTypeEnum[][];
|
|
53
58
|
sourceLabels?: string[][];
|
|
59
|
+
/**
|
|
60
|
+
* Explicit category grouping topology. Absence enables adjacent path-prefix inference;
|
|
61
|
+
* an empty array explicitly keeps repeated adjacent values as separate groups.
|
|
62
|
+
*/
|
|
63
|
+
categorySpans?: IUniverDataSetCategorySpan[];
|
|
54
64
|
}
|
|
55
65
|
/** Ordered field names that define the persisted Candlestick OHLC mapping contract. */
|
|
56
66
|
export declare const CHART_CANDLESTICK_MAPPING_FIELDS: readonly ["openIndex", "highIndex", "lowIndex", "closeIndex"];
|
|
@@ -356,6 +366,8 @@ export interface IChartContext {
|
|
|
356
366
|
categoryType?: CategoryType;
|
|
357
367
|
/** Ordered selected Label field indexes. */
|
|
358
368
|
categoryIndexes?: number[];
|
|
369
|
+
/** Whether ordered category indexes should render as one root-to-leaf category axis. */
|
|
370
|
+
multiLevelCategoryAxis?: boolean;
|
|
359
371
|
/**
|
|
360
372
|
* the flag to indicate whether the chart use date axis, only all category data is date type, the chart will use date axis, if there are some string type data, the chart will use category axis even the flag is true.
|
|
361
373
|
*/
|
|
@@ -470,6 +482,28 @@ export interface IChartDataCategory {
|
|
|
470
482
|
useDateAxis: boolean;
|
|
471
483
|
items: IChartDataItem[];
|
|
472
484
|
keys: string[];
|
|
485
|
+
hierarchy?: IChartDataCategoryHierarchy;
|
|
486
|
+
}
|
|
487
|
+
export interface IChartDataCategoryLevel {
|
|
488
|
+
index: number;
|
|
489
|
+
name: string;
|
|
490
|
+
}
|
|
491
|
+
export interface IChartDataCategoryHierarchy {
|
|
492
|
+
levels: IChartDataCategoryLevel[];
|
|
493
|
+
roots: IChartDataCategoryGroup[];
|
|
494
|
+
}
|
|
495
|
+
export interface IChartDataCategoryGroup {
|
|
496
|
+
label: string;
|
|
497
|
+
startIndex: number;
|
|
498
|
+
endIndex: number;
|
|
499
|
+
children?: IChartDataCategoryGroup[];
|
|
500
|
+
}
|
|
501
|
+
export interface IChartDataCategorySegment {
|
|
502
|
+
level: number;
|
|
503
|
+
label: string;
|
|
504
|
+
path: string[];
|
|
505
|
+
startIndex: number;
|
|
506
|
+
endIndex: number;
|
|
473
507
|
}
|
|
474
508
|
export interface IChartDataSeries {
|
|
475
509
|
index: number;
|
|
@@ -694,9 +728,6 @@ export interface IChartPlotArea {
|
|
|
694
728
|
height: number;
|
|
695
729
|
}
|
|
696
730
|
export interface IChartStyle {
|
|
697
|
-
runtime: IChartRuntimeContext;
|
|
698
|
-
/** Runtime-only locale direction. It must not be persisted in chart snapshots. */
|
|
699
|
-
direction: ChartDirection;
|
|
700
731
|
width: number;
|
|
701
732
|
height: number;
|
|
702
733
|
theme: string;
|
|
@@ -825,7 +856,8 @@ export interface IRelationForceOptions {
|
|
|
825
856
|
}
|
|
826
857
|
export type ChartStyle = DeepPartial<IChartStyle>;
|
|
827
858
|
export type ChartRenderRuntimeContext = Omit<DeepPartial<IChartRuntimeContext>, 'localeTexts'> & Pick<IChartRuntimeContext, 'localeTexts'>;
|
|
828
|
-
export type ChartRuntimeStyle =
|
|
859
|
+
export type ChartRuntimeStyle = ChartStyle & {
|
|
860
|
+
direction: ChartDirection;
|
|
829
861
|
runtime: ChartRenderRuntimeContext;
|
|
830
862
|
};
|
|
831
863
|
export interface IChartConfig extends IChartData {
|
|
@@ -840,7 +872,7 @@ export interface IChartSnapshot {
|
|
|
840
872
|
dataAggregation?: IChartDataAggregation;
|
|
841
873
|
}
|
|
842
874
|
/** Persisted chart field selection accepted by the snapshot reader. */
|
|
843
|
-
export interface IChartSnapshotContext extends Pick<IChartContext, 'categoryIndexes' | 'seriesIndexes' | 'histogram'> {
|
|
875
|
+
export interface IChartSnapshotContext extends Pick<IChartContext, 'categoryIndexes' | 'multiLevelCategoryAxis' | 'seriesIndexes' | 'useDateAxis' | 'histogram'> {
|
|
844
876
|
/** Historical snapshot field decoded only when `categoryIndexes` is absent. */
|
|
845
877
|
categoryIndex?: number;
|
|
846
878
|
}
|
|
@@ -903,7 +935,13 @@ export interface IChartRenderModelImageExportInput extends IChartRenderInput {
|
|
|
903
935
|
width: number;
|
|
904
936
|
height: number;
|
|
905
937
|
}
|
|
938
|
+
export declare const ChartImageExportFormat: {
|
|
939
|
+
readonly PNG: "png";
|
|
940
|
+
readonly SVG: "svg";
|
|
941
|
+
};
|
|
942
|
+
export type ChartImageExportFormat = (typeof ChartImageExportFormat)[keyof typeof ChartImageExportFormat];
|
|
906
943
|
export interface IChartRenderModelImageExportOptions {
|
|
944
|
+
format?: ChartImageExportFormat;
|
|
907
945
|
pixelRatio?: number;
|
|
908
946
|
backgroundColor?: string | null;
|
|
909
947
|
}
|
|
@@ -911,7 +949,8 @@ export interface IChartRenderModelImageExportResult {
|
|
|
911
949
|
dataUrl: string;
|
|
912
950
|
width: number;
|
|
913
951
|
height: number;
|
|
914
|
-
|
|
952
|
+
/** Explicit raster pixel ratio. Omitted when the renderer owns the default and for vector exports. */
|
|
953
|
+
pixelRatio?: number;
|
|
915
954
|
}
|
|
916
955
|
export interface IChartRenderInstance extends IDisposable {
|
|
917
956
|
readonly mode: ChartHostRenderMode;
|
|
@@ -974,6 +1013,7 @@ export type ChartImageSource = {
|
|
|
974
1013
|
export interface IChartRenderAsImageOptions {
|
|
975
1014
|
width: number;
|
|
976
1015
|
height: number;
|
|
1016
|
+
format?: ChartImageExportFormat;
|
|
977
1017
|
pixelRatio?: number;
|
|
978
1018
|
backgroundColor?: string;
|
|
979
1019
|
echartsProvider?: any;
|
package/lib/types/util.d.ts
CHANGED
|
@@ -7,7 +7,6 @@ export declare const chartBitsUtils: {
|
|
|
7
7
|
};
|
|
8
8
|
export declare function mergeChartConfig<T extends object>(current: T | undefined, update: Partial<T>): T;
|
|
9
9
|
export declare const setProperty: (data: Record<string, any>, propertyPath: string, value: any) => void;
|
|
10
|
-
export declare const getProperty: <T = any>(data: Record<string, any> | undefined, propertyPath: string) => T | undefined;
|
|
11
10
|
/**
|
|
12
11
|
* Set graphic element to data.
|
|
13
12
|
* because we use graphic element to draw watermark title, so we need to set it to data.
|
|
@@ -1,4 +1,10 @@
|
|
|
1
|
+
/** Copies only the top-level container while preserving nested references. */
|
|
2
|
+
export declare function shallowClone<T>(value: T): T;
|
|
1
3
|
/** Deep-clones a value while removing own properties whose value is undefined. */
|
|
2
4
|
export declare function cloneWithoutUndefined<T>(value: T): T;
|
|
3
5
|
/** Returns an undefined-free record, or undefined when no fields remain. */
|
|
4
6
|
export declare function compactRecord<T extends object>(value: T): T | undefined;
|
|
7
|
+
/** Returns a shallow copy without own string fields whose value is undefined. */
|
|
8
|
+
export declare function omitUndefinedFields<T extends object>(value: T): T;
|
|
9
|
+
/** Deletes own string fields whose value is undefined and preserves object identity. */
|
|
10
|
+
export declare function deleteUndefinedFields<T extends object>(target: T): T;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const DEFAULT_CHART_DEVICE_PIXEL_RATIO = 2;
|