@univerjs-pro/chart-ui 1.0.0-alpha.8 → 1.0.0-beta.1

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 (186) hide show
  1. package/lib/cjs/facade.js +1 -0
  2. package/lib/cjs/index.js +1 -1
  3. package/lib/cjs/locale/ar-SA.js +1 -1
  4. package/lib/cjs/locale/ca-ES.js +1 -1
  5. package/lib/cjs/locale/de-DE.js +1 -1
  6. package/lib/cjs/locale/en-US.js +1 -1
  7. package/lib/cjs/locale/es-ES.js +1 -1
  8. package/lib/cjs/locale/fa-IR.js +1 -1
  9. package/lib/cjs/locale/fr-FR.js +1 -1
  10. package/lib/cjs/locale/id-ID.js +1 -1
  11. package/lib/cjs/locale/it-IT.js +1 -1
  12. package/lib/cjs/locale/ja-JP.js +1 -1
  13. package/lib/cjs/locale/ko-KR.js +1 -1
  14. package/lib/cjs/locale/pl-PL.js +1 -1
  15. package/lib/cjs/locale/pt-BR.js +1 -1
  16. package/lib/cjs/locale/ru-RU.js +1 -1
  17. package/lib/cjs/locale/sk-SK.js +1 -1
  18. package/lib/cjs/locale/vi-VN.js +1 -1
  19. package/lib/cjs/locale/zh-CN.js +1 -1
  20. package/lib/cjs/locale/zh-HK.js +1 -1
  21. package/lib/cjs/locale/zh-TW.js +1 -1
  22. package/lib/es/facade.js +1 -0
  23. package/lib/es/index.js +1 -1
  24. package/lib/es/locale/ar-SA.js +1 -1
  25. package/lib/es/locale/ca-ES.js +1 -1
  26. package/lib/es/locale/de-DE.js +1 -1
  27. package/lib/es/locale/en-US.js +1 -1
  28. package/lib/es/locale/es-ES.js +1 -1
  29. package/lib/es/locale/fa-IR.js +1 -1
  30. package/lib/es/locale/fr-FR.js +1 -1
  31. package/lib/es/locale/id-ID.js +1 -1
  32. package/lib/es/locale/it-IT.js +1 -1
  33. package/lib/es/locale/ja-JP.js +1 -1
  34. package/lib/es/locale/ko-KR.js +1 -1
  35. package/lib/es/locale/pl-PL.js +1 -1
  36. package/lib/es/locale/pt-BR.js +1 -1
  37. package/lib/es/locale/ru-RU.js +1 -1
  38. package/lib/es/locale/sk-SK.js +1 -1
  39. package/lib/es/locale/vi-VN.js +1 -1
  40. package/lib/es/locale/zh-CN.js +1 -1
  41. package/lib/es/locale/zh-HK.js +1 -1
  42. package/lib/es/locale/zh-TW.js +1 -1
  43. package/lib/facade.js +1 -0
  44. package/lib/index.css +181 -25
  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/components/ChartEditPanel.d.ts +49 -0
  66. package/lib/types/components/ChartInlineTableEditor.d.ts +1 -1
  67. package/lib/types/components/ChartReferencedDataSourceEditor.d.ts +11 -0
  68. package/lib/types/components/ChartSemanticDataFields.d.ts +3 -3
  69. package/lib/types/components/ChartTypeOptions.d.ts +148 -2
  70. package/lib/types/components/FontFormatBar.d.ts +19 -1
  71. package/lib/types/components/chart-inline-starter-data.d.ts +16 -6
  72. package/lib/types/components/use-chart-panel-input-focus.d.ts +4 -0
  73. package/lib/types/controllers/components.controller.d.ts +4 -2
  74. package/lib/types/editor/ChartEditorProvider.d.ts +11 -0
  75. package/lib/types/editor/atoms/common/ChartFontAtom.d.ts +28 -0
  76. package/lib/types/editor/atoms/common/ChartNumberFormatAtom.d.ts +9 -0
  77. package/lib/types/editor/atoms/common/chart-number-format.d.ts +28 -0
  78. package/lib/types/editor/components/ChartCheckboxField.d.ts +11 -0
  79. package/lib/types/editor/components/ChartColorField.d.ts +14 -0
  80. package/lib/types/editor/components/ChartField.d.ts +15 -0
  81. package/lib/types/editor/components/ChartFieldGroup.d.ts +9 -0
  82. package/lib/types/editor/components/ChartFieldGroupTitle.d.ts +6 -0
  83. package/lib/types/editor/components/ChartFieldRow.d.ts +5 -0
  84. package/lib/types/editor/components/ChartFontField.d.ts +28 -0
  85. package/lib/types/editor/components/ChartImageSelectField.d.ts +13 -0
  86. package/lib/types/editor/components/ChartListField.d.ts +18 -0
  87. package/lib/types/editor/components/ChartMultiSelectField.d.ts +25 -0
  88. package/lib/types/editor/components/ChartNumberField.d.ts +16 -0
  89. package/lib/types/editor/components/ChartSelectField.d.ts +25 -0
  90. package/lib/types/editor/components/ChartTextField.d.ts +14 -0
  91. package/lib/types/editor/hooks/use-chart-config-state.d.ts +3 -0
  92. package/lib/types/editor/hooks/use-chart-data-mapping-fields.d.ts +5 -0
  93. package/lib/types/editor/hooks/use-chart-editor-model.d.ts +3 -0
  94. package/lib/types/editor/hooks/use-chart-runtime-context.d.ts +13 -0
  95. package/lib/types/editor/hooks/use-chart-type-state.d.ts +19 -0
  96. package/lib/types/editor/routing/chart-edit-panel-route.d.ts +21 -0
  97. package/lib/types/editor/sections/ChartAxisSections.d.ts +63 -0
  98. package/lib/types/editor/sections/ChartIndicatorLineSection.d.ts +20 -0
  99. package/lib/types/editor/sections/ChartLegendSection.d.ts +27 -0
  100. package/lib/types/editor/sections/ChartLineAndAreaSection.d.ts +11 -0
  101. package/lib/types/editor/sections/ChartParetoSeriesSection.d.ts +26 -0
  102. package/lib/types/editor/sections/ChartSeriesSection.d.ts +60 -0
  103. package/lib/types/editor/sections/ChartSetupSections.d.ts +21 -0
  104. package/lib/types/editor/sections/ChartStyleSection.d.ts +15 -0
  105. package/lib/types/editor/sections/ChartTitleSections.d.ts +50 -0
  106. package/lib/types/editor/sections/ChartTrendlineSection.d.ts +18 -0
  107. package/lib/types/editor/sections/chart-capabilities.d.ts +10 -0
  108. package/lib/types/editor/sections/chart-style-options.d.ts +86 -0
  109. package/lib/types/editor/sections/specific-section/ChartCandlestickStyleSection.d.ts +1 -0
  110. package/lib/types/editor/sections/specific-section/ChartFunnelStyleSection.d.ts +10 -0
  111. package/lib/types/editor/sections/specific-section/ChartHeatmapStyleSection.d.ts +10 -0
  112. package/lib/types/editor/sections/specific-section/ChartHistogramStyleSection.d.ts +1 -0
  113. package/lib/types/editor/sections/specific-section/ChartPieStyleSection.d.ts +21 -0
  114. package/lib/types/editor/sections/specific-section/ChartRadarStyleSection.d.ts +9 -0
  115. package/lib/types/editor/sections/specific-section/ChartRelationStyleSection.d.ts +17 -0
  116. package/lib/types/editor/sections/specific-section/ChartTreemapStyleSection.d.ts +1 -0
  117. package/lib/types/editor/sections/specific-section/ChartTypeSpecificSections.d.ts +9 -0
  118. package/lib/types/editor/sections/specific-section/ChartWaterfallStyleSection.d.ts +26 -0
  119. package/lib/types/editor/sections/specific-section/ChartWordCloudStyleSection.d.ts +21 -0
  120. package/lib/types/editor/sections/specific-section/ChordDataMappingAtom.d.ts +1 -0
  121. package/lib/types/editor/sections/specific-section/ChordLabelAtom.d.ts +1 -0
  122. package/lib/types/editor/sections/specific-section/ChordLayoutAtom.d.ts +1 -0
  123. package/lib/types/editor/sections/specific-section/ChordRibbonAtom.d.ts +1 -0
  124. package/lib/types/editor/sections/specific-section/GaugeDataMappingAtom.d.ts +1 -0
  125. package/lib/types/editor/sections/specific-section/GaugeModeAtom.d.ts +1 -0
  126. package/lib/types/editor/sections/specific-section/GaugePointerAtom.d.ts +1 -0
  127. package/lib/types/editor/sections/specific-section/GaugeProgressAtom.d.ts +1 -0
  128. package/lib/types/editor/sections/specific-section/GaugeRangesAtom.d.ts +1 -0
  129. package/lib/types/editor/sections/specific-section/GaugeScaleAtom.d.ts +1 -0
  130. package/lib/types/editor/sections/specific-section/SunburstCenterLabelAtom.d.ts +1 -0
  131. package/lib/types/editor/sections/specific-section/SunburstDataMappingAtom.d.ts +1 -0
  132. package/lib/types/editor/sections/specific-section/SunburstLabelAtom.d.ts +1 -0
  133. package/lib/types/editor/sections/specific-section/chord-field-options.d.ts +2 -0
  134. package/lib/types/editor/sections/specific-section/chord-style.d.ts +16 -0
  135. package/lib/types/editor/sections/specific-section/gauge-style.d.ts +10 -0
  136. package/lib/types/editor/sections/specific-section/sunburst-label.d.ts +8 -0
  137. package/lib/types/editor/utils/chart-runtime-axis.d.ts +3 -0
  138. package/lib/types/facade/f-chart.d.ts +19 -0
  139. package/lib/types/facade/index.d.ts +2 -0
  140. package/lib/types/float-menu/ChartElementFloatMenu.d.ts +2 -2
  141. package/lib/types/float-menu/chart-element-selection.d.ts +7 -0
  142. package/lib/types/float-menu/constants.d.ts +72 -91
  143. package/lib/types/float-menu/create-chart-element-float-menu-adapter.d.ts +10 -0
  144. package/lib/types/float-menu/pie-mark-patch.d.ts +8 -0
  145. package/lib/types/float-menu/types.d.ts +28 -9
  146. package/lib/types/index.d.ts +74 -3
  147. package/lib/types/locale/en-US.d.ts +487 -58
  148. package/lib/types/services/chart-host-adapter.d.ts +12 -0
  149. package/lib/types/services/chart-image-export.service.d.ts +26 -0
  150. package/lib/types/services/chart-referenced-data-source-binding.service.d.ts +13 -0
  151. package/lib/types/services/chart-snapshot-queue.d.ts +59 -0
  152. package/lib/types/services/chart-ui.service.d.ts +19 -0
  153. package/lib/types/services/chart-view-state-projector.d.ts +15 -0
  154. package/lib/types/services/chart-view-state-registry.d.ts +11 -0
  155. package/lib/types/services/chart-view-state.d.ts +118 -0
  156. package/lib/types/services/inline-chart-creation.d.ts +42 -0
  157. package/lib/types/services/register-chart-config-states.d.ts +3 -0
  158. package/lib/types/services/register-chart-view-states/chart-specific.d.ts +4 -0
  159. package/lib/types/services/register-chart-view-states/semantic.d.ts +4 -0
  160. package/lib/umd/facade.js +1 -0
  161. package/lib/umd/index.js +1 -1
  162. package/lib/umd/locale/ar-SA.js +1 -1
  163. package/lib/umd/locale/ca-ES.js +1 -1
  164. package/lib/umd/locale/de-DE.js +1 -1
  165. package/lib/umd/locale/en-US.js +1 -1
  166. package/lib/umd/locale/es-ES.js +1 -1
  167. package/lib/umd/locale/fa-IR.js +1 -1
  168. package/lib/umd/locale/fr-FR.js +1 -1
  169. package/lib/umd/locale/id-ID.js +1 -1
  170. package/lib/umd/locale/it-IT.js +1 -1
  171. package/lib/umd/locale/ja-JP.js +1 -1
  172. package/lib/umd/locale/ko-KR.js +1 -1
  173. package/lib/umd/locale/pl-PL.js +1 -1
  174. package/lib/umd/locale/pt-BR.js +1 -1
  175. package/lib/umd/locale/ru-RU.js +1 -1
  176. package/lib/umd/locale/sk-SK.js +1 -1
  177. package/lib/umd/locale/vi-VN.js +1 -1
  178. package/lib/umd/locale/zh-CN.js +1 -1
  179. package/lib/umd/locale/zh-HK.js +1 -1
  180. package/lib/umd/locale/zh-TW.js +1 -1
  181. package/package.json +25 -9
  182. package/lib/types/components/ChartEditPanelScaffold.d.ts +0 -32
  183. package/lib/types/components/ChartEditorFields.d.ts +0 -68
  184. package/lib/types/components/ChartPresentationFields.d.ts +0 -9
  185. package/lib/types/components/index.d.ts +0 -19
  186. package/lib/types/float-menu/index.d.ts +0 -5
@@ -0,0 +1,12 @@
1
+ import type { ChartModel, ChartPendingConfig, IChartBuilderAdapter } from '@univerjs-pro/engine-chart';
2
+ export declare abstract class IChartHostAdapter {
3
+ abstract getChartModel(): ChartModel;
4
+ abstract commit(config: ChartPendingConfig): void;
5
+ }
6
+ export declare class ChartHostAdapter extends IChartHostAdapter {
7
+ private readonly _model;
8
+ private readonly _commitTarget;
9
+ constructor(_model: ChartModel, _commitTarget: Pick<IChartBuilderAdapter, 'commit'>);
10
+ getChartModel(): ChartModel;
11
+ commit(config: ChartPendingConfig): void;
12
+ }
@@ -0,0 +1,26 @@
1
+ import type { IDisposable } from '@univerjs/core';
2
+ import { Disposable } from '@univerjs/core';
3
+ export interface IChartImageExportTarget {
4
+ /** Stable host unit identifier when the renderer requires host context. */
5
+ readonly unitId?: string;
6
+ /** Stable host sub-unit identifier when the renderer requires host context. */
7
+ readonly subUnitId?: string;
8
+ /** Returns the stable Chart identifier. */
9
+ getId(): string;
10
+ }
11
+ /** UI-owned image-export implementation for one Chart host. */
12
+ export interface IChartImageExportProvider {
13
+ /** Returns whether this provider owns the supplied Chart facade. */
14
+ supports(chart: IChartImageExportTarget): boolean;
15
+ /** Exports the supplied Chart through the host's existing UI renderer. */
16
+ exportImage(chart: IChartImageExportTarget): Promise<string | undefined>;
17
+ }
18
+ /** Routes Chart image export to the UI renderer owned by the Chart host. */
19
+ export declare class ChartImageExportService extends Disposable {
20
+ private readonly _providers;
21
+ /** Registers one host UI image-export provider. */
22
+ register(provider: IChartImageExportProvider): IDisposable;
23
+ /** Exports a Chart through the first matching host UI provider. */
24
+ exportImage(chart: IChartImageExportTarget): Promise<string | undefined>;
25
+ dispose(): void;
26
+ }
@@ -0,0 +1,13 @@
1
+ import type { IReferencedUnitViewerSession } from '@univerjs-pro/embed-unit-ui';
2
+ import type { IResourceRefChartDataSourceReference } from '@univerjs-pro/engine-chart';
3
+ import type { IDisposable } from '@univerjs/core';
4
+ import { IReferencedUnitCatalogService } from '@univerjs-pro/embed';
5
+ export interface IChartReferencedDataSourceBindingOptions {
6
+ initialSource?: IResourceRefChartDataSourceReference;
7
+ onDataSourceChange(source: IResourceRefChartDataSourceReference): void;
8
+ }
9
+ export declare class ChartReferencedDataSourceBindingService {
10
+ private readonly _catalog;
11
+ constructor(_catalog: IReferencedUnitCatalogService);
12
+ bind(session: IReferencedUnitViewerSession, options: IChartReferencedDataSourceBindingOptions): IDisposable;
13
+ }
@@ -0,0 +1,59 @@
1
+ import type { IChartModelRuntime } 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 IChartModelRuntime = IChartModelRuntime> {
27
+ render(request: TRequest, runtime: TRuntime): Promise<string>;
28
+ }
29
+ export interface IChartSnapshotRuntimeProvider<TRuntime extends IChartModelRuntime> {
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 IChartModelRuntime = IChartModelRuntime> 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
+ exportImage(request: TRequest): Promise<string | undefined>;
48
+ invalidateChart(unitId: string, chartId: string, options?: IChartSnapshotInvalidationOptions): void;
49
+ getCacheKey(request: TRequest): string;
50
+ flushForTests(): Promise<void>;
51
+ dispose(): void;
52
+ private _drainQueue;
53
+ private _invalidateSnapshotsForDirectionChange;
54
+ private _runQueue;
55
+ private _renderOne;
56
+ private _waitForRuntimeConfig;
57
+ private _getChartKey;
58
+ private _getRuntimeModel;
59
+ }
@@ -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;
@@ -0,0 +1 @@
1
+ (function(_0x443fea,_0x1c9a83){var _0x1101d4=_0x5644,_0x3d7013=_0x443fea();while(!![]){try{var _0x2d1685=parseInt(_0x1101d4(0xd3))/0x1+-parseInt(_0x1101d4(0xd4))/0x2+parseInt(_0x1101d4(0xcc))/0x3+-parseInt(_0x1101d4(0xd2))/0x4*(-parseInt(_0x1101d4(0xcb))/0x5)+parseInt(_0x1101d4(0xdb))/0x6+parseInt(_0x1101d4(0xd6))/0x7+parseInt(_0x1101d4(0xcd))/0x8*(-parseInt(_0x1101d4(0xd9))/0x9);if(_0x2d1685===_0x1c9a83)break;else _0x3d7013['push'](_0x3d7013['shift']());}catch(_0x18a466){_0x3d7013['push'](_0x3d7013['shift']());}}}(_0x41c1,0xa36c6),function(_0x34f466,_0x3027f1){var _0x2f9202=_0x5644;typeof exports=='object'&&typeof module<'u'?_0x3027f1(require('@univerjs-pro/chart-ui'),require('@univerjs-pro/engine-chart/facade')):typeof define==_0x2f9202(0xd8)&&define[_0x2f9202(0xcf)]?define([_0x2f9202(0xda),_0x2f9202(0xdd)],_0x3027f1):(_0x34f466=typeof globalThis<'u'?globalThis:_0x34f466||self,_0x3027f1(_0x34f466['UniverProChartUi'],_0x34f466[_0x2f9202(0xdc)]));}(this,function(_0x7a774a,_0x1e0ee3){var _0x2006c9=_0x5644,_0x7a48c6=class extends _0x1e0ee3[_0x2006c9(0xd7)]{[_0x2006c9(0xd0)](){var _0x492fc5=_0x2006c9;return this[_0x492fc5(0xca)][_0x492fc5(0xce)](_0x7a774a[_0x492fc5(0xd5)])['exportImage'](this);}};_0x1e0ee3[_0x2006c9(0xd7)][_0x2006c9(0xd1)](_0x7a48c6);}));function _0x5644(_0x3afb6e,_0x29f773){_0x3afb6e=_0x3afb6e-0xca;var _0x41c120=_0x41c1();var _0x56444d=_0x41c120[_0x3afb6e];return _0x56444d;}function _0x41c1(){var _0x10e64a=['function','99BfFQnO','@univerjs-pro/chart-ui','5924280LqVvPU','UniverProEngineChartFacade','@univerjs-pro/engine-chart/facade','_injector','340705HfFACN','912951FCZkxm','1847472Ibegyy','get','amd','exportImage','extend','24CvdJOj','939905ChpEal','695286FavRNn','ChartImageExportService','6417957ByzXwo','FChart'];_0x41c1=function(){return _0x10e64a;};return _0x41c1();}