@univerjs-pro/engine-chart 1.0.4 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/facade.js +1 -1
- package/lib/cjs/index.js +1 -1
- package/lib/cjs/locale/ar-SA.js +1 -1
- package/lib/cjs/locale/ca-ES.js +1 -1
- package/lib/cjs/locale/de-DE.js +1 -1
- package/lib/cjs/locale/en-US.js +1 -1
- package/lib/cjs/locale/es-ES.js +1 -1
- package/lib/cjs/locale/fa-IR.js +1 -1
- package/lib/cjs/locale/fr-FR.js +1 -1
- package/lib/cjs/locale/id-ID.js +1 -1
- package/lib/cjs/locale/it-IT.js +1 -1
- package/lib/cjs/locale/ja-JP.js +1 -1
- package/lib/cjs/locale/ko-KR.js +1 -1
- package/lib/cjs/locale/pl-PL.js +1 -1
- package/lib/cjs/locale/pt-BR.js +1 -1
- package/lib/cjs/locale/ru-RU.js +1 -1
- package/lib/cjs/locale/sk-SK.js +1 -1
- package/lib/cjs/locale/vi-VN.js +1 -1
- package/lib/cjs/locale/zh-CN.js +1 -1
- package/lib/cjs/locale/zh-HK.js +1 -1
- package/lib/cjs/locale/zh-TW.js +1 -1
- package/lib/es/facade.js +1 -1
- package/lib/es/index.js +1 -1
- package/lib/es/locale/ar-SA.js +1 -1
- package/lib/es/locale/ca-ES.js +1 -1
- package/lib/es/locale/de-DE.js +1 -1
- package/lib/es/locale/en-US.js +1 -1
- package/lib/es/locale/es-ES.js +1 -1
- package/lib/es/locale/fa-IR.js +1 -1
- package/lib/es/locale/fr-FR.js +1 -1
- package/lib/es/locale/id-ID.js +1 -1
- package/lib/es/locale/it-IT.js +1 -1
- package/lib/es/locale/ja-JP.js +1 -1
- package/lib/es/locale/ko-KR.js +1 -1
- package/lib/es/locale/pl-PL.js +1 -1
- package/lib/es/locale/pt-BR.js +1 -1
- package/lib/es/locale/ru-RU.js +1 -1
- package/lib/es/locale/sk-SK.js +1 -1
- package/lib/es/locale/vi-VN.js +1 -1
- package/lib/es/locale/zh-CN.js +1 -1
- package/lib/es/locale/zh-HK.js +1 -1
- package/lib/es/locale/zh-TW.js +1 -1
- package/lib/facade.js +1 -1
- package/lib/index.js +1 -1
- package/lib/locale/ar-SA.js +1 -1
- package/lib/locale/ca-ES.js +1 -1
- package/lib/locale/de-DE.js +1 -1
- package/lib/locale/en-US.js +1 -1
- package/lib/locale/es-ES.js +1 -1
- package/lib/locale/fa-IR.js +1 -1
- package/lib/locale/fr-FR.js +1 -1
- package/lib/locale/id-ID.js +1 -1
- package/lib/locale/it-IT.js +1 -1
- package/lib/locale/ja-JP.js +1 -1
- package/lib/locale/ko-KR.js +1 -1
- package/lib/locale/pl-PL.js +1 -1
- package/lib/locale/pt-BR.js +1 -1
- package/lib/locale/ru-RU.js +1 -1
- package/lib/locale/sk-SK.js +1 -1
- package/lib/locale/vi-VN.js +1 -1
- package/lib/locale/zh-CN.js +1 -1
- package/lib/locale/zh-HK.js +1 -1
- package/lib/locale/zh-TW.js +1 -1
- package/lib/types/chart-3d/adapters/appearance.d.ts +4 -0
- package/lib/types/chart-3d/adapters/axes.d.ts +21 -0
- package/lib/types/chart-3d/adapters/category-axis.d.ts +4 -0
- package/lib/types/chart-3d/adapters/echarts-adapter.d.ts +10 -0
- package/lib/types/chart-3d/adapters/echarts-time-scale.d.ts +9 -0
- package/lib/types/chart-3d/adapters/element-events.d.ts +3 -0
- package/lib/types/chart-3d/adapters/export-image.d.ts +2 -0
- package/lib/types/chart-3d/adapters/input-adapter.d.ts +11 -0
- package/lib/types/chart-3d/adapters/lighting.d.ts +4 -0
- package/lib/types/chart-3d/adapters/line-style.d.ts +2 -0
- package/lib/types/chart-3d/adapters/pie-labels.d.ts +7 -0
- package/lib/types/chart-3d/adapters/projection-data-label.d.ts +59 -0
- package/lib/types/chart-3d/adapters/projection-frame-image.d.ts +16 -0
- package/lib/types/chart-3d/adapters/render-input.d.ts +3 -0
- package/lib/types/chart-3d/adapters/render-instance.d.ts +32 -0
- package/lib/types/chart-3d/adapters/transform.d.ts +3 -0
- package/lib/types/chart-3d/adapters/types.d.ts +38 -0
- package/lib/types/chart-3d/adapters/webgl-renderer.d.ts +20 -0
- package/lib/types/chart-3d/chart-3d-extension.d.ts +6 -0
- package/lib/types/chart-3d/core/geometry.d.ts +39 -0
- package/lib/types/chart-3d/core/policy.d.ts +31 -0
- package/lib/types/chart-3d/core/projection.d.ts +23 -0
- package/lib/types/chart-3d/core/scene.d.ts +57 -0
- package/lib/types/chart-3d/core/types.d.ts +74 -0
- package/lib/types/chart-3d/index.d.ts +1 -0
- package/lib/types/chart-3d/view-defaults.d.ts +3 -0
- package/lib/types/chart-3d/webgl/draw-data.d.ts +6 -0
- package/lib/types/chart-3d/webgl/draw-queue.d.ts +10 -0
- package/lib/types/chart-3d/webgl/gradient.d.ts +3 -0
- package/lib/types/chart-3d/webgl/line-segments.d.ts +8 -0
- package/lib/types/chart-3d/webgl/program.d.ts +16 -0
- package/lib/types/chart-3d/webgl/renderer.d.ts +19 -0
- package/lib/types/chart-3d/webgl/stroke.d.ts +13 -0
- package/lib/types/chart-3d/webgl/types.d.ts +71 -0
- package/lib/types/chart-builder/chart-types.d.ts +22 -4
- package/lib/types/chart-builder/configuration/chart-config-group.d.ts +2 -0
- package/lib/types/chart-builder/configuration/three-d.d.ts +7 -0
- package/lib/types/chart-builder/conversion/chart-model-fields.d.ts +8 -0
- package/lib/types/chart-builder/conversion/describe-chart-model.d.ts +119 -7
- package/lib/types/config/config.d.ts +1 -1
- package/lib/types/enum.d.ts +13 -0
- package/lib/types/facade/builders/f-area-three-d-chart-builder.d.ts +6 -0
- package/lib/types/facade/builders/f-column-three-d-chart-builder.d.ts +6 -0
- package/lib/types/facade/builders/f-line-three-d-chart-builder.d.ts +6 -0
- package/lib/types/facade/builders/f-pie-three-d-chart-builder.d.ts +15 -0
- package/lib/types/facade/chart-builder-type-map.d.ts +15 -0
- package/lib/types/facade/create-chart-builder.d.ts +2 -1
- package/lib/types/facade/f-axis-chart-builder.d.ts +42 -7
- package/lib/types/facade/f-axis-three-d-chart-builder.d.ts +37 -0
- package/lib/types/facade/f-three-d-chart-builder.d.ts +30 -0
- package/lib/types/index.d.ts +13 -70
- package/lib/types/locale/en-US.d.ts +7 -0
- package/lib/types/models/chart-model/chart-model.d.ts +359 -22
- package/lib/types/models/chart-render/axes/axis-placement.d.ts +2 -0
- package/lib/types/models/chart-render/axes/chart-axis-scale.d.ts +14 -0
- package/lib/types/models/chart-render/axes/log-axis-data.d.ts +4 -0
- package/lib/types/models/chart-render/axes/log-axis-ticks.d.ts +5 -0
- package/lib/types/models/chart-render/axes/log-bar-layout.d.ts +3 -0
- package/lib/types/models/chart-render/axes/value-axis-scale.d.ts +13 -0
- package/lib/types/models/chart-render/converter/calendar-date-axis.d.ts +1 -1
- package/lib/types/models/chart-render/converter/render-spec-operators/empty-style-operator.d.ts +2 -0
- package/lib/types/models/chart-render/converter/render-spec-operators/legend-style.operator.d.ts +11 -1
- package/lib/types/models/chart-render/converter/render-spec-operators/log-axis-scale.d.ts +7 -0
- package/lib/types/models/chart-render/converter/render-spec-operators/series-style-operator/series-fill-pattern.d.ts +15 -0
- package/lib/types/models/chart-render/converter/render-spec-operators/tools.d.ts +3 -1
- package/lib/types/models/chart-render/converter/render-spec-operators/watermark.operator.d.ts +2 -0
- package/lib/types/models/chart-render/echart-render-model/base-chart-render-instance.d.ts +1 -1
- package/lib/types/models/chart-render/echart-render-model/chart-dimension-render-instance.d.ts +28 -0
- package/lib/types/models/chart-render/echart-render-model/dom-chart-instance.d.ts +1 -0
- package/lib/types/models/chart-render/echart-render-model/echart-render-engine.d.ts +7 -1
- package/lib/types/models/chart-render/echart-render-model/echart-render-model.d.ts +23 -10
- package/lib/types/models/chart-render/echart-render-model/echarts-render-hooks.d.ts +7 -0
- package/lib/types/models/chart-render/echart-render-model/index.d.ts +0 -1
- package/lib/types/models/chart-render/format/chart-label-content.d.ts +3 -0
- package/lib/types/models/common/chart-locale-texts.d.ts +7 -0
- package/lib/types/models/common/constants/default-chart-style.d.ts +5 -4
- package/lib/types/models/common/theme/build-in-theme/theme-util.d.ts +3 -1
- package/lib/types/types.d.ts +57 -16
- package/lib/types/util.d.ts +1 -1
- package/lib/types/{models/chart-render/converter/converters/word-cloud-converter.d.ts → wordcloud/adapters/chart-spec-adapter.d.ts} +1 -1
- package/lib/types/{wordcloud-chart/adapters/echarts/install.d.ts → wordcloud/adapters/echarts-adapter.d.ts} +3 -3
- package/lib/types/{wordcloud-chart/adapters/echarts → wordcloud}/chart-view.d.ts +2 -2
- package/lib/types/{wordcloud-chart → wordcloud}/core/collision/box-shape-engine.d.ts +1 -1
- package/lib/types/wordcloud/echarts-api.d.ts +3 -0
- package/lib/types/{wordcloud-chart/adapters/echarts → wordcloud}/echarts-options.d.ts +1 -1
- package/lib/types/wordcloud/index.d.ts +16 -0
- package/lib/types/{wordcloud-chart/adapters/echarts → wordcloud}/layout-register.d.ts +2 -2
- package/lib/types/{wordcloud-chart/adapters/echarts → wordcloud}/layout.d.ts +2 -2
- package/lib/types/wordcloud/register-word-cloud-rendering.d.ts +4 -0
- package/lib/types/wordcloud/render-resources.d.ts +2 -0
- package/lib/types/{word-cloud-resource → wordcloud/resources}/word-cloud-shape-resource.d.ts +1 -1
- package/lib/types/{wordcloud-chart/adapters/echarts → wordcloud}/runtime-cache.d.ts +4 -1
- package/lib/types/{wordcloud-chart/adapters/echarts → wordcloud}/series-model.d.ts +2 -2
- package/lib/types/{wordcloud-chart/adapters/echarts → wordcloud}/text-measurer.d.ts +1 -1
- package/lib/types/wordcloud/word-cloud-extension.d.ts +16 -0
- package/lib/types/{wordcloud-chart/adapters/echarts → wordcloud}/words.d.ts +2 -2
- package/lib/umd/facade.js +1 -1
- package/lib/umd/index.js +1 -1
- package/lib/umd/locale/ar-SA.js +1 -1
- package/lib/umd/locale/ca-ES.js +1 -1
- package/lib/umd/locale/de-DE.js +1 -1
- package/lib/umd/locale/en-US.js +1 -1
- package/lib/umd/locale/es-ES.js +1 -1
- package/lib/umd/locale/fa-IR.js +1 -1
- package/lib/umd/locale/fr-FR.js +1 -1
- package/lib/umd/locale/id-ID.js +1 -1
- package/lib/umd/locale/it-IT.js +1 -1
- package/lib/umd/locale/ja-JP.js +1 -1
- package/lib/umd/locale/ko-KR.js +1 -1
- package/lib/umd/locale/pl-PL.js +1 -1
- package/lib/umd/locale/pt-BR.js +1 -1
- package/lib/umd/locale/ru-RU.js +1 -1
- package/lib/umd/locale/sk-SK.js +1 -1
- package/lib/umd/locale/vi-VN.js +1 -1
- package/lib/umd/locale/zh-CN.js +1 -1
- package/lib/umd/locale/zh-HK.js +1 -1
- package/lib/umd/locale/zh-TW.js +1 -1
- package/package.json +6 -6
- /package/lib/types/{wordcloud-chart → wordcloud}/canvas.d.ts +0 -0
- /package/lib/types/{wordcloud-chart → wordcloud}/core/collision/bitset-board.d.ts +0 -0
- /package/lib/types/{wordcloud-chart → wordcloud}/core/collision/engine.d.ts +0 -0
- /package/lib/types/{wordcloud-chart → wordcloud}/core/collision/failure-cache.d.ts +0 -0
- /package/lib/types/{wordcloud-chart → wordcloud}/core/collision/footprint.d.ts +0 -0
- /package/lib/types/{wordcloud-chart → wordcloud}/core/collision/glyph-shape-engine.d.ts +0 -0
- /package/lib/types/{wordcloud-chart → wordcloud}/core/collision/grid.d.ts +0 -0
- /package/lib/types/{wordcloud-chart → wordcloud}/core/layout/candidates.d.ts +0 -0
- /package/lib/types/{wordcloud-chart → wordcloud}/core/layout/font-scale.d.ts +0 -0
- /package/lib/types/{wordcloud-chart → wordcloud}/core/layout/layout-config.d.ts +0 -0
- /package/lib/types/{wordcloud-chart → wordcloud}/core/layout/layout.d.ts +0 -0
- /package/lib/types/{wordcloud-chart → wordcloud}/core/layout/phases.d.ts +0 -0
- /package/lib/types/{wordcloud-chart → wordcloud}/core/layout/place-word.d.ts +0 -0
- /package/lib/types/{wordcloud-chart → wordcloud}/core/layout/placement-stats.d.ts +0 -0
- /package/lib/types/{wordcloud-chart → wordcloud}/core/layout/placement-types.d.ts +0 -0
- /package/lib/types/{wordcloud-chart → wordcloud}/core/layout/placement-word-manager.d.ts +0 -0
- /package/lib/types/{wordcloud-chart → wordcloud}/core/layout/rotation.d.ts +0 -0
- /package/lib/types/{wordcloud-chart → wordcloud}/core/layout/runtime-mask.d.ts +0 -0
- /package/lib/types/{wordcloud-chart → wordcloud}/core/layout/search-plan.d.ts +0 -0
- /package/lib/types/{wordcloud-chart → wordcloud}/core/layout/word-prepare.d.ts +0 -0
- /package/lib/types/{wordcloud-chart → wordcloud}/core/layout/word-shrink.d.ts +0 -0
- /package/lib/types/{wordcloud-chart → wordcloud}/core/random/seed.d.ts +0 -0
- /package/lib/types/{wordcloud-chart → wordcloud}/core/shape/built-in-shapes.d.ts +0 -0
- /package/lib/types/{wordcloud-chart → wordcloud}/core/shape/shape-mask.d.ts +0 -0
- /package/lib/types/{wordcloud-chart → wordcloud}/core/shape/shape-profile.d.ts +0 -0
- /package/lib/types/{wordcloud-chart → wordcloud}/core/shape/sprite-shape.d.ts +0 -0
- /package/lib/types/{wordcloud-chart → wordcloud}/core/text/formatter.d.ts +0 -0
- /package/lib/types/{wordcloud-chart → wordcloud}/core/text/measure.d.ts +0 -0
- /package/lib/types/{wordcloud-chart → wordcloud}/core/text/normalize.d.ts +0 -0
- /package/lib/types/{wordcloud-chart → wordcloud}/core/text/sprite.d.ts +0 -0
- /package/lib/types/{wordcloud-chart → wordcloud}/core/types/layout.d.ts +0 -0
- /package/lib/types/{wordcloud-chart → wordcloud}/defaults.d.ts +0 -0
- /package/lib/types/{wordcloud-chart/adapters/echarts → wordcloud}/render-config.d.ts +0 -0
- /package/lib/types/{word-cloud-resource → wordcloud/resources}/word-cloud-resource-config.d.ts +0 -0
- /package/lib/types/{wordcloud-chart → wordcloud}/types.d.ts +0 -0
- /package/lib/types/{wordcloud-chart → wordcloud}/word-cloud-render-config.d.ts +0 -0
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { registerLayout, registerPostUpdate } from 'echarts';
|
|
2
2
|
import type { IAxisOptions } from '../../../types';
|
|
3
|
+
export declare const LOG_AXIS_AUTO_CROSSING = 1;
|
|
3
4
|
declare const AXIS_PLACEMENT_META = "__univerAxisPlacement";
|
|
4
5
|
interface IAxisPlacement {
|
|
5
6
|
crossing?: IAxisOptions['crossing'];
|
|
@@ -12,6 +13,7 @@ interface IAxisOption {
|
|
|
12
13
|
}
|
|
13
14
|
/** Transient renderer metadata. The snapshot retains only the standard OOXML axis properties. */
|
|
14
15
|
export declare function setAxisPlacement(axis: IAxisOption, style: Pick<IAxisOptions, 'crossing' | 'tickLabelPosition'>, perpendicularInverse?: boolean): void;
|
|
16
|
+
export declare function getAxisCrossing(axis: IAxisOption): IAxisOptions['crossing'];
|
|
15
17
|
export declare function getAxisOriginalPosition(axis: IAxisOption): string | undefined;
|
|
16
18
|
export declare function resolveAxisLabelPosition(position: string, labelPosition: IAxisOptions['tickLabelPosition'], perpendicularInverse?: boolean): string;
|
|
17
19
|
/** Run after scale/grid resolution so resizing and legend filtering use the actual Cartesian geometry. */
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ChartDirection, ChartStyle, IChartData } from '../../../types';
|
|
2
|
+
import { ChartTypeBits } from '../../../enum';
|
|
3
|
+
export interface IChartAxisScaleState {
|
|
4
|
+
effectiveScale: 'linear' | 'log';
|
|
5
|
+
requestedBase?: number;
|
|
6
|
+
effectiveBase: number;
|
|
7
|
+
positiveMin?: number;
|
|
8
|
+
positiveMax?: number;
|
|
9
|
+
skippedPoints: number;
|
|
10
|
+
diagnostics: Array<'invalid-log-base' | 'orphan-log-base' | 'invalid-scale-type' | 'invalid-log-bounds' | 'no-positive-data' | 'unsupported-percent-log' | 'unsupported-log-axis'>;
|
|
11
|
+
seriesIndexes: number[];
|
|
12
|
+
invalidPoints: Record<number, number[]>;
|
|
13
|
+
}
|
|
14
|
+
export declare function analyzeChartAxisScales(chartType: ChartTypeBits, data: IChartData, style: ChartStyle, direction: ChartDirection): Partial<Record<'xAxis' | 'yAxis' | 'rightYAxis', IChartAxisScaleState>>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { EChartRenderSpecOperator } from '../../../types';
|
|
2
|
+
export declare const LOG_BAR_LAYOUT_META = "__univerLogBarLayout";
|
|
3
|
+
/** Only the ephemeral spec is filtered; source values and category indexes remain intact. */
|
|
4
|
+
export declare const logAxisDataOperator: EChartRenderSpecOperator;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { registerLayout } from 'echarts';
|
|
2
|
+
/** Renderer-only marker; never stored in chart configuration or OOXML. */
|
|
3
|
+
export declare const LOG_AXIS_TICKS_META = "__univerLogAxisTicks";
|
|
4
|
+
/** ECharts 6.1 builds axis text during Grid.resize, before registered series layouts. */
|
|
5
|
+
export declare function installLogAxisTicks(register: typeof registerLayout): void;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { IAxisOptions } from '../../../types';
|
|
2
|
+
export declare const OFFICE_AXIS_HEADROOM = 0.05;
|
|
3
|
+
export declare const OFFICE_HORIZONTAL_AXIS_SPLITS = 10;
|
|
4
|
+
export declare function getOfficeAutoMinimum(min: number, max: number, majorUnit: number | undefined, scatter: boolean, headroom: number, splitNumber: number): number | undefined;
|
|
5
|
+
export declare function createValueAxisScale(extent: readonly [number, number], options: Readonly<Pick<IAxisOptions, 'min' | 'max' | 'majorUnit' | 'autoScale'>>, context: {
|
|
6
|
+
readonly horizontal: boolean;
|
|
7
|
+
readonly percentStacked: boolean;
|
|
8
|
+
readonly threeDimensional: boolean;
|
|
9
|
+
}): {
|
|
10
|
+
readonly min: number;
|
|
11
|
+
readonly max: number;
|
|
12
|
+
readonly ticks: readonly number[];
|
|
13
|
+
};
|
|
@@ -3,5 +3,5 @@ interface ICalendarDateAxis {
|
|
|
3
3
|
data: string[];
|
|
4
4
|
key: (timestamp: number) => string;
|
|
5
5
|
}
|
|
6
|
-
export declare function resolveCalendarDateAxis(category: IChartConfig['category'], axis: Pick<IAxisOptions, 'baseTimeUnit' | 'min' | 'max'> | undefined): ICalendarDateAxis | undefined;
|
|
6
|
+
export declare function resolveCalendarDateAxis(category: IChartConfig['category'], axis: Pick<IAxisOptions, 'baseTimeUnit' | 'min' | 'max'> | undefined, useDefault1900DateSystem?: boolean): ICalendarDateAxis | undefined;
|
|
7
7
|
export {};
|
package/lib/types/models/chart-render/converter/render-spec-operators/empty-style-operator.d.ts
CHANGED
|
@@ -1,2 +1,4 @@
|
|
|
1
1
|
import type { EChartRenderSpecOperator } from '../../../../types';
|
|
2
2
|
export declare const emptyStyleOperator: EChartRenderSpecOperator;
|
|
3
|
+
/** Axis-local messages must not replace the healthy series on another value axis. */
|
|
4
|
+
export declare const logAxisStatusOperator: EChartRenderSpecOperator;
|
package/lib/types/models/chart-render/converter/render-spec-operators/legend-style.operator.d.ts
CHANGED
|
@@ -1,2 +1,12 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { LegendComponentOption } from 'echarts';
|
|
2
|
+
import type { ChartRuntimeStyle, EChartRenderSpecOperator } from '../../../../types';
|
|
3
|
+
import { LegendPositionEnum } from '../../../../enum';
|
|
4
|
+
interface IGridInfo {
|
|
5
|
+
left: number;
|
|
6
|
+
top: number;
|
|
7
|
+
right: number;
|
|
8
|
+
bottom: number;
|
|
9
|
+
}
|
|
10
|
+
export declare function getLegendPosition(position: LegendPositionEnum | undefined, style: ChartRuntimeStyle, gridInfo: Pick<IGridInfo, 'top'>): LegendComponentOption;
|
|
2
11
|
export declare const legendStyleOperator: EChartRenderSpecOperator;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** Positive, non-smoothed autoZero domains only. Authored endpoints remain exact. */
|
|
2
|
+
export declare function calculateLogAxisRange(dataMin: number, dataMax: number, base: number, fixedMin?: number, fixedMax?: number): {
|
|
3
|
+
min: number;
|
|
4
|
+
max: number;
|
|
5
|
+
} | undefined;
|
|
6
|
+
/** Integer exponent steps anchored at the actual minimum, including manual non-power minima. */
|
|
7
|
+
export declare function calculateLogAxisTicks(min: number, max: number, base: number, step: number): number[];
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { IChartSeriesFillPattern } from '../../../../../types';
|
|
2
|
+
export declare function createSeriesPatternStyle(pattern: IChartSeriesFillPattern, renderColor: (color: string) => string): {
|
|
3
|
+
color: string;
|
|
4
|
+
decal: null;
|
|
5
|
+
} | {
|
|
6
|
+
color: string;
|
|
7
|
+
decal: {
|
|
8
|
+
symbol: string;
|
|
9
|
+
symbolSize: number;
|
|
10
|
+
dashArrayX: number[];
|
|
11
|
+
dashArrayY: number[];
|
|
12
|
+
rotation: number;
|
|
13
|
+
color: string;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
@@ -23,5 +23,7 @@ export declare const getGradientColor: (color: string, gradientFill: boolean) =>
|
|
|
23
23
|
}[];
|
|
24
24
|
};
|
|
25
25
|
type RenderColorFunc = (color: string) => string;
|
|
26
|
-
export declare const getRenderColorFunc: (style:
|
|
26
|
+
export declare const getRenderColorFunc: (style: {
|
|
27
|
+
readonly runtime: Pick<ChartRuntimeStyle["runtime"], "getRenderColor">;
|
|
28
|
+
}) => RenderColorFunc;
|
|
27
29
|
export {};
|
package/lib/types/models/chart-render/converter/render-spec-operators/watermark.operator.d.ts
CHANGED
|
@@ -1,2 +1,4 @@
|
|
|
1
|
+
import type { GraphicComponentOption } from 'echarts';
|
|
1
2
|
import type { EChartRenderSpecOperator } from '../../../../types';
|
|
2
3
|
export declare const chartWaterMarkerOperator: EChartRenderSpecOperator;
|
|
4
|
+
export declare function createChartWatermarkGraphics(width?: number, height?: number): GraphicComponentOption[];
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { IDisposable } from '@univerjs/core';
|
|
2
2
|
import type { ChartElementEventHandler, ChartElementEventType, ChartRenderMode, ChartRuntimeStyle, EChartSpec, IChartHost, IChartHostRect, IChartHostStyle, IChartInstance, IChartRenderInput, IChartRenderInstance, IChartRenderInstanceCreateContext } from '../../../types';
|
|
3
3
|
import type { IChartRuntimeAdaptiveSize } from '../../common/adaptive-size/chart-runtime-adaptive-size';
|
|
4
|
+
import type { EChartRenderEngine } from './echart-render-engine';
|
|
4
5
|
import type { EChartRenderModel } from './echart-render-model';
|
|
5
6
|
import { Disposable } from '@univerjs/core';
|
|
6
|
-
import { EChartRenderEngine } from './echart-render-engine';
|
|
7
7
|
interface IPreparedRenderFrame {
|
|
8
8
|
hostStyle: IChartHostStyle;
|
|
9
9
|
renderRect: IChartHostRect;
|
package/lib/types/models/chart-render/echart-render-model/chart-dimension-render-instance.d.ts
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { IDisposable } from '@univerjs/core';
|
|
2
|
+
import type { ChartElementEventHandler, ChartElementEventType, IChartHost, IChartRenderInput, IChartRenderInstance, IChartRenderInstanceCreateContext, IChartRenderTransitionOptions } from '../../../types';
|
|
3
|
+
import type { EChartRenderModel } from './echart-render-model';
|
|
4
|
+
import { Disposable } from '@univerjs/core';
|
|
5
|
+
import { ChartRenderMode } from '../../../types';
|
|
6
|
+
export declare class ChartDimensionRenderInstance extends Disposable implements IChartRenderInstance {
|
|
7
|
+
readonly mode: ChartRenderMode;
|
|
8
|
+
private readonly _model;
|
|
9
|
+
private readonly _context?;
|
|
10
|
+
private readonly _addWatermark;
|
|
11
|
+
private _host?;
|
|
12
|
+
private _instance?;
|
|
13
|
+
private _factory?;
|
|
14
|
+
private _editing;
|
|
15
|
+
private _closed;
|
|
16
|
+
private readonly _listeners;
|
|
17
|
+
constructor(mode: ChartRenderMode, _model: EChartRenderModel, _context?: IChartRenderInstanceCreateContext | undefined, _addWatermark?: () => boolean);
|
|
18
|
+
bind(host: IChartHost): void;
|
|
19
|
+
private _clearInstance;
|
|
20
|
+
private _getInstance;
|
|
21
|
+
render(input: IChartRenderInput): Promise<void>;
|
|
22
|
+
renderTransition(previous: IChartRenderInput, input: IChartRenderInput, options: IChartRenderTransitionOptions): Promise<void>;
|
|
23
|
+
exportImg(): Promise<string | undefined>;
|
|
24
|
+
resize(): void;
|
|
25
|
+
setElementEditMode(enabled: boolean): void;
|
|
26
|
+
on(type: ChartElementEventType, handler: ChartElementEventHandler): IDisposable;
|
|
27
|
+
dispose(): void;
|
|
28
|
+
}
|
|
@@ -3,6 +3,7 @@ import type { ChartElementEventHandler, ChartElementEventType, EChartSpec, IChar
|
|
|
3
3
|
import type { EChartRenderModel } from './echart-render-model';
|
|
4
4
|
import { BaseChartRenderInstance } from './base-chart-render-instance';
|
|
5
5
|
export declare class DomChartInstance extends BaseChartRenderInstance {
|
|
6
|
+
private _renderVersion;
|
|
6
7
|
private _chartInstance;
|
|
7
8
|
constructor(renderModel: EChartRenderModel, context?: IChartRenderInstanceCreateContext<EChartSpec>);
|
|
8
9
|
render(input: IChartRenderInput): Promise<void>;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import type { IDisposable } from '@univerjs/core';
|
|
1
2
|
import type { ChartElementEventHandler, ChartElementEventType, ChartImageSource, EChartInstance, EChartSpec, IChartElementHit, IChartRenderAsImageOptions, IChartRenderRuntimeOptions, IChartRenderTransitionOptions } from '../../../types';
|
|
3
|
+
import type { IEChartsRenderHooks } from './echarts-render-hooks';
|
|
2
4
|
import { Disposable } from '@univerjs/core';
|
|
3
5
|
/** Converts materialized composite Pie marks back to their authored source identity. */
|
|
4
6
|
export declare function resolveEChartPieCompositeHit(spec: EChartSpec | null, seriesIndex: number | undefined, params?: any, dataIndex?: number): Pick<IChartElementHit, 'pieCompositeRole' | 'pieCompositePlot' | 'pieSourcePointIndex' | 'pieAggregateMemberSourcePointIndexes'> | undefined;
|
|
@@ -22,10 +24,14 @@ export declare class EChartRenderEngine extends Disposable implements EChartInst
|
|
|
22
24
|
private readonly _emittedElementEventKeys;
|
|
23
25
|
private _emittedElementEventKeysClearQueued;
|
|
24
26
|
private readonly _fieldButtonLayoutHandler;
|
|
25
|
-
|
|
27
|
+
private readonly _renderHooks;
|
|
28
|
+
constructor(renderHooks?: Iterable<IEChartsRenderHooks>);
|
|
26
29
|
mount(id: string | HTMLElement): void;
|
|
27
30
|
resize(echartsProviderOrOptions?: any | IChartRenderRuntimeOptions): void;
|
|
28
31
|
private _ensureChartInstance;
|
|
32
|
+
registerRenderHook(hooks: IEChartsRenderHooks): IDisposable;
|
|
33
|
+
private _getRenderHooks;
|
|
34
|
+
private _runWithContext;
|
|
29
35
|
get containerElement(): HTMLElement | null;
|
|
30
36
|
render(spec: EChartSpec, echartsProviderOrOptions?: any | IChartRenderRuntimeOptions): void;
|
|
31
37
|
renderTransition(previousSpec: EChartSpec, spec: EChartSpec, options: IChartRenderRuntimeOptions & IChartRenderTransitionOptions): Promise<void>;
|
|
@@ -1,24 +1,37 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
1
|
+
import type { IDisposable } from '@univerjs/core';
|
|
2
|
+
import type { ChartRenderEvent, ChartRenderMode, ChartRuntimeStyle, EChartSpec, IChartConfig, IChartHostRect, IChartInstance, IChartRenderInstance, IChartRenderInstanceCreateContext, IChartRenderModel, IChartRenderModelImageExportInput, IChartRenderModelImageExportOptions, IChartRenderModelImageExportResult, IChartRenderModelStylizeInit, IChartRenderSpecConverter } from '../../../types';
|
|
3
3
|
import { Disposable } from '@univerjs/core';
|
|
4
|
-
import {
|
|
5
|
-
export interface
|
|
6
|
-
|
|
4
|
+
import { EChartRenderEngine } from './echart-render-engine';
|
|
5
|
+
export interface IChartInstanceFactory {
|
|
6
|
+
canRender(config: IChartConfig): boolean;
|
|
7
|
+
create(mode: ChartRenderMode, context: IChartRenderInstanceCreateContext | undefined, addWatermark: () => boolean): IChartRenderInstance;
|
|
8
|
+
}
|
|
9
|
+
export interface IChartImageExporter {
|
|
10
|
+
canExport(input: IChartRenderModelImageExportInput): boolean;
|
|
11
|
+
exportImage(input: IChartRenderModelImageExportInput, options: IChartRenderModelImageExportOptions, addWatermark: boolean): Promise<IChartRenderModelImageExportResult>;
|
|
12
|
+
}
|
|
13
|
+
export interface IChartRenderExtension {
|
|
14
|
+
readonly name: string;
|
|
15
|
+
specConverter?: IChartRenderSpecConverter<EChartSpec>;
|
|
16
|
+
instanceFactory?: IChartInstanceFactory;
|
|
17
|
+
imageExporter?: IChartImageExporter;
|
|
18
|
+
onEvent?(event: ChartRenderEvent): void;
|
|
7
19
|
}
|
|
8
20
|
export declare class EChartRenderModel extends Disposable implements IChartRenderModel {
|
|
9
21
|
private _specConverters;
|
|
10
22
|
private _specOperators;
|
|
11
23
|
private _addWatermark;
|
|
12
|
-
private readonly
|
|
13
|
-
constructor(_addWatermark: boolean
|
|
24
|
+
private readonly _extensions;
|
|
25
|
+
constructor(_addWatermark: boolean);
|
|
26
|
+
registerExtension(extension: IChartRenderExtension): IDisposable;
|
|
27
|
+
emitChartEvent(event: ChartRenderEvent): void;
|
|
28
|
+
findInstanceFactory(config: IChartConfig): IChartInstanceFactory | undefined;
|
|
29
|
+
createRenderEngine(): EChartRenderEngine;
|
|
14
30
|
updateWatermark(addWatermark: boolean): void;
|
|
15
31
|
private _addSpecConverters;
|
|
16
32
|
private _addSpecOperators;
|
|
17
33
|
createChartInstance(): IChartInstance<EChartSpec>;
|
|
18
34
|
createChartInstance(mode: ChartRenderMode, context?: IChartRenderInstanceCreateContext<EChartSpec>): IChartRenderInstance;
|
|
19
|
-
clearRuntimeCache(chartId: string): void;
|
|
20
|
-
clearAllRuntimeCache(): void;
|
|
21
|
-
dispose(): void;
|
|
22
35
|
toSpec(config: IChartConfig, style: ChartRuntimeStyle): import("echarts").EChartsOption;
|
|
23
36
|
private _getShowEmpty;
|
|
24
37
|
stylizeSpec(spec: EChartSpec, stylizeInit: IChartRenderModelStylizeInit<EChartSpec>, rect: IChartHostRect): EChartSpec;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { EChartSpec } from '../../../types';
|
|
2
|
+
export declare const CHART_IMAGE_RENDER_SETTLE_TIMEOUT = 1000;
|
|
3
|
+
/** Synchronous layout context and resources required before image capture. */
|
|
4
|
+
export interface IEChartsRenderHooks {
|
|
5
|
+
runWithContext<T>(chartId: string | undefined, action: () => T): T;
|
|
6
|
+
waitForResources(spec: EChartSpec): Promise<void>;
|
|
7
|
+
}
|
|
@@ -1,3 +1,2 @@
|
|
|
1
1
|
export { EChartRenderEngine, resolveEChartChordHit, resolveEChartPieCompositeHit, resolveEChartSeriesIdentity, } from './echart-render-engine';
|
|
2
2
|
export { EChartRenderModel } from './echart-render-model';
|
|
3
|
-
export type { IEChartRenderModelOptions } from './echart-render-model';
|
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
export interface IChartLocaleTexts {
|
|
2
|
+
projectionInvalid: string;
|
|
3
|
+
projectionUnavailable: string;
|
|
4
|
+
projectionRetry: string;
|
|
5
|
+
projectionPngOnly: string;
|
|
6
|
+
logUnsupported: string;
|
|
7
|
+
logNoPositive: string;
|
|
8
|
+
logPercent: string;
|
|
2
9
|
seriesDefaultName: string;
|
|
3
10
|
blank: string;
|
|
4
11
|
boxplotMin: string;
|
|
@@ -614,6 +614,11 @@ export declare const defaultChartConfig: {
|
|
|
614
614
|
};
|
|
615
615
|
backgroundColor: string;
|
|
616
616
|
axis: {
|
|
617
|
+
logarithmic: {
|
|
618
|
+
base: number;
|
|
619
|
+
minBase: number;
|
|
620
|
+
maxBase: number;
|
|
621
|
+
};
|
|
617
622
|
lineVisible: boolean;
|
|
618
623
|
labelVisible: boolean;
|
|
619
624
|
reverse: boolean;
|
|
@@ -652,10 +657,7 @@ export declare const defaultChartConfig: {
|
|
|
652
657
|
lineStyle: AreaLineStyle;
|
|
653
658
|
};
|
|
654
659
|
bar: {
|
|
655
|
-
is3D: boolean;
|
|
656
660
|
shape: BarShape;
|
|
657
|
-
rotX: number;
|
|
658
|
-
rotY: number;
|
|
659
661
|
};
|
|
660
662
|
bubble: {
|
|
661
663
|
scale: number;
|
|
@@ -671,7 +673,6 @@ export declare const defaultChartConfig: {
|
|
|
671
673
|
borderColor: string;
|
|
672
674
|
labelPosition: PieLabelPosition;
|
|
673
675
|
hasPaddingAngle: boolean;
|
|
674
|
-
is3D: boolean;
|
|
675
676
|
};
|
|
676
677
|
combination: {
|
|
677
678
|
firstChartType: ChartTypeBits;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import type { DeepReadonly } from '@univerjs/core';
|
|
2
|
+
import type { DeepPartial } from '../../../../types';
|
|
1
3
|
import type { IEchartTheme, IEchartThemeContent } from './types';
|
|
2
4
|
export type axesType = 'category' | 'value' | 'time' | 'log' | 'all' | undefined;
|
|
3
|
-
export declare function getThemeAxesByType(themeInfo: IEchartTheme, axesType: axesType): import("./types").IEchartThemeAxisConfig | undefined;
|
|
5
|
+
export declare function getThemeAxesByType(themeInfo: DeepReadonly<DeepPartial<IEchartTheme>> | undefined, axesType: axesType): DeepReadonly<import("./types").IEchartThemeAxisConfig> | undefined;
|
|
4
6
|
export declare function getThemeProps<K extends keyof IEchartThemeContent>(themeInfo: IEchartTheme | undefined, key: K): IEchartThemeContent[K];
|
package/lib/types/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { IDisposable, Nullable } from '@univerjs/core';
|
|
1
|
+
import type { DateSystem, IDisposable, Nullable } from '@univerjs/core';
|
|
2
2
|
import type { BarSeriesOption, EChartsOption } from 'echarts';
|
|
3
3
|
import type { Observable } from 'rxjs';
|
|
4
4
|
import type { ChartColor, IChartLinearGradient } from './chart-builder/chart-color';
|
|
@@ -6,11 +6,12 @@ import type { IChartPieCompositeSpec, PieCompositeMarkRole, PieCompositePlot } f
|
|
|
6
6
|
import type { IChartDataAggregation } from './chart-data-aggregation';
|
|
7
7
|
import type { AreaLineStyle, AxisAlignEnum, AxisValueType, BarShape, CategoryType, ChartAxisDimension, ChartBorderDashType, ChartChordFocusMode, ChartChordLabelPosition, ChartChordRibbonColorMode, ChartGaugeMode, ChartGaugePointerShape, ChartHistogramBinKind, ChartMarkLineLabelPosition, ChartSemanticAxis, ChartSourceDataTypeEnum, ChartSunburstLabelPosition, ChartTrendlineType, ChartTypeBits, ChartWaterfallPointRole, DataOrientation, HistogramBinningMode, InvalidValueType, IRuntimeAxisPosition, IRuntimeAxisPriority, LabelAlignEnum, LabelContentType, LegendPositionEnum, LinePointShape, PieLabelPosition, RadarShape, RelationChartLayoutEnum, ScatterLineType, SelectModeEnum, SeriesLabelPosition, TitlePositionEnum, TreemapParentLabelLayout, WaterfallSeriesTypeEnum, WaterfallStackTypeEnum, WordCloudShapeEnum } from './enum';
|
|
8
8
|
import type { ICartesianPointData } from './models/chart-data/internal/cartesian-point-data';
|
|
9
|
+
import type { analyzeChartAxisScales } from './models/chart-render/axes/chart-axis-scale';
|
|
9
10
|
import type { IChartRuntimeAdaptiveSize } from './models/common/adaptive-size/chart-runtime-adaptive-size';
|
|
10
11
|
import type { IChartLocaleTexts } from './models/common/chart-locale-texts';
|
|
11
12
|
import type { IEchartTheme } from './models/common/theme/build-in-theme/types';
|
|
12
|
-
import type { IWordCloudRenderConfig } from './wordcloud
|
|
13
|
-
export type DeepPartial<T> = T extends IChartLinearGradient | IChartLabelPattern ? T : T extends Record<string, any> ? T extends any[] ? T : {
|
|
13
|
+
import type { IWordCloudRenderConfig } from './wordcloud';
|
|
14
|
+
export type DeepPartial<T> = T extends IChartLinearGradient | IChartLabelPattern | IChartSeriesFillPattern ? T : T extends Record<string, any> ? T extends any[] ? T : {
|
|
14
15
|
[key in keyof T]+?: DeepPartial<T[key]>;
|
|
15
16
|
} : T;
|
|
16
17
|
/** Recursive patch shape that permits `null` at every field and treats arrays as atomic values. */
|
|
@@ -47,6 +48,8 @@ export interface IUniverDataSetCategorySpan {
|
|
|
47
48
|
* used as a fallback category vector.
|
|
48
49
|
*/
|
|
49
50
|
export interface IUniverDataSet {
|
|
51
|
+
/** Runtime date-system owner for authored serial bounds; never persisted in chart resources. */
|
|
52
|
+
dateSystem?: DateSystem;
|
|
50
53
|
source: OptionDataValue[][];
|
|
51
54
|
dimensions: Array<DimensionDefinitionLoose>;
|
|
52
55
|
sourceType?: ChartSourceDataTypeEnum[][];
|
|
@@ -554,6 +557,9 @@ export interface IRuntimeAxis {
|
|
|
554
557
|
type: AxisValueType;
|
|
555
558
|
}
|
|
556
559
|
export interface IChartRuntimeContext {
|
|
560
|
+
/** Effective projection policy; never persisted into authored chart style. */
|
|
561
|
+
threeDRightAngleAxes?: boolean;
|
|
562
|
+
axisScaleStates?: ReturnType<typeof analyzeChartAxisScales>;
|
|
557
563
|
adaptiveSize?: IChartRuntimeAdaptiveSize;
|
|
558
564
|
/** Runtime-only host policy that opts chart rendering into width-based adaptive sizing. */
|
|
559
565
|
enableAdaptiveSize?: boolean;
|
|
@@ -650,6 +656,8 @@ export interface IGridLineStyle {
|
|
|
650
656
|
dashType?: ChartBorderDashType;
|
|
651
657
|
}
|
|
652
658
|
export interface IAxisOptions {
|
|
659
|
+
scaleType?: 'linear' | 'log';
|
|
660
|
+
logBase?: number;
|
|
653
661
|
/** Axis visibility (inverse of OOXML c:delete); authored gridlines and titles remain independent. */
|
|
654
662
|
visible?: boolean;
|
|
655
663
|
/**
|
|
@@ -675,7 +683,7 @@ export interface IAxisOptions {
|
|
|
675
683
|
max?: number | null;
|
|
676
684
|
/** Positive interval between major ticks on a numeric value axis; absent means automatic. */
|
|
677
685
|
majorUnit?: number;
|
|
678
|
-
/** Office-imported value-axis bounds
|
|
686
|
+
/** Office-imported value-axis bounds for the three-dimensional scene scale. */
|
|
679
687
|
autoScale?: 'office';
|
|
680
688
|
/** Calendar granularity of an imported date axis; absent retains elapsed-time behavior. */
|
|
681
689
|
baseTimeUnit?: 'days' | 'months' | 'years';
|
|
@@ -709,6 +717,12 @@ export interface IPointStyle {
|
|
|
709
717
|
size: number;
|
|
710
718
|
color: Nullable<string>;
|
|
711
719
|
}
|
|
720
|
+
/** Imported DrawingML series/point fill. Omission inherits; null clears the pattern. */
|
|
721
|
+
export interface IChartSeriesFillPattern {
|
|
722
|
+
preset: string;
|
|
723
|
+
foregroundColor: string;
|
|
724
|
+
backgroundColor: string;
|
|
725
|
+
}
|
|
712
726
|
export interface IDataPointStyle extends Omit<IPointStyle, 'color'> {
|
|
713
727
|
/** Per-point stroke overrides; absent properties inherit the series border. */
|
|
714
728
|
border?: Partial<ISeriesStyle['border']>;
|
|
@@ -718,6 +732,7 @@ export interface IDataPointStyle extends Omit<IPointStyle, 'color'> {
|
|
|
718
732
|
offset?: [number, number];
|
|
719
733
|
};
|
|
720
734
|
color: Nullable<ChartColor>;
|
|
735
|
+
fillPattern?: IChartSeriesFillPattern | null;
|
|
721
736
|
/** Fill opacity for this data point, from 0 (transparent) to 1 (opaque). */
|
|
722
737
|
fillOpacity?: number;
|
|
723
738
|
}
|
|
@@ -729,6 +744,7 @@ export interface ISeriesStyle {
|
|
|
729
744
|
/** Explicit line-series smoothing; overrides chart-level smoothing when present. */
|
|
730
745
|
smooth?: boolean;
|
|
731
746
|
color: Nullable<ChartColor>;
|
|
747
|
+
fillPattern?: IChartSeriesFillPattern | null;
|
|
732
748
|
/** Fill opacity for this series, from 0 (transparent) to 1 (opaque). */
|
|
733
749
|
fillOpacity: number;
|
|
734
750
|
border: {
|
|
@@ -757,7 +773,7 @@ export interface ISeriesStyle {
|
|
|
757
773
|
};
|
|
758
774
|
}
|
|
759
775
|
export type RightYAxisOptions = Omit<IAxisOptions, 'reverse'>;
|
|
760
|
-
export interface IAllSeriesStyle extends Pick<ISeriesStyle, 'border' | 'label' | 'rightYAxis' | 'point' | 'color' | 'fillOpacity' | 'waterfall' | 'scatterLine'> {
|
|
776
|
+
export interface IAllSeriesStyle extends Pick<ISeriesStyle, 'border' | 'label' | 'rightYAxis' | 'point' | 'color' | 'fillOpacity' | 'fillPattern' | 'waterfall' | 'scatterLine'> {
|
|
761
777
|
}
|
|
762
778
|
export interface ITrendLine {
|
|
763
779
|
/** Stable source identity. `seriesIndex` remains the fallback for legacy snapshots. */
|
|
@@ -817,13 +833,7 @@ export interface IBarStyle {
|
|
|
817
833
|
gapWidth?: number;
|
|
818
834
|
/** Series overlap from -100 (separated) through 100 (fully overlapped). */
|
|
819
835
|
overlap?: number;
|
|
820
|
-
/** Exchange metadata. Renderers without 3D support may ignore these fields. */
|
|
821
|
-
is3D: boolean;
|
|
822
836
|
shape: BarShape;
|
|
823
|
-
/** OOXML view rotation around the horizontal axis, in degrees. */
|
|
824
|
-
rotX: number;
|
|
825
|
-
/** OOXML view rotation around the vertical axis, in degrees. */
|
|
826
|
-
rotY: number;
|
|
827
837
|
}
|
|
828
838
|
export interface IChartBubbleStyle {
|
|
829
839
|
/** Maximum bubble size as an OOXML-compatible percentage. */
|
|
@@ -838,6 +848,26 @@ export interface IChartPlotArea {
|
|
|
838
848
|
width: number;
|
|
839
849
|
height: number;
|
|
840
850
|
}
|
|
851
|
+
/** Authored OOXML-compatible view semantics; camera matrices are renderer-owned. */
|
|
852
|
+
export interface IChart3DView {
|
|
853
|
+
rotX?: number;
|
|
854
|
+
rotY?: number;
|
|
855
|
+
rightAngleAxes?: boolean;
|
|
856
|
+
/** OOXML perspective value, not a camera field of view. */
|
|
857
|
+
perspective?: number;
|
|
858
|
+
/** Omission preserves automatic height. */
|
|
859
|
+
heightPercent?: number;
|
|
860
|
+
depthPercent?: number;
|
|
861
|
+
}
|
|
862
|
+
export interface IChart3DStyle {
|
|
863
|
+
view?: IChart3DView;
|
|
864
|
+
/** Only applies to non-stacked Column and Bar charts. */
|
|
865
|
+
grouping?: 'standard' | 'clustered';
|
|
866
|
+
/** Series depth gap as a percentage; independent of category gapWidth. */
|
|
867
|
+
gapDepth?: number;
|
|
868
|
+
}
|
|
869
|
+
export interface IChartDepthAxisStyle extends Pick<IAxisOptions, 'lineVisible' | 'lineStyle' | 'label' | 'gridLine' | 'tick' | 'reverse'> {
|
|
870
|
+
}
|
|
841
871
|
export interface IChartErrorBars {
|
|
842
872
|
/** Data-source field index of the owning value series, not its display order. */
|
|
843
873
|
seriesIndex: number;
|
|
@@ -858,6 +888,9 @@ export interface IChartErrorBars {
|
|
|
858
888
|
};
|
|
859
889
|
}
|
|
860
890
|
export interface IChartStyle {
|
|
891
|
+
/** Retained while inactive in 2D; the ThreeD chart type bit alone enables 3D. */
|
|
892
|
+
threeD?: IChart3DStyle;
|
|
893
|
+
depthAxis?: IChartDepthAxisStyle;
|
|
861
894
|
width: number;
|
|
862
895
|
height: number;
|
|
863
896
|
theme: string;
|
|
@@ -878,6 +911,7 @@ export interface IChartStyle {
|
|
|
878
911
|
/** Imported PowerPoint Cartesian edge/label spacing; the inner plot remains automatic. */
|
|
879
912
|
automaticLayout?: 'powerpoint';
|
|
880
913
|
titles: {
|
|
914
|
+
depthAxisTitle?: IChartTitleStyle;
|
|
881
915
|
title: IChartTitleStyle;
|
|
882
916
|
subtitle: IChartTitleStyle;
|
|
883
917
|
xAxisTitle: IChartTitleStyle;
|
|
@@ -911,8 +945,6 @@ export interface IChartStyle {
|
|
|
911
945
|
labelStyle: IPieLabelStyle;
|
|
912
946
|
borderColor: string;
|
|
913
947
|
hasPaddingAngle: boolean;
|
|
914
|
-
/** Exchange metadata. Renderers without 3D support may ignore this field. */
|
|
915
|
-
is3D: boolean;
|
|
916
948
|
isHalfPie: boolean;
|
|
917
949
|
rosePie: boolean;
|
|
918
950
|
showLabelLine: boolean;
|
|
@@ -923,7 +955,10 @@ export interface IChartStyle {
|
|
|
923
955
|
sliceStyles: {
|
|
924
956
|
[index: number]: {
|
|
925
957
|
color: Nullable<ChartColor>;
|
|
958
|
+
fillPattern?: IChartSeriesFillPattern | null;
|
|
926
959
|
fillOpacity?: number;
|
|
960
|
+
/** Radius ratio; explicit zero overrides overall pie explosion. */
|
|
961
|
+
explosion?: number;
|
|
927
962
|
};
|
|
928
963
|
};
|
|
929
964
|
};
|
|
@@ -991,7 +1026,7 @@ export interface IRelationForceOptions {
|
|
|
991
1026
|
gravity?: number;
|
|
992
1027
|
}
|
|
993
1028
|
export type ChartStyle = DeepPartial<IChartStyle>;
|
|
994
|
-
export type ChartRenderRuntimeContext = Omit<DeepPartial<IChartRuntimeContext>, 'adaptiveSize' | 'localeTexts' | 'updateAdaptiveSizeFromDomRender'> & Pick<IChartRuntimeContext, 'localeTexts'> & Partial<Pick<IChartRuntimeContext, 'adaptiveSize' | 'updateAdaptiveSizeFromDomRender'>>;
|
|
1029
|
+
export type ChartRenderRuntimeContext = Omit<DeepPartial<IChartRuntimeContext>, 'axisScaleStates' | 'adaptiveSize' | 'localeTexts' | 'updateAdaptiveSizeFromDomRender'> & Pick<IChartRuntimeContext, 'localeTexts'> & Partial<Pick<IChartRuntimeContext, 'axisScaleStates' | 'adaptiveSize' | 'updateAdaptiveSizeFromDomRender'>>;
|
|
995
1030
|
export type ChartRuntimeStyle = ChartStyle & {
|
|
996
1031
|
direction: ChartDirection;
|
|
997
1032
|
runtime: ChartRenderRuntimeContext;
|
|
@@ -1124,6 +1159,13 @@ export interface IChartRenderModelStylizeInit<Spec> {
|
|
|
1124
1159
|
chartConfig: IChartConfig;
|
|
1125
1160
|
chartInstance?: IChartInstance<Spec>;
|
|
1126
1161
|
}
|
|
1162
|
+
/** Renderer lifecycle notifications; these are runtime events, not persisted commands. */
|
|
1163
|
+
export type ChartRenderEvent = {
|
|
1164
|
+
type: 'render' | 'remove' | 'detach';
|
|
1165
|
+
chartId: string;
|
|
1166
|
+
} | {
|
|
1167
|
+
type: 'dispose';
|
|
1168
|
+
};
|
|
1127
1169
|
export interface IChartRenderModel<Spec extends Record<string, any> = Record<string, any>> extends IDisposable {
|
|
1128
1170
|
toSpec(chartConfig: IChartConfig, style: ChartRuntimeStyle): Spec;
|
|
1129
1171
|
stylizeSpec(spec: Spec, stylizeInit: IChartRenderModelStylizeInit<Spec>, rect: IChartHostRect): Spec;
|
|
@@ -1131,8 +1173,7 @@ export interface IChartRenderModel<Spec extends Record<string, any> = Record<str
|
|
|
1131
1173
|
updateWatermark(addWatermark: boolean): void;
|
|
1132
1174
|
createChartInstance(): IChartInstance<Spec>;
|
|
1133
1175
|
createChartInstance(mode: ChartRenderMode, context?: IChartRenderInstanceCreateContext<Spec>): IChartRenderInstance;
|
|
1134
|
-
|
|
1135
|
-
clearAllRuntimeCache?(): void;
|
|
1176
|
+
emitChartEvent?(event: ChartRenderEvent): void;
|
|
1136
1177
|
dispose(): void;
|
|
1137
1178
|
}
|
|
1138
1179
|
export interface IChartThemeOptions {
|
package/lib/types/util.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ export declare const chartBitsUtils: {
|
|
|
3
3
|
has(bit: number, attribute: number): boolean;
|
|
4
4
|
baseOn(bit: number, base: number): boolean;
|
|
5
5
|
remove(bit: number, attribute: number): number;
|
|
6
|
-
chartBitToString(bit: ChartTypeBits): "" | "line" | "bar" | "pie" | "radar" | "scatter" | "combination" | "wordCloud" | "funnel" | "sankey" | "heatmap" | "boxplot" | "candlestick" | "treemap" | "sunburst" | "gauge" | "chord" | "graph";
|
|
6
|
+
chartBitToString(bit: ChartTypeBits): "" | "line" | "bar" | "pie" | "radar" | "scatter" | "combination" | "wordCloud" | "funnel" | "sankey" | "heatmap" | "boxplot" | "candlestick" | "treemap" | "sunburst" | "gauge" | "chord" | "graph" | undefined;
|
|
7
7
|
};
|
|
8
8
|
export declare function mergeChartConfig<T extends object>(current: T | undefined, update: Partial<T>): T;
|
|
9
9
|
export declare const setProperty: (data: Record<string, any>, propertyPath: string, value: any) => void;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { EChartSpec, IChartRenderSpecConverter } from '
|
|
1
|
+
import type { EChartSpec, IChartRenderSpecConverter } from '../../types';
|
|
2
2
|
export declare const wordCloudChartConverter: IChartRenderSpecConverter<EChartSpec>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { IWordCloudEChartsSeriesOption } from '
|
|
3
|
-
export declare function registerWordCloudChart(echartsInstance:
|
|
1
|
+
import type { IWordCloudEChartsApi } from '../echarts-api';
|
|
2
|
+
import type { IWordCloudEChartsSeriesOption } from '../types';
|
|
3
|
+
export declare function registerWordCloudChart(echartsInstance: IWordCloudEChartsApi): IWordCloudEChartsApi;
|
|
4
4
|
export declare function waitForWordCloudImageResourcesReady(spec: unknown, timeout?: number): Promise<void>;
|
|
5
5
|
export type { IWordCloudEChartsSeriesOption };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { IWordCloudEChartsApi } from './echarts-api';
|
|
2
2
|
export interface IRegisterWordCloudChartViewContext {
|
|
3
3
|
createTextElement(layout: any, data: any, dataIndex: number, seriesModel: any): unknown;
|
|
4
4
|
}
|
|
5
|
-
export declare function registerWordCloudChartView(echartsInstance:
|
|
5
|
+
export declare function registerWordCloudChartView(echartsInstance: IWordCloudEChartsApi, context: IRegisterWordCloudChartViewContext): void;
|
|
@@ -16,7 +16,7 @@ export declare class BoxShapeEngine implements ICollisionEngine<IBoxFootprint> {
|
|
|
16
16
|
private _lastShapeCheck;
|
|
17
17
|
constructor(_grid: IWordCloudLayoutGrid, _shapeGrid: Uint8Array);
|
|
18
18
|
createFootprint(_word: IWordCloudEncodedWord, style: ICollisionTextStyle, rotation: number): IBoxFootprint;
|
|
19
|
-
getBounds(footprint: IBoxFootprint, candidate: ICollisionCandidate): import("
|
|
19
|
+
getBounds(footprint: IBoxFootprint, candidate: ICollisionCandidate): import("../..").IWordCloudBounds;
|
|
20
20
|
isInsideLayout(footprint: IBoxFootprint, candidate: ICollisionCandidate, width: number, height: number): boolean;
|
|
21
21
|
canPlace(footprint: IBoxFootprint, candidate: ICollisionCandidate): boolean;
|
|
22
22
|
isShapeBlocked(footprint: IBoxFootprint, candidate: ICollisionCandidate): boolean;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type * as echarts from 'echarts';
|
|
2
|
+
export interface IWordCloudEChartsApi extends Pick<typeof echarts, 'extendChartView' | 'extendSeriesModel' | 'format' | 'getInstanceByDom' | 'graphic' | 'helper' | 'init' | 'List' | 'number' | 'registerAction' | 'registerLayout' | 'registerPreprocessor' | 'util'> {
|
|
3
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export declare const WORD_CLOUD_SERIES_TYPE = "wordCloud";
|
|
2
2
|
export declare const WORD_CLOUD_DEFAULT_OPTION: {
|
|
3
3
|
readonly z: 2;
|
|
4
|
-
readonly maskSource: import("
|
|
4
|
+
readonly maskSource: import("./types").IWordCloudEChartsMaskSource;
|
|
5
5
|
readonly colorBy: "data";
|
|
6
6
|
readonly keepAspect: false;
|
|
7
7
|
readonly left: "center";
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export { registerWordCloudChart } from './adapters/echarts-adapter';
|
|
2
|
+
export { layoutWordCloudChart, resolveLayoutOptions, } from './canvas';
|
|
3
|
+
export type { CallbackOption, IFieldOption, IWordCloudFontSizeMeta } from './core/layout/font-scale';
|
|
4
|
+
export { createWordCloudFontSizeAccessor, extent, generateWordCloudSqrtScale, normalizeWordCloudFontSizeRange, signedSqrt, WORD_CLOUD_DEFAULT_FONT_SIZE_RANGE, } from './core/layout/font-scale';
|
|
5
|
+
export { createBuiltinMaskGrid, createMaskGridFromShape, createTextMaskGrid, normalizeMaskGrid, segmentMaskGrid, } from './core/shape/built-in-shapes';
|
|
6
|
+
export { encodeWordCloudWords } from './core/text/formatter';
|
|
7
|
+
export { normalizeWordCloudData } from './core/text/normalize';
|
|
8
|
+
export { DEFAULT_WORD_CLOUD_CHART_SPEC, resolveWordCloudSpec, } from './defaults';
|
|
9
|
+
export { WORD_CLOUD_DEFAULT_OPTION, WORD_CLOUD_SERIES_TYPE } from './echarts-options';
|
|
10
|
+
export { registerWordCloudRendering } from './register-word-cloud-rendering';
|
|
11
|
+
export { WordCloudMaskImageOptions, WordCloudResourceConfig } from './resources/word-cloud-resource-config';
|
|
12
|
+
export type { INormalizedWordCloudDatum, IResolvedWordCloudSpec, IWordCloudBounds, IWordCloudChartSpec, IWordCloudDataSource, IWordCloudEChartsMaskSource, IWordCloudEChartsSeriesDataItem, IWordCloudEChartsSeriesOption, IWordCloudEncodedWord, IWordCloudEncoding, IWordCloudFieldMapping, IWordCloudLayoutMask, IWordCloudLayoutOptions, IWordCloudLayoutResult, IWordCloudMaskGrid, IWordCloudMaskShapeSpec, IWordCloudPlacedWord, IWordCloudProtocolSpec, IWordCloudSegmentationRegion, IWordCloudSegmentationResult, IWordCloudTextMarkAttrs, IWordCloudTextMarkSpec, IWordCloudTextMeasurer, IWordCloudTextSprite, WordCloudFontSizeRange, WordCloudShape, } from './types';
|
|
13
|
+
export { DEFAULT_WORD_CLOUD_SHAPE, normalizeWordCloudShape, SUPPORTED_WORD_CLOUD_SHAPES, } from './types';
|
|
14
|
+
export { WordCloudExtension } from './word-cloud-extension';
|
|
15
|
+
export { DEFAULT_WORD_CLOUD_RENDER_CONFIG, resolveWordCloudRenderConfig, STATIC_CHART_WORD_CLOUD_RENDER_CONFIG, } from './word-cloud-render-config';
|
|
16
|
+
export type { IResolvedWordCloudRenderConfig, IWordCloudRenderConfig, } from './word-cloud-render-config';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { IWordCloudEChartsApi } from './echarts-api';
|
|
2
2
|
export type PerformWordCloudSeriesLayout = (seriesModel: unknown, ecModel: unknown, api: unknown) => void;
|
|
3
|
-
export declare function registerWordCloudLayout(echartsInstance:
|
|
3
|
+
export declare function registerWordCloudLayout(echartsInstance: IWordCloudEChartsApi, performSeriesLayout: PerformWordCloudSeriesLayout): void;
|