@univerjs-pro/engine-chart 1.0.0-alpha.2 → 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.
- package/README.md +9 -3
- package/lib/cjs/facade.js +1 -0
- package/lib/cjs/index.js +1 -1
- package/lib/es/facade.js +1 -0
- package/lib/es/index.js +1 -1
- package/lib/facade.js +1 -0
- package/lib/index.js +1 -1
- package/lib/types/chart-builder/chart-builder-adapter.d.ts +13 -0
- package/lib/types/chart-builder/chart-builder.d.ts +35 -0
- package/lib/types/chart-builder/chart-description.d.ts +3 -0
- package/lib/types/chart-builder/chart-types.d.ts +459 -0
- package/lib/types/chart-builder/configuration/aggregation.d.ts +7 -0
- package/lib/types/chart-builder/configuration/appearance.d.ts +8 -0
- package/lib/types/chart-builder/configuration/area.d.ts +3 -0
- package/lib/types/chart-builder/configuration/axes.d.ts +26 -0
- package/lib/types/chart-builder/configuration/axis-pointer.d.ts +9 -0
- package/lib/types/chart-builder/configuration/bar.d.ts +3 -0
- package/lib/types/chart-builder/configuration/cartesian-series.d.ts +25 -0
- package/lib/types/chart-builder/configuration/chart-config-operation.d.ts +40 -0
- package/lib/types/chart-builder/configuration/combination.d.ts +10 -0
- package/lib/types/chart-builder/configuration/funnel.d.ts +4 -0
- package/lib/types/chart-builder/configuration/heatmap.d.ts +9 -0
- package/lib/types/chart-builder/configuration/index.d.ts +29 -0
- package/lib/types/chart-builder/configuration/invalid-value.d.ts +3 -0
- package/lib/types/chart-builder/configuration/legend.d.ts +3 -0
- package/lib/types/chart-builder/configuration/line.d.ts +3 -0
- package/lib/types/chart-builder/configuration/mapping.d.ts +4 -0
- package/lib/types/chart-builder/configuration/mark-lines.d.ts +3 -0
- package/lib/types/chart-builder/configuration/palette.d.ts +4 -0
- package/lib/types/chart-builder/configuration/pareto.d.ts +7 -0
- package/lib/types/chart-builder/configuration/pie.d.ts +23 -0
- package/lib/types/chart-builder/configuration/point-mapping.d.ts +5 -0
- package/lib/types/chart-builder/configuration/radar.d.ts +5 -0
- package/lib/types/chart-builder/configuration/relation.d.ts +14 -0
- package/lib/types/chart-builder/configuration/subtitle.d.ts +3 -0
- package/lib/types/chart-builder/configuration/theme.d.ts +4 -0
- package/lib/types/chart-builder/configuration/title.d.ts +3 -0
- package/lib/types/chart-builder/configuration/trendline.d.ts +12 -0
- package/lib/types/chart-builder/configuration/waterfall.d.ts +12 -0
- package/lib/types/chart-builder/configuration/word-cloud.d.ts +7 -0
- package/lib/types/chart-builder/conversion/chart-config-converter.d.ts +24 -0
- package/lib/types/chart-builder/conversion/chart-model-fields.d.ts +115 -0
- package/lib/types/chart-builder/conversion/chart-type-converter.d.ts +6 -0
- package/lib/types/chart-builder/conversion/describe-chart-model.d.ts +11 -0
- package/lib/types/chart-builder/conversion/resolve-chart-model-data.d.ts +5 -0
- package/lib/types/chart-builder/detached-chart-builder-adapter.d.ts +19 -0
- package/lib/types/chart-builder/index.d.ts +12 -0
- package/lib/types/chart-builder/internal/deep-freeze.d.ts +1 -0
- package/lib/types/chart-builder/internal/host-builder-runtime.d.ts +5 -0
- package/lib/types/chart-builder/internal/merge-description.d.ts +2 -0
- package/lib/types/enum.d.ts +36 -0
- package/lib/types/facade/builders/f-area-chart-builder.d.ts +33 -0
- package/lib/types/facade/builders/f-bubble-chart-builder.d.ts +33 -0
- package/lib/types/facade/builders/f-combination-chart-builder.d.ts +66 -0
- package/lib/types/facade/builders/f-funnel-chart-builder.d.ts +61 -0
- package/lib/types/facade/builders/f-heatmap-chart-builder.d.ts +124 -0
- package/lib/types/facade/builders/f-line-chart-builder.d.ts +36 -0
- package/lib/types/facade/builders/f-pareto-chart-builder.d.ts +112 -0
- package/lib/types/facade/builders/f-pie-chart-builder.d.ts +324 -0
- package/lib/types/facade/builders/f-radar-chart-builder.d.ts +62 -0
- package/lib/types/facade/builders/f-relation-chart-builder.d.ts +184 -0
- package/lib/types/facade/builders/f-scatter-chart-builder.d.ts +33 -0
- package/lib/types/facade/builders/f-waterfall-chart-builder.d.ts +226 -0
- package/lib/types/facade/builders/f-word-cloud-chart-builder.d.ts +91 -0
- package/lib/types/facade/builders/index.d.ts +13 -0
- package/lib/types/facade/chart-builder-registry.d.ts +8 -0
- package/lib/types/facade/chart-builder-type-map.d.ts +30 -0
- package/lib/types/facade/chart-host-builder-types.d.ts +21 -0
- package/lib/types/facade/f-axis-chart-builder.d.ts +245 -0
- package/lib/types/facade/f-cartesian-chart-builder.d.ts +146 -0
- package/lib/types/facade/f-chart-base.d.ts +82 -0
- package/lib/types/facade/f-chart-builder-base.d.ts +331 -0
- package/lib/types/facade/f-charts-base.d.ts +74 -0
- package/lib/types/facade/f-enum.d.ts +75 -0
- package/lib/types/facade/index.d.ts +16 -0
- package/lib/types/facade/internal/chart-builder-facade-context.d.ts +12 -0
- package/lib/types/facade/internal/constants.d.ts +2 -0
- package/lib/types/facade/internal/host-builder-composer.d.ts +16 -0
- package/lib/types/facade/register-builders.d.ts +1 -0
- package/lib/types/index.d.ts +74 -15
- package/lib/types/models/chart-data-operators/build-chart-data.d.ts +6 -1
- package/lib/types/models/chart-data-operators/cartesian-point-data.d.ts +43 -0
- package/lib/types/models/chart-data-operators/operators.d.ts +6 -6
- package/lib/types/models/chart-element-axis-id.d.ts +9 -0
- package/lib/types/models/chart-element-edit-overlay/chart-element-edit-overlay.d.ts +38 -0
- package/lib/types/models/chart-element-edit-overlay/index.d.ts +4 -0
- package/lib/types/models/chart-element-edit-overlay/palette.d.ts +2 -0
- package/lib/types/models/chart-element-edit-overlay/resolve-chart-element-hit-layout.d.ts +16 -0
- package/lib/types/models/chart-element-edit-overlay/types.d.ts +20 -0
- package/lib/types/models/chart-host-style.d.ts +40 -0
- package/lib/types/models/chart-model.d.ts +181 -49
- package/lib/types/models/chart-render-input-resolver.d.ts +13 -0
- package/lib/types/models/chart-render-model-manager.service.d.ts +26 -0
- package/lib/types/models/chart-resource-serializer.d.ts +10 -0
- package/lib/types/models/chart-semantic-axes.d.ts +4 -0
- package/lib/types/models/constants/build-in-theme/index.d.ts +12 -12
- package/lib/types/models/constants/build-in-theme/univer-gradient1.d.ts +1 -1
- package/lib/types/models/constants/build-in-theme/univer-gradient2.d.ts +1 -1
- package/lib/types/models/constants/build-in-theme/univer-gradient3.d.ts +1 -1
- package/lib/types/models/constants/build-in-theme/univer-gradient4.d.ts +1 -1
- package/lib/types/models/constants/build-in-theme/univer-gradient5.d.ts +1 -1
- package/lib/types/models/constants/build-in-theme/univer-gradient6.d.ts +1 -1
- package/lib/types/models/constants/build-in-theme/univer1.d.ts +1 -1
- package/lib/types/models/constants/build-in-theme/univer2.d.ts +1 -1
- package/lib/types/models/constants/build-in-theme/univer3.d.ts +1 -1
- package/lib/types/models/constants/build-in-theme/univer4.d.ts +1 -1
- package/lib/types/models/constants/build-in-theme/univer5.d.ts +1 -1
- package/lib/types/models/constants/build-in-theme/univer6.d.ts +1 -1
- package/lib/types/models/constants/default-chart-style.d.ts +21 -1
- package/lib/types/models/constants/default.d.ts +3 -1
- package/lib/types/models/echart-render-model.d.ts +37 -2
- package/lib/types/models/image-chart-host.d.ts +2 -1
- package/lib/types/models/mode-converter/converters/waterfall-layout.d.ts +34 -0
- package/lib/types/models/mode-converter/mode-converter.d.ts +0 -2
- package/lib/types/models/mode-converter/render-spec-operators/legend-size.d.ts +2 -1
- package/lib/types/models/mode-converter/render-spec-operators/mark-line.operator.d.ts +3 -0
- package/lib/types/models/mode-converter/render-spec-operators/tools.d.ts +2 -3
- package/lib/types/models/series-style/series-style-resolver.d.ts +9 -0
- package/lib/types/source/chart-data-item.d.ts +3 -0
- package/lib/types/source/source-util.d.ts +1 -1
- package/lib/types/source/static-chart-source.d.ts +11 -3
- package/lib/types/types.d.ts +162 -39
- package/lib/types/util.d.ts +2 -4
- package/lib/types/utils/compact.d.ts +4 -0
- package/lib/types/wordcloud-chart/adapters/echarts/chart-view.d.ts +2 -2
- package/lib/types/wordcloud-chart/adapters/echarts/install.d.ts +2 -2
- package/lib/types/wordcloud-chart/adapters/echarts/layout-register.d.ts +2 -2
- package/lib/types/wordcloud-chart/adapters/echarts/series-model.d.ts +2 -2
- package/lib/types/wordcloud-chart/core/collision/box-shape-engine.d.ts +1 -1
- package/lib/types/wordcloud-chart/core/collision/engine.d.ts +1 -1
- package/lib/types/wordcloud-chart/core/collision/footprint.d.ts +1 -1
- package/lib/types/wordcloud-chart/core/collision/glyph-shape-engine.d.ts +1 -1
- package/lib/types/wordcloud-chart/core/collision/grid.d.ts +1 -1
- package/lib/types/wordcloud-chart/core/layout/candidates.d.ts +1 -1
- package/lib/types/wordcloud-chart/core/layout/layout-config.d.ts +1 -1
- package/lib/types/wordcloud-chart/core/layout/layout.d.ts +1 -2
- package/lib/types/wordcloud-chart/core/layout/phases.d.ts +1 -1
- package/lib/types/wordcloud-chart/core/layout/place-word.d.ts +1 -1
- package/lib/types/wordcloud-chart/core/layout/placement-stats.d.ts +1 -1
- package/lib/types/wordcloud-chart/core/layout/placement-types.d.ts +1 -1
- package/lib/types/wordcloud-chart/core/layout/placement-word-manager.d.ts +1 -1
- package/lib/types/wordcloud-chart/core/layout/runtime-mask.d.ts +1 -1
- package/lib/types/wordcloud-chart/core/layout/word-prepare.d.ts +1 -1
- package/lib/types/wordcloud-chart/core/shape/shape-mask.d.ts +1 -1
- package/lib/types/wordcloud-chart/index.d.ts +3 -2
- package/lib/types/wordcloud-chart/types.d.ts +2 -0
- package/lib/umd/facade.js +1 -0
- package/lib/umd/index.js +1 -1
- package/package.json +15 -5
- package/lib/types/wordcloud-chart/core/collision/types.d.ts +0 -1
- package/lib/types/wordcloud-chart/core/layout/types.d.ts +0 -1
- package/lib/types/wordcloud-chart/core/shape/types.d.ts +0 -1
- package/lib/types/wordcloud-chart/core/text/types.d.ts +0 -1
- package/lib/types/wordcloud-chart/core/types/option.d.ts +0 -1
- package/lib/types/wordcloud-chart/core/types/shape.d.ts +0 -1
- package/lib/types/wordcloud-chart/core/types/word.d.ts +0 -1
- package/lib/types/wordcloud-chart/echarts.d.ts +0 -2
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ChartStyle, IChartRenderModelImageExportInput } from '../types';
|
|
2
|
+
import type { ChartModel } from './chart-model';
|
|
3
|
+
export interface IChartRenderInputRuntime {
|
|
4
|
+
chartId: string;
|
|
5
|
+
model: ChartModel;
|
|
6
|
+
}
|
|
7
|
+
export interface IResolveChartRenderModelImageExportInputParams {
|
|
8
|
+
runtime: IChartRenderInputRuntime;
|
|
9
|
+
direction: ChartStyle['direction'];
|
|
10
|
+
width: number;
|
|
11
|
+
height: number;
|
|
12
|
+
}
|
|
13
|
+
export declare function resolveChartRenderModelImageExportInput(params: IResolveChartRenderModelImageExportInputParams): IChartRenderModelImageExportInput | null;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { IDisposable, Injector } from '@univerjs/core';
|
|
2
|
+
import type { ChartHostRenderMode, IChartInstance, IChartRenderInstance, IChartRenderInstanceCreateContext, IChartRenderModel, IChartRenderModelImageExportInput, IChartRenderModelImageExportOptions, IChartRenderModelImageExportResult } from '../types';
|
|
3
|
+
import { Disposable } from '@univerjs/core';
|
|
4
|
+
export interface IChartRenderModelManagerService extends IDisposable {
|
|
5
|
+
registerRenderModel(name: string, renderModel: IChartRenderModel): void;
|
|
6
|
+
setRenderModel(name: string): void;
|
|
7
|
+
getRenderModel(name?: string): IChartRenderModel | undefined;
|
|
8
|
+
getCurrentRenderModel(): IChartRenderModel;
|
|
9
|
+
createChartInstance(): IChartInstance;
|
|
10
|
+
createChartInstance(mode: ChartHostRenderMode, context?: IChartRenderInstanceCreateContext): IChartRenderInstance;
|
|
11
|
+
exportImage(input: IChartRenderModelImageExportInput, options?: IChartRenderModelImageExportOptions): Promise<IChartRenderModelImageExportResult>;
|
|
12
|
+
}
|
|
13
|
+
export declare const IChartRenderModelManagerService: import("@wendellhu/redi").IdentifierDecorator<IChartRenderModelManagerService>;
|
|
14
|
+
export declare class ChartRenderModelManagerService extends Disposable implements IChartRenderModelManagerService {
|
|
15
|
+
private readonly _renderModelMap;
|
|
16
|
+
private _currentRenderModel;
|
|
17
|
+
registerRenderModel(name: string, renderModel: IChartRenderModel): void;
|
|
18
|
+
setRenderModel(name: string): void;
|
|
19
|
+
getRenderModel(name?: string): IChartRenderModel | undefined;
|
|
20
|
+
getCurrentRenderModel(): IChartRenderModel;
|
|
21
|
+
createChartInstance(): IChartInstance;
|
|
22
|
+
createChartInstance(mode: ChartHostRenderMode, context?: IChartRenderInstanceCreateContext): IChartRenderInstance;
|
|
23
|
+
exportImage(input: IChartRenderModelImageExportInput, options?: IChartRenderModelImageExportOptions): Promise<IChartRenderModelImageExportResult>;
|
|
24
|
+
dispose(): void;
|
|
25
|
+
}
|
|
26
|
+
export declare function registerChartRenderModelManagerService(injector: Injector, defaultRenderModel?: IChartRenderModel): IChartRenderModelManagerService;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ChartStyle } from '../types';
|
|
2
|
+
interface IChartResourceSnapshot {
|
|
3
|
+
style?: ChartStyle;
|
|
4
|
+
}
|
|
5
|
+
interface IChartResourceEnvelope<TChart extends IChartResourceSnapshot> {
|
|
6
|
+
charts: Record<string, TChart>;
|
|
7
|
+
}
|
|
8
|
+
/** Serializes a host chart resource while omitting non-canonical empty chart palettes. */
|
|
9
|
+
export declare function serializeChartResource<TChart extends IChartResourceSnapshot, TResource extends IChartResourceEnvelope<TChart>>(resource: TResource): string;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { IChartAxisBinding, IRuntimeAxis } from '../types';
|
|
2
|
+
import { ChartSemanticAxis, ChartTypeBits } from '../enum';
|
|
3
|
+
/** Maps the renderer's transient axes to stable semantic roles used by Facade readback. */
|
|
4
|
+
export declare function resolveChartSemanticAxisBindings(type: ChartTypeBits, axes: readonly IRuntimeAxis[]): Partial<Record<ChartSemanticAxis, IChartAxisBinding>> | undefined;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
export { themeDefault } from './default';
|
|
2
2
|
export { getThemeAxesByType, getThemeProps } from './theme-util';
|
|
3
3
|
export type { IEchartTheme } from './types';
|
|
4
|
-
export {
|
|
5
|
-
export {
|
|
6
|
-
export {
|
|
7
|
-
export {
|
|
8
|
-
export {
|
|
9
|
-
export {
|
|
10
|
-
export {
|
|
11
|
-
export {
|
|
12
|
-
export {
|
|
13
|
-
export {
|
|
14
|
-
export {
|
|
15
|
-
export {
|
|
4
|
+
export { UniverTheme1 } from './univer1';
|
|
5
|
+
export { UniverTheme2 } from './univer2';
|
|
6
|
+
export { UniverTheme3 } from './univer3';
|
|
7
|
+
export { UniverTheme4 } from './univer4';
|
|
8
|
+
export { UniverTheme5 } from './univer5';
|
|
9
|
+
export { UniverTheme6 } from './univer6';
|
|
10
|
+
export { UniverThemeGradient1 } from './univer-gradient1';
|
|
11
|
+
export { UniverThemeGradient2 } from './univer-gradient2';
|
|
12
|
+
export { UniverThemeGradient3 } from './univer-gradient3';
|
|
13
|
+
export { UniverThemeGradient4 } from './univer-gradient4';
|
|
14
|
+
export { UniverThemeGradient5 } from './univer-gradient5';
|
|
15
|
+
export { UniverThemeGradient6 } from './univer-gradient6';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { IEchartTheme } from './types';
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const UniverThemeGradient1: IEchartTheme;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { IEchartTheme } from './types';
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const UniverThemeGradient2: IEchartTheme;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { IEchartTheme } from './types';
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const UniverThemeGradient3: IEchartTheme;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { IEchartTheme } from './types';
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const UniverThemeGradient4: IEchartTheme;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { IEchartTheme } from './types';
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const UniverThemeGradient5: IEchartTheme;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { IEchartTheme } from './types';
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const UniverThemeGradient6: IEchartTheme;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { IEchartTheme } from './types';
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const UniverTheme1: IEchartTheme;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { IEchartTheme } from './types';
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const UniverTheme2: IEchartTheme;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { IEchartTheme } from './types';
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const UniverTheme3: IEchartTheme;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { IEchartTheme } from './types';
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const UniverTheme4: IEchartTheme;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { IEchartTheme } from './types';
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const UniverTheme5: IEchartTheme;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { IEchartTheme } from './types';
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const UniverTheme6: IEchartTheme;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ChartStyle } from '../../types';
|
|
2
|
-
import { AreaLineStyle, AxisAlignEnum, ChartBorderDashType, ChartTypeBits, InvalidValueType, LabelContentType, LegendPositionEnum, LinePointShape, PieLabelPosition, RadarShape, SelectModeEnum, SeriesLabelPosition, TextAlign, TitlePositionEnum, WaterfallStackTypeEnum, WordCloudShapeEnum } from '../../enum';
|
|
2
|
+
import { AreaLineStyle, AxisAlignEnum, BarShape, ChartBorderDashType, ChartTypeBits, InvalidValueType, LabelContentType, LegendPositionEnum, LinePointShape, PieLabelPosition, RadarShape, SelectModeEnum, SeriesLabelPosition, TextAlign, TitlePositionEnum, WaterfallStackTypeEnum, WordCloudShapeEnum } from '../../enum';
|
|
3
3
|
export declare const themeColors: string[];
|
|
4
4
|
export declare const RTLChartStyle: ChartStyle;
|
|
5
5
|
export declare const defaultChartConfig: {
|
|
@@ -47,6 +47,12 @@ export declare const defaultChartConfig: {
|
|
|
47
47
|
area: {
|
|
48
48
|
lineStyle: AreaLineStyle;
|
|
49
49
|
};
|
|
50
|
+
bar: {
|
|
51
|
+
is3D: boolean;
|
|
52
|
+
shape: BarShape;
|
|
53
|
+
rotX: number;
|
|
54
|
+
rotY: number;
|
|
55
|
+
};
|
|
50
56
|
labelContentType: LabelContentType;
|
|
51
57
|
pie: {
|
|
52
58
|
labelContentType: number;
|
|
@@ -55,6 +61,7 @@ export declare const defaultChartConfig: {
|
|
|
55
61
|
borderColor: string;
|
|
56
62
|
labelPosition: PieLabelPosition;
|
|
57
63
|
hasPaddingAngle: boolean;
|
|
64
|
+
is3D: boolean;
|
|
58
65
|
};
|
|
59
66
|
combination: {
|
|
60
67
|
firstChartType: ChartTypeBits;
|
|
@@ -76,6 +83,14 @@ export declare const defaultChartConfig: {
|
|
|
76
83
|
waterfall: {
|
|
77
84
|
stackType: WaterfallStackTypeEnum;
|
|
78
85
|
useSubtotal: boolean;
|
|
86
|
+
pointRoles: never[];
|
|
87
|
+
connector: boolean;
|
|
88
|
+
connectorStyle: {
|
|
89
|
+
color: string;
|
|
90
|
+
width: number;
|
|
91
|
+
opacity: number;
|
|
92
|
+
dashType: ChartBorderDashType;
|
|
93
|
+
};
|
|
79
94
|
subtotalColor: string;
|
|
80
95
|
};
|
|
81
96
|
trendline: {
|
|
@@ -88,6 +103,11 @@ export declare const defaultChartConfig: {
|
|
|
88
103
|
showFormula: boolean;
|
|
89
104
|
showR2: boolean;
|
|
90
105
|
};
|
|
106
|
+
semanticLine: {
|
|
107
|
+
width: number;
|
|
108
|
+
opacity: number;
|
|
109
|
+
dashType: ChartBorderDashType;
|
|
110
|
+
};
|
|
91
111
|
relation: {
|
|
92
112
|
force: {
|
|
93
113
|
gravity: number;
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
+
import type { ChartStyle } from '../../types';
|
|
1
2
|
export declare const EChartRenderEngineName = "EChartRenderEngine";
|
|
2
3
|
export declare const defaultChartWidth = 468;
|
|
3
4
|
export declare const defaultChartHeight = 369;
|
|
4
5
|
export declare const LegendPadding = 15;
|
|
5
6
|
export declare const TitleOrLegendPadding = 12;
|
|
6
7
|
export declare const TitleDefaultStartPosition = 8;
|
|
7
|
-
export declare const
|
|
8
|
+
export declare const DEFAULT_CHART_LAYOUT_PADDING = 14;
|
|
9
|
+
export declare function getChartLayoutPadding(style?: ChartStyle): number;
|
|
8
10
|
export declare const TitleLineHeightBase = 1.2;
|
|
9
11
|
export declare const AxisLabelMaxPercent = 0.15;
|
|
10
12
|
export declare const defaultBubbleSize = 0.12;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ChartElementEventHandler, ChartElementEventType, ChartImageSource, ChartStyle, EChartInstance, EChartSpec, IChartConfig, IChartHostRect, IChartInstance, IChartRenderAsImageOptions, IChartRenderInstance, IChartRenderInstanceCreateContext, IChartRenderModel, IChartRenderModelImageExportInput, IChartRenderModelImageExportOptions, IChartRenderModelImageExportResult, IChartRenderModelStylizeInit, IChartRenderRuntimeOptions } from '../types';
|
|
2
2
|
import type { IWordCloudRenderConfig } from '../wordcloud-chart/word-cloud-render-config';
|
|
3
3
|
import { Disposable } from '@univerjs/core';
|
|
4
|
+
import { ChartHostRenderMode } from '../types';
|
|
4
5
|
export interface IEChartRenderModelOptions {
|
|
5
6
|
wordCloudRenderConfig?: IWordCloudRenderConfig;
|
|
6
7
|
}
|
|
@@ -22,20 +23,54 @@ export declare class EChartRenderModel extends Disposable implements IChartRende
|
|
|
22
23
|
stylizeSpec(spec: EChartSpec, stylizeInit: IChartRenderModelStylizeInit<EChartSpec>, rect: IChartHostRect): import("echarts").EChartsOption | {
|
|
23
24
|
backgroundColor: string;
|
|
24
25
|
};
|
|
26
|
+
exportImage(input: IChartRenderModelImageExportInput, options?: IChartRenderModelImageExportOptions): Promise<IChartRenderModelImageExportResult>;
|
|
25
27
|
}
|
|
26
28
|
export declare class EChartRenderEngine extends Disposable implements EChartInstance {
|
|
27
29
|
static engineName: string;
|
|
28
30
|
private _instance;
|
|
29
31
|
container: HTMLElement | string;
|
|
30
32
|
private _devicePixelRatio;
|
|
33
|
+
private _lastSpec;
|
|
34
|
+
private readonly _eventHandlers;
|
|
35
|
+
private readonly _nativeEventHandlers;
|
|
36
|
+
private readonly _nativeZrBlankEventHandlers;
|
|
37
|
+
private readonly _elementEditModeHandlers;
|
|
38
|
+
private _elementEditModeZrMouseMoveHandler;
|
|
39
|
+
private _elementEditModeZrClickHandler;
|
|
40
|
+
private _elementEditModeEnabled;
|
|
41
|
+
private _editOverlay;
|
|
42
|
+
private readonly _emittedElementEventKeys;
|
|
43
|
+
private _emittedElementEventKeysClearQueued;
|
|
31
44
|
constructor();
|
|
32
45
|
getDevicePixelRatio(): 1 | 2 | undefined;
|
|
33
46
|
mount(id: string | HTMLElement): void;
|
|
34
|
-
resize(
|
|
47
|
+
resize(echartsProviderOrOptions?: any | IChartRenderRuntimeOptions): void;
|
|
35
48
|
private _ensureChartInstance;
|
|
36
49
|
get containerElement(): HTMLElement | null;
|
|
37
50
|
render(spec: EChartSpec, echartsProviderOrOptions?: any | IChartRenderRuntimeOptions): void;
|
|
38
51
|
renderAsImage(spec: EChartSpec, options: IChartRenderAsImageOptions): Promise<ChartImageSource>;
|
|
52
|
+
on(type: ChartElementEventType, handler: ChartElementEventHandler): {
|
|
53
|
+
dispose: () => void;
|
|
54
|
+
};
|
|
55
|
+
setElementEditMode(enabled: boolean): void;
|
|
56
|
+
private _bindAllNativeEvents;
|
|
57
|
+
private _bindNativeEvent;
|
|
58
|
+
private _unbindNativeEvent;
|
|
59
|
+
private _bindNativeZrBlankEvent;
|
|
60
|
+
private _unbindNativeZrBlankEvent;
|
|
61
|
+
private _bindElementEditModeEvents;
|
|
62
|
+
private _unbindElementEditModeEvents;
|
|
63
|
+
private _emitChartElementEvent;
|
|
64
|
+
private _shouldSkipDuplicateElementEvent;
|
|
65
|
+
private _handleElementEditHover;
|
|
66
|
+
private _handleElementEditZrHover;
|
|
67
|
+
private _handleElementEditClick;
|
|
68
|
+
private _handleElementEditZrClick;
|
|
69
|
+
private _hideTooltip;
|
|
70
|
+
private _ensureEditOverlay;
|
|
71
|
+
private _removeEditOverlay;
|
|
72
|
+
private _clearHoverBorder;
|
|
73
|
+
private _clearFixedBorder;
|
|
39
74
|
exportImg(echartsProvider?: any): Promise<string>;
|
|
40
75
|
dispose(): void;
|
|
41
76
|
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import type { ChartImageSource, IChartHostLease, IChartHostRect, IChartHostStyle, IImageChartHost } from '../types';
|
|
2
2
|
import { Disposable } from '@univerjs/core';
|
|
3
|
+
import { ChartHostRenderMode } from '../types';
|
|
3
4
|
export declare function chartImageSourceToDataUrl(image: ChartImageSource): string;
|
|
4
5
|
export declare abstract class ImageChartHost extends Disposable implements IImageChartHost {
|
|
5
6
|
readonly chartId: string;
|
|
6
|
-
readonly mode
|
|
7
|
+
readonly mode = ChartHostRenderMode.Image;
|
|
7
8
|
private readonly _offscreenChartHost;
|
|
8
9
|
constructor(chartId: string);
|
|
9
10
|
abstract getRect(): IChartHostRect | null;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { IChartDataSeries, IWaterfallPointRole } from '../../../types';
|
|
2
|
+
import { ChartWaterfallPointRole } from '../../../enum';
|
|
3
|
+
export declare enum WaterfallPointClassification {
|
|
4
|
+
Increase = "increase",
|
|
5
|
+
Decrease = "decrease",
|
|
6
|
+
Total = "total"
|
|
7
|
+
}
|
|
8
|
+
export interface IResolvedWaterfallPoint {
|
|
9
|
+
seriesIndex: number;
|
|
10
|
+
dataPointIndex: number;
|
|
11
|
+
categoryIndex: number;
|
|
12
|
+
role: ChartWaterfallPointRole;
|
|
13
|
+
classification: WaterfallPointClassification;
|
|
14
|
+
value: number;
|
|
15
|
+
start: number;
|
|
16
|
+
end: number;
|
|
17
|
+
}
|
|
18
|
+
export interface IResolvedWaterfallConnector {
|
|
19
|
+
from: {
|
|
20
|
+
categoryIndex: number;
|
|
21
|
+
value: number;
|
|
22
|
+
};
|
|
23
|
+
to: {
|
|
24
|
+
categoryIndex: number;
|
|
25
|
+
value: number;
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
export interface IResolvedWaterfallLayout {
|
|
29
|
+
points: IResolvedWaterfallPoint[];
|
|
30
|
+
connectors: IResolvedWaterfallConnector[];
|
|
31
|
+
cumulative: number;
|
|
32
|
+
}
|
|
33
|
+
/** Resolves persisted Waterfall semantics without renderer or theme concerns. */
|
|
34
|
+
export declare function resolveArrangementWaterfallLayout(series: IChartDataSeries[], roles?: readonly IWaterfallPointRole[]): IResolvedWaterfallLayout;
|
|
@@ -2,7 +2,6 @@ import type { Injector } from '@univerjs/core';
|
|
|
2
2
|
import type { ChartTypeBits } from '../../enum';
|
|
3
3
|
import type { ChartStyle, IChartContext, IChartHostRect, IUniverDataSet } from '../../types';
|
|
4
4
|
import type { IChartLocaleTexts } from '../chart-locale-texts';
|
|
5
|
-
import { StaticChartSource } from '../../source/static-chart-source';
|
|
6
5
|
import { ChartModel } from '../chart-model';
|
|
7
6
|
/**
|
|
8
7
|
* The parameters for initializing a chart model.
|
|
@@ -53,7 +52,6 @@ export interface IChartModelInitParams {
|
|
|
53
52
|
isRowDirection?: boolean;
|
|
54
53
|
localeTexts?: IChartLocaleTexts;
|
|
55
54
|
}
|
|
56
|
-
export declare function generateChartModelContext(chartModel: ChartModel, dataSource: StaticChartSource): IChartContext;
|
|
57
55
|
/**
|
|
58
56
|
* Convert the initial data to a chart model.
|
|
59
57
|
* @param initJson The initial data of the chart model.
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import type { ChartStyle, EChartSeriesItem, EChartSpec,
|
|
1
|
+
import type { ChartStyle, EChartSeriesItem, EChartSpec, ILabelStyle } from '../../../types';
|
|
2
2
|
import type { ISpecGrid } from './operator-types';
|
|
3
|
-
type PartialLabelStyle = Partial<Pick<ILabelStyle, 'visible' | 'color' | 'fontSize' | 'italic' | 'bold' | 'underline' | 'strikethrough' | 'showMaxLabel' | 'showMinLabel'>>;
|
|
3
|
+
type PartialLabelStyle = Partial<Pick<ILabelStyle, 'visible' | 'color' | 'fontSize' | 'family' | 'italic' | 'bold' | 'underline' | 'strikethrough' | 'showMaxLabel' | 'showMinLabel'>>;
|
|
4
4
|
export declare function applyLabelStyle(spec: Record<string, any>, path: string, labelStyle: PartialLabelStyle): void;
|
|
5
5
|
export declare function applyLineStyle(spec: Record<string, any>, path: string, labelStyle: PartialLabelStyle): void;
|
|
6
6
|
export declare function toArray<T = unknown>(value: T | T[]): T[];
|
|
7
7
|
export declare function seriesForEach(series: EChartSpec['series'], func: (item: EChartSeriesItem, index: number) => void): void;
|
|
8
8
|
export declare function toPercentage(value: number, fixed?: number): string;
|
|
9
|
-
export declare const getLegendOrSeriesMaxWidth: (gridInfo: ISpecGrid, config: IChartConfig, style: ChartStyle) => number;
|
|
10
9
|
export declare const getCategoryLabelVertical: (gridInfo: ISpecGrid, style: ChartStyle) => number;
|
|
11
10
|
export declare const getCategoryLabelHorizontal: (gridInfo: ISpecGrid, style: ChartStyle, seriesCount: number, axisLabelMaxWidth?: number) => number;
|
|
12
11
|
export declare const getIntegerValue: (value: number, digit?: number) => number;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
type SeriesStyleKeyInput = string | number | null | undefined;
|
|
2
|
+
export interface ISeriesStyleSource {
|
|
3
|
+
seriesId?: SeriesStyleKeyInput;
|
|
4
|
+
seriesIndex?: SeriesStyleKeyInput;
|
|
5
|
+
baseSeriesIndex?: SeriesStyleKeyInput;
|
|
6
|
+
}
|
|
7
|
+
export declare function getSeriesStyleKey(source: ISeriesStyleSource): string | undefined;
|
|
8
|
+
export declare function resolveSeriesStyle<T extends object>(seriesStyleMap: Partial<Record<string, T | undefined>> | undefined, source: ISeriesStyleSource, fallbackSources?: readonly ISeriesStyleSource[]): T | undefined;
|
|
9
|
+
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { OptionDataValue } from '../types';
|
|
2
2
|
import { ChartSourceDataTypeEnum } from '../enum';
|
|
3
|
-
export declare function getCategoryData(source: OptionDataValue[][], categoryIndex: number,
|
|
3
|
+
export declare function getCategoryData(source: OptionDataValue[][], categoryIndex: number, sourceType?: ChartSourceDataTypeEnum[][]): {
|
|
4
4
|
categoryData: Array<OptionDataValue | undefined>;
|
|
5
5
|
isAllDateTime: boolean;
|
|
6
6
|
};
|
|
@@ -1,14 +1,22 @@
|
|
|
1
1
|
import type { IUniverDataSet } from '../types';
|
|
2
2
|
import { BehaviorSubject } from 'rxjs';
|
|
3
3
|
import { ChartDataSource } from './chart-source';
|
|
4
|
+
/**
|
|
5
|
+
* Legacy static init data uses `dimensions` as the table header row and
|
|
6
|
+
* `source` as row-major table cells. StaticChartSource adapts that input to the
|
|
7
|
+
* canonical vector-based IUniverDataSet returned by convertDataSet().
|
|
8
|
+
*/
|
|
9
|
+
type ILegacyTableDataSet = IUniverDataSet;
|
|
4
10
|
export declare class StaticChartSource extends ChartDataSource {
|
|
5
11
|
_canSwitchOrient$: BehaviorSubject<boolean>;
|
|
6
|
-
private
|
|
12
|
+
private _rawDataSet;
|
|
13
|
+
private _convertedDataSetCache;
|
|
7
14
|
constructor();
|
|
8
|
-
initData(data:
|
|
9
|
-
setData(data:
|
|
15
|
+
initData(data: ILegacyTableDataSet, isRowDirection?: boolean): void;
|
|
16
|
+
setData(data: ILegacyTableDataSet): void;
|
|
10
17
|
updateIsRowDirection(flag: boolean): void;
|
|
11
18
|
refresh(): void;
|
|
12
19
|
convertDataSet(): IUniverDataSet;
|
|
13
20
|
dispose(): void;
|
|
14
21
|
}
|
|
22
|
+
export {};
|