@univerjs-pro/engine-chart 1.0.0-alpha.7 → 1.0.0-alpha.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/facade.js +1 -1
- package/lib/cjs/index.js +1 -1
- package/lib/es/facade.js +1 -1
- package/lib/es/index.js +1 -1
- package/lib/facade.js +1 -1
- package/lib/index.js +1 -1
- package/lib/types/chart-builder/candlestick-inline-table.d.ts +4 -0
- package/lib/types/chart-builder/chart-builder-adapter.d.ts +3 -3
- package/lib/types/chart-builder/chart-builder.d.ts +3 -3
- package/lib/types/chart-builder/chart-starter-data.d.ts +3 -0
- package/lib/types/chart-builder/chart-types.d.ts +71 -57
- package/lib/types/chart-builder/configuration/assertions.d.ts +1 -0
- package/lib/types/chart-builder/configuration/candlestick.d.ts +9 -0
- package/lib/types/chart-builder/configuration/chart-config-operation.d.ts +3 -0
- package/lib/types/chart-builder/configuration/histogram.d.ts +11 -0
- package/lib/types/chart-builder/configuration/index.d.ts +4 -0
- package/lib/types/chart-builder/configuration/point-mapping.d.ts +3 -0
- package/lib/types/chart-builder/configuration/treemap.d.ts +8 -0
- package/lib/types/chart-builder/conversion/chart-config-converter.d.ts +7 -3
- package/lib/types/chart-builder/conversion/chart-context-patch.d.ts +5 -0
- package/lib/types/chart-builder/conversion/chart-model-fields.d.ts +6 -0
- package/lib/types/chart-builder/conversion/resolve-chart-model-data.d.ts +3 -3
- package/lib/types/chart-builder/index.d.ts +4 -1
- package/lib/types/chart-builder/internal/host-builder-runtime.d.ts +0 -2
- package/lib/types/chart-text-measure-canvas.d.ts +6 -0
- package/lib/types/enum.d.ts +34 -1
- package/lib/types/facade/builders/f-candlestick-chart-builder.d.ts +133 -0
- package/lib/types/facade/builders/f-histogram-chart-builder.d.ts +74 -0
- package/lib/types/facade/builders/f-treemap-chart-builder.d.ts +34 -0
- package/lib/types/facade/builders/index.d.ts +3 -0
- package/lib/types/facade/chart-builder-type-map.d.ts +4 -1
- package/lib/types/facade/f-chart-base.d.ts +2 -2
- package/lib/types/index.d.ts +9 -8
- package/lib/types/models/chart-data-operators/histogram-data.d.ts +10 -0
- package/lib/types/models/chart-data-operators/index.d.ts +1 -0
- package/lib/types/models/chart-data-operators/operators.d.ts +7 -1
- package/lib/types/models/chart-data-operators/treemap-data.d.ts +3 -0
- package/lib/types/models/chart-locale-texts.d.ts +15 -1
- package/lib/types/models/chart-model.d.ts +215 -29
- package/lib/types/models/constants/default-chart-style.d.ts +43 -0
- package/lib/types/models/constants/histogram-defaults.d.ts +4 -0
- package/lib/types/models/constants/treemap.d.ts +1 -0
- package/lib/types/models/data-context-transformers/candlestick-data-context-transformer.d.ts +4 -0
- package/lib/types/models/data-context-transformers/histogram-data-context-transformer.d.ts +7 -0
- package/lib/types/models/data-context-transformers/treemap-data-context-transformer.d.ts +11 -0
- package/lib/types/models/echart-render-model.d.ts +10 -7
- package/lib/types/models/mode-converter/converters/boxplot-chart-converter.d.ts +3 -2
- package/lib/types/models/mode-converter/converters/bubble-chart-converter.d.ts +3 -2
- package/lib/types/models/mode-converter/converters/candlestick-chart-converter.d.ts +5 -0
- package/lib/types/models/mode-converter/converters/combination-chart-converter.d.ts +3 -2
- package/lib/types/models/mode-converter/converters/funnel-chart-converter.d.ts +3 -2
- package/lib/types/models/mode-converter/converters/heatmap-chart-convert.d.ts +3 -2
- package/lib/types/models/mode-converter/converters/histogram-chart-converter.d.ts +4 -0
- package/lib/types/models/mode-converter/converters/pareto-chart-converter.d.ts +3 -2
- package/lib/types/models/mode-converter/converters/pie-chart-converter.d.ts +3 -2
- package/lib/types/models/mode-converter/converters/radar-chart-converter.d.ts +3 -2
- package/lib/types/models/mode-converter/converters/relation-chart-converter.d.ts +3 -2
- package/lib/types/models/mode-converter/converters/sankey-chart-converter.d.ts +3 -2
- package/lib/types/models/mode-converter/converters/scatter-chart-converter.d.ts +3 -2
- package/lib/types/models/mode-converter/converters/treemap-chart-converter.d.ts +4 -0
- package/lib/types/models/mode-converter/converters/waterfall-chart-converter.d.ts +3 -2
- package/lib/types/models/mode-converter/converters/word-cloud-converter.d.ts +3 -2
- package/lib/types/models/mode-converter/render-spec-operators/tool-tip-operator.d.ts +8 -2
- package/lib/types/models/mode-converter/render-spec-operators/tools.d.ts +3 -2
- package/lib/types/types.d.ts +133 -8
- package/lib/types/util.d.ts +1 -7
- package/lib/types/wordcloud-chart/canvas.d.ts +3 -3
- package/lib/types/wordcloud-chart/core/layout/word-shrink.d.ts +5 -8
- package/lib/types/wordcloud-chart/core/text/formatter.d.ts +2 -2
- package/lib/types/wordcloud-chart/core/text/normalize.d.ts +2 -2
- package/lib/types/wordcloud-chart/defaults.d.ts +2 -2
- package/lib/types/wordcloud-chart/index.d.ts +1 -1
- package/lib/types/wordcloud-chart/types.d.ts +0 -3
- package/lib/umd/facade.js +1 -1
- package/lib/umd/index.js +1 -1
- package/package.json +4 -4
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { ChartTypeBits } from '../enum';
|
|
2
|
+
export declare const CANDLESTICK_INLINE_COLUMN_COUNT = 5;
|
|
3
|
+
/** Enforces the fixed Category/Open/High/Low/Close inline-host contract. */
|
|
4
|
+
export declare function normalizeCandlestickInlineTable<T>(chartType: ChartTypeBits, values: T[][]): T[][] | undefined;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { IChartRenderModelImageExportOptions, IChartRenderModelImageExportResult, IUniverDataSet } from '../types';
|
|
2
|
-
import type { ChartPendingConfig, IChartDescription
|
|
1
|
+
import type { IChartData, IChartRenderModelImageExportOptions, IChartRenderModelImageExportResult, IUniverDataSet } from '../types';
|
|
2
|
+
import type { ChartPendingConfig, IChartDescription } from './chart-types';
|
|
3
3
|
/** Host-owned persistence and rendering capabilities used by a chart builder. */
|
|
4
4
|
export interface IChartBuilderAdapter<THostDescription extends object = object> {
|
|
5
5
|
/** Reads the canonical host description, optionally evaluating pending config against an alternate data set without persisting either. */
|
|
@@ -7,7 +7,7 @@ export interface IChartBuilderAdapter<THostDescription extends object = object>
|
|
|
7
7
|
/** Persists one pending semantic configuration patch. */
|
|
8
8
|
commit(config: ChartPendingConfig): void;
|
|
9
9
|
/** Materializes fresh engine semantic data for the effective pending state without mutating the host. */
|
|
10
|
-
resolveData(config: ChartPendingConfig):
|
|
10
|
+
resolveData(config: ChartPendingConfig): IChartData;
|
|
11
11
|
/** Renders the hosted chart as an image when rendering is available. */
|
|
12
12
|
exportImage(options?: IChartRenderModelImageExportOptions): Promise<IChartRenderModelImageExportResult | null>;
|
|
13
13
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { DeepReadonly } from '@univerjs/core';
|
|
2
2
|
import type { IChartBuilderAdapter } from './chart-builder-adapter';
|
|
3
|
-
import type {
|
|
3
|
+
import type { IChartData, IUniverDataSet } from '../types';
|
|
4
|
+
import type { ChartPendingConfig, IChartDescription } from './chart-types';
|
|
4
5
|
import type { IChartConfigOperation } from './configuration/chart-config-operation';
|
|
5
|
-
import type { IUniverDataSet } from '../types';
|
|
6
6
|
import { ChartTypeString } from './chart-types';
|
|
7
7
|
/** Maintains an immutable chart baseline plus pending semantic configuration changes. */
|
|
8
8
|
export declare class ChartBuilder<THostDescription extends object = object> {
|
|
@@ -23,7 +23,7 @@ export declare class ChartBuilder<THostDescription extends object = object> {
|
|
|
23
23
|
/** Returns a frozen description composed from the baseline and pending state. */
|
|
24
24
|
describe(): DeepReadonly<IChartDescription & THostDescription>;
|
|
25
25
|
/** Materializes a fresh deeply read-only engine data result for this hosted builder. */
|
|
26
|
-
resolveData(): DeepReadonly<
|
|
26
|
+
resolveData(): DeepReadonly<IChartData>;
|
|
27
27
|
/** Persists pending changes through the host adapter and refreshes the baseline. */
|
|
28
28
|
commit(): void;
|
|
29
29
|
protected refreshBaseline(): void;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { AreaLineStyle, BarShape, ChartAxisDimension, ChartBorderDashType, ChartMarkLineLabelPosition, ChartSemanticAxis, ChartTrendlineType, ChartWaterfallPointRole, InvalidValueType, IRuntimeAxisPosition, LabelAlignEnum, LabelContentType, LegendPositionEnum, LinePointShape, PieLabelPosition, RadarShape, RelationChartLayoutEnum, SelectModeEnum, SeriesLabelPosition, TitlePositionEnum, WaterfallStackTypeEnum, WordCloudShapeEnum } from '../enum';
|
|
2
|
-
import type {
|
|
2
|
+
import type { DeepNullish, IChartCandlestickMappingSpec, IChartCandlestickSpec, IChartHistogramSpec, IChartTreemapSpec } from '../types';
|
|
3
3
|
import type { ChartColor } from './chart-color';
|
|
4
|
-
export { ChartAxisDimension, ChartMarkLineLabelPosition, ChartSemanticAxis, ChartWaterfallPointRole } from '../enum';
|
|
5
4
|
/** Canonical semantic chart type names exposed by the chart facade. */
|
|
6
5
|
export declare enum ChartTypeString {
|
|
7
6
|
Line = "line",
|
|
@@ -27,7 +26,10 @@ export declare enum ChartTypeString {
|
|
|
27
26
|
Pareto = "pareto",
|
|
28
27
|
Sankey = "sankey",
|
|
29
28
|
Heatmap = "heatmap",
|
|
30
|
-
Boxplot = "boxplot"
|
|
29
|
+
Boxplot = "boxplot",
|
|
30
|
+
Candlestick = "candlestick",
|
|
31
|
+
Histogram = "histogram",
|
|
32
|
+
Treemap = "treemap"
|
|
31
33
|
}
|
|
32
34
|
export declare enum ChartSeriesTypeString {
|
|
33
35
|
Column = "column",
|
|
@@ -87,8 +89,8 @@ export interface IChartAxisLabelSpec extends IChartFontSpec {
|
|
|
87
89
|
}
|
|
88
90
|
export interface IChartAxisSpec {
|
|
89
91
|
title?: string;
|
|
90
|
-
min?: number
|
|
91
|
-
max?: number
|
|
92
|
+
min?: number;
|
|
93
|
+
max?: number;
|
|
92
94
|
reverse?: boolean;
|
|
93
95
|
line?: {
|
|
94
96
|
visible?: boolean;
|
|
@@ -102,7 +104,7 @@ export interface IChartAxisSpec {
|
|
|
102
104
|
length?: number;
|
|
103
105
|
position?: ChartAxisTickPosition;
|
|
104
106
|
};
|
|
105
|
-
format?: string
|
|
107
|
+
format?: string;
|
|
106
108
|
titleStyle?: IChartFontSpec;
|
|
107
109
|
label?: IChartAxisLabelSpec;
|
|
108
110
|
gridLine?: {
|
|
@@ -159,7 +161,7 @@ export type ChartSeriesSelector = {
|
|
|
159
161
|
name: string;
|
|
160
162
|
};
|
|
161
163
|
export interface IChartSeriesBorderSpec {
|
|
162
|
-
color?: string
|
|
164
|
+
color?: string;
|
|
163
165
|
width?: number;
|
|
164
166
|
opacity?: number;
|
|
165
167
|
dashType?: ChartBorderDashType;
|
|
@@ -167,7 +169,7 @@ export interface IChartSeriesBorderSpec {
|
|
|
167
169
|
export interface IChartSeriesPointSpec {
|
|
168
170
|
shape?: LinePointShape;
|
|
169
171
|
size?: number;
|
|
170
|
-
color?: string
|
|
172
|
+
color?: string;
|
|
171
173
|
}
|
|
172
174
|
export interface IChartSeriesLabelSpec extends IChartFontSpec {
|
|
173
175
|
visible?: boolean;
|
|
@@ -240,7 +242,7 @@ export interface IChartHeatmapSpec {
|
|
|
240
242
|
}
|
|
241
243
|
export interface IChartWordCloudSpec {
|
|
242
244
|
shape?: WordCloudShapeEnum;
|
|
243
|
-
maskImageId?: string
|
|
245
|
+
maskImageId?: string;
|
|
244
246
|
repeat?: boolean;
|
|
245
247
|
}
|
|
246
248
|
export interface IChartWordCloudDescription {
|
|
@@ -252,10 +254,10 @@ export interface IChartWordCloudDescription {
|
|
|
252
254
|
export interface IChartAppearanceSpec {
|
|
253
255
|
background?: {
|
|
254
256
|
/** CSS background color. Use `'transparent'` for an explicit transparent chart and host background. */
|
|
255
|
-
color?: string
|
|
257
|
+
color?: string;
|
|
256
258
|
};
|
|
257
259
|
border?: {
|
|
258
|
-
color?: string
|
|
260
|
+
color?: string;
|
|
259
261
|
/** Persisted host-border width. Use `0` to hide the host border without changing host-owned stroke state. */
|
|
260
262
|
width?: number;
|
|
261
263
|
};
|
|
@@ -268,22 +270,25 @@ export interface IChartAppearanceSpec {
|
|
|
268
270
|
export interface IChartScatterMappingSpec {
|
|
269
271
|
xIndex: number;
|
|
270
272
|
yIndex: number;
|
|
271
|
-
labelIndex?: number
|
|
273
|
+
labelIndex?: number;
|
|
272
274
|
}
|
|
273
275
|
export interface IChartBubbleMappingSpec extends IChartScatterMappingSpec {
|
|
274
|
-
sizeIndex?: number
|
|
275
|
-
seriesIndex?: number
|
|
276
|
+
sizeIndex?: number;
|
|
277
|
+
seriesIndex?: number;
|
|
276
278
|
}
|
|
277
279
|
export interface IChartMappingSpec {
|
|
278
|
-
categoryIndex?: number
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
280
|
+
categoryIndex?: number;
|
|
281
|
+
/** Ordered root-to-leaf hierarchy fields for hierarchy charts. */
|
|
282
|
+
hierarchyIndexes?: number[];
|
|
283
|
+
seriesIndexes?: number[];
|
|
284
|
+
useDateAxis?: boolean;
|
|
285
|
+
scatter?: IChartScatterMappingSpec;
|
|
286
|
+
bubble?: IChartBubbleMappingSpec;
|
|
287
|
+
candlestick?: IChartCandlestickMappingSpec;
|
|
283
288
|
}
|
|
284
289
|
export interface IChartAggregationSpec {
|
|
285
|
-
aggregate?: boolean
|
|
286
|
-
topN?: number
|
|
290
|
+
aggregate?: boolean;
|
|
291
|
+
topN?: number;
|
|
287
292
|
}
|
|
288
293
|
export interface IChartPieLabelSpec extends IChartFontSpec {
|
|
289
294
|
visible?: boolean;
|
|
@@ -296,7 +301,7 @@ export interface IChartSliceStyleSpec {
|
|
|
296
301
|
fillOpacity?: number;
|
|
297
302
|
}
|
|
298
303
|
export interface IChartPieSpec {
|
|
299
|
-
doughnutHole?: number
|
|
304
|
+
doughnutHole?: number;
|
|
300
305
|
explosion?: number;
|
|
301
306
|
borderColor?: string;
|
|
302
307
|
hasPaddingAngle?: boolean;
|
|
@@ -367,7 +372,7 @@ export interface IChartAxisPointerSpec {
|
|
|
367
372
|
indicatorLabelTextColor?: string;
|
|
368
373
|
}
|
|
369
374
|
export interface IChartAreaSpec {
|
|
370
|
-
lineStyle?: AreaLineStyle
|
|
375
|
+
lineStyle?: AreaLineStyle;
|
|
371
376
|
}
|
|
372
377
|
export interface IChartBarSpec {
|
|
373
378
|
is3D?: boolean;
|
|
@@ -376,8 +381,8 @@ export interface IChartBarSpec {
|
|
|
376
381
|
rotY?: number;
|
|
377
382
|
}
|
|
378
383
|
export interface IChartFunnelSpec {
|
|
379
|
-
gap?: number
|
|
380
|
-
useAbsoluteValue?: boolean
|
|
384
|
+
gap?: number;
|
|
385
|
+
useAbsoluteValue?: boolean;
|
|
381
386
|
}
|
|
382
387
|
export interface IChartRelationForceSpec {
|
|
383
388
|
gravity?: number;
|
|
@@ -385,12 +390,12 @@ export interface IChartRelationForceSpec {
|
|
|
385
390
|
edgeLength?: number;
|
|
386
391
|
}
|
|
387
392
|
export interface IChartRelationSpec {
|
|
388
|
-
layout?: RelationChartLayoutEnum
|
|
389
|
-
useValueAsSymbolSize?: boolean
|
|
390
|
-
emphasisEnabled?: boolean
|
|
391
|
-
force?: IChartRelationForceSpec
|
|
392
|
-
circularLabelRotation?: boolean
|
|
393
|
-
nodeShape?: LinePointShape
|
|
393
|
+
layout?: RelationChartLayoutEnum;
|
|
394
|
+
useValueAsSymbolSize?: boolean;
|
|
395
|
+
emphasisEnabled?: boolean;
|
|
396
|
+
force?: IChartRelationForceSpec;
|
|
397
|
+
circularLabelRotation?: boolean;
|
|
398
|
+
nodeShape?: LinePointShape;
|
|
394
399
|
}
|
|
395
400
|
/** Waterfall semantic configuration exposed through the Facade. */
|
|
396
401
|
export interface IChartWaterfallSpec {
|
|
@@ -420,33 +425,42 @@ export interface IChartWaterfallConnectorStyleSpec {
|
|
|
420
425
|
interface IChartSemanticConfig {
|
|
421
426
|
type?: ChartTypeString;
|
|
422
427
|
autoGradientFill?: boolean;
|
|
423
|
-
title?: ChartTitleSpec
|
|
424
|
-
subtitle?: ChartSubtitleSpec
|
|
425
|
-
trendlines?: IChartTrendlineSpec[]
|
|
426
|
-
heatmap?: IChartHeatmapSpec
|
|
427
|
-
invalidValueStrategy?: InvalidValueType
|
|
428
|
-
legend?: ChartLegendSpec
|
|
429
|
-
axes?: IChartAxesSpec
|
|
430
|
-
allSeriesStyle?: IChartSeriesStyleSpec
|
|
431
|
-
series?: IChartSeriesPatch[]
|
|
432
|
-
wordCloud?: IChartWordCloudSpec
|
|
433
|
-
appearance?: IChartAppearanceSpec
|
|
434
|
-
mapping?: IChartMappingSpec
|
|
435
|
-
aggregation?: IChartAggregationSpec
|
|
436
|
-
pie?: IChartPieSpec
|
|
437
|
-
radar?: IChartRadarSpec
|
|
438
|
-
pareto?: IChartParetoSpec
|
|
439
|
-
axisPointer?: IChartAxisPointerSpec
|
|
440
|
-
area?: IChartAreaSpec
|
|
441
|
-
bar?: IChartBarSpec
|
|
442
|
-
funnel?: IChartFunnelSpec
|
|
443
|
-
relation?: IChartRelationSpec
|
|
444
|
-
waterfall?: IChartWaterfallSpec
|
|
445
|
-
|
|
446
|
-
|
|
428
|
+
title?: ChartTitleSpec;
|
|
429
|
+
subtitle?: ChartSubtitleSpec;
|
|
430
|
+
trendlines?: IChartTrendlineSpec[];
|
|
431
|
+
heatmap?: IChartHeatmapSpec;
|
|
432
|
+
invalidValueStrategy?: InvalidValueType;
|
|
433
|
+
legend?: ChartLegendSpec;
|
|
434
|
+
axes?: IChartAxesSpec;
|
|
435
|
+
allSeriesStyle?: IChartSeriesStyleSpec;
|
|
436
|
+
series?: IChartSeriesPatch[];
|
|
437
|
+
wordCloud?: IChartWordCloudSpec;
|
|
438
|
+
appearance?: IChartAppearanceSpec;
|
|
439
|
+
mapping?: IChartMappingSpec;
|
|
440
|
+
aggregation?: IChartAggregationSpec;
|
|
441
|
+
pie?: IChartPieSpec;
|
|
442
|
+
radar?: IChartRadarSpec;
|
|
443
|
+
pareto?: IChartParetoSpec;
|
|
444
|
+
axisPointer?: IChartAxisPointerSpec;
|
|
445
|
+
area?: IChartAreaSpec;
|
|
446
|
+
bar?: IChartBarSpec;
|
|
447
|
+
funnel?: IChartFunnelSpec;
|
|
448
|
+
relation?: IChartRelationSpec;
|
|
449
|
+
waterfall?: IChartWaterfallSpec;
|
|
450
|
+
candlestick?: IChartCandlestickSpec;
|
|
451
|
+
histogram?: IChartHistogramSpec;
|
|
452
|
+
treemap?: IChartTreemapSpec;
|
|
453
|
+
markLines?: IChartMarkLineSpec[];
|
|
454
|
+
theme?: string;
|
|
447
455
|
/** Persisted absolute series colors. A non-empty value overrides theme colors. */
|
|
448
|
-
palette?: string[]
|
|
456
|
+
palette?: string[];
|
|
449
457
|
}
|
|
458
|
+
/** Pending chart edits; `null` is a runtime-only delete marker consumed before persistence. */
|
|
459
|
+
export type ChartPendingConfig = Pick<IChartSemanticConfig, 'type'> & DeepNullish<Omit<IChartSemanticConfig, 'type' | 'series'>> & {
|
|
460
|
+
series?: Array<{
|
|
461
|
+
selector: ChartSeriesSelector;
|
|
462
|
+
} & DeepNullish<Omit<IChartSeriesPatch, 'selector'>>> | null;
|
|
463
|
+
};
|
|
450
464
|
/** Data-free metadata and semantic styling for one source series. */
|
|
451
465
|
export interface IChartSeriesDescription extends IChartSeriesStyleSpec {
|
|
452
466
|
name: string;
|
|
@@ -459,7 +473,6 @@ export interface IChartCategoryDescription {
|
|
|
459
473
|
name: string;
|
|
460
474
|
}
|
|
461
475
|
/** Materialized engine semantic data returned explicitly by hosted builders. */
|
|
462
|
-
export type IResolvedChartData = IChartData;
|
|
463
476
|
export interface IChartDescription extends Omit<IChartSemanticConfig, 'autoGradientFill' | 'series'> {
|
|
464
477
|
id: string;
|
|
465
478
|
type: ChartTypeString;
|
|
@@ -484,3 +497,4 @@ export interface IChartDescription extends Omit<IChartSemanticConfig, 'autoGradi
|
|
|
484
497
|
*/
|
|
485
498
|
axisBindings?: Partial<Record<ChartSemanticAxis, IChartAxisBindingDescription>>;
|
|
486
499
|
}
|
|
500
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { IChartCandlestickStateStyleSpec } from '../../types';
|
|
2
|
+
export declare const setRisingStyle: (value: IChartCandlestickStateStyleSpec) => import("./chart-config-operation").IChartConfigOperation;
|
|
3
|
+
export declare const clearRisingStyle: () => import("./chart-config-operation").IChartConfigOperation;
|
|
4
|
+
export declare const setFallingStyle: (value: IChartCandlestickStateStyleSpec) => import("./chart-config-operation").IChartConfigOperation;
|
|
5
|
+
export declare const clearFallingStyle: () => import("./chart-config-operation").IChartConfigOperation;
|
|
6
|
+
export declare const setDojiStyle: (value: IChartCandlestickStateStyleSpec) => import("./chart-config-operation").IChartConfigOperation;
|
|
7
|
+
export declare const clearDojiStyle: () => import("./chart-config-operation").IChartConfigOperation;
|
|
8
|
+
export declare const setCandleWidth: (value: number) => import("./chart-config-operation").IChartConfigOperation;
|
|
9
|
+
export declare const resetCandleWidth: () => import("./chart-config-operation").IChartConfigOperation;
|
|
@@ -7,6 +7,9 @@ export declare enum ChartConfigGroup {
|
|
|
7
7
|
AxisPointer = "axisPointer",
|
|
8
8
|
Aggregation = "aggregation",
|
|
9
9
|
Appearance = "appearance",
|
|
10
|
+
Candlestick = "candlestick",
|
|
11
|
+
Histogram = "histogram",
|
|
12
|
+
Treemap = "treemap",
|
|
10
13
|
Axes = "axes",
|
|
11
14
|
Bar = "bar",
|
|
12
15
|
Heatmap = "heatmap",
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const setHistogramField: (index: number) => import("./chart-config-operation").IChartConfigOperation;
|
|
2
|
+
export declare const clearHistogramField: () => import("./chart-config-operation").IChartConfigOperation;
|
|
3
|
+
export declare const setHistogramBinCount: (count: number) => import("./chart-config-operation").IChartConfigOperation;
|
|
4
|
+
export declare const setHistogramBinWidth: (width: number) => import("./chart-config-operation").IChartConfigOperation;
|
|
5
|
+
export declare const resetHistogramBinning: () => import("./chart-config-operation").IChartConfigOperation;
|
|
6
|
+
export declare const setHistogramUnderflowThreshold: (value: number) => import("./chart-config-operation").IChartConfigOperation;
|
|
7
|
+
export declare const clearHistogramUnderflowThreshold: () => import("./chart-config-operation").IChartConfigOperation;
|
|
8
|
+
export declare const setHistogramOverflowThreshold: (value: number) => import("./chart-config-operation").IChartConfigOperation;
|
|
9
|
+
export declare const clearHistogramOverflowThreshold: () => import("./chart-config-operation").IChartConfigOperation;
|
|
10
|
+
export declare const setHistogramBinGap: (value: number) => import("./chart-config-operation").IChartConfigOperation;
|
|
11
|
+
export declare const resetHistogramBinGap: () => import("./chart-config-operation").IChartConfigOperation;
|
|
@@ -7,10 +7,13 @@ export * from './auto-gradient-fill';
|
|
|
7
7
|
export * from './axes';
|
|
8
8
|
export * from './axis-pointer';
|
|
9
9
|
export * from './bar';
|
|
10
|
+
export * from './candlestick';
|
|
10
11
|
export * from './cartesian-series';
|
|
12
|
+
export type { IChartConfigOperation } from './chart-config-operation';
|
|
11
13
|
export * from './combination';
|
|
12
14
|
export * from './funnel';
|
|
13
15
|
export * from './heatmap';
|
|
16
|
+
export * from './histogram';
|
|
14
17
|
export * from './invalid-value';
|
|
15
18
|
export * from './legend';
|
|
16
19
|
export * from './line';
|
|
@@ -25,6 +28,7 @@ export * from './relation';
|
|
|
25
28
|
export * from './subtitle';
|
|
26
29
|
export * from './theme';
|
|
27
30
|
export * from './title';
|
|
31
|
+
export * from './treemap';
|
|
28
32
|
export * from './trendline';
|
|
29
33
|
export * from './waterfall';
|
|
30
34
|
export * from './word-cloud';
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
+
import type { IChartCandlestickMappingSpec } from '../../types';
|
|
1
2
|
import type { IChartBubbleMappingSpec, IChartScatterMappingSpec } from '../chart-types';
|
|
2
3
|
export declare const setScatterMapping: (value: IChartScatterMappingSpec) => import("./chart-config-operation").IChartConfigOperation;
|
|
3
4
|
export declare const clearScatterMapping: () => import("./chart-config-operation").IChartConfigOperation;
|
|
4
5
|
export declare const setBubbleMapping: (value: IChartBubbleMappingSpec) => import("./chart-config-operation").IChartConfigOperation;
|
|
5
6
|
export declare const clearBubbleMapping: () => import("./chart-config-operation").IChartConfigOperation;
|
|
7
|
+
export declare function setCandlestickFields(value: IChartCandlestickMappingSpec): import("./chart-config-operation").IChartConfigOperation;
|
|
8
|
+
export declare const clearCandlestickFields: () => import("./chart-config-operation").IChartConfigOperation;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { TreemapParentLabelLayout } from '../../enum';
|
|
2
|
+
import type { IChartTreemapLabelSpec } from '../../types';
|
|
3
|
+
export declare const setTreemapHierarchyFields: (indexes: readonly number[]) => import("./chart-config-operation").IChartConfigOperation;
|
|
4
|
+
export declare const setTreemapValueField: (index: number) => import("./chart-config-operation").IChartConfigOperation;
|
|
5
|
+
export declare const setTreemapParentLabelLayout: (layout: TreemapParentLabelLayout) => import("./chart-config-operation").IChartConfigOperation;
|
|
6
|
+
export declare const resetTreemapParentLabelLayout: () => import("./chart-config-operation").IChartConfigOperation;
|
|
7
|
+
export declare const setTreemapLabel: (label: IChartTreemapLabelSpec) => import("./chart-config-operation").IChartConfigOperation;
|
|
8
|
+
export declare const resetTreemapLabel: () => import("./chart-config-operation").IChartConfigOperation;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ChartStyle, IChartContext, IChartDataAggregation, IChartDataSeries } from '../../types';
|
|
1
|
+
import type { ChartStyle, DeepNullish, IChartContext, IChartDataAggregation, IChartDataSeries } from '../../types';
|
|
2
2
|
import type { ChartPendingConfig, IChartDescription } from '../chart-types';
|
|
3
3
|
import { ChartTypeBits } from '../../enum';
|
|
4
4
|
interface IChartConfigConversionOptions {
|
|
@@ -8,12 +8,16 @@ interface IChartConfigConversionOptions {
|
|
|
8
8
|
currentContext?: IChartContext;
|
|
9
9
|
currentDataAggregation?: IChartDataAggregation;
|
|
10
10
|
}
|
|
11
|
-
|
|
11
|
+
type ChartContextPendingPatch = DeepNullish<IChartContext>;
|
|
12
|
+
interface IChartModelConfigPendingUpdate {
|
|
12
13
|
chartType?: ChartTypeBits;
|
|
13
14
|
style?: ChartStyle;
|
|
14
|
-
context?:
|
|
15
|
+
context?: ChartContextPendingPatch;
|
|
15
16
|
dataAggregation?: Partial<IChartDataAggregation>;
|
|
16
17
|
}
|
|
18
|
+
interface IChartModelConfigUpdate extends Omit<IChartModelConfigPendingUpdate, 'context'> {
|
|
19
|
+
context?: IChartContext;
|
|
20
|
+
}
|
|
17
21
|
export interface ICompleteChartModelConfig {
|
|
18
22
|
chartType?: ChartTypeBits;
|
|
19
23
|
style?: ChartStyle;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { DeepNullish, IChartContext } from '../../types';
|
|
2
|
+
/** Validates and clones a complete context received at a replacement boundary. */
|
|
3
|
+
export declare function canonicalizeChartContext(value: unknown): IChartContext;
|
|
4
|
+
/** Internal Pending boundary used before a command payload is created. */
|
|
5
|
+
export declare function applyPendingChartContext(current: IChartContext | undefined, value: DeepNullish<IChartContext>): IChartContext;
|
|
@@ -6,12 +6,15 @@ export declare enum ChartStyleField {
|
|
|
6
6
|
BackgroundColor = "backgroundColor",
|
|
7
7
|
BorderColor = "borderColor",
|
|
8
8
|
BorderWidth = "borderWidth",
|
|
9
|
+
Candlestick = "candlestick",
|
|
9
10
|
FontColor = "fontColor",
|
|
10
11
|
FontFamily = "fontFamily",
|
|
11
12
|
FontSize = "fontSize",
|
|
12
13
|
Funnel = "funnel",
|
|
13
14
|
GradientFill = "gradientFill",
|
|
14
15
|
Heatmap = "heatmap",
|
|
16
|
+
Histogram = "histogram",
|
|
17
|
+
Treemap = "treemap",
|
|
15
18
|
InvalidValueType = "invalidValueType",
|
|
16
19
|
MarkLines = "markLines",
|
|
17
20
|
Palette = "palette",
|
|
@@ -33,6 +36,9 @@ export declare enum ChartContextField {
|
|
|
33
36
|
BubbleSeriesIndex = "bubbleSeriesIndex",
|
|
34
37
|
BubbleSizeIndex = "bubbleSizeIndex",
|
|
35
38
|
CategoryIndex = "categoryIndex",
|
|
39
|
+
Candlestick = "candlestick",
|
|
40
|
+
Histogram = "histogram",
|
|
41
|
+
HierarchyIndexes = "hierarchyIndexes",
|
|
36
42
|
ScatterLabelIndex = "scatterLabelIndex",
|
|
37
43
|
ScatterXIndex = "scatterXIndex",
|
|
38
44
|
ScatterYIndex = "scatterYIndex",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ChartModel } from '../../models/chart-model';
|
|
2
|
-
import type { IUniverDataSet } from '../../types';
|
|
3
|
-
import type { ChartPendingConfig
|
|
2
|
+
import type { IChartData, IUniverDataSet } from '../../types';
|
|
3
|
+
import type { ChartPendingConfig } from '../chart-types';
|
|
4
4
|
/** Resolves fresh engine semantic data from the model plus an uncommitted Facade patch. */
|
|
5
|
-
export declare function resolveChartModelData(model: ChartModel, pending: ChartPendingConfig, dataSet?: IUniverDataSet, isRowDirection?: boolean):
|
|
5
|
+
export declare function resolveChartModelData(model: ChartModel, pending: ChartPendingConfig, dataSet?: IUniverDataSet, isRowDirection?: boolean): IChartData;
|
|
@@ -1,11 +1,14 @@
|
|
|
1
|
+
export type { IChartCandlestickMappingSpec, IChartCandlestickSpec, IChartCandlestickStateStyleSpec, IChartHistogramBinningSpec, IChartHistogramDataSpec, IChartHistogramSpec, IChartHistogramStyleSpec, IChartTreemapLabelSpec, IChartTreemapSpec, } from '../types';
|
|
1
2
|
export { ChartBuilder } from './chart-builder';
|
|
2
3
|
export type { IChartBuilderAdapter } from './chart-builder-adapter';
|
|
3
4
|
export { CHART_LINEAR_GRADIENT_TYPE, chartLinearGradient } from './chart-color';
|
|
4
|
-
export type { ChartColor, ChartLinearGradientInput, IChartGradientPoint, IChartGradientStop, IChartLinearGradient } from './chart-color';
|
|
5
|
+
export type { ChartColor, ChartLinearGradientInput, IChartGradientPoint, IChartGradientStop, IChartLinearGradient, } from './chart-color';
|
|
5
6
|
export type { ChartDescription } from './chart-description';
|
|
7
|
+
export { createChartStarterRows } from './chart-starter-data';
|
|
6
8
|
export * from './chart-types';
|
|
7
9
|
export * from './configuration';
|
|
8
10
|
export { toChartModelConfig, toCompleteChartModelConfig } from './conversion/chart-config-converter';
|
|
11
|
+
export { canonicalizeChartContext } from './conversion/chart-context-patch';
|
|
9
12
|
export { chartBitsToType, chartTypeToBits } from './conversion/chart-type-converter';
|
|
10
13
|
export { describeChartModel, resolveChartDescriptionMetadata } from './conversion/describe-chart-model';
|
|
11
14
|
export { resolveChartModelData } from './conversion/resolve-chart-model-data';
|
|
@@ -1,5 +1,3 @@
|
|
|
1
1
|
import type { IUniverDataSet } from '../../types';
|
|
2
|
-
export { resolveChartDescriptionMetadata } from '../conversion/describe-chart-model';
|
|
3
|
-
export { resolveChartModelData } from '../conversion/resolve-chart-model-data';
|
|
4
2
|
/** Builds a detached data set from raw inline values and disposes the temporary source. */
|
|
5
3
|
export declare function resolveInlineChartDataSet<TCell>(values: TCell[][], buildDataSet: (data: TCell[][]) => IUniverDataSet, isRowDirection?: boolean): IUniverDataSet;
|
package/lib/types/enum.d.ts
CHANGED
|
@@ -76,7 +76,13 @@ export declare enum ChartTypeBits {
|
|
|
76
76
|
/** Sankey chart */
|
|
77
77
|
Sankey = 32768,
|
|
78
78
|
Heatmap = 65536,
|
|
79
|
-
Boxplot = 131072
|
|
79
|
+
Boxplot = 131072,
|
|
80
|
+
/** Candlestick chart */
|
|
81
|
+
Candlestick = 262144,
|
|
82
|
+
/** Histogram chart */
|
|
83
|
+
Histogram = 524288,
|
|
84
|
+
/** Treemap chart */
|
|
85
|
+
Treemap = 1048576
|
|
80
86
|
}
|
|
81
87
|
export declare enum CategoryType {
|
|
82
88
|
Linear = "Linear",
|
|
@@ -116,6 +122,33 @@ export declare enum ChartWaterfallPointRole {
|
|
|
116
122
|
Change = "change",
|
|
117
123
|
Total = "total"
|
|
118
124
|
}
|
|
125
|
+
/** Candlestick point states used by persisted style keys and render classification. */
|
|
126
|
+
export declare const ChartCandlestickState: {
|
|
127
|
+
readonly Rising: "rising";
|
|
128
|
+
readonly Falling: "falling";
|
|
129
|
+
readonly Doji: "doji";
|
|
130
|
+
};
|
|
131
|
+
export type ChartCandlestickState = typeof ChartCandlestickState[keyof typeof ChartCandlestickState];
|
|
132
|
+
/** Histogram bin sizing modes persisted by the semantic chart model. */
|
|
133
|
+
export declare const HistogramBinningMode: {
|
|
134
|
+
readonly Count: "count";
|
|
135
|
+
readonly Width: "width";
|
|
136
|
+
};
|
|
137
|
+
export type HistogramBinningMode = typeof HistogramBinningMode[keyof typeof HistogramBinningMode];
|
|
138
|
+
/** Roles assigned to computed Histogram bins. */
|
|
139
|
+
export declare const ChartHistogramBinKind: {
|
|
140
|
+
readonly Underflow: "underflow";
|
|
141
|
+
readonly Regular: "regular";
|
|
142
|
+
readonly Overflow: "overflow";
|
|
143
|
+
};
|
|
144
|
+
export type ChartHistogramBinKind = typeof ChartHistogramBinKind[keyof typeof ChartHistogramBinKind];
|
|
145
|
+
/** Layout modes for Treemap parent labels. */
|
|
146
|
+
export declare const TreemapParentLabelLayout: {
|
|
147
|
+
readonly Banner: "banner";
|
|
148
|
+
readonly Overlapping: "overlapping";
|
|
149
|
+
readonly None: "none";
|
|
150
|
+
};
|
|
151
|
+
export type TreemapParentLabelLayout = typeof TreemapParentLabelLayout[keyof typeof TreemapParentLabelLayout];
|
|
119
152
|
export declare enum IRuntimeAxisPriority {
|
|
120
153
|
Primary = 1,
|
|
121
154
|
Secondary = 2,
|