@univerjs-pro/engine-chart 0.24.0 → 0.25.0-insiders.20260608-e4336f7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (98) hide show
  1. package/lib/cjs/index.js +1 -1
  2. package/lib/es/index.js +1 -1
  3. package/lib/index.js +1 -1
  4. package/lib/types/index.d.ts +20 -17
  5. package/lib/types/{model → models}/chart-data-operators/build-chart-data.d.ts +2 -2
  6. package/lib/types/models/chart-locale-texts.d.ts +22 -0
  7. package/lib/types/{model → models}/chart-model.d.ts +69 -263
  8. package/lib/types/models/chart-runtime-axes.d.ts +37 -0
  9. package/lib/types/models/chart-runtime-style.d.ts +12 -0
  10. package/lib/types/{model → models}/constants/default-chart-style.d.ts +2 -0
  11. package/lib/types/{model → models}/mode-converter/mode-converter.d.ts +2 -0
  12. package/lib/types/{model → models}/mode-converter/render-spec-operators/index.d.ts +1 -0
  13. package/lib/types/models/mode-converter/render-spec-operators/rtl-render-spec.operator.d.ts +2 -0
  14. package/lib/types/models/mode-converter/render-spec-operators/tool-tip-operator.d.ts +37 -0
  15. package/lib/types/models/mode-converter/render-spec-operators/tool-tip-renderer.d.ts +15 -0
  16. package/lib/types/types.d.ts +12 -3
  17. package/lib/types/util.d.ts +1 -0
  18. package/lib/umd/index.js +1 -1
  19. package/package.json +5 -5
  20. package/lib/types/model/mode-converter/render-spec-operators/tool-tip-operator.d.ts +0 -3
  21. /package/lib/types/{model → models}/chart-data-operators/index.d.ts +0 -0
  22. /package/lib/types/{model → models}/chart-data-operators/operators.d.ts +0 -0
  23. /package/lib/types/{model → models}/chart-theme.service.d.ts +0 -0
  24. /package/lib/types/{model → models}/constants/build-in-theme/default.d.ts +0 -0
  25. /package/lib/types/{model → models}/constants/build-in-theme/index.d.ts +0 -0
  26. /package/lib/types/{model → models}/constants/build-in-theme/theme-util.d.ts +0 -0
  27. /package/lib/types/{model → models}/constants/build-in-theme/types.d.ts +0 -0
  28. /package/lib/types/{model → models}/constants/build-in-theme/univer-gradient1.d.ts +0 -0
  29. /package/lib/types/{model → models}/constants/build-in-theme/univer-gradient2.d.ts +0 -0
  30. /package/lib/types/{model → models}/constants/build-in-theme/univer-gradient3.d.ts +0 -0
  31. /package/lib/types/{model → models}/constants/build-in-theme/univer-gradient4.d.ts +0 -0
  32. /package/lib/types/{model → models}/constants/build-in-theme/univer-gradient5.d.ts +0 -0
  33. /package/lib/types/{model → models}/constants/build-in-theme/univer-gradient6.d.ts +0 -0
  34. /package/lib/types/{model → models}/constants/build-in-theme/univer1.d.ts +0 -0
  35. /package/lib/types/{model → models}/constants/build-in-theme/univer2.d.ts +0 -0
  36. /package/lib/types/{model → models}/constants/build-in-theme/univer3.d.ts +0 -0
  37. /package/lib/types/{model → models}/constants/build-in-theme/univer4.d.ts +0 -0
  38. /package/lib/types/{model → models}/constants/build-in-theme/univer5.d.ts +0 -0
  39. /package/lib/types/{model → models}/constants/build-in-theme/univer6.d.ts +0 -0
  40. /package/lib/types/{model → models}/constants/default.d.ts +0 -0
  41. /package/lib/types/{model → models}/data-context-transformers/bar-data-context-transformer.d.ts +0 -0
  42. /package/lib/types/{model → models}/data-context-transformers/box-plot-data-context-transformer.d.ts +0 -0
  43. /package/lib/types/{model → models}/data-context-transformers/line-like-context-transformer.d.ts +0 -0
  44. /package/lib/types/{model → models}/data-context-transformers/pareto-data-context-transformer.d.ts +0 -0
  45. /package/lib/types/{model → models}/data-context-transformers/percent-data-context-transformer.d.ts +0 -0
  46. /package/lib/types/{model → models}/data-context-transformers/pie-data-context-transformer.d.ts +0 -0
  47. /package/lib/types/{model → models}/data-context-transformers/word-cloud-data-context-transform.d.ts +0 -0
  48. /package/lib/types/{model → models}/echart-render-model.d.ts +0 -0
  49. /package/lib/types/{model → models}/echart-to-chart-model-init.d.ts +0 -0
  50. /package/lib/types/{model → models}/mode-converter/converters/boxplot-chart-converter.d.ts +0 -0
  51. /package/lib/types/{model → models}/mode-converter/converters/bubble-chart-converter.d.ts +0 -0
  52. /package/lib/types/{model → models}/mode-converter/converters/combination-chart-converter.d.ts +0 -0
  53. /package/lib/types/{model → models}/mode-converter/converters/constants.d.ts +0 -0
  54. /package/lib/types/{model → models}/mode-converter/converters/funnel-chart-converter.d.ts +0 -0
  55. /package/lib/types/{model → models}/mode-converter/converters/heatmap-chart-convert.d.ts +0 -0
  56. /package/lib/types/{model → models}/mode-converter/converters/pareto-chart-converter.d.ts +0 -0
  57. /package/lib/types/{model → models}/mode-converter/converters/pie-chart-converter.d.ts +0 -0
  58. /package/lib/types/{model → models}/mode-converter/converters/radar-chart-converter.d.ts +0 -0
  59. /package/lib/types/{model → models}/mode-converter/converters/relation-chart-converter.d.ts +0 -0
  60. /package/lib/types/{model → models}/mode-converter/converters/sankey-chart-converter.d.ts +0 -0
  61. /package/lib/types/{model → models}/mode-converter/converters/scatter-chart-converter.d.ts +0 -0
  62. /package/lib/types/{model → models}/mode-converter/converters/tools.d.ts +0 -0
  63. /package/lib/types/{model → models}/mode-converter/converters/waterfall-chart-converter.d.ts +0 -0
  64. /package/lib/types/{model → models}/mode-converter/converters/word-cloud-converter.d.ts +0 -0
  65. /package/lib/types/{model → models}/mode-converter/render-spec-operators/axis-title.operator.d.ts +0 -0
  66. /package/lib/types/{model → models}/mode-converter/render-spec-operators/bubble-style.operator.d.ts +0 -0
  67. /package/lib/types/{model → models}/mode-converter/render-spec-operators/chart-axes.operator.d.ts +0 -0
  68. /package/lib/types/{model → models}/mode-converter/render-spec-operators/chart-box-style.operator.d.ts +0 -0
  69. /package/lib/types/{model → models}/mode-converter/render-spec-operators/empty-style-operator.d.ts +0 -0
  70. /package/lib/types/{model → models}/mode-converter/render-spec-operators/font-size.operator.d.ts +0 -0
  71. /package/lib/types/{model → models}/mode-converter/render-spec-operators/grid-operator.d.ts +0 -0
  72. /package/lib/types/{model → models}/mode-converter/render-spec-operators/heatmap-chart-operator.d.ts +0 -0
  73. /package/lib/types/{model → models}/mode-converter/render-spec-operators/hover-mark-style.operator.d.ts +0 -0
  74. /package/lib/types/{model → models}/mode-converter/render-spec-operators/invalid-value-style.operator.d.ts +0 -0
  75. /package/lib/types/{model → models}/mode-converter/render-spec-operators/legend-style.operator.d.ts +0 -0
  76. /package/lib/types/{model → models}/mode-converter/render-spec-operators/line-like-style.operator.d.ts +0 -0
  77. /package/lib/types/{model → models}/mode-converter/render-spec-operators/operator-types.d.ts +0 -0
  78. /package/lib/types/{model → models}/mode-converter/render-spec-operators/pie-style.operator.d.ts +0 -0
  79. /package/lib/types/{model → models}/mode-converter/render-spec-operators/radar-style.operator.d.ts +0 -0
  80. /package/lib/types/{model → models}/mode-converter/render-spec-operators/relation-chart-operator/relation-chart-operator.d.ts +0 -0
  81. /package/lib/types/{model → models}/mode-converter/render-spec-operators/relation-chart-operator/relation-force-directed-layout.d.ts +0 -0
  82. /package/lib/types/{model → models}/mode-converter/render-spec-operators/sankey-chart-operator.d.ts +0 -0
  83. /package/lib/types/{model → models}/mode-converter/render-spec-operators/scatter-style.operator.d.ts +0 -0
  84. /package/lib/types/{model → models}/mode-converter/render-spec-operators/series-style-operator/pareto-series-style.handler.d.ts +0 -0
  85. /package/lib/types/{model → models}/mode-converter/render-spec-operators/series-style-operator/series-chart-style.handler.d.ts +0 -0
  86. /package/lib/types/{model → models}/mode-converter/render-spec-operators/series-style-operator/series-data-label.handler.d.ts +0 -0
  87. /package/lib/types/{model → models}/mode-converter/render-spec-operators/series-style-operator/series-style-operator.d.ts +0 -0
  88. /package/lib/types/{model → models}/mode-converter/render-spec-operators/series-style-operator/waterfall-series-style-operator.d.ts +0 -0
  89. /package/lib/types/{model → models}/mode-converter/render-spec-operators/stack.operator.d.ts +0 -0
  90. /package/lib/types/{model → models}/mode-converter/render-spec-operators/theme.operator.d.ts +0 -0
  91. /package/lib/types/{model → models}/mode-converter/render-spec-operators/title-style.operator.d.ts +0 -0
  92. /package/lib/types/{model → models}/mode-converter/render-spec-operators/tools.d.ts +0 -0
  93. /package/lib/types/{model → models}/mode-converter/render-spec-operators/trend-line/trend-line.operator.d.ts +0 -0
  94. /package/lib/types/{model → models}/mode-converter/render-spec-operators/trend-line/trendline-util.d.ts +0 -0
  95. /package/lib/types/{model → models}/mode-converter/render-spec-operators/visual-map-operator.d.ts +0 -0
  96. /package/lib/types/{model → models}/mode-converter/render-spec-operators/watermark.operator.d.ts +0 -0
  97. /package/lib/types/{model → models}/spec-converter/spec-converter.d.ts +0 -0
  98. /package/lib/types/{model → models}/word-cloud-musk-image.service.d.ts +0 -0
@@ -1,24 +1,27 @@
1
1
  export { AreaLineStyle, AxisAlignEnum, AxisValueType, CategoryType, ChartAttributeBits, ChartBorderDashType, ChartSourceDataTypeEnum, ChartTrendlineType, ChartTypeBits, DataOrientation, InvalidValueType, IRuntimeAxisPosition, IRuntimeAxisPriority, LabelAlignEnum, LabelContentType, LegendPositionEnum, LinePointShape, PieLabelPosition, RadarShape, RelationChartLayoutEnum, SelectModeEnum, SeriesLabelPosition, StackType, TextAlign, TextVerticalAlign, TitlePositionEnum, WaterfallSeriesTypeEnum, WaterfallStackTypeEnum, WordCloudShapeEnum, } from './enum';
2
- export { buildChartData } from './model/chart-data-operators/build-chart-data';
3
- export { findCategoryIndexes, findCategoryOperator, findHeaderOperator, findSeriesOperator, pieSeriesFilterOperator } from './model/chart-data-operators/operators';
4
- export { ChartModel } from './model/chart-model';
5
- export { CHART_DEBOUNCE_TIME } from './model/chart-model';
6
- export { ChartThemeService, registerChartThemeService } from './model/chart-theme.service';
7
- export { getThemeAxesByType } from './model/constants/build-in-theme';
8
- export { themeDefault, UniverTheme1, UniverTheme2, UniverTheme3, UniverTheme4, UniverTheme5, UniverTheme6, UniverThemeGradient1, UniverThemeGradient2, UniverThemeGradient3, UniverThemeGradient4, UniverThemeGradient5, UniverThemeGradient6, } from './model/constants/build-in-theme';
9
- export type { IEchartTheme } from './model/constants/build-in-theme';
10
- export { getThemeProps } from './model/constants/build-in-theme';
11
- export { defaultChartHeight, defaultChartWidth, EChartRenderEngineName } from './model/constants/default';
12
- export { defaultChartConfig, themeColors } from './model/constants/default-chart-style';
13
- export { EChartRenderModel } from './model/echart-render-model';
14
- export { echartToChartModelInit, isChartModelInit } from './model/echart-to-chart-model-init';
15
- export type { IChartModelInitParams } from './model/mode-converter/mode-converter';
16
- export { convertModelFromInitData, convertModelToSpec, generateChartModelContext } from './model/mode-converter/mode-converter';
17
- export { registerWordCloudChartMakImageService, WordCloudMuskImageService } from './model/word-cloud-musk-image.service';
2
+ export { buildChartData } from './models/chart-data-operators/build-chart-data';
3
+ export { findCategoryIndexes, findCategoryOperator, findHeaderOperator, findSeriesOperator, pieSeriesFilterOperator, } from './models/chart-data-operators/operators';
4
+ export type { IChartLocaleTexts } from './models/chart-locale-texts';
5
+ export { getDefaultChartLocaleTexts, replaceLocaleParams } from './models/chart-locale-texts';
6
+ export { ChartModel } from './models/chart-model';
7
+ export { CHART_DEBOUNCE_TIME } from './models/chart-model';
8
+ export { resolveChartRuntimeStyle } from './models/chart-runtime-style';
9
+ export { ChartThemeService, registerChartThemeService } from './models/chart-theme.service';
10
+ export { getThemeAxesByType } from './models/constants/build-in-theme';
11
+ export { themeDefault, UniverTheme1, UniverTheme2, UniverTheme3, UniverTheme4, UniverTheme5, UniverTheme6, UniverThemeGradient1, UniverThemeGradient2, UniverThemeGradient3, UniverThemeGradient4, UniverThemeGradient5, UniverThemeGradient6, } from './models/constants/build-in-theme';
12
+ export type { IEchartTheme } from './models/constants/build-in-theme';
13
+ export { getThemeProps } from './models/constants/build-in-theme';
14
+ export { defaultChartHeight, defaultChartWidth, EChartRenderEngineName } from './models/constants/default';
15
+ export { defaultChartConfig, RTLChartStyle, themeColors } from './models/constants/default-chart-style';
16
+ export { EChartRenderModel } from './models/echart-render-model';
17
+ export { echartToChartModelInit, isChartModelInit } from './models/echart-to-chart-model-init';
18
+ export type { IChartModelInitParams } from './models/mode-converter/mode-converter';
19
+ export { convertModelFromInitData, convertModelToSpec, generateChartModelContext } from './models/mode-converter/mode-converter';
20
+ export { registerWordCloudChartMakImageService, WordCloudMuskImageService } from './models/word-cloud-musk-image.service';
18
21
  export { ChartDataSource } from './source/chart-source';
19
22
  export { StaticChartSource } from './source/static-chart-source';
20
23
  export type { DimensionDefinitionLoose, IChartDataSource, IDimensionDefinition, IUniverDataSet, OptionDataValue, } from './types';
21
- export type { ChartDataSourceValue, ChartDataSourceValues, ChartStyle, DeepPartial, IAllSeriesStyle, IAxisOptions, IChartConfig, IChartContext, IChartData, IChartDataAggregation, IChartDataCategory, IChartDataSeries, IChartHostRect, IChartInstance, IChartRenderModel, IChartSnapshot, IChartStyle, IGridLineStyle, ILabelStyle, ILegendStyle, IPieLabelStyle, IPointStyle, IRelationForceOptions, IRuntimeAxis, ISeriesLabelStyle, ISeriesStyle, ITrendLine, RightYAxisOptions, } from './types';
24
+ export type { ChartDataSourceValue, ChartDataSourceValues, ChartDirection, ChartStyle, DeepPartial, IAllSeriesStyle, IAxisOptions, IChartConfig, IChartContext, IChartData, IChartDataAggregation, IChartDataCategory, IChartDataSeries, IChartHostRect, IChartInstance, IChartRenderModel, IChartSnapshot, IChartStyle, IGridLineStyle, ILabelStyle, ILegendStyle, IPieLabelStyle, IPointStyle, IRelationForceOptions, IRuntimeAxis, ISeriesLabelStyle, ISeriesStyle, ITrendLine, RightYAxisOptions, } from './types';
22
25
  export { chartBitsUtils, chartTypeCanUseTrendLine } from './util';
23
26
  export * from './utils/echarts';
24
27
  export { WordCloudResourceConfig } from './word-cloud-resource/word-cloud-resource-config';
@@ -1,4 +1,4 @@
1
- import type { LocaleService } from '@univerjs/core';
2
1
  import type { IChartContext, IChartData, IUniverDataSet } from '../../types';
2
+ import type { IChartLocaleTexts } from '../chart-locale-texts';
3
3
  import { ChartTypeBits } from '../../enum';
4
- export declare function buildChartData(dataSource: IUniverDataSet, chartContext: IChartContext, chartType: ChartTypeBits, isRowDirection: boolean, localeService: LocaleService): IChartData;
4
+ export declare function buildChartData(dataSource: IUniverDataSet, chartContext: IChartContext, chartType: ChartTypeBits, isRowDirection: boolean, localeTexts: IChartLocaleTexts): IChartData;
@@ -0,0 +1,22 @@
1
+ export interface IChartLocaleTexts {
2
+ seriesDefaultName: string;
3
+ categoryDefaultName: string;
4
+ blank: string;
5
+ boxplotMin: string;
6
+ boxplotQ1: string;
7
+ boxplotMedian: string;
8
+ boxplotQ3: string;
9
+ boxplotMax: string;
10
+ bubbleEmptyTips: string;
11
+ cloudWord: string;
12
+ cloudFrequency: string;
13
+ msgEmptyTips: string;
14
+ msgSankeyCircularTips: string;
15
+ paretoLineName: string;
16
+ relationEmptyTips: string;
17
+ waterfallPositive: string;
18
+ waterfallNegative: string;
19
+ waterfallSubtotal: string;
20
+ }
21
+ export declare function replaceLocaleParams(text: string, ...args: string[]): string;
22
+ export declare function getDefaultChartLocaleTexts(): IChartLocaleTexts;
@@ -1,9 +1,10 @@
1
1
  import type { Injector } from '@univerjs/core';
2
2
  import type { Observable, Subscription } from 'rxjs';
3
- import type { ChartStyle, IChartConfig, IChartContext, IChartDataAggregation, IChartDataSource, IChartRuntimeContext, IChartSnapshot, IRuntimeAxis } from '../types';
4
- import { Disposable, LocaleService } from '@univerjs/core';
3
+ import type { ChartStyle, IChartConfig, IChartContext, IChartDataAggregation, IChartDataSource, IChartRuntimeContext, IChartSnapshot } from '../types';
4
+ import { Disposable } from '@univerjs/core';
5
5
  import { BehaviorSubject } from 'rxjs';
6
6
  import { ChartTypeBits } from '../enum';
7
+ import type { IChartLocaleTexts } from './chart-locale-texts';
7
8
  import { ChartThemeService } from './chart-theme.service';
8
9
  import { WordCloudMuskImageService } from './word-cloud-musk-image.service';
9
10
  export interface IChartModelInit {
@@ -12,11 +13,12 @@ export interface IChartModelInit {
12
13
  dataAggregation?: IChartDataAggregation;
13
14
  context?: Pick<IChartContext, 'categoryIndex' | 'seriesIndexes' | 'transform'>;
14
15
  style?: ChartStyle;
16
+ localeTexts?: IChartLocaleTexts;
15
17
  }
16
18
  export declare const CHART_DEBOUNCE_TIME = 0;
17
19
  export declare class ChartModel extends Disposable {
18
20
  readonly id: string;
19
- private _options;
21
+ protected _options: IChartModelInit;
20
22
  private _injector;
21
23
  protected _dataSource: IChartDataSource;
22
24
  get dataSource(): IChartDataSource;
@@ -39,7 +41,7 @@ export declare class ChartModel extends Disposable {
39
41
  protected _style$: BehaviorSubject<{
40
42
  runtime?: {
41
43
  themeColors?: string[] | undefined;
42
- axes?: IRuntimeAxis[] | undefined;
44
+ axes?: import("..").IRuntimeAxis[] | undefined;
43
45
  themeInfo?: {
44
46
  version?: string | number | undefined;
45
47
  themeName?: string | undefined;
@@ -104,91 +106,25 @@ export declare class ChartModel extends Disposable {
104
106
  getRenderColor?: {} | undefined;
105
107
  isDarkMode?: boolean | undefined;
106
108
  hasSecondaryAxis?: boolean | undefined;
107
- localeService?: {
108
- readonly currentLocale$?: {
109
- source?: {
110
- source?: /*elided*/ any | undefined;
111
- operator?: {
112
- call?: {} | undefined;
113
- } | undefined;
114
- lift?: {} | undefined;
115
- subscribe?: {} | undefined;
116
- forEach?: {} | undefined;
117
- pipe?: {} | undefined;
118
- toPromise?: {} | undefined;
119
- } | undefined;
120
- operator?: {
121
- call?: {} | undefined;
122
- } | undefined;
123
- lift?: {} | undefined;
124
- subscribe?: {} | undefined;
125
- forEach?: {} | undefined;
126
- pipe?: {} | undefined;
127
- toPromise?: {} | undefined;
128
- } | undefined;
129
- readonly direction$?: {
130
- source?: {
131
- source?: /*elided*/ any | undefined;
132
- operator?: {
133
- call?: {} | undefined;
134
- } | undefined;
135
- lift?: {} | undefined;
136
- subscribe?: {} | undefined;
137
- forEach?: {} | undefined;
138
- pipe?: {} | undefined;
139
- toPromise?: {} | undefined;
140
- } | undefined;
141
- operator?: {
142
- call?: {} | undefined;
143
- } | undefined;
144
- lift?: {} | undefined;
145
- subscribe?: {} | undefined;
146
- forEach?: {} | undefined;
147
- pipe?: {} | undefined;
148
- toPromise?: {} | undefined;
149
- } | undefined;
150
- localeChanged$?: {
151
- closed?: boolean | undefined;
152
- observers?: import("rxjs").Observer<void>[] | undefined;
153
- isStopped?: boolean | undefined;
154
- hasError?: boolean | undefined;
155
- thrownError?: any;
156
- lift?: {} | undefined;
157
- next?: {} | undefined;
158
- error?: {} | undefined;
159
- complete?: {} | undefined;
160
- unsubscribe?: {} | undefined;
161
- readonly observed?: boolean | undefined;
162
- asObservable?: {} | undefined;
163
- source?: {
164
- source?: /*elided*/ any | undefined;
165
- operator?: {
166
- call?: {} | undefined;
167
- } | undefined;
168
- lift?: {} | undefined;
169
- subscribe?: {} | undefined;
170
- forEach?: {} | undefined;
171
- pipe?: {} | undefined;
172
- toPromise?: {} | undefined;
173
- } | undefined;
174
- operator?: {
175
- call?: {} | undefined;
176
- } | undefined;
177
- subscribe?: {} | undefined;
178
- forEach?: {} | undefined;
179
- pipe?: {} | undefined;
180
- toPromise?: {} | undefined;
181
- } | undefined;
182
- load?: {} | undefined;
183
- t?: (key: string, ...args: string[]) => string;
184
- setLocale?: {} | undefined;
185
- getLocales?: {} | undefined;
186
- getCurrentLocale?: {} | undefined;
187
- setDirection?: {} | undefined;
188
- getDirection?: {} | undefined;
189
- resolveKeyPath?: {} | undefined;
190
- disposeWithMe?: {} | undefined;
191
- dispose?: {} | undefined;
109
+ localeTexts?: {
110
+ seriesDefaultName?: string | undefined;
111
+ categoryDefaultName?: string | undefined;
112
+ blank?: string | undefined;
113
+ boxplotMin?: string | undefined;
114
+ boxplotQ1?: string | undefined;
115
+ boxplotMedian?: string | undefined;
116
+ boxplotQ3?: string | undefined;
117
+ boxplotMax?: string | undefined;
118
+ bubbleEmptyTips?: string | undefined;
119
+ cloudWord?: string | undefined;
120
+ cloudFrequency?: string | undefined;
121
+ msgEmptyTips?: string | undefined;
122
+ msgSankeyCircularTips?: string | undefined;
123
+ paretoLineName?: string | undefined;
124
+ relationEmptyTips?: string | undefined;
125
+ waterfallPositive?: string | undefined;
126
+ waterfallNegative?: string | undefined;
127
+ waterfallSubtotal?: string | undefined;
192
128
  } | undefined;
193
129
  wordCloudImageMaskMap?: {
194
130
  clear?: {} | undefined;
@@ -207,6 +143,7 @@ export declare class ChartModel extends Disposable {
207
143
  readonly [Symbol.toStringTag]?: string | undefined;
208
144
  } | undefined;
209
145
  } | undefined;
146
+ direction?: import("..").ChartDirection | undefined;
210
147
  width?: number | undefined;
211
148
  height?: number | undefined;
212
149
  theme?: string | undefined;
@@ -1227,7 +1164,7 @@ export declare class ChartModel extends Disposable {
1227
1164
  readonly style$: Observable<{
1228
1165
  runtime?: {
1229
1166
  themeColors?: string[] | undefined;
1230
- axes?: IRuntimeAxis[] | undefined;
1167
+ axes?: import("..").IRuntimeAxis[] | undefined;
1231
1168
  themeInfo?: {
1232
1169
  version?: string | number | undefined;
1233
1170
  themeName?: string | undefined;
@@ -1292,91 +1229,25 @@ export declare class ChartModel extends Disposable {
1292
1229
  getRenderColor?: {} | undefined;
1293
1230
  isDarkMode?: boolean | undefined;
1294
1231
  hasSecondaryAxis?: boolean | undefined;
1295
- localeService?: {
1296
- readonly currentLocale$?: {
1297
- source?: {
1298
- source?: /*elided*/ any | undefined;
1299
- operator?: {
1300
- call?: {} | undefined;
1301
- } | undefined;
1302
- lift?: {} | undefined;
1303
- subscribe?: {} | undefined;
1304
- forEach?: {} | undefined;
1305
- pipe?: {} | undefined;
1306
- toPromise?: {} | undefined;
1307
- } | undefined;
1308
- operator?: {
1309
- call?: {} | undefined;
1310
- } | undefined;
1311
- lift?: {} | undefined;
1312
- subscribe?: {} | undefined;
1313
- forEach?: {} | undefined;
1314
- pipe?: {} | undefined;
1315
- toPromise?: {} | undefined;
1316
- } | undefined;
1317
- readonly direction$?: {
1318
- source?: {
1319
- source?: /*elided*/ any | undefined;
1320
- operator?: {
1321
- call?: {} | undefined;
1322
- } | undefined;
1323
- lift?: {} | undefined;
1324
- subscribe?: {} | undefined;
1325
- forEach?: {} | undefined;
1326
- pipe?: {} | undefined;
1327
- toPromise?: {} | undefined;
1328
- } | undefined;
1329
- operator?: {
1330
- call?: {} | undefined;
1331
- } | undefined;
1332
- lift?: {} | undefined;
1333
- subscribe?: {} | undefined;
1334
- forEach?: {} | undefined;
1335
- pipe?: {} | undefined;
1336
- toPromise?: {} | undefined;
1337
- } | undefined;
1338
- localeChanged$?: {
1339
- closed?: boolean | undefined;
1340
- observers?: import("rxjs").Observer<void>[] | undefined;
1341
- isStopped?: boolean | undefined;
1342
- hasError?: boolean | undefined;
1343
- thrownError?: any;
1344
- lift?: {} | undefined;
1345
- next?: {} | undefined;
1346
- error?: {} | undefined;
1347
- complete?: {} | undefined;
1348
- unsubscribe?: {} | undefined;
1349
- readonly observed?: boolean | undefined;
1350
- asObservable?: {} | undefined;
1351
- source?: {
1352
- source?: /*elided*/ any | undefined;
1353
- operator?: {
1354
- call?: {} | undefined;
1355
- } | undefined;
1356
- lift?: {} | undefined;
1357
- subscribe?: {} | undefined;
1358
- forEach?: {} | undefined;
1359
- pipe?: {} | undefined;
1360
- toPromise?: {} | undefined;
1361
- } | undefined;
1362
- operator?: {
1363
- call?: {} | undefined;
1364
- } | undefined;
1365
- subscribe?: {} | undefined;
1366
- forEach?: {} | undefined;
1367
- pipe?: {} | undefined;
1368
- toPromise?: {} | undefined;
1369
- } | undefined;
1370
- load?: {} | undefined;
1371
- t?: (key: string, ...args: string[]) => string;
1372
- setLocale?: {} | undefined;
1373
- getLocales?: {} | undefined;
1374
- getCurrentLocale?: {} | undefined;
1375
- setDirection?: {} | undefined;
1376
- getDirection?: {} | undefined;
1377
- resolveKeyPath?: {} | undefined;
1378
- disposeWithMe?: {} | undefined;
1379
- dispose?: {} | undefined;
1232
+ localeTexts?: {
1233
+ seriesDefaultName?: string | undefined;
1234
+ categoryDefaultName?: string | undefined;
1235
+ blank?: string | undefined;
1236
+ boxplotMin?: string | undefined;
1237
+ boxplotQ1?: string | undefined;
1238
+ boxplotMedian?: string | undefined;
1239
+ boxplotQ3?: string | undefined;
1240
+ boxplotMax?: string | undefined;
1241
+ bubbleEmptyTips?: string | undefined;
1242
+ cloudWord?: string | undefined;
1243
+ cloudFrequency?: string | undefined;
1244
+ msgEmptyTips?: string | undefined;
1245
+ msgSankeyCircularTips?: string | undefined;
1246
+ paretoLineName?: string | undefined;
1247
+ relationEmptyTips?: string | undefined;
1248
+ waterfallPositive?: string | undefined;
1249
+ waterfallNegative?: string | undefined;
1250
+ waterfallSubtotal?: string | undefined;
1380
1251
  } | undefined;
1381
1252
  wordCloudImageMaskMap?: {
1382
1253
  clear?: {} | undefined;
@@ -1395,6 +1266,7 @@ export declare class ChartModel extends Disposable {
1395
1266
  readonly [Symbol.toStringTag]?: string | undefined;
1396
1267
  } | undefined;
1397
1268
  } | undefined;
1269
+ direction?: import("..").ChartDirection | undefined;
1398
1270
  width?: number | undefined;
1399
1271
  height?: number | undefined;
1400
1272
  theme?: string | undefined;
@@ -2415,7 +2287,7 @@ export declare class ChartModel extends Disposable {
2415
2287
  get style(): {
2416
2288
  runtime?: {
2417
2289
  themeColors?: string[] | undefined;
2418
- axes?: IRuntimeAxis[] | undefined;
2290
+ axes?: import("..").IRuntimeAxis[] | undefined;
2419
2291
  themeInfo?: {
2420
2292
  version?: string | number | undefined;
2421
2293
  themeName?: string | undefined;
@@ -2480,91 +2352,25 @@ export declare class ChartModel extends Disposable {
2480
2352
  getRenderColor?: {} | undefined;
2481
2353
  isDarkMode?: boolean | undefined;
2482
2354
  hasSecondaryAxis?: boolean | undefined;
2483
- localeService?: {
2484
- readonly currentLocale$?: {
2485
- source?: {
2486
- source?: /*elided*/ any | undefined;
2487
- operator?: {
2488
- call?: {} | undefined;
2489
- } | undefined;
2490
- lift?: {} | undefined;
2491
- subscribe?: {} | undefined;
2492
- forEach?: {} | undefined;
2493
- pipe?: {} | undefined;
2494
- toPromise?: {} | undefined;
2495
- } | undefined;
2496
- operator?: {
2497
- call?: {} | undefined;
2498
- } | undefined;
2499
- lift?: {} | undefined;
2500
- subscribe?: {} | undefined;
2501
- forEach?: {} | undefined;
2502
- pipe?: {} | undefined;
2503
- toPromise?: {} | undefined;
2504
- } | undefined;
2505
- readonly direction$?: {
2506
- source?: {
2507
- source?: /*elided*/ any | undefined;
2508
- operator?: {
2509
- call?: {} | undefined;
2510
- } | undefined;
2511
- lift?: {} | undefined;
2512
- subscribe?: {} | undefined;
2513
- forEach?: {} | undefined;
2514
- pipe?: {} | undefined;
2515
- toPromise?: {} | undefined;
2516
- } | undefined;
2517
- operator?: {
2518
- call?: {} | undefined;
2519
- } | undefined;
2520
- lift?: {} | undefined;
2521
- subscribe?: {} | undefined;
2522
- forEach?: {} | undefined;
2523
- pipe?: {} | undefined;
2524
- toPromise?: {} | undefined;
2525
- } | undefined;
2526
- localeChanged$?: {
2527
- closed?: boolean | undefined;
2528
- observers?: import("rxjs").Observer<void>[] | undefined;
2529
- isStopped?: boolean | undefined;
2530
- hasError?: boolean | undefined;
2531
- thrownError?: any;
2532
- lift?: {} | undefined;
2533
- next?: {} | undefined;
2534
- error?: {} | undefined;
2535
- complete?: {} | undefined;
2536
- unsubscribe?: {} | undefined;
2537
- readonly observed?: boolean | undefined;
2538
- asObservable?: {} | undefined;
2539
- source?: {
2540
- source?: /*elided*/ any | undefined;
2541
- operator?: {
2542
- call?: {} | undefined;
2543
- } | undefined;
2544
- lift?: {} | undefined;
2545
- subscribe?: {} | undefined;
2546
- forEach?: {} | undefined;
2547
- pipe?: {} | undefined;
2548
- toPromise?: {} | undefined;
2549
- } | undefined;
2550
- operator?: {
2551
- call?: {} | undefined;
2552
- } | undefined;
2553
- subscribe?: {} | undefined;
2554
- forEach?: {} | undefined;
2555
- pipe?: {} | undefined;
2556
- toPromise?: {} | undefined;
2557
- } | undefined;
2558
- load?: {} | undefined;
2559
- t?: (key: string, ...args: string[]) => string;
2560
- setLocale?: {} | undefined;
2561
- getLocales?: {} | undefined;
2562
- getCurrentLocale?: {} | undefined;
2563
- setDirection?: {} | undefined;
2564
- getDirection?: {} | undefined;
2565
- resolveKeyPath?: {} | undefined;
2566
- disposeWithMe?: {} | undefined;
2567
- dispose?: {} | undefined;
2355
+ localeTexts?: {
2356
+ seriesDefaultName?: string | undefined;
2357
+ categoryDefaultName?: string | undefined;
2358
+ blank?: string | undefined;
2359
+ boxplotMin?: string | undefined;
2360
+ boxplotQ1?: string | undefined;
2361
+ boxplotMedian?: string | undefined;
2362
+ boxplotQ3?: string | undefined;
2363
+ boxplotMax?: string | undefined;
2364
+ bubbleEmptyTips?: string | undefined;
2365
+ cloudWord?: string | undefined;
2366
+ cloudFrequency?: string | undefined;
2367
+ msgEmptyTips?: string | undefined;
2368
+ msgSankeyCircularTips?: string | undefined;
2369
+ paretoLineName?: string | undefined;
2370
+ relationEmptyTips?: string | undefined;
2371
+ waterfallPositive?: string | undefined;
2372
+ waterfallNegative?: string | undefined;
2373
+ waterfallSubtotal?: string | undefined;
2568
2374
  } | undefined;
2569
2375
  wordCloudImageMaskMap?: {
2570
2376
  clear?: {} | undefined;
@@ -2583,6 +2389,7 @@ export declare class ChartModel extends Disposable {
2583
2389
  readonly [Symbol.toStringTag]?: string | undefined;
2584
2390
  } | undefined;
2585
2391
  } | undefined;
2392
+ direction?: import("..").ChartDirection | undefined;
2586
2393
  width?: number | undefined;
2587
2394
  height?: number | undefined;
2588
2395
  theme?: string | undefined;
@@ -3607,10 +3414,9 @@ export declare class ChartModel extends Disposable {
3607
3414
  _init(): void;
3608
3415
  getRuntimeService(): {
3609
3416
  chartThemeService: ChartThemeService;
3610
- localeService: LocaleService;
3611
3417
  wordCloudMuskImageService: WordCloudMuskImageService;
3612
3418
  };
3613
- getRuntimeContext(): IChartRuntimeContext;
3419
+ getRuntimeContext(direction?: ChartStyle['direction']): IChartRuntimeContext;
3614
3420
  applyStyle(newStyle: ChartStyle): void;
3615
3421
  assignChartContext(context: Partial<IChartContext>): void;
3616
3422
  assignDataAggregation(config: Partial<IChartDataAggregation>): void;
@@ -0,0 +1,37 @@
1
+ import type { ChartStyle, IChartContext, IRuntimeAxis } from '../types';
2
+ import { ChartTypeBits } from '../enum';
3
+ export interface IGetChartRuntimeAxesParams {
4
+ chartType: ChartTypeBits;
5
+ context?: Pick<IChartContext, 'categoryIndex' | 'seriesIndexes'>;
6
+ style?: ChartStyle;
7
+ direction?: ChartStyle['direction'];
8
+ }
9
+ /**
10
+ * Builds the transient axis model consumed by chart converters.
11
+ *
12
+ * Persisted `ChartStyle` axis options are semantic buckets, while converters and
13
+ * style operators consume axes by physical `position`, value `type`, and runtime
14
+ * `priority`. This function centralizes the mapping from chart type, data
15
+ * context, per-series secondary-axis switches, and document direction. The
16
+ * returned priorities are runtime-only roles and should not be treated as the
17
+ * persisted `yAxis` / `rightYAxis` bucket names.
18
+ *
19
+ * Cases handled here:
20
+ * - Heatmap always returns two text axes because both dimensions come from
21
+ * `heatmapData`; the vertical axis is left in LTR and right in RTL, while the
22
+ * bottom axis remains text.
23
+ * - Horizontal bar charts use a vertical primary category axis, left in LTR and
24
+ * right in RTL, plus a numeric bottom axis. If the normal source context has
25
+ * no category, the vertical text axis is filtered out.
26
+ * - Scatter and bubble charts use a numeric bottom axis instead of a category
27
+ * bottom axis. Their vertical value axis still follows the normal RTL and
28
+ * secondary-axis visibility rules.
29
+ * - Other vertical category/value charts use a bottom text axis when a category
30
+ * exists. Their left/right value axes are derived from
31
+ * `allSeriesStyle.rightYAxis` and `seriesStyleMap[*].rightYAxis`; RTL merges
32
+ * `RTLChartStyle` first so the default value axis is physical right unless a
33
+ * user override brings the left axis back.
34
+ * - Pareto keeps its Excel-like sorted layout. RTL does not apply default axis
35
+ * mirroring, and the right value axis is always available.
36
+ */
37
+ export declare function getChartRuntimeAxes(params: IGetChartRuntimeAxesParams): IRuntimeAxis[];
@@ -0,0 +1,12 @@
1
+ import type { ChartStyle } from '../types';
2
+ import { ChartTypeBits } from '../enum';
3
+ /**
4
+ * Converts persisted semantic chart style buckets into transient render buckets.
5
+ *
6
+ * Persisted `style.yAxis` is the primary vertical axis configuration, and
7
+ * `style.rightYAxis` is the secondary vertical axis configuration. RTL can draw
8
+ * the primary vertical axis on the physical right, but that must not change the
9
+ * saved field names. This resolver swaps y-axis option/title buckets only in
10
+ * the runtime render style consumed by physical-position operators.
11
+ */
12
+ export declare function resolveChartRuntimeStyle(style: ChartStyle, chartType?: ChartTypeBits): ChartStyle;
@@ -1,5 +1,7 @@
1
+ import type { ChartStyle } from '../../types';
1
2
  import { AreaLineStyle, AxisAlignEnum, ChartBorderDashType, ChartTypeBits, InvalidValueType, LabelContentType, LegendPositionEnum, LinePointShape, PieLabelPosition, RadarShape, SelectModeEnum, SeriesLabelPosition, TextAlign, TitlePositionEnum, WaterfallStackTypeEnum } from '../../enum';
2
3
  export declare const themeColors: string[];
4
+ export declare const RTLChartStyle: ChartStyle;
3
5
  export declare const defaultChartConfig: {
4
6
  allSeriesId: string;
5
7
  invalidValueType: InvalidValueType;
@@ -1,6 +1,7 @@
1
1
  import type { Injector } from '@univerjs/core';
2
2
  import type { ChartTypeBits } from '../../enum';
3
3
  import type { ChartStyle, IChartContext, IChartHostRect, IUniverDataSet } from '../../types';
4
+ import type { IChartLocaleTexts } from '../chart-locale-texts';
4
5
  import { StaticChartSource } from '../../source/static-chart-source';
5
6
  import { ChartModel } from '../chart-model';
6
7
  /**
@@ -50,6 +51,7 @@ export interface IChartModelInitParams {
50
51
  * The direction of the data source. If the data source is column direction, the value should be false.The default value is true.
51
52
  */
52
53
  isRowDirection?: boolean;
54
+ localeTexts?: IChartLocaleTexts;
53
55
  }
54
56
  export declare function generateChartModelContext(chartModel: ChartModel, dataSource: StaticChartSource): IChartContext | null;
55
57
  /**
@@ -7,6 +7,7 @@ export { invalidValueStyleOperator } from './invalid-value-style.operator';
7
7
  export { legendStyleOperator } from './legend-style.operator';
8
8
  export { lineLikeStyleOperator } from './line-like-style.operator';
9
9
  export { pieStyleOperator } from './pie-style.operator';
10
+ export { rtlRenderSpecOperator } from './rtl-render-spec.operator';
10
11
  export { seriesStyleOperator } from './series-style-operator/series-style-operator';
11
12
  export { stackOperator } from './stack.operator';
12
13
  export { chartThemeOperator } from './theme.operator';
@@ -0,0 +1,2 @@
1
+ import type { EChartRenderSpecOperator } from '../../../types';
2
+ export declare const rtlRenderSpecOperator: EChartRenderSpecOperator;
@@ -0,0 +1,37 @@
1
+ import type { ChartDirection, ChartStyle, EChartRenderSpecOperator, EChartSpec, IChartConfig } from '../../../types';
2
+ import { InvalidValueType } from '../../../enum';
3
+ interface ITooltipFormatterDataContext {
4
+ category: IChartConfig['category'];
5
+ xAxisFormat: ChartStyle['xAxis'] extends infer T ? T extends {
6
+ format?: infer F;
7
+ } ? F : undefined : undefined;
8
+ invalidValueType: InvalidValueType;
9
+ blankText: string;
10
+ minText: string;
11
+ q1Text: string;
12
+ medianText: string;
13
+ q3Text: string;
14
+ maxText: string;
15
+ wordText: string;
16
+ frequencyText: string;
17
+ isDateAxis: boolean | undefined;
18
+ allSeriesStyle: ChartStyle['allSeriesStyle'];
19
+ seriesStyleMap: ChartStyle['seriesStyleMap'];
20
+ runtimeThemeColors: string[];
21
+ relationNodeMap: Map<string, string>;
22
+ negativeMap: Map<string, boolean>;
23
+ getRenderColor: (color: string) => string;
24
+ }
25
+ interface ITooltipFormatters {
26
+ axis: (params: any) => string;
27
+ item: (params: any) => string;
28
+ radar: (params: any) => string;
29
+ wordCloud: (params: any) => string;
30
+ }
31
+ export declare function excelDateToUnixMilliseconds(excelDate: number, useDefault1900DateSystem?: boolean): number;
32
+ export declare function createTooltipFormatterDataContext(spec: EChartSpec, style: ChartStyle, config: IChartConfig): ITooltipFormatterDataContext;
33
+ export declare function createLTRTooltipFormatters(context: ITooltipFormatterDataContext, config: IChartConfig): ITooltipFormatters;
34
+ export declare function createRTLTooltipFormatters(context: ITooltipFormatterDataContext, config: IChartConfig): ITooltipFormatters;
35
+ export declare function createTooltipFormatters(context: ITooltipFormatterDataContext, config: IChartConfig, direction: ChartDirection): ITooltipFormatters;
36
+ export declare const toolTipStyleOperator: EChartRenderSpecOperator;
37
+ export {};
@@ -0,0 +1,15 @@
1
+ import type { ChartDirection } from '../../../types';
2
+ export declare const tooltipBaseCss = "max-width: 280px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden;";
3
+ export declare const rtlTooltipCss = "direction:rtl;text-align:right;";
4
+ export declare function getTooltipExtraCss(backgroundColor: string, direction: ChartDirection): string;
5
+ export declare function getLTRTooltipMarker(color: string): string;
6
+ export declare function getRTLTooltipMarker(color: string): string;
7
+ export declare function normalizeRTLTooltipMarker(marker: string | undefined): string;
8
+ export declare function wrapTooltipAutoDirection(content: string): string;
9
+ export declare function wrapTooltipLTRDirection(content: string): string;
10
+ export declare function renderRTLTooltipRow(content: string): string;
11
+ export declare function renderRTLTooltipBlock(rows: string[]): string;
12
+ export declare function renderRTLTitleRow(content: string): string;
13
+ export declare function renderRTLMarkerTextRow(text: string, marker?: string): string;
14
+ export declare function renderRTLValueLabelRow(label: string, value: unknown, marker?: string, boldValue?: boolean): string;
15
+ export declare function renderRTLEdgeRow(sourceName: string, targetName: string, value: unknown, marker?: string): string;