@univerjs-pro/chart-ui 1.0.0-alpha.7 → 1.0.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (176) hide show
  1. package/lib/cjs/index.js +1 -1
  2. package/lib/cjs/locale/ar-SA.js +1 -1
  3. package/lib/cjs/locale/ca-ES.js +1 -1
  4. package/lib/cjs/locale/de-DE.js +1 -1
  5. package/lib/cjs/locale/en-US.js +1 -1
  6. package/lib/cjs/locale/es-ES.js +1 -1
  7. package/lib/cjs/locale/fa-IR.js +1 -1
  8. package/lib/cjs/locale/fr-FR.js +1 -1
  9. package/lib/cjs/locale/id-ID.js +1 -1
  10. package/lib/cjs/locale/it-IT.js +1 -1
  11. package/lib/cjs/locale/ja-JP.js +1 -1
  12. package/lib/cjs/locale/ko-KR.js +1 -1
  13. package/lib/cjs/locale/pl-PL.js +1 -1
  14. package/lib/cjs/locale/pt-BR.js +1 -1
  15. package/lib/cjs/locale/ru-RU.js +1 -1
  16. package/lib/cjs/locale/sk-SK.js +1 -1
  17. package/lib/cjs/locale/vi-VN.js +1 -1
  18. package/lib/cjs/locale/zh-CN.js +1 -1
  19. package/lib/cjs/locale/zh-HK.js +1 -1
  20. package/lib/cjs/locale/zh-TW.js +1 -1
  21. package/lib/es/index.js +1 -1
  22. package/lib/es/locale/ar-SA.js +1 -1
  23. package/lib/es/locale/ca-ES.js +1 -1
  24. package/lib/es/locale/de-DE.js +1 -1
  25. package/lib/es/locale/en-US.js +1 -1
  26. package/lib/es/locale/es-ES.js +1 -1
  27. package/lib/es/locale/fa-IR.js +1 -1
  28. package/lib/es/locale/fr-FR.js +1 -1
  29. package/lib/es/locale/id-ID.js +1 -1
  30. package/lib/es/locale/it-IT.js +1 -1
  31. package/lib/es/locale/ja-JP.js +1 -1
  32. package/lib/es/locale/ko-KR.js +1 -1
  33. package/lib/es/locale/pl-PL.js +1 -1
  34. package/lib/es/locale/pt-BR.js +1 -1
  35. package/lib/es/locale/ru-RU.js +1 -1
  36. package/lib/es/locale/sk-SK.js +1 -1
  37. package/lib/es/locale/vi-VN.js +1 -1
  38. package/lib/es/locale/zh-CN.js +1 -1
  39. package/lib/es/locale/zh-HK.js +1 -1
  40. package/lib/es/locale/zh-TW.js +1 -1
  41. package/lib/index.css +323 -6
  42. package/lib/index.js +1 -1
  43. package/lib/locale/ar-SA.js +1 -1
  44. package/lib/locale/ca-ES.js +1 -1
  45. package/lib/locale/de-DE.js +1 -1
  46. package/lib/locale/en-US.js +1 -1
  47. package/lib/locale/es-ES.js +1 -1
  48. package/lib/locale/fa-IR.js +1 -1
  49. package/lib/locale/fr-FR.js +1 -1
  50. package/lib/locale/id-ID.js +1 -1
  51. package/lib/locale/it-IT.js +1 -1
  52. package/lib/locale/ja-JP.js +1 -1
  53. package/lib/locale/ko-KR.js +1 -1
  54. package/lib/locale/pl-PL.js +1 -1
  55. package/lib/locale/pt-BR.js +1 -1
  56. package/lib/locale/ru-RU.js +1 -1
  57. package/lib/locale/sk-SK.js +1 -1
  58. package/lib/locale/vi-VN.js +1 -1
  59. package/lib/locale/zh-CN.js +1 -1
  60. package/lib/locale/zh-HK.js +1 -1
  61. package/lib/locale/zh-TW.js +1 -1
  62. package/lib/types/components/ChartEditPanel.d.ts +49 -0
  63. package/lib/types/components/ChartInlineTableEditor.d.ts +5 -0
  64. package/lib/types/components/ChartSemanticDataFields.d.ts +28 -0
  65. package/lib/types/components/ChartTypeOptions.d.ts +148 -2
  66. package/lib/types/components/FontFormatBar.d.ts +19 -1
  67. package/lib/types/components/chart-inline-starter-data.d.ts +23 -0
  68. package/lib/types/components/use-chart-panel-input-focus.d.ts +4 -0
  69. package/lib/types/controllers/components.controller.d.ts +4 -2
  70. package/lib/types/editor/ChartEditorProvider.d.ts +11 -0
  71. package/lib/types/editor/atoms/common/ChartFontAtom.d.ts +28 -0
  72. package/lib/types/editor/atoms/common/ChartNumberFormatAtom.d.ts +9 -0
  73. package/lib/types/editor/atoms/common/chart-number-format.d.ts +28 -0
  74. package/lib/types/editor/components/ChartCheckboxField.d.ts +11 -0
  75. package/lib/types/editor/components/ChartColorField.d.ts +13 -0
  76. package/lib/types/editor/components/ChartField.d.ts +15 -0
  77. package/lib/types/editor/components/ChartFieldGroup.d.ts +9 -0
  78. package/lib/types/editor/components/ChartFieldGroupTitle.d.ts +6 -0
  79. package/lib/types/editor/components/ChartFieldRow.d.ts +5 -0
  80. package/lib/types/editor/components/ChartFontField.d.ts +28 -0
  81. package/lib/types/editor/components/ChartImageSelectField.d.ts +13 -0
  82. package/lib/types/editor/components/ChartListField.d.ts +18 -0
  83. package/lib/types/editor/components/ChartMultiSelectField.d.ts +25 -0
  84. package/lib/types/editor/components/ChartNumberField.d.ts +16 -0
  85. package/lib/types/editor/components/ChartSelectField.d.ts +25 -0
  86. package/lib/types/editor/components/ChartTextField.d.ts +14 -0
  87. package/lib/types/editor/hooks/use-chart-config-state.d.ts +3 -0
  88. package/lib/types/editor/hooks/use-chart-data-mapping-fields.d.ts +5 -0
  89. package/lib/types/editor/hooks/use-chart-editor-model.d.ts +3 -0
  90. package/lib/types/editor/hooks/use-chart-runtime-context.d.ts +13 -0
  91. package/lib/types/editor/routing/chart-edit-panel-route.d.ts +21 -0
  92. package/lib/types/editor/sections/ChartAxisSections.d.ts +63 -0
  93. package/lib/types/editor/sections/ChartIndicatorLineSection.d.ts +20 -0
  94. package/lib/types/editor/sections/ChartLegendSection.d.ts +27 -0
  95. package/lib/types/editor/sections/ChartLineAndAreaSection.d.ts +11 -0
  96. package/lib/types/editor/sections/ChartParetoSeriesSection.d.ts +26 -0
  97. package/lib/types/editor/sections/ChartSeriesSection.d.ts +60 -0
  98. package/lib/types/editor/sections/ChartSetupSections.d.ts +21 -0
  99. package/lib/types/editor/sections/ChartStyleSection.d.ts +15 -0
  100. package/lib/types/editor/sections/ChartTitleSections.d.ts +50 -0
  101. package/lib/types/editor/sections/ChartTrendlineSection.d.ts +18 -0
  102. package/lib/types/editor/sections/chart-capabilities.d.ts +10 -0
  103. package/lib/types/editor/sections/chart-style-options.d.ts +86 -0
  104. package/lib/types/editor/sections/specific-section/ChartCandlestickStyleSection.d.ts +1 -0
  105. package/lib/types/editor/sections/specific-section/ChartFunnelStyleSection.d.ts +10 -0
  106. package/lib/types/editor/sections/specific-section/ChartHeatmapStyleSection.d.ts +10 -0
  107. package/lib/types/editor/sections/specific-section/ChartHistogramStyleSection.d.ts +1 -0
  108. package/lib/types/editor/sections/specific-section/ChartPieStyleSection.d.ts +21 -0
  109. package/lib/types/editor/sections/specific-section/ChartRadarStyleSection.d.ts +9 -0
  110. package/lib/types/editor/sections/specific-section/ChartRelationStyleSection.d.ts +17 -0
  111. package/lib/types/editor/sections/specific-section/ChartTreemapStyleSection.d.ts +1 -0
  112. package/lib/types/editor/sections/specific-section/ChartTypeSpecificSections.d.ts +9 -0
  113. package/lib/types/editor/sections/specific-section/ChartWaterfallStyleSection.d.ts +26 -0
  114. package/lib/types/editor/sections/specific-section/ChartWordCloudStyleSection.d.ts +21 -0
  115. package/lib/types/editor/sections/specific-section/ChordDataMappingAtom.d.ts +1 -0
  116. package/lib/types/editor/sections/specific-section/ChordLabelAtom.d.ts +1 -0
  117. package/lib/types/editor/sections/specific-section/ChordLayoutAtom.d.ts +1 -0
  118. package/lib/types/editor/sections/specific-section/ChordRibbonAtom.d.ts +1 -0
  119. package/lib/types/editor/sections/specific-section/GaugeDataMappingAtom.d.ts +1 -0
  120. package/lib/types/editor/sections/specific-section/GaugeModeAtom.d.ts +1 -0
  121. package/lib/types/editor/sections/specific-section/GaugePointerAtom.d.ts +1 -0
  122. package/lib/types/editor/sections/specific-section/GaugeProgressAtom.d.ts +1 -0
  123. package/lib/types/editor/sections/specific-section/GaugeRangesAtom.d.ts +1 -0
  124. package/lib/types/editor/sections/specific-section/GaugeScaleAtom.d.ts +1 -0
  125. package/lib/types/editor/sections/specific-section/SunburstCenterLabelAtom.d.ts +1 -0
  126. package/lib/types/editor/sections/specific-section/SunburstDataMappingAtom.d.ts +1 -0
  127. package/lib/types/editor/sections/specific-section/SunburstLabelAtom.d.ts +1 -0
  128. package/lib/types/editor/sections/specific-section/chord-field-options.d.ts +2 -0
  129. package/lib/types/editor/sections/specific-section/chord-style.d.ts +16 -0
  130. package/lib/types/editor/sections/specific-section/gauge-style.d.ts +10 -0
  131. package/lib/types/editor/sections/specific-section/sunburst-label.d.ts +8 -0
  132. package/lib/types/editor/utils/chart-runtime-axis.d.ts +3 -0
  133. package/lib/types/float-menu/ChartElementFloatMenu.d.ts +2 -2
  134. package/lib/types/float-menu/chart-element-selection.d.ts +7 -0
  135. package/lib/types/float-menu/constants.d.ts +72 -77
  136. package/lib/types/float-menu/create-chart-element-float-menu-adapter.d.ts +10 -0
  137. package/lib/types/float-menu/pie-mark-patch.d.ts +8 -0
  138. package/lib/types/float-menu/types.d.ts +28 -9
  139. package/lib/types/index.d.ts +68 -3
  140. package/lib/types/locale/en-US.d.ts +481 -58
  141. package/lib/types/services/chart-host-adapter.d.ts +12 -0
  142. package/lib/types/services/chart-snapshot-queue.d.ts +58 -0
  143. package/lib/types/services/chart-ui.service.d.ts +19 -0
  144. package/lib/types/services/chart-view-state-projector.d.ts +15 -0
  145. package/lib/types/services/chart-view-state-registry.d.ts +11 -0
  146. package/lib/types/services/chart-view-state.d.ts +118 -0
  147. package/lib/types/services/inline-chart-creation.d.ts +42 -0
  148. package/lib/types/services/register-chart-config-states.d.ts +3 -0
  149. package/lib/types/services/register-chart-view-states/chart-specific.d.ts +4 -0
  150. package/lib/types/services/register-chart-view-states/semantic.d.ts +4 -0
  151. package/lib/umd/index.js +1 -1
  152. package/lib/umd/locale/ar-SA.js +1 -1
  153. package/lib/umd/locale/ca-ES.js +1 -1
  154. package/lib/umd/locale/de-DE.js +1 -1
  155. package/lib/umd/locale/en-US.js +1 -1
  156. package/lib/umd/locale/es-ES.js +1 -1
  157. package/lib/umd/locale/fa-IR.js +1 -1
  158. package/lib/umd/locale/fr-FR.js +1 -1
  159. package/lib/umd/locale/id-ID.js +1 -1
  160. package/lib/umd/locale/it-IT.js +1 -1
  161. package/lib/umd/locale/ja-JP.js +1 -1
  162. package/lib/umd/locale/ko-KR.js +1 -1
  163. package/lib/umd/locale/pl-PL.js +1 -1
  164. package/lib/umd/locale/pt-BR.js +1 -1
  165. package/lib/umd/locale/ru-RU.js +1 -1
  166. package/lib/umd/locale/sk-SK.js +1 -1
  167. package/lib/umd/locale/vi-VN.js +1 -1
  168. package/lib/umd/locale/zh-CN.js +1 -1
  169. package/lib/umd/locale/zh-HK.js +1 -1
  170. package/lib/umd/locale/zh-TW.js +1 -1
  171. package/package.json +11 -8
  172. package/lib/types/components/ChartEditPanelScaffold.d.ts +0 -16
  173. package/lib/types/components/ChartEditorFields.d.ts +0 -65
  174. package/lib/types/components/ChartPresentationFields.d.ts +0 -8
  175. package/lib/types/components/index.d.ts +0 -16
  176. package/lib/types/float-menu/index.d.ts +0 -5
@@ -0,0 +1,58 @@
1
+ import type { IStaticChartModelRuntime } from '@univerjs-pro/engine-chart';
2
+ import type { LocaleService } from '@univerjs/core';
3
+ import { Disposable } from '@univerjs/core';
4
+ import { Subject } from 'rxjs';
5
+ export interface IChartSnapshotRequest {
6
+ unitId: string;
7
+ chartId: string;
8
+ width: number;
9
+ height: number;
10
+ dpr?: number;
11
+ mode?: string;
12
+ }
13
+ export interface IChartSnapshotEntry {
14
+ key: string;
15
+ status: 'pending' | 'ready' | 'error';
16
+ dataUrl?: string;
17
+ error?: unknown;
18
+ }
19
+ export interface IChartSnapshotInvalidation {
20
+ unitId: string;
21
+ chartId: string;
22
+ }
23
+ export interface IChartSnapshotInvalidationOptions {
24
+ waitForConfig?: boolean;
25
+ }
26
+ export interface IChartSnapshotRenderer<TRequest extends IChartSnapshotRequest, TRuntime extends IStaticChartModelRuntime = IStaticChartModelRuntime> {
27
+ render(request: TRequest, runtime: TRuntime): Promise<string>;
28
+ }
29
+ export interface IChartSnapshotRuntimeProvider<TRuntime extends IStaticChartModelRuntime> {
30
+ ensureChartModel(unitId: string, chartId: string): TRuntime | undefined;
31
+ getChartModel(unitId: string, chartId: string): TRuntime | undefined;
32
+ }
33
+ export declare class ChartSnapshotQueue<TRequest extends IChartSnapshotRequest, TRuntime extends IStaticChartModelRuntime = IStaticChartModelRuntime> extends Disposable {
34
+ private readonly _localeService;
35
+ private readonly _modelService;
36
+ private readonly _renderer;
37
+ readonly snapshotUpdated$: Subject<IChartSnapshotEntry>;
38
+ readonly chartInvalidated$: Subject<IChartSnapshotInvalidation>;
39
+ private readonly _cache;
40
+ private readonly _queue;
41
+ private readonly _configWaitKeys;
42
+ private _rendering;
43
+ private _activeDrain;
44
+ constructor(_localeService: LocaleService, _modelService: IChartSnapshotRuntimeProvider<TRuntime>, _renderer: IChartSnapshotRenderer<TRequest, TRuntime>);
45
+ requestSnapshot(request: TRequest): IChartSnapshotEntry;
46
+ getSnapshot(request: TRequest): IChartSnapshotEntry | undefined;
47
+ invalidateChart(unitId: string, chartId: string, options?: IChartSnapshotInvalidationOptions): void;
48
+ getCacheKey(request: TRequest): string;
49
+ flushForTests(): Promise<void>;
50
+ dispose(): void;
51
+ private _drainQueue;
52
+ private _invalidateSnapshotsForDirectionChange;
53
+ private _runQueue;
54
+ private _renderOne;
55
+ private _waitForRuntimeConfig;
56
+ private _getChartKey;
57
+ private _getRuntimeModel;
58
+ }
@@ -0,0 +1,19 @@
1
+ import type { IDisposable } from '@univerjs/core';
2
+ import type { ChartViewStateName, IChartViewStateDefinition, IChartViewStateMap } from './chart-view-state';
3
+ import { Disposable } from '@univerjs/core';
4
+ import { ChartViewStateRegistry } from './chart-view-state-registry';
5
+ export interface IChartUIService<TRuntimeModel = unknown, TUpdateConfigParams = never> {
6
+ readonly activeRuntimeModel: TRuntimeModel | null;
7
+ executeChartUpdateConfig(params: TUpdateConfigParams): void;
8
+ registerViewState<K extends ChartViewStateName>(key: K, definition: IChartViewStateDefinition<IChartViewStateMap[K]>): IDisposable;
9
+ getViewState<K extends ChartViewStateName>(key: K): IChartViewStateDefinition<IChartViewStateMap[K]>;
10
+ }
11
+ export declare const IChartUIService: import("@wendellhu/redi").IdentifierDecorator<IChartUIService<unknown, never>>;
12
+ export declare abstract class ChartUIService<TRuntimeModel, TUpdateConfigParams> extends Disposable implements IChartUIService<TRuntimeModel, TUpdateConfigParams> {
13
+ abstract readonly activeRuntimeModel: TRuntimeModel | null;
14
+ abstract executeChartUpdateConfig(params: TUpdateConfigParams): void;
15
+ private readonly _viewStates;
16
+ constructor(viewStates: ChartViewStateRegistry);
17
+ registerViewState<K extends ChartViewStateName>(key: K, definition: IChartViewStateDefinition<IChartViewStateMap[K]>): IDisposable;
18
+ getViewState<K extends ChartViewStateName>(key: K): IChartViewStateDefinition<IChartViewStateMap[K]>;
19
+ }
@@ -0,0 +1,15 @@
1
+ import type { ChartModel } from '@univerjs-pro/engine-chart';
2
+ import type { Observable } from 'rxjs';
3
+ import type { IChartViewStateMap } from './chart-view-state';
4
+ import { ChartViewStateKey } from './chart-view-state';
5
+ export interface IChartViewStateProjector {
6
+ get<K extends ChartViewStateKey>(model: ChartModel, key: K): IChartViewStateMap[K];
7
+ observe<K extends ChartViewStateKey>(model: ChartModel, key: K): Observable<IChartViewStateMap[K]>;
8
+ }
9
+ export declare class ChartViewStateProjector implements IChartViewStateProjector {
10
+ private readonly _observables;
11
+ get<K extends ChartViewStateKey>(model: ChartModel, key: K): IChartViewStateMap[K];
12
+ observe<K extends ChartViewStateKey>(model: ChartModel, key: K): Observable<IChartViewStateMap[K]>;
13
+ private _dependencies;
14
+ private _project;
15
+ }
@@ -0,0 +1,11 @@
1
+ import type { IDisposable } from '@univerjs/core';
2
+ import type { ChartViewStateName, IChartViewStateDefinition, IChartViewStateMap } from './chart-view-state';
3
+ export interface IChartViewStateRegistry {
4
+ registerViewState<K extends ChartViewStateName>(key: K, definition: IChartViewStateDefinition<IChartViewStateMap[K]>): IDisposable;
5
+ resolve<K extends ChartViewStateName>(key: K): IChartViewStateDefinition<IChartViewStateMap[K]>;
6
+ }
7
+ export declare class ChartViewStateRegistry implements IChartViewStateRegistry {
8
+ private readonly _definitions;
9
+ registerViewState<K extends ChartViewStateName>(key: K, definition: IChartViewStateDefinition<IChartViewStateMap[K]>): IDisposable;
10
+ resolve<K extends ChartViewStateName>(key: K): IChartViewStateDefinition<IChartViewStateMap[K]>;
11
+ }
@@ -0,0 +1,118 @@
1
+ import type { ChartPendingConfig, ChartTypeBits, DeepNullish, IChartChordMappingSpec, IChartChordSpec, IChartGaugeSpec, IChartHeatmapSpec, IChartSeriesDescription, IChartSunburstSpec } from '@univerjs-pro/engine-chart';
2
+ import type { Observable } from 'rxjs';
3
+ import type { IChartHostAdapter } from './chart-host-adapter';
4
+ export interface IChartEditorOption {
5
+ label: string;
6
+ value: string;
7
+ }
8
+ export interface IChartChordFieldOptions {
9
+ categoryFields: IChartEditorOption[];
10
+ valueFields: IChartEditorOption[];
11
+ }
12
+ export interface IChartEditorSeriesState {
13
+ dataPointOptions: IChartEditorOption[];
14
+ name: string;
15
+ selector: number;
16
+ style: DeepNullish<Omit<IChartSeriesDescription, 'name'>>;
17
+ }
18
+ /**
19
+ * Stable in-process identities used by the chart editor state registry.
20
+ *
21
+ * These values identify editor view state only. They are not command IDs,
22
+ * persisted values, or collaborative wire contracts.
23
+ */
24
+ export declare enum ChartViewStateKey {
25
+ /** Authored style shared by all series. */
26
+ AllSeriesStyle = "allSeriesStyle",
27
+ Appearance = "appearance",
28
+ Aggregation = "aggregation",
29
+ Area = "area",
30
+ AutoGradientFill = "autoGradientFill",
31
+ Bar = "bar",
32
+ Axes = "axes",
33
+ AxisPointer = "axisPointer",
34
+ Candlestick = "candlestick",
35
+ ChartType = "chartType",
36
+ ChordFields = "chordFields",
37
+ ChordMapping = "chordMapping",
38
+ ChordStyle = "chordStyle",
39
+ Funnel = "funnel",
40
+ GaugeFields = "gaugeFields",
41
+ GaugeLabelIndex = "gaugeLabelIndex",
42
+ GaugeStyle = "gaugeStyle",
43
+ GaugeValueIndex = "gaugeValueIndex",
44
+ Heatmap = "heatmap",
45
+ Histogram = "histogram",
46
+ InvalidValueStrategy = "invalidValueStrategy",
47
+ Legend = "legend",
48
+ /** Authored category, series, hierarchy, and relation field mapping. */
49
+ Mapping = "mapping",
50
+ MappingFields = "mappingFields",
51
+ Pareto = "pareto",
52
+ ParetoDataPointOptions = "paretoDataPointOptions",
53
+ Pie = "pie",
54
+ PlotArea = "plotArea",
55
+ Radar = "radar",
56
+ Relation = "relation",
57
+ Series = "series",
58
+ Subtitle = "subtitle",
59
+ SunburstFields = "sunburstFields",
60
+ SunburstHierarchyIndexes = "sunburstHierarchyIndexes",
61
+ SunburstStyle = "sunburstStyle",
62
+ SunburstValueIndex = "sunburstValueIndex",
63
+ Theme = "theme",
64
+ Title = "title",
65
+ Treemap = "treemap",
66
+ Trendlines = "trendlines",
67
+ Waterfall = "waterfall",
68
+ WordCloud = "wordCloud"
69
+ }
70
+ export interface IChartViewStateMap {
71
+ [ChartViewStateKey.AllSeriesStyle]: ChartPendingConfig['allSeriesStyle'];
72
+ [ChartViewStateKey.Appearance]: ChartPendingConfig['appearance'];
73
+ [ChartViewStateKey.Aggregation]: ChartPendingConfig['aggregation'];
74
+ [ChartViewStateKey.Area]: ChartPendingConfig['area'];
75
+ [ChartViewStateKey.AutoGradientFill]: ChartPendingConfig['autoGradientFill'];
76
+ [ChartViewStateKey.Bar]: ChartPendingConfig['bar'];
77
+ [ChartViewStateKey.Axes]: ChartPendingConfig['axes'];
78
+ [ChartViewStateKey.AxisPointer]: ChartPendingConfig['axisPointer'];
79
+ [ChartViewStateKey.Candlestick]: ChartPendingConfig['candlestick'];
80
+ [ChartViewStateKey.ChartType]: ChartTypeBits;
81
+ [ChartViewStateKey.ChordFields]: IChartChordFieldOptions;
82
+ [ChartViewStateKey.ChordMapping]: IChartChordMappingSpec | undefined;
83
+ [ChartViewStateKey.ChordStyle]: DeepNullish<IChartChordSpec> | undefined;
84
+ [ChartViewStateKey.Funnel]: ChartPendingConfig['funnel'];
85
+ [ChartViewStateKey.GaugeFields]: IChartEditorOption[];
86
+ [ChartViewStateKey.GaugeLabelIndex]: number | undefined;
87
+ [ChartViewStateKey.GaugeStyle]: DeepNullish<IChartGaugeSpec> | undefined;
88
+ [ChartViewStateKey.GaugeValueIndex]: number | undefined;
89
+ [ChartViewStateKey.Heatmap]: DeepNullish<IChartHeatmapSpec> | undefined;
90
+ [ChartViewStateKey.Histogram]: ChartPendingConfig['histogram'];
91
+ [ChartViewStateKey.InvalidValueStrategy]: ChartPendingConfig['invalidValueStrategy'];
92
+ [ChartViewStateKey.Legend]: ChartPendingConfig['legend'];
93
+ [ChartViewStateKey.Mapping]: ChartPendingConfig['mapping'];
94
+ [ChartViewStateKey.MappingFields]: IChartEditorOption[];
95
+ [ChartViewStateKey.Pareto]: ChartPendingConfig['pareto'];
96
+ [ChartViewStateKey.ParetoDataPointOptions]: IChartEditorOption[];
97
+ [ChartViewStateKey.Pie]: ChartPendingConfig['pie'];
98
+ [ChartViewStateKey.PlotArea]: ChartPendingConfig['plotArea'];
99
+ [ChartViewStateKey.Radar]: ChartPendingConfig['radar'];
100
+ [ChartViewStateKey.Relation]: ChartPendingConfig['relation'];
101
+ [ChartViewStateKey.Series]: IChartEditorSeriesState[];
102
+ [ChartViewStateKey.Subtitle]: ChartPendingConfig['subtitle'];
103
+ [ChartViewStateKey.SunburstFields]: IChartEditorOption[];
104
+ [ChartViewStateKey.SunburstHierarchyIndexes]: number[];
105
+ [ChartViewStateKey.SunburstStyle]: DeepNullish<IChartSunburstSpec> | undefined;
106
+ [ChartViewStateKey.SunburstValueIndex]: number | undefined;
107
+ [ChartViewStateKey.Theme]: ChartPendingConfig['theme'];
108
+ [ChartViewStateKey.Title]: ChartPendingConfig['title'];
109
+ [ChartViewStateKey.Treemap]: ChartPendingConfig['treemap'];
110
+ [ChartViewStateKey.Trendlines]: ChartPendingConfig['trendlines'];
111
+ [ChartViewStateKey.Waterfall]: ChartPendingConfig['waterfall'];
112
+ [ChartViewStateKey.WordCloud]: ChartPendingConfig['wordCloud'];
113
+ }
114
+ export type ChartViewStateName = keyof IChartViewStateMap;
115
+ export interface IChartViewStateDefinition<T> {
116
+ get(hostAdapter: IChartHostAdapter): Observable<T>;
117
+ set?(hostAdapter: IChartHostAdapter, value: T): void;
118
+ }
@@ -0,0 +1,42 @@
1
+ import type { ChartStyle, PieSecondaryPlotType as PieSecondaryPlotTypeValue } from '@univerjs-pro/engine-chart';
2
+ import type { ChartInlineCellValue } from '../components/ChartInlineTableEditor';
3
+ import { ChartTypeBits } from '@univerjs-pro/engine-chart';
4
+ export type ChartTypeOptionId = string;
5
+ export interface IChartCreationIntent {
6
+ chartType: ChartTypeBits;
7
+ pieSecondaryPlotType?: PieSecondaryPlotTypeValue;
8
+ }
9
+ export declare enum InlineChartCreationIssueCode {
10
+ UnknownOption = "unknownOption",
11
+ EmptyData = "emptyData",
12
+ InvalidCandlestickData = "invalidCandlestickData"
13
+ }
14
+ export interface IInlineChartCreationIssue {
15
+ code: InlineChartCreationIssueCode;
16
+ }
17
+ export type InlineChartDataPreparationResult<T extends ChartInlineCellValue = ChartInlineCellValue> = {
18
+ ok: true;
19
+ values: T[][];
20
+ } | {
21
+ ok: false;
22
+ issue: IInlineChartCreationIssue;
23
+ };
24
+ export interface IInlineChartCreationInput<T extends ChartInlineCellValue = ChartInlineCellValue> {
25
+ optionId: ChartTypeOptionId;
26
+ values: T[][];
27
+ }
28
+ export interface IInlineChartCreationPlan<T extends ChartInlineCellValue = ChartInlineCellValue> {
29
+ chartType: ChartTypeBits;
30
+ style?: ChartStyle;
31
+ values: T[][];
32
+ }
33
+ export type InlineChartCreationResult<T extends ChartInlineCellValue = ChartInlineCellValue> = {
34
+ ok: true;
35
+ plan: IInlineChartCreationPlan<T>;
36
+ } | {
37
+ ok: false;
38
+ issue: IInlineChartCreationIssue;
39
+ };
40
+ export declare function resolveChartCreationIntent(optionId: ChartTypeOptionId): IChartCreationIntent | undefined;
41
+ export declare function tryPrepareInlineChartData<T extends ChartInlineCellValue>(chartType: ChartTypeBits, values: T[][]): InlineChartDataPreparationResult<T>;
42
+ export declare function tryBuildInlineChartCreationPlan<T extends ChartInlineCellValue>(input: IInlineChartCreationInput<T>): InlineChartCreationResult<T>;
@@ -0,0 +1,3 @@
1
+ import type { IDisposable } from '@univerjs/core';
2
+ import type { ChartViewStateRegistry } from './chart-view-state-registry';
3
+ export declare function registerChartConfigStates(service: ChartViewStateRegistry): IDisposable;
@@ -0,0 +1,4 @@
1
+ import type { ChartViewStateProjector } from '../chart-view-state-projector';
2
+ import type { ChartViewStateRegistry } from '../chart-view-state-registry';
3
+ import { DisposableCollection } from '@univerjs/core';
4
+ export declare function registerChartSpecificStates(service: ChartViewStateRegistry, projector: ChartViewStateProjector): DisposableCollection;
@@ -0,0 +1,4 @@
1
+ import type { ChartViewStateProjector } from '../chart-view-state-projector';
2
+ import type { ChartViewStateRegistry } from '../chart-view-state-registry';
3
+ import { DisposableCollection } from '@univerjs/core';
4
+ export declare function registerSemanticStates(service: ChartViewStateRegistry, projector: ChartViewStateProjector): DisposableCollection;