@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.
Files changed (187) hide show
  1. package/README.md +9 -0
  2. package/lib/cjs/facade.js +1 -1
  3. package/lib/cjs/index.js +1 -1
  4. package/lib/cjs/locale/ar-SA.js +1 -1
  5. package/lib/cjs/locale/ca-ES.js +1 -1
  6. package/lib/cjs/locale/de-DE.js +1 -1
  7. package/lib/cjs/locale/en-US.js +1 -1
  8. package/lib/cjs/locale/es-ES.js +1 -1
  9. package/lib/cjs/locale/fa-IR.js +1 -1
  10. package/lib/cjs/locale/fr-FR.js +1 -1
  11. package/lib/cjs/locale/id-ID.js +1 -1
  12. package/lib/cjs/locale/it-IT.js +1 -1
  13. package/lib/cjs/locale/ja-JP.js +1 -1
  14. package/lib/cjs/locale/ko-KR.js +1 -1
  15. package/lib/cjs/locale/pl-PL.js +1 -1
  16. package/lib/cjs/locale/pt-BR.js +1 -1
  17. package/lib/cjs/locale/ru-RU.js +1 -1
  18. package/lib/cjs/locale/sk-SK.js +1 -1
  19. package/lib/cjs/locale/vi-VN.js +1 -1
  20. package/lib/cjs/locale/zh-CN.js +1 -1
  21. package/lib/cjs/locale/zh-HK.js +1 -1
  22. package/lib/cjs/locale/zh-TW.js +1 -1
  23. package/lib/es/facade.js +1 -1
  24. package/lib/es/index.js +1 -1
  25. package/lib/es/locale/ar-SA.js +1 -1
  26. package/lib/es/locale/ca-ES.js +1 -1
  27. package/lib/es/locale/de-DE.js +1 -1
  28. package/lib/es/locale/en-US.js +1 -1
  29. package/lib/es/locale/es-ES.js +1 -1
  30. package/lib/es/locale/fa-IR.js +1 -1
  31. package/lib/es/locale/fr-FR.js +1 -1
  32. package/lib/es/locale/id-ID.js +1 -1
  33. package/lib/es/locale/it-IT.js +1 -1
  34. package/lib/es/locale/ja-JP.js +1 -1
  35. package/lib/es/locale/ko-KR.js +1 -1
  36. package/lib/es/locale/pl-PL.js +1 -1
  37. package/lib/es/locale/pt-BR.js +1 -1
  38. package/lib/es/locale/ru-RU.js +1 -1
  39. package/lib/es/locale/sk-SK.js +1 -1
  40. package/lib/es/locale/vi-VN.js +1 -1
  41. package/lib/es/locale/zh-CN.js +1 -1
  42. package/lib/es/locale/zh-HK.js +1 -1
  43. package/lib/es/locale/zh-TW.js +1 -1
  44. package/lib/facade.js +1 -1
  45. package/lib/index.js +1 -1
  46. package/lib/locale/ar-SA.js +1 -1
  47. package/lib/locale/ca-ES.js +1 -1
  48. package/lib/locale/de-DE.js +1 -1
  49. package/lib/locale/en-US.js +1 -1
  50. package/lib/locale/es-ES.js +1 -1
  51. package/lib/locale/fa-IR.js +1 -1
  52. package/lib/locale/fr-FR.js +1 -1
  53. package/lib/locale/id-ID.js +1 -1
  54. package/lib/locale/it-IT.js +1 -1
  55. package/lib/locale/ja-JP.js +1 -1
  56. package/lib/locale/ko-KR.js +1 -1
  57. package/lib/locale/pl-PL.js +1 -1
  58. package/lib/locale/pt-BR.js +1 -1
  59. package/lib/locale/ru-RU.js +1 -1
  60. package/lib/locale/sk-SK.js +1 -1
  61. package/lib/locale/vi-VN.js +1 -1
  62. package/lib/locale/zh-CN.js +1 -1
  63. package/lib/locale/zh-HK.js +1 -1
  64. package/lib/locale/zh-TW.js +1 -1
  65. package/lib/types/chart-builder/chart-builder-adapter.d.ts +1 -3
  66. package/lib/types/chart-builder/chart-builder.d.ts +2 -5
  67. package/lib/types/chart-builder/chart-live-adapter.d.ts +15 -0
  68. package/lib/types/chart-builder/chart-types.d.ts +21 -0
  69. package/lib/types/chart-builder/configuration/cartesian-series.d.ts +1 -0
  70. package/lib/types/chart-builder/configuration/chart-config-group.d.ts +38 -0
  71. package/lib/types/chart-builder/configuration/chart-config-operation.d.ts +1 -38
  72. package/lib/types/chart-builder/configuration/gauge.d.ts +1 -1
  73. package/lib/types/chart-builder/conversion/chart-config-converter.d.ts +24 -11
  74. package/lib/types/chart-builder/conversion/chart-create-config.d.ts +6 -0
  75. package/lib/types/chart-builder/conversion/chart-model-fields.d.ts +20 -0
  76. package/lib/types/chart-builder/conversion/chart-type-converter.d.ts +1 -3
  77. package/lib/types/chart-builder/conversion/describe-chart-model.d.ts +0 -127
  78. package/lib/types/chart-builder/detached-chart-builder-adapter.d.ts +1 -10
  79. package/lib/types/chart-builder/internal/apply-pending-to-description.d.ts +2 -0
  80. package/lib/types/chart-builder/internal/chart-host-config-adapter.d.ts +3 -0
  81. package/lib/types/chart-builder/internal/chart-pending-patch.d.ts +11 -0
  82. package/lib/types/chart-builder/internal/patch-interpreter.d.ts +17 -0
  83. package/lib/types/facade/builders/f-area-chart-builder.d.ts +52 -7
  84. package/lib/types/facade/builders/f-boxplot-chart-builder.d.ts +88 -3
  85. package/lib/types/facade/builders/f-bubble-chart-builder.d.ts +59 -6
  86. package/lib/types/facade/builders/f-candlestick-chart-builder.d.ts +90 -31
  87. package/lib/types/facade/builders/f-chord-chart-builder.d.ts +180 -8
  88. package/lib/types/facade/builders/f-combination-chart-builder.d.ts +55 -10
  89. package/lib/types/facade/builders/f-funnel-chart-builder.d.ts +55 -9
  90. package/lib/types/facade/builders/f-gauge-chart-builder.d.ts +378 -10
  91. package/lib/types/facade/builders/f-heatmap-chart-builder.d.ts +83 -26
  92. package/lib/types/facade/builders/f-histogram-chart-builder.d.ts +142 -16
  93. package/lib/types/facade/builders/f-line-chart-builder.d.ts +51 -6
  94. package/lib/types/facade/builders/f-pareto-chart-builder.d.ts +83 -20
  95. package/lib/types/facade/builders/f-pie-chart-builder.d.ts +131 -47
  96. package/lib/types/facade/builders/f-radar-chart-builder.d.ts +64 -11
  97. package/lib/types/facade/builders/f-relation-chart-builder.d.ts +72 -38
  98. package/lib/types/facade/builders/f-scatter-chart-builder.d.ts +58 -6
  99. package/lib/types/facade/builders/f-sunburst-chart-builder.d.ts +122 -8
  100. package/lib/types/facade/builders/f-treemap-chart-builder.d.ts +115 -13
  101. package/lib/types/facade/builders/f-waterfall-chart-builder.d.ts +87 -53
  102. package/lib/types/facade/builders/f-word-cloud-chart-builder.d.ts +64 -15
  103. package/lib/types/facade/chart-builder-registry.d.ts +4 -4
  104. package/lib/types/facade/chart-builder-type-map.d.ts +35 -32
  105. package/lib/types/facade/chart-host-builder-types.d.ts +2 -21
  106. package/lib/types/facade/create-chart-builder.d.ts +46 -0
  107. package/lib/types/facade/f-axis-chart-builder.d.ts +21 -38
  108. package/lib/types/facade/f-cartesian-chart-builder.d.ts +32 -20
  109. package/lib/types/facade/f-chart-builder-base.d.ts +240 -73
  110. package/lib/types/facade/f-chart.d.ts +686 -0
  111. package/lib/types/facade/f-enum.d.ts +684 -31
  112. package/lib/types/facade/f-univer.d.ts +51 -0
  113. package/lib/types/facade/index.d.ts +7 -9
  114. package/lib/types/facade/internal/category-fields.d.ts +3 -0
  115. package/lib/types/facade/internal/chart-builder-facade-context.d.ts +11 -10
  116. package/lib/types/index.d.ts +28 -17
  117. package/lib/types/models/chart-context/chart-field-selection.d.ts +1 -1
  118. package/lib/types/models/chart-context/resolve-chart-context.d.ts +3 -0
  119. package/lib/types/models/chart-data/chart-field-consumption-validator.d.ts +1 -1
  120. package/lib/types/models/chart-data/internal/category-series-aggregation.d.ts +1 -2
  121. package/lib/types/models/chart-data/internal/data-set-category-spans.d.ts +7 -0
  122. package/lib/types/models/chart-data/internal/multi-level-category-axis.d.ts +10 -0
  123. package/lib/types/models/chart-host/config/chart-config-interpreter.d.ts +13 -0
  124. package/lib/types/models/chart-host/resource/chart-data-source-resolver.d.ts +58 -0
  125. package/lib/types/models/chart-host/resource/chart-resource-repository.d.ts +111 -0
  126. package/lib/types/models/chart-host/resource/chart-resource-serializer.d.ts +2 -1
  127. package/lib/types/models/chart-host/resource/inline-chart-table.d.ts +4 -3
  128. package/lib/types/models/chart-host/resource/persisted-chart-style.d.ts +3 -0
  129. package/lib/types/models/chart-host/resource/resource-ref-chart-data-source.adapter.d.ts +22 -0
  130. package/lib/types/models/chart-host/resource/resource-ref-chart-data-source.provider.d.ts +12 -0
  131. package/lib/types/models/chart-host/static/chart-model-store.d.ts +56 -0
  132. package/lib/types/models/chart-host/static/{static-chart-runtime.d.ts → chart-runtime.d.ts} +6 -5
  133. package/lib/types/models/chart-model/chart-model.d.ts +2 -383
  134. package/lib/types/models/chart-render/axes/chart-runtime-axes.d.ts +2 -2
  135. package/lib/types/models/chart-render/chart-render-input-resolver.d.ts +2 -2
  136. package/lib/types/models/chart-render/converter/category-axis-domain.d.ts +6 -0
  137. package/lib/types/models/chart-render/converter/converters/gauge-chart-converter.d.ts +5 -3
  138. package/lib/types/models/chart-render/converter/echart-text-overflow.d.ts +7 -0
  139. package/lib/types/models/chart-render/converter/render-spec-operators/grid-operator.d.ts +3 -3
  140. package/lib/types/models/chart-render/converter/render-spec-operators/legend-size.d.ts +1 -2
  141. package/lib/types/models/chart-render/converter/render-spec-operators/multi-level-category-axis-grid.operator.d.ts +2 -0
  142. package/lib/types/models/chart-render/converter/render-spec-operators/multi-level-category-axis-layout.d.ts +23 -0
  143. package/lib/types/models/chart-render/converter/render-spec-operators/multi-level-category-axis-overlay.operator.d.ts +12 -0
  144. package/lib/types/models/chart-render/converter/render-spec-operators/series-style-operator/series-style-operator.d.ts +2 -2
  145. package/lib/types/models/chart-render/converter/render-spec-operators/tool-tip-operator.d.ts +3 -13
  146. package/lib/types/models/chart-render/converter/render-spec-operators/tools.d.ts +4 -4
  147. package/lib/types/models/chart-render/converter/render-spec-operators/visual-map-operator.d.ts +4 -0
  148. package/lib/types/models/chart-render/echart-render-model.d.ts +7 -3
  149. package/lib/types/models/chart-render/edit-overlay/chart-element-edit-overlay.d.ts +1 -1
  150. package/lib/types/models/chart-render/edit-overlay/resolve-chart-element-hit-layout.d.ts +1 -1
  151. package/lib/types/models/chart-render/style/chart-runtime-style.d.ts +0 -1
  152. package/lib/types/models/common/constants/default-chart-style.d.ts +53 -53
  153. package/lib/types/models/common/constants/default.d.ts +3 -2
  154. package/lib/types/plugin.d.ts +1 -1
  155. package/lib/types/types.d.ts +46 -6
  156. package/lib/types/util.d.ts +0 -1
  157. package/lib/types/utils/compact.d.ts +6 -0
  158. package/lib/types/utils/device-pixel-ratio.d.ts +1 -0
  159. package/lib/umd/facade.js +1 -1
  160. package/lib/umd/index.js +1 -1
  161. package/lib/umd/locale/ar-SA.js +1 -1
  162. package/lib/umd/locale/ca-ES.js +1 -1
  163. package/lib/umd/locale/de-DE.js +1 -1
  164. package/lib/umd/locale/en-US.js +1 -1
  165. package/lib/umd/locale/es-ES.js +1 -1
  166. package/lib/umd/locale/fa-IR.js +1 -1
  167. package/lib/umd/locale/fr-FR.js +1 -1
  168. package/lib/umd/locale/id-ID.js +1 -1
  169. package/lib/umd/locale/it-IT.js +1 -1
  170. package/lib/umd/locale/ja-JP.js +1 -1
  171. package/lib/umd/locale/ko-KR.js +1 -1
  172. package/lib/umd/locale/pl-PL.js +1 -1
  173. package/lib/umd/locale/pt-BR.js +1 -1
  174. package/lib/umd/locale/ru-RU.js +1 -1
  175. package/lib/umd/locale/sk-SK.js +1 -1
  176. package/lib/umd/locale/vi-VN.js +1 -1
  177. package/lib/umd/locale/zh-CN.js +1 -1
  178. package/lib/umd/locale/zh-HK.js +1 -1
  179. package/lib/umd/locale/zh-TW.js +1 -1
  180. package/package.json +7 -6
  181. package/lib/types/chart-builder/internal/host-builder-runtime.d.ts +0 -3
  182. package/lib/types/chart-builder/internal/merge-description.d.ts +0 -2
  183. package/lib/types/facade/f-chart-base.d.ts +0 -82
  184. package/lib/types/facade/f-charts-base.d.ts +0 -74
  185. package/lib/types/facade/internal/host-builder-composer.d.ts +0 -16
  186. package/lib/types/models/chart-host/resource/static-chart-resource-repository.d.ts +0 -75
  187. package/lib/types/models/chart-host/static/static-chart-model-store.d.ts +0 -43
@@ -1,2 +1,6 @@
1
1
  import type { EChartRenderSpecOperator } from '../../../../types';
2
+ export declare const VisualMapOrientation: {
3
+ readonly Horizontal: "horizontal";
4
+ readonly Vertical: "vertical";
5
+ };
2
6
  export declare const visualMapOperator: EChartRenderSpecOperator;
@@ -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: 6;
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: 10;
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: 14;
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.65;
64
+ readonly offsetY: 0.95;
65
65
  readonly color: "gray.700";
66
- readonly fontSize: 14;
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.35;
73
+ readonly offsetY: 0.65;
74
74
  readonly color: "gray.700";
75
- readonly fontSize: 32;
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: 6;
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: 10;
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: 14;
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.65;
142
+ readonly offsetY: 0.95;
143
143
  readonly color: "gray.700";
144
- readonly fontSize: 14;
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.35;
151
+ readonly offsetY: 0.65;
152
152
  readonly color: "gray.700";
153
- readonly fontSize: 20;
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: 14;
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.65;
206
+ readonly offsetY: 0.95;
207
207
  readonly visible: true;
208
208
  readonly color: "gray.700";
209
- readonly fontSize: 14;
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.35;
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: 6;
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.65;
276
+ readonly offsetY: 0.95;
277
277
  readonly color: "gray.700";
278
- readonly fontSize: 14;
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.35;
285
+ readonly offsetY: 0.65;
286
286
  readonly color: "gray.700";
287
- readonly fontSize: 32;
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.35;
333
+ readonly offsetY: 0.65;
334
334
  readonly color: "gray.700";
335
- readonly fontSize: 32;
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: 6;
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: 10;
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: 14;
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.65;
403
+ readonly offsetY: 0.95;
404
404
  readonly color: "gray.700";
405
- readonly fontSize: 14;
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.35;
412
+ readonly offsetY: 0.65;
413
413
  readonly color: "gray.700";
414
- readonly fontSize: 32;
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: 6;
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: 10;
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: 14;
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.65;
481
+ readonly offsetY: 0.95;
482
482
  readonly color: "gray.700";
483
- readonly fontSize: 14;
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.35;
490
+ readonly offsetY: 0.65;
491
491
  readonly color: "gray.700";
492
- readonly fontSize: 20;
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.65;
537
+ readonly offsetY: 0.95;
538
538
  readonly color: "gray.700";
539
- readonly fontSize: 14;
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.35;
546
+ readonly offsetY: 0.65;
547
547
  readonly color: "gray.700";
548
- readonly fontSize: 32;
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.35;
594
+ readonly offsetY: 0.65;
595
595
  readonly color: "gray.700";
596
- readonly fontSize: 32;
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: 6;
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: 10;
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: 14;
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.65;
866
+ readonly offsetY: 0.95;
867
867
  readonly color: "gray.700";
868
- readonly fontSize: 14;
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.35;
875
+ readonly offsetY: 0.65;
876
876
  readonly color: "gray.700";
877
- readonly fontSize: 20;
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 { ChartStyle } from '../../../types';
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?: ChartStyle): number;
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;
@@ -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;
@@ -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 = Omit<ChartStyle, 'runtime'> & {
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
- pixelRatio: number;
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;
@@ -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;