@univerjs-pro/engine-chart 1.0.0-alpha.3 → 1.0.0-alpha.4

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 (107) hide show
  1. package/lib/cjs/facade.js +1 -0
  2. package/lib/cjs/index.js +1 -1
  3. package/lib/es/facade.js +1 -0
  4. package/lib/es/index.js +1 -1
  5. package/lib/facade.js +1 -0
  6. package/lib/index.js +1 -1
  7. package/lib/types/chart-builder/chart-builder-adapter.d.ts +13 -0
  8. package/lib/types/chart-builder/chart-builder.d.ts +35 -0
  9. package/lib/types/chart-builder/chart-description.d.ts +3 -0
  10. package/lib/types/chart-builder/chart-types.d.ts +459 -0
  11. package/lib/types/chart-builder/configuration/aggregation.d.ts +7 -0
  12. package/lib/types/chart-builder/configuration/appearance.d.ts +8 -0
  13. package/lib/types/chart-builder/configuration/area.d.ts +3 -0
  14. package/lib/types/chart-builder/configuration/axes.d.ts +26 -0
  15. package/lib/types/chart-builder/configuration/axis-pointer.d.ts +9 -0
  16. package/lib/types/chart-builder/configuration/bar.d.ts +3 -0
  17. package/lib/types/chart-builder/configuration/cartesian-series.d.ts +25 -0
  18. package/lib/types/chart-builder/configuration/chart-config-operation.d.ts +40 -0
  19. package/lib/types/chart-builder/configuration/combination.d.ts +10 -0
  20. package/lib/types/chart-builder/configuration/funnel.d.ts +4 -0
  21. package/lib/types/chart-builder/configuration/heatmap.d.ts +9 -0
  22. package/lib/types/chart-builder/configuration/index.d.ts +29 -0
  23. package/lib/types/chart-builder/configuration/invalid-value.d.ts +3 -0
  24. package/lib/types/chart-builder/configuration/legend.d.ts +3 -0
  25. package/lib/types/chart-builder/configuration/line.d.ts +3 -0
  26. package/lib/types/chart-builder/configuration/mapping.d.ts +4 -0
  27. package/lib/types/chart-builder/configuration/mark-lines.d.ts +3 -0
  28. package/lib/types/chart-builder/configuration/palette.d.ts +4 -0
  29. package/lib/types/chart-builder/configuration/pareto.d.ts +7 -0
  30. package/lib/types/chart-builder/configuration/pie.d.ts +23 -0
  31. package/lib/types/chart-builder/configuration/point-mapping.d.ts +5 -0
  32. package/lib/types/chart-builder/configuration/radar.d.ts +5 -0
  33. package/lib/types/chart-builder/configuration/relation.d.ts +14 -0
  34. package/lib/types/chart-builder/configuration/subtitle.d.ts +3 -0
  35. package/lib/types/chart-builder/configuration/theme.d.ts +4 -0
  36. package/lib/types/chart-builder/configuration/title.d.ts +3 -0
  37. package/lib/types/chart-builder/configuration/trendline.d.ts +12 -0
  38. package/lib/types/chart-builder/configuration/waterfall.d.ts +12 -0
  39. package/lib/types/chart-builder/configuration/word-cloud.d.ts +7 -0
  40. package/lib/types/chart-builder/conversion/chart-config-converter.d.ts +24 -0
  41. package/lib/types/chart-builder/conversion/chart-model-fields.d.ts +115 -0
  42. package/lib/types/chart-builder/conversion/chart-type-converter.d.ts +6 -0
  43. package/lib/types/chart-builder/conversion/describe-chart-model.d.ts +11 -0
  44. package/lib/types/chart-builder/conversion/resolve-chart-model-data.d.ts +5 -0
  45. package/lib/types/chart-builder/detached-chart-builder-adapter.d.ts +19 -0
  46. package/lib/types/chart-builder/index.d.ts +12 -0
  47. package/lib/types/chart-builder/internal/deep-freeze.d.ts +1 -0
  48. package/lib/types/chart-builder/internal/host-builder-runtime.d.ts +5 -0
  49. package/lib/types/chart-builder/internal/merge-description.d.ts +2 -0
  50. package/lib/types/enum.d.ts +28 -0
  51. package/lib/types/facade/builders/f-area-chart-builder.d.ts +33 -0
  52. package/lib/types/facade/builders/f-bubble-chart-builder.d.ts +33 -0
  53. package/lib/types/facade/builders/f-combination-chart-builder.d.ts +66 -0
  54. package/lib/types/facade/builders/f-funnel-chart-builder.d.ts +61 -0
  55. package/lib/types/facade/builders/f-heatmap-chart-builder.d.ts +124 -0
  56. package/lib/types/facade/builders/f-line-chart-builder.d.ts +36 -0
  57. package/lib/types/facade/builders/f-pareto-chart-builder.d.ts +112 -0
  58. package/lib/types/facade/builders/f-pie-chart-builder.d.ts +324 -0
  59. package/lib/types/facade/builders/f-radar-chart-builder.d.ts +62 -0
  60. package/lib/types/facade/builders/f-relation-chart-builder.d.ts +184 -0
  61. package/lib/types/facade/builders/f-scatter-chart-builder.d.ts +33 -0
  62. package/lib/types/facade/builders/f-waterfall-chart-builder.d.ts +226 -0
  63. package/lib/types/facade/builders/f-word-cloud-chart-builder.d.ts +91 -0
  64. package/lib/types/facade/builders/index.d.ts +13 -0
  65. package/lib/types/facade/chart-builder-registry.d.ts +8 -0
  66. package/lib/types/facade/chart-builder-type-map.d.ts +30 -0
  67. package/lib/types/facade/chart-host-builder-types.d.ts +21 -0
  68. package/lib/types/facade/f-axis-chart-builder.d.ts +245 -0
  69. package/lib/types/facade/f-cartesian-chart-builder.d.ts +146 -0
  70. package/lib/types/facade/f-chart-base.d.ts +82 -0
  71. package/lib/types/facade/f-chart-builder-base.d.ts +331 -0
  72. package/lib/types/facade/f-charts-base.d.ts +74 -0
  73. package/lib/types/facade/f-enum.d.ts +75 -0
  74. package/lib/types/facade/index.d.ts +16 -0
  75. package/lib/types/facade/internal/chart-builder-facade-context.d.ts +12 -0
  76. package/lib/types/facade/internal/constants.d.ts +2 -0
  77. package/lib/types/facade/internal/host-builder-composer.d.ts +16 -0
  78. package/lib/types/facade/register-builders.d.ts +1 -0
  79. package/lib/types/index.d.ts +10 -54
  80. package/lib/types/models/chart-host-style.d.ts +6 -1
  81. package/lib/types/models/chart-model.d.ts +141 -18
  82. package/lib/types/models/chart-resource-serializer.d.ts +10 -0
  83. package/lib/types/models/chart-semantic-axes.d.ts +4 -0
  84. package/lib/types/models/constants/default-chart-style.d.ts +21 -1
  85. package/lib/types/models/mode-converter/converters/waterfall-layout.d.ts +34 -0
  86. package/lib/types/models/mode-converter/render-spec-operators/mark-line.operator.d.ts +3 -0
  87. package/lib/types/models/mode-converter/render-spec-operators/tools.d.ts +2 -3
  88. package/lib/types/source/chart-data-item.d.ts +3 -0
  89. package/lib/types/types.d.ts +61 -2
  90. package/lib/types/util.d.ts +1 -3
  91. package/lib/types/utils/compact.d.ts +4 -0
  92. package/lib/umd/facade.js +1 -0
  93. package/lib/umd/index.js +1 -1
  94. package/package.json +14 -4
  95. package/lib/types/chart-model-api/chart-model-api.d.ts +0 -2
  96. package/lib/types/chart-model-api/chart-type-manifest.d.ts +0 -128
  97. package/lib/types/chart-model-api/chart-type-registry.d.ts +0 -56
  98. package/lib/types/chart-model-api/chart-type.d.ts +0 -7
  99. package/lib/types/chart-model-api/constants.d.ts +0 -99
  100. package/lib/types/chart-model-api/describe.d.ts +0 -3
  101. package/lib/types/chart-model-api/index.d.ts +0 -8
  102. package/lib/types/chart-model-api/patch-builder.d.ts +0 -9
  103. package/lib/types/chart-model-api/series-selector.d.ts +0 -3
  104. package/lib/types/chart-model-api/types.d.ts +0 -452
  105. package/lib/types/chart-model-api/utils.d.ts +0 -10
  106. package/lib/types/chart-model-api/validate.d.ts +0 -5
  107. package/lib/types/f-base-chart.d.ts +0 -25
@@ -0,0 +1,62 @@
1
+ import type { RadarShape } from '@univerjs-pro/engine-chart';
2
+ import { FChartBuilderBase } from '../f-chart-builder-base';
3
+ export declare class FRadarChartBuilder extends FChartBuilderBase {
4
+ /**
5
+ * Sets the shape configuration and returns this builder for chaining.
6
+ *
7
+ * This method executes synchronously.
8
+ *
9
+ * @param value The semantic value to record.
10
+ * @returns This builder for chaining.
11
+ * @example
12
+ * ```ts
13
+ * const worksheet = univerAPI.getActiveWorkbook().getActiveSheet();
14
+ * const builder = worksheet.charts.create().setType(univerAPI.Enum.ChartTypeString.Radar);
15
+ * builder.setShape(univerAPI.Enum.RadarShape.Polygon);
16
+ * ```
17
+ */
18
+ setShape(value: RadarShape): this;
19
+ /**
20
+ * Restores the radar grid shape to `Polygon` and returns this builder for chaining.
21
+ *
22
+ * This method executes synchronously.
23
+ *
24
+ * @returns This builder for chaining.
25
+ * @example
26
+ * ```ts
27
+ * const worksheet = univerAPI.getActiveWorkbook().getActiveSheet();
28
+ * const builder = worksheet.charts.create().setType(univerAPI.Enum.ChartTypeString.Radar);
29
+ * builder.resetShape();
30
+ * ```
31
+ */
32
+ resetShape(): this;
33
+ /**
34
+ * Sets the fill configuration and returns this builder for chaining.
35
+ *
36
+ * This method executes synchronously.
37
+ *
38
+ * @param value The semantic value to record.
39
+ * @returns This builder for chaining.
40
+ * @example
41
+ * ```ts
42
+ * const worksheet = univerAPI.getActiveWorkbook().getActiveSheet();
43
+ * const builder = worksheet.charts.create().setType(univerAPI.Enum.ChartTypeString.Radar);
44
+ * builder.setFill(true);
45
+ * ```
46
+ */
47
+ setFill(value: boolean): this;
48
+ /**
49
+ * Restores the default of drawing outlines without area fill and returns this builder for chaining.
50
+ *
51
+ * This method executes synchronously.
52
+ *
53
+ * @returns This builder for chaining.
54
+ * @example
55
+ * ```ts
56
+ * const worksheet = univerAPI.getActiveWorkbook().getActiveSheet();
57
+ * const builder = worksheet.charts.create().setType(univerAPI.Enum.ChartTypeString.Radar);
58
+ * builder.resetFill();
59
+ * ```
60
+ */
61
+ resetFill(): this;
62
+ }
@@ -0,0 +1,184 @@
1
+ import type { IChartRelationForceSpec, LinePointShape, RelationChartLayoutEnum } from '@univerjs-pro/engine-chart';
2
+ import { FChartBuilderBase } from '../f-chart-builder-base';
3
+ export declare class FRelationChartBuilder extends FChartBuilderBase {
4
+ /**
5
+ * Sets the layout configuration and returns this builder for chaining.
6
+ *
7
+ * This method executes synchronously.
8
+ *
9
+ * @param value The semantic value to record.
10
+ * @returns This builder for chaining.
11
+ * @example
12
+ * ```ts
13
+ * const worksheet = univerAPI.getActiveWorkbook().getActiveSheet();
14
+ * const builder = worksheet.charts.create().setType(univerAPI.Enum.ChartTypeString.Relation);
15
+ * builder.setLayout(univerAPI.Enum.RelationChartLayoutEnum.Force);
16
+ * ```
17
+ */
18
+ setLayout(value: RelationChartLayoutEnum): this;
19
+ /**
20
+ * Restores the layout to `None`, which uses Univer's fixed relation layout, and returns this builder for chaining.
21
+ *
22
+ * This method executes synchronously.
23
+ *
24
+ * @returns This builder for chaining.
25
+ * @example
26
+ * ```ts
27
+ * const worksheet = univerAPI.getActiveWorkbook().getActiveSheet();
28
+ * const builder = worksheet.charts.create().setType(univerAPI.Enum.ChartTypeString.Relation);
29
+ * builder.resetLayout();
30
+ * ```
31
+ */
32
+ resetLayout(): this;
33
+ /**
34
+ * Sets the use value as symbol size configuration and returns this builder for chaining.
35
+ *
36
+ * This method executes synchronously.
37
+ *
38
+ * @param value The semantic value to record.
39
+ * @returns This builder for chaining.
40
+ * @example
41
+ * ```ts
42
+ * const worksheet = univerAPI.getActiveWorkbook().getActiveSheet();
43
+ * const builder = worksheet.charts.create().setType(univerAPI.Enum.ChartTypeString.Relation);
44
+ * builder.setUseValueAsSymbolSize(true);
45
+ * ```
46
+ */
47
+ setUseValueAsSymbolSize(value: boolean): this;
48
+ /**
49
+ * Restores the default of scaling node symbols from their values and returns this builder for chaining.
50
+ *
51
+ * This method executes synchronously.
52
+ *
53
+ * @returns This builder for chaining.
54
+ * @example
55
+ * ```ts
56
+ * const worksheet = univerAPI.getActiveWorkbook().getActiveSheet();
57
+ * const builder = worksheet.charts.create().setType(univerAPI.Enum.ChartTypeString.Relation);
58
+ * builder.resetUseValueAsSymbolSize();
59
+ * ```
60
+ */
61
+ resetUseValueAsSymbolSize(): this;
62
+ /**
63
+ * Sets the emphasis enabled configuration and returns this builder for chaining.
64
+ *
65
+ * This method executes synchronously.
66
+ *
67
+ * @param value The semantic value to record.
68
+ * @returns This builder for chaining.
69
+ * @example
70
+ * ```ts
71
+ * const worksheet = univerAPI.getActiveWorkbook().getActiveSheet();
72
+ * const builder = worksheet.charts.create().setType(univerAPI.Enum.ChartTypeString.Relation);
73
+ * builder.setEmphasisEnabled(true);
74
+ * ```
75
+ */
76
+ setEmphasisEnabled(value: boolean): this;
77
+ /**
78
+ * Restores the default of emphasizing adjacent nodes and links on hover and returns this builder for chaining.
79
+ *
80
+ * This method executes synchronously.
81
+ *
82
+ * @returns This builder for chaining.
83
+ * @example
84
+ * ```ts
85
+ * const worksheet = univerAPI.getActiveWorkbook().getActiveSheet();
86
+ * const builder = worksheet.charts.create().setType(univerAPI.Enum.ChartTypeString.Relation);
87
+ * builder.resetEmphasisEnabled();
88
+ * ```
89
+ */
90
+ resetEmphasisEnabled(): this;
91
+ /**
92
+ * Sets the force configuration and returns this builder for chaining.
93
+ *
94
+ * Omitted fields keep their current values. Without explicit overrides, force layout uses
95
+ * gravity `0.1`, repulsion `5000`, and an edge length equal to one fifth of the chart's shorter side.
96
+ *
97
+ * This method executes synchronously.
98
+ *
99
+ * @param value The semantic value to record.
100
+ * @returns This builder for chaining.
101
+ * @example
102
+ * ```ts
103
+ * const worksheet = univerAPI.getActiveWorkbook().getActiveSheet();
104
+ * const builder = worksheet.charts.create().setType(univerAPI.Enum.ChartTypeString.Relation);
105
+ * builder.setForce({ gravity: 0.2, repulsion: 50 });
106
+ * ```
107
+ */
108
+ setForce(value: IChartRelationForceSpec): this;
109
+ /**
110
+ * Clears the force configuration and returns this builder for chaining.
111
+ *
112
+ * Force layout then uses gravity `0.1`, repulsion `5000`, and an edge length equal to one fifth
113
+ * of the chart's shorter side.
114
+ *
115
+ * This method executes synchronously.
116
+ *
117
+ * @returns This builder for chaining.
118
+ * @example
119
+ * ```ts
120
+ * const worksheet = univerAPI.getActiveWorkbook().getActiveSheet();
121
+ * const builder = worksheet.charts.create().setType(univerAPI.Enum.ChartTypeString.Relation);
122
+ * builder.clearForce();
123
+ * ```
124
+ */
125
+ clearForce(): this;
126
+ /**
127
+ * Sets the circular label rotation configuration and returns this builder for chaining.
128
+ *
129
+ * This method executes synchronously.
130
+ *
131
+ * @param value The semantic value to record.
132
+ * @returns This builder for chaining.
133
+ * @example
134
+ * ```ts
135
+ * const worksheet = univerAPI.getActiveWorkbook().getActiveSheet();
136
+ * const builder = worksheet.charts.create().setType(univerAPI.Enum.ChartTypeString.Relation);
137
+ * builder.setCircularLabelRotation(true);
138
+ * ```
139
+ */
140
+ setCircularLabelRotation(value: boolean): this;
141
+ /**
142
+ * Restores the default of keeping circular-layout labels unrotated and returns this builder for chaining.
143
+ *
144
+ * This method executes synchronously.
145
+ *
146
+ * @returns This builder for chaining.
147
+ * @example
148
+ * ```ts
149
+ * const worksheet = univerAPI.getActiveWorkbook().getActiveSheet();
150
+ * const builder = worksheet.charts.create().setType(univerAPI.Enum.ChartTypeString.Relation);
151
+ * builder.resetCircularLabelRotation();
152
+ * ```
153
+ */
154
+ resetCircularLabelRotation(): this;
155
+ /**
156
+ * Sets the node shape configuration and returns this builder for chaining.
157
+ *
158
+ * This method executes synchronously.
159
+ *
160
+ * @param value The semantic value to record.
161
+ * @returns This builder for chaining.
162
+ * @example
163
+ * ```ts
164
+ * const worksheet = univerAPI.getActiveWorkbook().getActiveSheet();
165
+ * const builder = worksheet.charts.create().setType(univerAPI.Enum.ChartTypeString.Relation);
166
+ * builder.setNodeShape(univerAPI.Enum.LinePointShape.Circle);
167
+ * ```
168
+ */
169
+ setNodeShape(value: LinePointShape): this;
170
+ /**
171
+ * Removes the node-shape override so relation nodes use the renderer's circular symbol.
172
+ *
173
+ * This method executes synchronously.
174
+ *
175
+ * @returns This builder for chaining.
176
+ * @example
177
+ * ```ts
178
+ * const worksheet = univerAPI.getActiveWorkbook().getActiveSheet();
179
+ * const builder = worksheet.charts.create().setType(univerAPI.Enum.ChartTypeString.Relation);
180
+ * builder.resetNodeShape();
181
+ * ```
182
+ */
183
+ resetNodeShape(): this;
184
+ }
@@ -0,0 +1,33 @@
1
+ import type { IChartScatterMappingSpec } from '@univerjs-pro/engine-chart';
2
+ import { FCartesianChartBuilder } from '../f-cartesian-chart-builder';
3
+ export declare class FScatterChartBuilder extends FCartesianChartBuilder {
4
+ /**
5
+ * Sets the scatter mapping configuration and returns this builder for chaining.
6
+ *
7
+ * This method executes synchronously.
8
+ *
9
+ * @param value The semantic value to record.
10
+ * @returns This builder for chaining.
11
+ * @example
12
+ * ```ts
13
+ * const worksheet = univerAPI.getActiveWorkbook().getActiveSheet();
14
+ * const builder = worksheet.charts.create().setType(univerAPI.Enum.ChartTypeString.Scatter);
15
+ * builder.setScatterMapping({ xIndex: 0, yIndex: 1 });
16
+ * ```
17
+ */
18
+ setScatterMapping(value: IChartScatterMappingSpec): this;
19
+ /**
20
+ * Clears the scatter mapping configuration and returns this builder for chaining.
21
+ *
22
+ * This method executes synchronously.
23
+ *
24
+ * @returns This builder for chaining.
25
+ * @example
26
+ * ```ts
27
+ * const worksheet = univerAPI.getActiveWorkbook().getActiveSheet();
28
+ * const builder = worksheet.charts.create().setType(univerAPI.Enum.ChartTypeString.Scatter);
29
+ * builder.clearScatterMapping();
30
+ * ```
31
+ */
32
+ clearScatterMapping(): this;
33
+ }
@@ -0,0 +1,226 @@
1
+ import type { ChartPublicSeriesSelector, IChartSeriesPatch, IChartWaterfallConnectorStyleSpec, IChartWaterfallPointRoleSpec, WaterfallStackTypeEnum } from '@univerjs-pro/engine-chart';
2
+ import type { DeepReadonly } from '@univerjs/core';
3
+ import { FCartesianChartBuilder } from '../f-cartesian-chart-builder';
4
+ export declare class FWaterfallChartBuilder extends FCartesianChartBuilder {
5
+ /**
6
+ * Returns the canonical point-role list, including pending changes.
7
+ *
8
+ * @returns The current Waterfall point roles in canonical order.
9
+ * @example
10
+ * ```ts
11
+ * const worksheet = univerAPI.getActiveWorkbook().getActiveSheet();
12
+ * const builder = worksheet.charts.create().setType(univerAPI.Enum.ChartTypeString.Waterfall);
13
+ * const roles = builder.getPointRoles();
14
+ * ```
15
+ */
16
+ getPointRoles(): DeepReadonly<IChartWaterfallPointRoleSpec[]>;
17
+ /**
18
+ * Replaces all Waterfall point roles.
19
+ *
20
+ * Duplicate series/point identities use the last input and read back in canonical order.
21
+ *
22
+ * @param roles The complete point-role collection.
23
+ * @returns This builder for chaining.
24
+ * @example
25
+ * ```ts
26
+ * const worksheet = univerAPI.getActiveWorkbook().getActiveSheet();
27
+ * const builder = worksheet.charts.create().setType(univerAPI.Enum.ChartTypeString.Waterfall);
28
+ * builder.setPointRoles([{ series: 0, dataPointIndex: 0, role: univerAPI.Enum.ChartWaterfallPointRole.Total }]);
29
+ * const roles = builder.getPointRoles();
30
+ * ```
31
+ */
32
+ setPointRoles(roles: readonly IChartWaterfallPointRoleSpec[]): this;
33
+ /**
34
+ * Enables, disables, or styles derived Waterfall connectors.
35
+ *
36
+ * Passing `true` renders a 1 px dashed connector with full opacity, no endpoint symbols,
37
+ * and a neutral `#8C8C8C` base color that is adapted by the active light or dark theme. An object
38
+ * starts from those defaults and overrides only the supplied fields. Pass `false` to hide it.
39
+ *
40
+ * Read the current value from `builder.describe().waterfall?.connector`.
41
+ *
42
+ * @param value `false` disables, `true` enables the default dashed style, and an object enables style overrides.
43
+ * @returns This builder for chaining.
44
+ * @example
45
+ * ```ts
46
+ * const worksheet = univerAPI.getActiveWorkbook().getActiveSheet();
47
+ * const builder = worksheet.charts.create().setType(univerAPI.Enum.ChartTypeString.Waterfall);
48
+ * builder.setConnector(true);
49
+ * const connector = builder.describe().waterfall?.connector;
50
+ * ```
51
+ */
52
+ setConnector(value: boolean | IChartWaterfallConnectorStyleSpec): this;
53
+ /**
54
+ * Clears connector configuration. With no persisted connector setting, the renderer does not
55
+ * draw connectors; call `setConnector(true)` to restore the default dashed connector.
56
+ *
57
+ * Read the cleared value from `builder.describe().waterfall?.connector`.
58
+ *
59
+ * @returns This builder for chaining.
60
+ * @example
61
+ * ```ts
62
+ * const worksheet = univerAPI.getActiveWorkbook().getActiveSheet();
63
+ * const builder = worksheet.charts.create().setType(univerAPI.Enum.ChartTypeString.Waterfall);
64
+ * builder.clearConnector();
65
+ * const connector = builder.describe().waterfall?.connector;
66
+ * ```
67
+ */
68
+ clearConnector(): this;
69
+ /**
70
+ * Sets the stack type configuration and returns this builder for chaining.
71
+ *
72
+ * This method executes synchronously.
73
+ *
74
+ * @param value The semantic value to record.
75
+ * @returns This builder for chaining.
76
+ * @example
77
+ * ```ts
78
+ * const worksheet = univerAPI.getActiveWorkbook().getActiveSheet();
79
+ * const builder = worksheet.charts.create().setType(univerAPI.Enum.ChartTypeString.Waterfall);
80
+ * builder.setStackType(univerAPI.Enum.WaterfallStackTypeEnum.Arrangement);
81
+ * ```
82
+ */
83
+ setStackType(value: WaterfallStackTypeEnum): this;
84
+ /**
85
+ * Restores the stack type to `Arrangement` and returns this builder for chaining.
86
+ *
87
+ * This method executes synchronously.
88
+ *
89
+ * @returns This builder for chaining.
90
+ * @example
91
+ * ```ts
92
+ * const worksheet = univerAPI.getActiveWorkbook().getActiveSheet();
93
+ * const builder = worksheet.charts.create().setType(univerAPI.Enum.ChartTypeString.Waterfall);
94
+ * builder.resetStackType();
95
+ * ```
96
+ */
97
+ resetStackType(): this;
98
+ /**
99
+ * Sets the use subtotal configuration and returns this builder for chaining.
100
+ *
101
+ * This method executes synchronously.
102
+ *
103
+ * @param value The semantic value to record.
104
+ * @returns This builder for chaining.
105
+ * @example
106
+ * ```ts
107
+ * const worksheet = univerAPI.getActiveWorkbook().getActiveSheet();
108
+ * const builder = worksheet.charts.create().setType(univerAPI.Enum.ChartTypeString.Waterfall);
109
+ * builder.setUseSubtotal(true);
110
+ * ```
111
+ */
112
+ setUseSubtotal(value: boolean): this;
113
+ /**
114
+ * Restores automatic subtotal generation to its default of `true` and returns this builder for chaining.
115
+ *
116
+ * This method executes synchronously.
117
+ *
118
+ * @returns This builder for chaining.
119
+ * @example
120
+ * ```ts
121
+ * const worksheet = univerAPI.getActiveWorkbook().getActiveSheet();
122
+ * const builder = worksheet.charts.create().setType(univerAPI.Enum.ChartTypeString.Waterfall);
123
+ * builder.resetUseSubtotal();
124
+ * ```
125
+ */
126
+ resetUseSubtotal(): this;
127
+ /**
128
+ * Sets the positive style configuration and returns this builder for chaining.
129
+ *
130
+ * This method executes synchronously.
131
+ *
132
+ * @param selector The target series selector.
133
+ * @param value The semantic value to record.
134
+ * @returns This builder for chaining.
135
+ * @example
136
+ * ```ts
137
+ * const worksheet = univerAPI.getActiveWorkbook().getActiveSheet();
138
+ * const builder = worksheet.charts.create().setType(univerAPI.Enum.ChartTypeString.Waterfall);
139
+ * builder.setPositiveStyle(0, { color: '#52c41a' });
140
+ * const positive = builder.describe().series[0]?.waterfallStyles?.positive;
141
+ * ```
142
+ */
143
+ setPositiveStyle(selector: ChartPublicSeriesSelector, value: Omit<IChartSeriesPatch, 'selector'>): this;
144
+ /**
145
+ * Clears the positive style configuration and returns this builder for chaining.
146
+ *
147
+ * This method executes synchronously.
148
+ *
149
+ * @param selector The target series selector.
150
+ * @returns This builder for chaining.
151
+ * @example
152
+ * ```ts
153
+ * const worksheet = univerAPI.getActiveWorkbook().getActiveSheet();
154
+ * const builder = worksheet.charts.create().setType(univerAPI.Enum.ChartTypeString.Waterfall);
155
+ * builder.clearPositiveStyle(0);
156
+ * const positive = builder.describe().series[0]?.waterfallStyles?.positive;
157
+ * ```
158
+ */
159
+ clearPositiveStyle(selector: ChartPublicSeriesSelector): this;
160
+ /**
161
+ * Sets the negative style configuration and returns this builder for chaining.
162
+ *
163
+ * This method executes synchronously.
164
+ *
165
+ * @param selector The target series selector.
166
+ * @param value The semantic value to record.
167
+ * @returns This builder for chaining.
168
+ * @example
169
+ * ```ts
170
+ * const worksheet = univerAPI.getActiveWorkbook().getActiveSheet();
171
+ * const builder = worksheet.charts.create().setType(univerAPI.Enum.ChartTypeString.Waterfall);
172
+ * builder.setNegativeStyle(0, { color: '#f5222d' });
173
+ * const negative = builder.describe().series[0]?.waterfallStyles?.negative;
174
+ * ```
175
+ */
176
+ setNegativeStyle(selector: ChartPublicSeriesSelector, value: Omit<IChartSeriesPatch, 'selector'>): this;
177
+ /**
178
+ * Clears the negative style configuration and returns this builder for chaining.
179
+ *
180
+ * This method executes synchronously.
181
+ *
182
+ * @param selector The target series selector.
183
+ * @returns This builder for chaining.
184
+ * @example
185
+ * ```ts
186
+ * const worksheet = univerAPI.getActiveWorkbook().getActiveSheet();
187
+ * const builder = worksheet.charts.create().setType(univerAPI.Enum.ChartTypeString.Waterfall);
188
+ * builder.clearNegativeStyle(0);
189
+ * const negative = builder.describe().series[0]?.waterfallStyles?.negative;
190
+ * ```
191
+ */
192
+ clearNegativeStyle(selector: ChartPublicSeriesSelector): this;
193
+ /**
194
+ * Sets the subtotal style configuration and returns this builder for chaining.
195
+ *
196
+ * This method executes synchronously.
197
+ *
198
+ * @param selector The target series selector.
199
+ * @param value The semantic value to record.
200
+ * @returns This builder for chaining.
201
+ * @example
202
+ * ```ts
203
+ * const worksheet = univerAPI.getActiveWorkbook().getActiveSheet();
204
+ * const builder = worksheet.charts.create().setType(univerAPI.Enum.ChartTypeString.Waterfall);
205
+ * builder.setSubtotalStyle(0, { color: '#1677ff' });
206
+ * const subtotal = builder.describe().series[0]?.waterfallStyles?.subtotal;
207
+ * ```
208
+ */
209
+ setSubtotalStyle(selector: ChartPublicSeriesSelector, value: Omit<IChartSeriesPatch, 'selector'>): this;
210
+ /**
211
+ * Clears the subtotal style configuration and returns this builder for chaining.
212
+ *
213
+ * This method executes synchronously.
214
+ *
215
+ * @param selector The target series selector.
216
+ * @returns This builder for chaining.
217
+ * @example
218
+ * ```ts
219
+ * const worksheet = univerAPI.getActiveWorkbook().getActiveSheet();
220
+ * const builder = worksheet.charts.create().setType(univerAPI.Enum.ChartTypeString.Waterfall);
221
+ * builder.clearSubtotalStyle(0);
222
+ * const subtotal = builder.describe().series[0]?.waterfallStyles?.subtotal;
223
+ * ```
224
+ */
225
+ clearSubtotalStyle(selector: ChartPublicSeriesSelector): this;
226
+ }
@@ -0,0 +1,91 @@
1
+ import type { WordCloudShapeEnum } from '@univerjs-pro/engine-chart';
2
+ import { FChartBuilderBase } from '../f-chart-builder-base';
3
+ export declare class FWordCloudChartBuilder extends FChartBuilderBase {
4
+ /**
5
+ * Sets the shape configuration and returns this builder for chaining.
6
+ *
7
+ * This method executes synchronously.
8
+ *
9
+ * @param value The semantic value to record.
10
+ * @returns This builder for chaining.
11
+ * @example
12
+ * ```ts
13
+ * const worksheet = univerAPI.getActiveWorkbook().getActiveSheet();
14
+ * const builder = worksheet.charts.create().setType(univerAPI.Enum.ChartTypeString.WordCloud);
15
+ * builder.setShape(univerAPI.Enum.WordCloudShapeEnum.Cloud);
16
+ * ```
17
+ */
18
+ setShape(value: WordCloudShapeEnum): this;
19
+ /**
20
+ * Restores the word-cloud shape to `Cloud` and returns this builder for chaining.
21
+ *
22
+ * This method executes synchronously.
23
+ *
24
+ * @returns This builder for chaining.
25
+ * @example
26
+ * ```ts
27
+ * const worksheet = univerAPI.getActiveWorkbook().getActiveSheet();
28
+ * const builder = worksheet.charts.create().setType(univerAPI.Enum.ChartTypeString.WordCloud);
29
+ * builder.resetShape();
30
+ * ```
31
+ */
32
+ resetShape(): this;
33
+ /**
34
+ * Sets the mask image configuration and returns this builder for chaining.
35
+ *
36
+ * This method executes synchronously.
37
+ *
38
+ * @param resourceId The host resource ID.
39
+ * @returns This builder for chaining.
40
+ * @example
41
+ * ```ts
42
+ * const worksheet = univerAPI.getActiveWorkbook().getActiveSheet();
43
+ * const builder = worksheet.charts.create().setType(univerAPI.Enum.ChartTypeString.WordCloud);
44
+ * builder.setMaskImage('resource-id');
45
+ * ```
46
+ */
47
+ setMaskImage(resourceId: string): this;
48
+ /**
49
+ * Clears the mask image configuration and returns this builder for chaining.
50
+ *
51
+ * This method executes synchronously.
52
+ *
53
+ * @returns This builder for chaining.
54
+ * @example
55
+ * ```ts
56
+ * const worksheet = univerAPI.getActiveWorkbook().getActiveSheet();
57
+ * const builder = worksheet.charts.create().setType(univerAPI.Enum.ChartTypeString.WordCloud);
58
+ * builder.clearMaskImage();
59
+ * ```
60
+ */
61
+ clearMaskImage(): this;
62
+ /**
63
+ * Sets the repeat configuration and returns this builder for chaining.
64
+ *
65
+ * This method executes synchronously.
66
+ *
67
+ * @param value The semantic value to record.
68
+ * @returns This builder for chaining.
69
+ * @example
70
+ * ```ts
71
+ * const worksheet = univerAPI.getActiveWorkbook().getActiveSheet();
72
+ * const builder = worksheet.charts.create().setType(univerAPI.Enum.ChartTypeString.WordCloud);
73
+ * builder.setRepeat(true);
74
+ * ```
75
+ */
76
+ setRepeat(value: boolean): this;
77
+ /**
78
+ * Restores the default of not repeating words and returns this builder for chaining.
79
+ *
80
+ * This method executes synchronously.
81
+ *
82
+ * @returns This builder for chaining.
83
+ * @example
84
+ * ```ts
85
+ * const worksheet = univerAPI.getActiveWorkbook().getActiveSheet();
86
+ * const builder = worksheet.charts.create().setType(univerAPI.Enum.ChartTypeString.WordCloud);
87
+ * builder.resetRepeat();
88
+ * ```
89
+ */
90
+ resetRepeat(): this;
91
+ }
@@ -0,0 +1,13 @@
1
+ export { FAreaChartBuilder } from './f-area-chart-builder';
2
+ export { FBubbleChartBuilder } from './f-bubble-chart-builder';
3
+ export { FCombinationChartBuilder } from './f-combination-chart-builder';
4
+ export { FFunnelChartBuilder } from './f-funnel-chart-builder';
5
+ export { FHeatmapChartBuilder } from './f-heatmap-chart-builder';
6
+ export { FLineChartBuilder } from './f-line-chart-builder';
7
+ export { FParetoChartBuilder } from './f-pareto-chart-builder';
8
+ export { FPieChartBuilder } from './f-pie-chart-builder';
9
+ export { FRadarChartBuilder } from './f-radar-chart-builder';
10
+ export { FRelationChartBuilder } from './f-relation-chart-builder';
11
+ export { FScatterChartBuilder } from './f-scatter-chart-builder';
12
+ export { FWaterfallChartBuilder } from './f-waterfall-chart-builder';
13
+ export { FWordCloudChartBuilder } from './f-word-cloud-chart-builder';
@@ -0,0 +1,8 @@
1
+ import type { ChartBuilder } from '@univerjs-pro/engine-chart';
2
+ import type { IChartBuilderTypeMap } from './chart-builder-type-map';
3
+ import type { FChartBuilderBase } from './f-chart-builder-base';
4
+ import type { IChartBuilderFacadeContext } from './internal/chart-builder-facade-context';
5
+ export type ChartBuilderConstructor<T extends FChartBuilderBase = FChartBuilderBase> = new (context: IChartBuilderFacadeContext<ChartBuilder>) => T;
6
+ export declare function registerChartBuilder<T extends keyof IChartBuilderTypeMap>(type: T, Constructor: ChartBuilderConstructor<IChartBuilderTypeMap[T]>): void;
7
+ export declare function getChartBuilderConstructor<T extends keyof IChartBuilderTypeMap>(type: T): ChartBuilderConstructor<IChartBuilderTypeMap[T]>;
8
+ export declare function getChartBuilderRegistryKeys(): (keyof IChartBuilderTypeMap)[];
@@ -0,0 +1,30 @@
1
+ import type { ChartTypeString } from '@univerjs-pro/engine-chart';
2
+ import type { FAreaChartBuilder, FBubbleChartBuilder, FCombinationChartBuilder, FFunnelChartBuilder, FHeatmapChartBuilder, FLineChartBuilder, FParetoChartBuilder, FPieChartBuilder, FRadarChartBuilder, FRelationChartBuilder, FScatterChartBuilder, FWaterfallChartBuilder, FWordCloudChartBuilder } from './builders';
3
+ import type { FCartesianChartBuilder } from './f-cartesian-chart-builder';
4
+ import type { FChartBuilderBase } from './f-chart-builder-base';
5
+ export interface IChartBuilderTypeMap {
6
+ [ChartTypeString.Line]: FLineChartBuilder;
7
+ [ChartTypeString.Column]: FCartesianChartBuilder;
8
+ [ChartTypeString.ColumnStacked]: FCartesianChartBuilder;
9
+ [ChartTypeString.ColumnPercentStacked]: FCartesianChartBuilder;
10
+ [ChartTypeString.Bar]: FCartesianChartBuilder;
11
+ [ChartTypeString.BarStacked]: FCartesianChartBuilder;
12
+ [ChartTypeString.BarPercentStacked]: FCartesianChartBuilder;
13
+ [ChartTypeString.Pie]: FPieChartBuilder;
14
+ [ChartTypeString.Donut]: FPieChartBuilder;
15
+ [ChartTypeString.Area]: FAreaChartBuilder;
16
+ [ChartTypeString.AreaStacked]: FAreaChartBuilder;
17
+ [ChartTypeString.AreaPercentStacked]: FAreaChartBuilder;
18
+ [ChartTypeString.Radar]: FRadarChartBuilder;
19
+ [ChartTypeString.Scatter]: FScatterChartBuilder;
20
+ [ChartTypeString.Combination]: FCombinationChartBuilder;
21
+ [ChartTypeString.WordCloud]: FWordCloudChartBuilder;
22
+ [ChartTypeString.Funnel]: FFunnelChartBuilder;
23
+ [ChartTypeString.Bubble]: FBubbleChartBuilder;
24
+ [ChartTypeString.Relation]: FRelationChartBuilder;
25
+ [ChartTypeString.Waterfall]: FWaterfallChartBuilder;
26
+ [ChartTypeString.Pareto]: FParetoChartBuilder;
27
+ [ChartTypeString.Sankey]: FChartBuilderBase;
28
+ [ChartTypeString.Heatmap]: FHeatmapChartBuilder;
29
+ [ChartTypeString.Boxplot]: FCartesianChartBuilder;
30
+ }
@@ -0,0 +1,21 @@
1
+ import type { IChartBuilderTypeMap } from './chart-builder-type-map';
2
+ import type { FChartBuilderBase } from './f-chart-builder-base';
3
+ import type { IChartBuilderHostTypes } from './f-charts-base';
4
+ type RebindHostMethods<TBuilder extends FChartBuilderBase, THostMethods extends object> = {
5
+ [K in keyof THostMethods]: THostMethods[K] extends (...args: infer TArgs) => infer TResult ? TResult extends THostMethods ? (...args: TArgs) => HostComposedChartBuilder<TBuilder, THostMethods> : THostMethods[K] : THostMethods[K];
6
+ };
7
+ type RebindBuilderMethods<TBuilder extends FChartBuilderBase, THostMethods extends object> = {
8
+ [K in keyof Omit<TBuilder, keyof THostMethods | 'setType'>]: Omit<TBuilder, keyof THostMethods | 'setType'>[K] extends (...args: infer TArgs) => infer TResult ? TResult extends FChartBuilderBase ? (...args: TArgs) => HostComposedChartBuilder<TResult, THostMethods> : Omit<TBuilder, keyof THostMethods | 'setType'>[K] : Omit<TBuilder, keyof THostMethods | 'setType'>[K];
9
+ };
10
+ export type HostComposedChartBuilder<TBuilder extends FChartBuilderBase, THostMethods extends object> = RebindBuilderMethods<TBuilder, THostMethods> & Pick<TBuilder, 'getId' | 'describe' | 'commit' | 'exportImage'> & RebindHostMethods<TBuilder, THostMethods> & {
11
+ setType<T extends keyof IChartBuilderTypeMap>(type: T): HostComposedChartBuilder<IChartBuilderTypeMap[T], THostMethods>;
12
+ };
13
+ export type HostChartBuilderOf<T extends keyof IChartBuilderTypeMap, THostMethods extends object> = HostComposedChartBuilder<IChartBuilderTypeMap[T], THostMethods>;
14
+ export type HostAnyChartBuilder<THostMethods extends object> = {
15
+ [T in keyof IChartBuilderTypeMap]: HostChartBuilderOf<T, THostMethods>;
16
+ }[keyof IChartBuilderTypeMap];
17
+ export interface IHostChartBuilderTypes<THostMethods extends object> extends IChartBuilderHostTypes {
18
+ Initial: HostComposedChartBuilder<FChartBuilderBase, THostMethods>;
19
+ Any: HostAnyChartBuilder<THostMethods>;
20
+ }
21
+ export {};