@univerjs-pro/engine-chart 1.4.0 → 1.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -15
- 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/axes.d.ts +3 -2
- package/lib/types/chart-3d/adapters/types.d.ts +2 -0
- package/lib/types/chart-3d/core/scene.d.ts +11 -1
- package/lib/types/chart-3d/core/types.d.ts +2 -0
- package/lib/types/chart-builder/chart-builder.d.ts +2 -1
- package/lib/types/chart-builder/chart-types.d.ts +5 -1
- package/lib/types/chart-builder/configuration/chart-config-group.d.ts +1 -0
- package/lib/types/chart-builder/configuration/error-bars.d.ts +4 -0
- package/lib/types/chart-builder/conversion/chart-config-converter.d.ts +3 -1
- package/lib/types/chart-builder/conversion/chart-model-fields.d.ts +1 -0
- package/lib/types/chart-builder/conversion/chart-source-fields.d.ts +4 -0
- package/lib/types/chart-builder/conversion/chart-type-converter.d.ts +2 -1
- package/lib/types/enum.d.ts +4 -0
- package/lib/types/facade/chart-builder-type-map.d.ts +2 -0
- package/lib/types/facade/f-cartesian-chart-builder.d.ts +41 -1
- package/lib/types/facade/f-chart.d.ts +40 -2
- package/lib/types/index.d.ts +3 -1
- package/lib/types/models/chart-data/pie-composite/pie-composite-spec.d.ts +0 -2
- package/lib/types/models/chart-render/converter/calendar-date-axis.d.ts +5 -7
- package/lib/types/models/chart-render/converter/calendar-date-point.d.ts +4 -0
- package/lib/types/models/chart-render/converter/render-spec-operators/axis-title.operator.d.ts +2 -1
- package/lib/types/models/chart-render/converter/render-spec-operators/chart-axes.operator.d.ts +2 -1
- package/lib/types/models/chart-render/converter/render-spec-operators/grid-operator.d.ts +2 -1
- package/lib/types/models/chart-render/converter/render-spec-operators/legend-size.d.ts +1 -1
- package/lib/types/models/chart-render/converter/render-spec-operators/legend-style.operator.d.ts +4 -1
- package/lib/types/models/chart-render/converter/render-spec-operators/series-style-operator/series-style-operator.d.ts +1 -0
- package/lib/types/models/chart-render/converter/render-spec-operators/title-style.operator.d.ts +2 -1
- package/lib/types/models/chart-render/converter/render-spec-operators/tool-tip-operator.d.ts +0 -1
- package/lib/types/models/chart-render/converter/render-spec-operators/watermark.operator.d.ts +5 -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 +1 -0
- package/lib/types/models/chart-render/echart-render-model/echart-render-model.d.ts +3 -3
- package/lib/types/models/chart-render/style/chart-runtime-style.d.ts +3 -1
- package/lib/types/models/common/adaptive-size/chart-runtime-adaptive-size.d.ts +1 -0
- package/lib/types/models/common/chart-field-role.d.ts +1 -2
- package/lib/types/models/common/constants/default-chart-style.d.ts +5 -0
- package/lib/types/types.d.ts +21 -8
- package/lib/types/validation/validate-candlestick.d.ts +4 -0
- package/lib/types/validation/validate-error-bars.d.ts +17 -0
- package/lib/types/validation/validate-gradient.d.ts +15 -0
- package/lib/types/validation/validate-pie-composite.d.ts +9 -0
- package/lib/types/validation/validate.d.ts +12 -0
- package/lib/types/wordcloud/word-cloud-extension.d.ts +1 -1
- 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 +7 -7
package/lib/types/models/chart-render/converter/render-spec-operators/title-style.operator.d.ts
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
import type { EChartRenderSpecOperator } from '../../../../types';
|
|
1
|
+
import type { ChartRuntimeStyle, EChartRenderSpecOperator, EChartSpec } from '../../../../types';
|
|
2
2
|
export declare const chartTitleStyleOperator: EChartRenderSpecOperator;
|
|
3
|
+
export declare function applyChartTitleStyle(spec: EChartSpec, style: ChartRuntimeStyle): void;
|
package/lib/types/models/chart-render/converter/render-spec-operators/tool-tip-operator.d.ts
CHANGED
|
@@ -13,7 +13,6 @@ interface ITooltipFormatterDataContext {
|
|
|
13
13
|
invalidValueType: InvalidValueType;
|
|
14
14
|
localeText: IChartLocaleTexts;
|
|
15
15
|
isDateAxis: boolean | undefined;
|
|
16
|
-
isCalendarDateAxis: boolean;
|
|
17
16
|
allSeriesStyle: ChartStyle['allSeriesStyle'];
|
|
18
17
|
seriesStyleMap: ChartStyle['seriesStyleMap'];
|
|
19
18
|
runtimeThemeColors: string[];
|
package/lib/types/models/chart-render/converter/render-spec-operators/watermark.operator.d.ts
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
|
+
import type { UniverRenderingContext } from '@univerjs/engine-render';
|
|
1
2
|
import type { GraphicComponentOption } from 'echarts';
|
|
2
3
|
import type { EChartRenderSpecOperator } from '../../../../types';
|
|
3
4
|
export declare const chartWaterMarkerOperator: EChartRenderSpecOperator;
|
|
5
|
+
/** License branding only; user-configured document watermarks use a separate renderer. */
|
|
6
|
+
export declare function createChartOutputWatermarkGraphics(width: number | undefined, height: number | undefined, getRenderColor: (color: string) => string): GraphicComponentOption[];
|
|
4
7
|
export declare function createChartWatermarkGraphics(width?: number, height?: number): GraphicComponentOption[];
|
|
8
|
+
/** Paint UI-only chart branding over a clean snapshot, never into its cached pixels. */
|
|
9
|
+
export declare function renderChartLicenseWatermark(ctx: UniverRenderingContext, width: number, height: number): void;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { IDisposable } from '@univerjs/core';
|
|
2
|
+
import { Disposable } from '@univerjs/core';
|
|
2
3
|
import type { ChartElementEventHandler, ChartElementEventType, ChartRenderMode, ChartRuntimeStyle, EChartSpec, IChartHost, IChartHostRect, IChartHostStyle, IChartInstance, IChartRenderInput, IChartRenderInstance, IChartRenderInstanceCreateContext } from '../../../types';
|
|
3
4
|
import type { IChartRuntimeAdaptiveSize } from '../../common/adaptive-size/chart-runtime-adaptive-size';
|
|
4
5
|
import type { EChartRenderEngine } from './echart-render-engine';
|
|
5
6
|
import type { EChartRenderModel } from './echart-render-model';
|
|
6
|
-
import { Disposable } from '@univerjs/core';
|
|
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
CHANGED
|
@@ -17,6 +17,7 @@ export declare class ChartDimensionRenderInstance extends Disposable implements
|
|
|
17
17
|
constructor(mode: ChartRenderMode, _model: EChartRenderModel, _context?: IChartRenderInstanceCreateContext | undefined, _addWatermark?: () => boolean);
|
|
18
18
|
bind(host: IChartHost): void;
|
|
19
19
|
private _clearInstance;
|
|
20
|
+
private _selectInstanceFactory;
|
|
20
21
|
private _getInstance;
|
|
21
22
|
render(input: IChartRenderInput): Promise<void>;
|
|
22
23
|
renderTransition(previous: IChartRenderInput, input: IChartRenderInput, options: IChartRenderTransitionOptions): Promise<void>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
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
2
|
import { Disposable } from '@univerjs/core';
|
|
3
|
+
import type { ChartRenderEvent, ChartRenderMode, EChartSpec, IChartConfig, IChartHostRect, IChartInstance, IChartRenderInstance, IChartRenderInstanceCreateContext, IChartRenderModel, IChartRenderModelImageExportInput, IChartRenderModelImageExportOptions, IChartRenderModelImageExportResult, IChartRenderSpecContext, IChartRenderSpecConverter } from '../../../types';
|
|
4
4
|
import { EChartRenderEngine } from './echart-render-engine';
|
|
5
5
|
export interface IChartInstanceFactory {
|
|
6
6
|
canRender(config: IChartConfig): boolean;
|
|
@@ -32,8 +32,8 @@ export declare class EChartRenderModel extends Disposable implements IChartRende
|
|
|
32
32
|
private _addSpecOperators;
|
|
33
33
|
createChartInstance(): IChartInstance<EChartSpec>;
|
|
34
34
|
createChartInstance(mode: ChartRenderMode, context?: IChartRenderInstanceCreateContext<EChartSpec>): IChartRenderInstance;
|
|
35
|
-
toSpec(
|
|
35
|
+
toSpec(context: IChartRenderSpecContext): import("echarts").EChartsOption;
|
|
36
36
|
private _getShowEmpty;
|
|
37
|
-
stylizeSpec(spec: EChartSpec,
|
|
37
|
+
stylizeSpec(spec: EChartSpec, context: IChartRenderSpecContext, rect: IChartHostRect, chartInstance?: IChartInstance<EChartSpec>): EChartSpec;
|
|
38
38
|
exportImage(input: IChartRenderModelImageExportInput, options?: IChartRenderModelImageExportOptions): Promise<IChartRenderModelImageExportResult>;
|
|
39
39
|
}
|
|
@@ -15,5 +15,7 @@ export declare function resolveChartFontFamily(style: Pick<ChartStyle, 'fontFami
|
|
|
15
15
|
export declare function resolveChartRuntimeStyle(style: ChartRuntimeStyle, chartType?: ChartTypeBits): ChartRuntimeStyle;
|
|
16
16
|
export declare function resolveChartStyleBackgroundColor(style: Pick<ChartStyle, 'backgroundColor'>): string;
|
|
17
17
|
export declare function scaleChartRuntimePx(style: ChartRuntimeStyle, size: number): number;
|
|
18
|
-
export declare function scaleChartRuntimeFontSize(style:
|
|
18
|
+
export declare function scaleChartRuntimeFontSize(style: {
|
|
19
|
+
runtime: Pick<ChartRuntimeStyle['runtime'], 'adaptiveSize'>;
|
|
20
|
+
}, fontSize: number): number;
|
|
19
21
|
export declare function scaleChartRuntimeLineWidth(style: ChartRuntimeStyle, lineWidth: number): number;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export interface IChartRuntimeAdaptiveSize {
|
|
2
2
|
scalePx(size: number): number;
|
|
3
|
+
scaleFontSize(size: number): number;
|
|
3
4
|
scaleOptions(baseOptions: readonly number[]): number[];
|
|
4
5
|
}
|
|
5
6
|
export declare function getChartRuntimeAdaptiveSize(chartWidth: number | null | undefined): IChartRuntimeAdaptiveSize;
|
|
@@ -73,7 +73,6 @@ export type CandlestickFieldRoleResult = {
|
|
|
73
73
|
* the role mapping, and point values do not change it.
|
|
74
74
|
*/
|
|
75
75
|
export declare function parseCandlestickFieldRoles(categoryIndexes: readonly number[], seriesIndexes: readonly number[]): CandlestickFieldRoleResult;
|
|
76
|
-
/** Generic pending patches may be partial, but explicitly invalid Open must never be erased. */
|
|
77
|
-
export declare function assertCandlestickOpenIndex(mapping: DeepNullish<IChartCandlestickMappingSpec> | null | undefined): void;
|
|
78
76
|
/** Mapping patches must be checked before generic patch compaction can erase invalid Open. */
|
|
79
77
|
export declare function parseCandlestickMappingIndexes(mapping: DeepNullish<IChartCandlestickMappingSpec>): number[];
|
|
78
|
+
export declare function isCandlestickFieldIndex(value: unknown): value is number;
|
package/lib/types/types.d.ts
CHANGED
|
@@ -569,6 +569,8 @@ export interface IChartRuntimeContext {
|
|
|
569
569
|
wordCloudRenderConfig?: IWordCloudRenderConfig;
|
|
570
570
|
/** Runtime-only host policy for rendering a chart watermark. */
|
|
571
571
|
addWatermark?: boolean;
|
|
572
|
+
/** Runtime-only host policy; false keeps an empty Chart Area without diagnostic artwork. */
|
|
573
|
+
showEmptyState?: boolean;
|
|
572
574
|
/** Runtime-only extra inset reserved by host adapters around chart content. */
|
|
573
575
|
layoutInset?: number;
|
|
574
576
|
/** Runtime-only opt-in for category hierarchy hit targets and expand/collapse controls. */
|
|
@@ -591,6 +593,13 @@ export interface IChartRuntimeContext {
|
|
|
591
593
|
localeTexts: IChartLocaleTexts;
|
|
592
594
|
updateAdaptiveSizeFromDomRender?(chartWidth: number): void;
|
|
593
595
|
}
|
|
596
|
+
export interface ICalendarDateAxis {
|
|
597
|
+
data: string[];
|
|
598
|
+
key: (timestamp: number) => string;
|
|
599
|
+
positions: number[];
|
|
600
|
+
position: (timestamp: number) => number;
|
|
601
|
+
timestamp: (position: number) => number;
|
|
602
|
+
}
|
|
594
603
|
export interface IChartLabelPattern {
|
|
595
604
|
type: 'pattern';
|
|
596
605
|
/** OOXML ST_PresetPatternVal token. */
|
|
@@ -1055,10 +1064,10 @@ export interface IWaterfallLegendData {
|
|
|
1055
1064
|
}
|
|
1056
1065
|
export interface IChartRenderSpecConverter<ChartRenderSpec = Record<string, any>> {
|
|
1057
1066
|
canConvert: (config: IChartConfig) => boolean;
|
|
1058
|
-
convert: (
|
|
1067
|
+
convert: (context: IChartRenderSpecContext) => ChartRenderSpec;
|
|
1059
1068
|
}
|
|
1060
1069
|
export type ChartConfigInterceptor = (config: IChartConfig) => IChartConfig;
|
|
1061
|
-
export type RenderSpecOperator<ChartRenderSpec> = (spec: ChartRenderSpec,
|
|
1070
|
+
export type RenderSpecOperator<ChartRenderSpec> = (spec: ChartRenderSpec, context: IChartRenderSpecContext, instance: IChartInstance) => void;
|
|
1062
1071
|
export declare enum ChartRenderMode {
|
|
1063
1072
|
Image = "image",
|
|
1064
1073
|
Dom = "dom"
|
|
@@ -1154,10 +1163,14 @@ export interface IChartRenderInstanceCreateContext<Spec = Record<string, any>> {
|
|
|
1154
1163
|
}) => string | undefined;
|
|
1155
1164
|
prepareSpec?: (input: IChartRenderInstanceSpecInput<Spec>) => Spec;
|
|
1156
1165
|
}
|
|
1157
|
-
export interface
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1166
|
+
export interface IChartRenderSpecContext {
|
|
1167
|
+
style: ChartRuntimeStyle;
|
|
1168
|
+
config: IChartConfig;
|
|
1169
|
+
/** Render-scoped values populated by conversion and reused by later render phases. */
|
|
1170
|
+
derived: {
|
|
1171
|
+
calendarDateAxis?: ICalendarDateAxis;
|
|
1172
|
+
calendarDateCategoryNames?: ReadonlyMap<string, readonly string[]>;
|
|
1173
|
+
};
|
|
1161
1174
|
}
|
|
1162
1175
|
/** Renderer lifecycle notifications; these are runtime events, not persisted commands. */
|
|
1163
1176
|
export type ChartRenderEvent = {
|
|
@@ -1167,8 +1180,8 @@ export type ChartRenderEvent = {
|
|
|
1167
1180
|
type: 'dispose';
|
|
1168
1181
|
};
|
|
1169
1182
|
export interface IChartRenderModel<Spec extends Record<string, any> = Record<string, any>> extends IDisposable {
|
|
1170
|
-
toSpec(
|
|
1171
|
-
stylizeSpec(spec: Spec,
|
|
1183
|
+
toSpec(context: IChartRenderSpecContext): Spec;
|
|
1184
|
+
stylizeSpec(spec: Spec, context: IChartRenderSpecContext, rect: IChartHostRect, chartInstance?: IChartInstance<Spec>): Spec;
|
|
1172
1185
|
exportImage(input: IChartRenderModelImageExportInput, options?: IChartRenderModelImageExportOptions): Promise<IChartRenderModelImageExportResult>;
|
|
1173
1186
|
updateWatermark(addWatermark: boolean): void;
|
|
1174
1187
|
createChartInstance(): IChartInstance<Spec>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { DeepNullish, IChartCandlestickMappingSpec } from '../types';
|
|
2
|
+
import type { Validate } from './validate';
|
|
3
|
+
/** Preserve the original pre-compaction Open check; complete mapping parsing has its own owner. */
|
|
4
|
+
export declare const validateCandlestickOpenIndex: Validate<DeepNullish<IChartCandlestickMappingSpec> | null | undefined>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { ChartTypeBits } from '../enum';
|
|
2
|
+
import type { IChartErrorBars, IUniverDataSet } from '../types';
|
|
3
|
+
import type { Validate } from './validate';
|
|
4
|
+
interface IErrorBarsValidation {
|
|
5
|
+
value: unknown;
|
|
6
|
+
previous?: readonly Partial<IChartErrorBars>[];
|
|
7
|
+
}
|
|
8
|
+
interface IErrorBarBindingsValidation {
|
|
9
|
+
errorBars: readonly IChartErrorBars[];
|
|
10
|
+
chartType?: ChartTypeBits;
|
|
11
|
+
seriesIndexes?: readonly number[];
|
|
12
|
+
previous?: readonly Partial<IChartErrorBars>[];
|
|
13
|
+
targetDataSet?: IUniverDataSet;
|
|
14
|
+
}
|
|
15
|
+
export declare const validateChartErrorBars: Validate<IErrorBarsValidation>;
|
|
16
|
+
export declare const validateChartErrorBarBindings: Validate<IErrorBarBindingsValidation>;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ChartPendingConfig } from '../chart-builder/chart-types';
|
|
2
|
+
import type { ChartStyle, IChartDataSeries } from '../types';
|
|
3
|
+
import type { Validate } from './validate';
|
|
4
|
+
import { ChartTypeBits } from '../enum';
|
|
5
|
+
export declare const EXPLICIT_GRADIENT_UNSUPPORTED_MESSAGE = "Explicit chart gradients are not supported for this chart mark.";
|
|
6
|
+
export declare function isGradientColor(value: unknown): boolean;
|
|
7
|
+
export declare function supportsSeriesGradient(chartType: ChartTypeBits | undefined): boolean;
|
|
8
|
+
export declare function supportsDataPointGradient(chartType: ChartTypeBits | undefined, seriesType: ChartTypeBits | undefined): boolean;
|
|
9
|
+
export declare function getPersistedSeriesType(seriesId: string, seriesStyle: NonNullable<ChartStyle['seriesStyleMap']>[string] | undefined, chartType: ChartTypeBits | undefined, series: IChartDataSeries[] | undefined): ChartTypeBits | undefined;
|
|
10
|
+
export declare function hasUnsupportedPersistedGradient(style: ChartStyle, chartType: ChartTypeBits | undefined, series: IChartDataSeries[] | undefined): boolean;
|
|
11
|
+
export declare const validateExplicitGradientCapabilities: Validate<{
|
|
12
|
+
config: ChartPendingConfig;
|
|
13
|
+
chartType?: ChartTypeBits;
|
|
14
|
+
series?: IChartDataSeries[];
|
|
15
|
+
}>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { IChartPieCompositeSpec } from '../chart-builder/chart-types';
|
|
2
|
+
import type { DeepNullish } from '../types';
|
|
3
|
+
import type { Validate } from './validate';
|
|
4
|
+
interface IPieCompositeValidation {
|
|
5
|
+
current?: DeepNullish<IChartPieCompositeSpec> | null;
|
|
6
|
+
patch?: DeepNullish<IChartPieCompositeSpec> | null;
|
|
7
|
+
}
|
|
8
|
+
export declare const validatePieComposite: Validate<IPieCompositeValidation>;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface IChartValidationError extends Error {
|
|
2
|
+
readonly rule: string;
|
|
3
|
+
readonly path: readonly (string | number)[];
|
|
4
|
+
}
|
|
5
|
+
export type Validate<T> = (value: T) => IChartValidationError | undefined;
|
|
6
|
+
export declare function validationError(rule: string, path: readonly (string | number)[], error: Error): IChartValidationError;
|
|
7
|
+
export declare function prependValidationPath(error: IChartValidationError | undefined, ...path: (string | number)[]): IChartValidationError | undefined;
|
|
8
|
+
export declare function combineValidations<T>(...validations: Validate<T>[]): Validate<T>;
|
|
9
|
+
export declare function validateFields<T extends object>(schema: {
|
|
10
|
+
[K in keyof T]?: Validate<T[K]>;
|
|
11
|
+
}): Validate<T>;
|
|
12
|
+
export declare function validateItems<T>(validate: Validate<T>): Validate<readonly T[]>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { Disposable } from '@univerjs/core';
|
|
1
2
|
import type { IChartRenderExtension } from '../models/chart-render/echart-render-model/echart-render-model';
|
|
2
3
|
import type { ChartRenderEvent, EChartSpec, IChartRenderSpecConverter } from '../types';
|
|
3
4
|
import type { IWordCloudRenderConfig } from './word-cloud-render-config';
|
|
4
|
-
import { Disposable } from '@univerjs/core';
|
|
5
5
|
interface IWordCloudExtensionOptions {
|
|
6
6
|
renderConfig?: IWordCloudRenderConfig;
|
|
7
7
|
}
|