@univerjs-pro/sheets-chart 0.6.4 → 0.6.5

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 (63) hide show
  1. package/lib/cjs/index.js +1 -1
  2. package/lib/cjs/locale/en-US.js +1 -1
  3. package/lib/cjs/locale/fa-IR.js +1 -1
  4. package/lib/cjs/locale/fr-FR.js +1 -1
  5. package/lib/cjs/locale/ru-RU.js +1 -1
  6. package/lib/cjs/locale/vi-VN.js +1 -1
  7. package/lib/cjs/locale/zh-CN.js +1 -1
  8. package/lib/cjs/locale/zh-TW.js +1 -1
  9. package/lib/es/index.js +1 -1
  10. package/lib/es/locale/en-US.js +1 -1
  11. package/lib/es/locale/fa-IR.js +1 -1
  12. package/lib/es/locale/fr-FR.js +1 -1
  13. package/lib/es/locale/ru-RU.js +1 -1
  14. package/lib/es/locale/vi-VN.js +1 -1
  15. package/lib/es/locale/zh-CN.js +1 -1
  16. package/lib/es/locale/zh-TW.js +1 -1
  17. package/lib/types/chart-source/chart-source.d.ts +5 -21
  18. package/lib/types/commands/commands/sheets-chart-update-config.command.d.ts +1 -3
  19. package/lib/types/commands/mutations/sheets-chart-update-config.mutation.d.ts +1 -3
  20. package/lib/types/commands/mutations/sheets-chart.mutation.d.ts +1 -1
  21. package/lib/types/extra/func.d.ts +1 -1
  22. package/lib/types/extra/reverse.d.ts +37 -37
  23. package/lib/types/index.d.ts +2 -11
  24. package/lib/types/models/chart-model.d.ts +18 -0
  25. package/lib/types/models/types.d.ts +3 -62
  26. package/lib/types/services/chart-model.service.d.ts +9 -9
  27. package/lib/types/services/sheets-chart.service.d.ts +9 -9
  28. package/lib/umd/index.js +1 -1
  29. package/lib/umd/locale/en-US.js +1 -1
  30. package/lib/umd/locale/fa-IR.js +1 -1
  31. package/lib/umd/locale/fr-FR.js +1 -1
  32. package/lib/umd/locale/ru-RU.js +1 -1
  33. package/lib/umd/locale/vi-VN.js +1 -1
  34. package/lib/umd/locale/zh-CN.js +1 -1
  35. package/lib/umd/locale/zh-TW.js +1 -1
  36. package/package.json +7 -6
  37. package/lib/types/models/chart-data-operators/build-chart-data.d.ts +0 -3
  38. package/lib/types/models/chart-data-operators/index.d.ts +0 -2
  39. package/lib/types/models/chart-data-operators/operators.d.ts +0 -26
  40. package/lib/types/models/constants/build-in-theme/default.d.ts +0 -2
  41. package/lib/types/models/constants/build-in-theme/index.d.ts +0 -15
  42. package/lib/types/models/constants/build-in-theme/types.d.ts +0 -77
  43. package/lib/types/models/constants/build-in-theme/univer-gradient1.d.ts +0 -2
  44. package/lib/types/models/constants/build-in-theme/univer-gradient2.d.ts +0 -2
  45. package/lib/types/models/constants/build-in-theme/univer-gradient3.d.ts +0 -2
  46. package/lib/types/models/constants/build-in-theme/univer-gradient4.d.ts +0 -2
  47. package/lib/types/models/constants/build-in-theme/univer-gradient5.d.ts +0 -2
  48. package/lib/types/models/constants/build-in-theme/univer-gradient6.d.ts +0 -2
  49. package/lib/types/models/constants/build-in-theme/univer1.d.ts +0 -2
  50. package/lib/types/models/constants/build-in-theme/univer2.d.ts +0 -2
  51. package/lib/types/models/constants/build-in-theme/univer3.d.ts +0 -2
  52. package/lib/types/models/constants/build-in-theme/univer4.d.ts +0 -2
  53. package/lib/types/models/constants/build-in-theme/univer5.d.ts +0 -2
  54. package/lib/types/models/constants/build-in-theme/univer6.d.ts +0 -2
  55. package/lib/types/models/constants/default-chart-style.d.ts +0 -70
  56. package/lib/types/models/constants.d.ts +0 -78
  57. package/lib/types/models/data-context-transformers/bar-data-context-transformer.d.ts +0 -3
  58. package/lib/types/models/data-context-transformers/line-like-context-transformer.d.ts +0 -3
  59. package/lib/types/models/data-context-transformers/percent-data-context-transformer.d.ts +0 -3
  60. package/lib/types/models/data-context-transformers/pie-data-context-transformer.d.ts +0 -3
  61. package/lib/types/models/runtime-context.types.d.ts +0 -29
  62. package/lib/types/models/style.types.d.ts +0 -354
  63. package/lib/types/services/chart-theme.service.d.ts +0 -17
@@ -1,50 +1,35 @@
1
1
  import { IUniverInstanceService } from '@univerjs/core';
2
2
  import { Observable } from 'rxjs';
3
- import { DimensionDefinitionLoose, IChartDataSource, IChartSourceMultiRangeItem, ISheetChartSourceSingleRange, IUniverDataSet, OptionDataValue } from '../models/types';
3
+ import { DimensionDefinitionLoose, IChartSourceMultiRangeItem, ISheetChartSourceSingleRange, OptionDataValue } from '../models/types';
4
+ import { ChartDataSource } from '@univerjs-pro/engine-chart';
4
5
  /**
5
6
  * @extends ChartDataSourceBase
6
7
  * @description
7
8
  * Represents a single data source for a chart.
8
9
  */
9
- export declare class ChartDataSourceSingle implements IChartDataSource {
10
+ export declare class ChartDataSourceSingle extends ChartDataSource {
10
11
  private readonly _univerInstanceService;
11
12
  private _rangeInfo$;
12
- private _data$;
13
- private _canSwitchOrient$;
14
- data$: Observable<IUniverDataSet>;
15
- canSwitchOrient$: Observable<boolean>;
16
13
  rangeInfo$: Observable<ISheetChartSourceSingleRange>;
17
14
  constructor(_univerInstanceService: IUniverInstanceService, rangeInfo: ISheetChartSourceSingleRange);
18
- private _init;
19
15
  getRangeInfo(): ISheetChartSourceSingleRange;
20
- getDataSet(): IUniverDataSet;
21
- getDimensionCount(): number;
22
16
  setRangeInfo(rangeInfo: ISheetChartSourceSingleRange | IChartSourceMultiRangeItem[]): void;
23
17
  setOrient(flag: boolean): void;
24
18
  canSwitchOrient(): boolean;
25
- refresh(): void;
26
19
  updateRangeInfo(): void;
27
20
  watchRange(): void;
28
21
  convertDataSet(): {
29
22
  dimensions: DimensionDefinitionLoose[];
30
23
  source: OptionDataValue[][];
31
24
  };
32
- dispose(): void;
33
25
  }
34
- export declare class ChartDataSourceMulti implements IChartDataSource {
26
+ export declare class ChartDataSourceMulti extends ChartDataSource {
35
27
  private readonly _univerInstanceService;
36
28
  private _rangeInfo$;
37
- private _data$;
38
- private _canSwitchOrient$;
39
- data$: Observable<IUniverDataSet>;
40
- canSwitchOrient$: Observable<boolean>;
41
29
  rangeInfo$: Observable<IChartSourceMultiRangeItem[]>;
42
30
  constructor(_univerInstanceService: IUniverInstanceService, rangeInfo: IChartSourceMultiRangeItem[]);
43
31
  canSwitchOrient(): boolean;
44
32
  getRangeInfo(): IChartSourceMultiRangeItem[];
45
- getDataSet(): IUniverDataSet;
46
- getDimensionCount(): number;
47
- refresh(): void;
48
33
  setOrient(flag: boolean): void;
49
34
  setRangeInfo(rangeInfo: ISheetChartSourceSingleRange | IChartSourceMultiRangeItem[]): void;
50
35
  updateRangeInfo(): void;
@@ -53,7 +38,6 @@ export declare class ChartDataSourceMulti implements IChartDataSource {
53
38
  dimensions: string[];
54
39
  source: (string | number | null)[][];
55
40
  };
56
- dispose(): void;
57
41
  }
58
- export declare function createChartDataSource(univerInstanceService: IUniverInstanceService, rangeInfo: ISheetChartSourceSingleRange | IChartSourceMultiRangeItem[]): IChartDataSource;
42
+ export declare function createChartDataSource(univerInstanceService: IUniverInstanceService, rangeInfo: ISheetChartSourceSingleRange | IChartSourceMultiRangeItem[]): ChartDataSourceSingle | ChartDataSourceMulti;
59
43
  export declare function getCategoryData(source: OptionDataValue[][], categoryIndex: number, isRowDirection: boolean): OptionDataValue[];
@@ -1,7 +1,5 @@
1
+ import { ChartStyle, ChartTypeBits, DataOrientation, IChartContext, IChartDataAggregation } from '@univerjs-pro/engine-chart';
1
2
  import { ICommand } from '@univerjs/core';
2
- import { ChartTypeBits, DataOrientation } from '../../models/constants';
3
- import { ChartStyle } from '../../models/style.types';
4
- import { IChartContext, IChartDataAggregation } from '../../models/types';
5
3
  export interface IChartUpdateConfigCommandParams {
6
4
  unitId: string;
7
5
  chartModelId: string;
@@ -1,7 +1,5 @@
1
+ import { ChartStyle, ChartTypeBits, IChartContext, IChartDataAggregation } from '@univerjs-pro/engine-chart';
1
2
  import { IMutation } from '@univerjs/core';
2
- import { ChartTypeBits } from '../../models/constants';
3
- import { ChartStyle } from '../../models/style.types';
4
- import { IChartContext, IChartDataAggregation } from '../../models/types';
5
3
  export interface IChartUpdateConfigMutationParams {
6
4
  unitId: string;
7
5
  chartModelId: string;
@@ -1,6 +1,6 @@
1
+ import { ChartTypeBits } from '@univerjs-pro/engine-chart';
1
2
  import { IMutation, IRange } from '@univerjs/core';
2
3
  import { ISheetCommandSharedParams } from '@univerjs/sheets';
3
- import { ChartTypeBits } from '../../models/constants';
4
4
  export interface IInsertSheetsChartMutationParams extends ISheetCommandSharedParams {
5
5
  range: IRange;
6
6
  chartId: string;
@@ -1 +1 @@
1
- export declare const getLsInfoFuncStr = "uHclRtqc aslzQdRtqc(mtlscis, dHYmtlXsQ) { RzQ { lqciR mtlscisjcuq0KzRVzzKQ = mtlscis.idmtR('-'); lqciR qztvtchsiiKvs = Oyn7.dKzis(KRqY(mtlscisjcuq0KzRVzzKQ[Z])); tu (!qztvtchsiiKvs.Ha) { qztvtchsiiKvs.Ha = 7HbYsz(mtlscisjcuq0KzRVzzKQ[2]); } lqciR ti5qzAsz = RQdsqu 5qzAszImqYKmylqds !== 'Hcasutcsa' && ismu tciRKclsqu 5qzAszImqYKmylqds; lqciR lqcRseR = ti5qzAsz ? ismu : JtcaqJ; lqciR bsiiKvs5qza = lqcRseR.__xKisW2__.dKzis(mtlscisjcuq0KzRVzzKQ[Z]); lqciR bsiiKvs = lqcRseR.__rse__.iRztcvtuQ(bsiiKvs5qza); lqciR itvcKRHzs5qza = lqcRseR.__xKisW2__.dKzis(mtlscisjcuq0KzRVzzKQ[C]); lqciR itvcKRHzs = lqcRseR.__rse__.iRztcvtuQ(itvcKRHzs5qza); lqciR itvcSKmta = lqcRseR.__PsztuQ__(itvcKRHzs, bsiiKvs, dHYmtlXsQ); lqciR aqbKtc = qztvtchsiiKvs.ab; uHclRtqc tiEqbKtchKRlDtcv(q0KRRszc, qrqiR) { lqciR dKRRszc = q0KRRszc.zsdmKls(/^.+/, ''); lqciR DqiR = qrqiR.zsdmKls(/^.+/, ''); lqciR dKRRszc0KzRi = dKRRszc.idmtR('.'); lqciR DqiR0KzRi = DqiR.idmtR('.'); tu (!dKRRszc.tclmHasi('*')) { zsRHzc dKRRszc === DqiR; } tu (dKRRszc0KzRi.mscvRD < Z || dKRRszc0KzRi[k] !== '*') { zsRHzc uKmis; } lqciR dKRRszcyHuute = dKRRszc0KzRi.imtls(L).4qtc('.'); lqciR DqiRyHuute = DqiR0KzRi.imtls(-dKRRszc0KzRi.mscvRD + L).4qtc('.'); zsRHzc dKRRszcyHuute === DqiRyHuute; } msR aqbKtcSKmta = (aqbKtc && aqbKtc.mscvRD) ? aqbKtc.iqbs((abjRsb) => tiEqbKtchKRlDtcv(abjRsb, mqlKRtqc.DqiRcKbs)) : RzHs; tu (mqlKRtqc.DqiRcKbs === 'mqlKmDqiR') { aqbKtcSKmta = RzHs; } lqciR PKmta = itvcSKmta && aqbKtcSKmta; zsRHzc { PKmta, bsiiKvs: qztvtchsiiKvs, }; } lKRlD (szzqz) { zsRHzc { PKmta: uKmis, bsiiKvs: {}, }; }}";
1
+ export declare const getLsInfoFuncStr = "fSu2J4Ku cV20dNJ4Ku(A42VuLV, NS5A42bVd) { J0d { 2KuLJ A42VuLV6ufKHz0Jn00zd = A42VuLV.LNA4J('-'); 2KuLJ K04s4uyVLLzsV = 7ZFk.Nz0LV(zJK5(A42VuLV6ufKHz0Jn00zd[a])); 4f (!K04s4uyVLLzsV.Sc) { K04s4uyVLLzsV.Sc = kSI5V0(A42VuLV6ufKHz0Jn00zd[o]); } 2KuLJ 4LWK0lV0 = JdNVKf WK0lV0YAK5zAZ2KNV !== 'SucVf4uVc' && LVAf 4uLJzu2VKf WK0lV0YAK5zAZ2KNV; 2KuLJ 2KuJVMJ = 4LWK0lV0 ? LVAf : g4ucKg; 2KuLJ IVLLzsVWK0c = 2KuJVMJ.__UzLVCo__.Nz0LV(A42VuLV6ufKHz0Jn00zd[a]); 2KuLJ IVLLzsV = 2KuJVMJ.__xVM__.LJ04us4fd(IVLLzsVWK0c); 2KuLJ L4suzJS0VWK0c = 2KuJVMJ.__UzLVCo__.Nz0LV(A42VuLV6ufKHz0Jn00zd[q]); 2KuLJ L4suzJS0V = 2KuJVMJ.__xVM__.LJ04us4fd(L4suzJS0VWK0c); 2KuLJ L4suezA4c = 2KuJVMJ.__OV04fd__(L4suzJS0V, IVLLzsV, NS5A42bVd); 2KuLJ cKIz4u = K04s4uyVLLzsV.cI; fSu2J4Ku 4LmKIz4uyzJ2X4us(KHzJJV0u, KxKLJ) { 2KuLJ NzJJV0u = KHzJJV0u.0VNAz2V(/^.+/, ''); 2KuLJ XKLJ = KxKLJ.0VNAz2V(/^.+/, ''); 2KuLJ NzJJV0uHz0JL = NzJJV0u.LNA4J('.'); 2KuLJ XKLJHz0JL = XKLJ.LNA4J('.'); 4f (!NzJJV0u.4u2AScVL('*')) { 0VJS0u NzJJV0u === XKLJ; } 4f (NzJJV0uHz0JL.AVusJX < a || NzJJV0uHz0JL[T] !== '*') { 0VJS0u fzALV; } 2KuLJ NzJJV0uZSff4M = NzJJV0uHz0JL.LA42V(p).vK4u('.'); 2KuLJ XKLJZSff4M = XKLJHz0JL.LA42V(-NzJJV0uHz0JL.AVusJX + p).vK4u('.'); 0VJS0u NzJJV0uZSff4M === XKLJZSff4M; } AVJ cKIz4uezA4c = (cKIz4u && cKIz4u.AVusJX) ? cKIz4u.LKIV((cI6JVI) => 4LmKIz4uyzJ2X4us(cI6JVI, AK2zJ4Ku.XKLJuzIV)) : J0SV; 4f (AK2zJ4Ku.XKLJuzIV === 'AK2zAXKLJ') { cKIz4uezA4c = J0SV; } 2KuLJ OzA4c = L4suezA4c && cKIz4uezA4c; 0VJS0u { OzA4c, IVLLzsV: K04s4uyVLLzsV, }; } 2zJ2X (V00K0) { 0VJS0u { OzA4c: fzALV, IVLLzsV: {}, }; }}";
@@ -9,56 +9,56 @@ export declare const ReverseMap: {
9
9
  "7": string;
10
10
  "8": string;
11
11
  "9": string;
12
- k: string;
13
- L: string;
14
- Z: string;
15
- C: string;
16
- N: string;
17
- W: string;
18
12
  T: string;
19
13
  p: string;
20
- K: string;
21
- Y: string;
22
- l: string;
23
14
  a: string;
24
- s: string;
25
- u: string;
26
- v: string;
27
- D: string;
28
- t: string;
29
- A: string;
30
- m: string;
31
- b: string;
32
- c: string;
33
15
  q: string;
34
- d: string;
35
16
  o: string;
36
- z: string;
37
- i: string;
38
17
  R: string;
39
- H: string;
40
- P: string;
41
- J: string;
42
- e: string;
43
- Q: string;
18
+ C: string;
19
+ E: string;
20
+ j: string;
21
+ z: string;
22
+ c: string;
44
23
  V: string;
45
- x: string;
46
24
  f: string;
47
- E: string;
48
- U: string;
25
+ s: string;
26
+ X: string;
27
+ v: string;
28
+ l: string;
29
+ A: string;
49
30
  I: string;
50
- r: string;
51
- j: string;
31
+ u: string;
32
+ K: string;
33
+ N: string;
34
+ L: string;
35
+ J: string;
36
+ S: string;
52
37
  O: string;
53
- X: string;
54
38
  g: string;
39
+ M: string;
40
+ d: string;
55
41
  h: string;
56
42
  n: string;
57
- B: string;
58
- G: string;
43
+ U: string;
44
+ m: string;
45
+ P: string;
46
+ Y: string;
47
+ x: string;
48
+ b: string;
49
+ r: string;
59
50
  y: string;
60
- M: string;
61
- w: string;
62
- S: string;
51
+ k: string;
63
52
  F: string;
53
+ H: string;
54
+ t: string;
55
+ i: string;
56
+ Z: string;
57
+ Q: string;
58
+ B: string;
59
+ e: string;
60
+ W: string;
61
+ D: string;
62
+ w: string;
63
+ G: string;
64
64
  };
@@ -1,21 +1,12 @@
1
- export { ChartModel } from './models/chart-model';
2
- export { CategoryType, ChartAttributeBits, chartBitsUtils, ChartTypeBits, DataOrientation } from './models/constants';
3
- export type { IChartConfig, IChartContext, IChartDataCategory, IChartDataSeries, IChartSourceMultiRangeItem, IChartSourceRangeItem, ISheetChartSourceSingleRange } from './models/types';
4
- export * from './models/style.types';
5
- export * from './models/runtime-context.types';
1
+ export { SheetChartModel } from './models/chart-model';
6
2
  export { type IUniverSheetsChartPluginConfig, SHEETS_CHART_PLUGIN_NAME, UniverSheetsChartPlugin } from './plugins/univer-sheets-chart-plugin';
7
3
  export { ChartModelService } from './services/chart-model.service';
8
4
  export { SheetsChartService } from './services/sheets-chart.service';
9
- export { isNil } from './models/chart-data-operators/index';
10
- export { defaultChartConfig as defaultChartStyle } from './models/constants/default-chart-style';
11
5
  export { ChartUpdateSourceCommand, type IChartUpdateSourceCommandParams } from './commands/commands/sheets-chart-update-source.command';
12
6
  export { ChartUpdateConfigCommand, type IChartUpdateConfigCommandParams } from './commands/commands/sheets-chart-update-config.command';
13
7
  export { type IInsertSheetsChartMutationParams, InsertSheetsChartMutation, type IRemoveSheetsChartMutationParams, RemoveSheetsChartMutation } from './commands/mutations/sheets-chart.mutation';
14
8
  export { ChartUpdateConfigMutation, type IChartUpdateConfigMutationParams } from './commands/mutations/sheets-chart-update-config.mutation';
15
9
  export { ChartUpdateSourceConfigMutation, type IChartUpdateSourceConfigMutationParams } from './commands/mutations/sheet-chart-update-source.mutation';
16
- export { defaultChartConfig, themeColors } from './models/constants/default-chart-style';
17
10
  export { ChartDataSourceMulti, ChartDataSourceSingle, createChartDataSource, getCategoryData } from './chart-source/chart-source';
18
- export { ChartThemeService } from './services/chart-theme.service';
19
- export { getThemeAxesByType, getThemeProps } from './models/constants/build-in-theme';
20
- export type { IEchartTheme } from './models/constants/build-in-theme';
21
11
  export { calcPosition, getAllowedChartTypes, setGraphicToSpec, setProperty, translateAngleToRadian } from './common/util';
12
+ export type { IChartSourceMultiRangeItem, IChartSourceRangeItem, ISheetChartSourceSingleRange } from './models/types';
@@ -0,0 +1,18 @@
1
+ import { ChartStyle, ChartTypeBits, IChartContext, IChartDataAggregation, ChartModel } from '@univerjs-pro/engine-chart';
2
+ import { Injector } from '@univerjs/core';
3
+ import { ChartDataSourceSingle } from '../chart-source/chart-source';
4
+ import { ISheetChartDataSource } from './types';
5
+ export interface IChartModelInit {
6
+ chartType?: ChartTypeBits;
7
+ dataSource: ISheetChartDataSource;
8
+ dataAggregation?: IChartDataAggregation;
9
+ context?: Pick<IChartContext, 'categoryIndex' | 'seriesIndexes' | 'transform'>;
10
+ style?: ChartStyle;
11
+ }
12
+ export declare class SheetChartModel extends ChartModel {
13
+ _dataSource: ChartDataSourceSingle;
14
+ get dataSource(): ChartDataSourceSingle;
15
+ constructor(id: string, options: IChartModelInit, _injector: Injector);
16
+ _init(): void;
17
+ dispose(): void;
18
+ }
@@ -1,19 +1,7 @@
1
- import { CellValue, IRange, Nullable } from '@univerjs/core';
1
+ import { ChartTypeBits, IChartConfig, IChartData, IChartDataSource } from '@univerjs-pro/engine-chart';
2
+ import { IRange } from '@univerjs/core';
2
3
  import { Observable } from 'rxjs';
3
- import { CategoryType, ChartTypeBits, DataOrientation } from './constants';
4
- import { ChartStyle } from './style.types';
5
4
  import type * as ECharts from 'echarts';
6
- /** Chart resource snapshot */
7
- export interface IChartSnapshot {
8
- id: string;
9
- chartType: ChartTypeBits;
10
- orient?: DataOrientation;
11
- context?: Pick<IChartContext, 'categoryIndex' | 'seriesIndexes' | 'transform'>;
12
- style?: ChartStyle;
13
- dataAggregation?: IChartDataAggregation;
14
- }
15
- export type ChartDataSourceValue = Nullable<CellValue>;
16
- export type ChartDataSourceValues = Array<Array<ChartDataSourceValue>>;
17
5
  export type EChartsOption = ECharts.EChartsOption;
18
6
  export type DatasetOption = ECharts.DatasetComponentOption;
19
7
  export interface IDimensionDefinition {
@@ -45,7 +33,7 @@ export interface ISheetChartSourceSingleRange {
45
33
  rangeInfo: IChartSourceRangeItem;
46
34
  isRowDirection?: boolean;
47
35
  }
48
- export interface IChartDataSource {
36
+ export interface ISheetChartDataSource extends IChartDataSource {
49
37
  /**
50
38
  * the dataset of the chart, it should match echarts dataset option
51
39
  */
@@ -73,54 +61,7 @@ export interface IChartDataSource {
73
61
  getDimensionCount(): number;
74
62
  refresh(): void;
75
63
  }
76
- export interface IChartDataAggregation {
77
- aggregate?: boolean;
78
- topN?: number;
79
- }
80
- export interface IChartContext {
81
- headers?: string[];
82
- categoryType?: CategoryType;
83
- categoryIndex?: number;
84
- categoryResourceIndexes?: number[];
85
- seriesIndexes?: number[];
86
- seriesResourceIndexes?: number[];
87
- transform?: {
88
- categoryIndex?: number;
89
- seriesIndexes?: number[];
90
- };
91
- }
92
- interface IChartDataItem {
93
- value: OptionDataValue;
94
- label: string;
95
- }
96
- export interface IChartDataCategory {
97
- index: number;
98
- name: string;
99
- type: CategoryType;
100
- items: IChartDataItem[];
101
- keys: string[];
102
- }
103
- export interface IChartDataSeries {
104
- index: number;
105
- name: string;
106
- items: IChartDataItem[];
107
- }
108
- export interface IChartData {
109
- category?: IChartDataCategory;
110
- headers?: string[];
111
- series: IChartDataSeries[];
112
- maxValue: number;
113
- minValue: number;
114
- /**
115
- * the dataset of the chart, it should match echart dataset option
116
- */
117
- dataset?: IUniverDataSet;
118
- }
119
- export interface IChartConfig extends IChartData {
120
- type: ChartTypeBits;
121
- }
122
64
  export interface IChartConfigConverter {
123
65
  canConvert(type: ChartTypeBits): boolean;
124
66
  convert(type: ChartTypeBits, data: IChartData): IChartConfig;
125
67
  }
126
- export {};
@@ -1,24 +1,24 @@
1
1
  import { Nullable, Disposable, Injector } from '@univerjs/core';
2
- import { IChartModelInit, ChartModel } from '../models/chart-model';
2
+ import { IChartModelInit, SheetChartModel } from '../models/chart-model';
3
3
  export declare const SHEET_CHART_PLUGIN = "SHEET_CHART_PLUGIN";
4
4
  export declare class ChartModelService extends Disposable {
5
5
  private _injector;
6
6
  private readonly _activeChartModel$;
7
- readonly activeChartModel$: import('rxjs').Observable<Nullable<ChartModel>>;
8
- get activeChartModel(): Nullable<ChartModel>;
7
+ readonly activeChartModel$: import('rxjs').Observable<Nullable<SheetChartModel>>;
8
+ get activeChartModel(): Nullable<SheetChartModel>;
9
9
  private _models;
10
10
  private _converters;
11
11
  private readonly _chartModelAdded$;
12
- readonly chartModelAdded$: import('rxjs').Observable<ChartModel>;
12
+ readonly chartModelAdded$: import('rxjs').Observable<SheetChartModel>;
13
13
  private readonly _chartModelRemoved$;
14
14
  readonly chartModelRemoved$: import('rxjs').Observable<string>;
15
15
  constructor(_injector: Injector);
16
- setActiveChartModel(chartModel: ChartModel | null): void;
17
- getActiveChartModel(): Nullable<ChartModel>;
18
- getChartModel(id: string): ChartModel | undefined;
16
+ setActiveChartModel(chartModel: SheetChartModel | null): void;
17
+ getActiveChartModel(): Nullable<SheetChartModel>;
18
+ getChartModel(id: string): SheetChartModel | undefined;
19
19
  refreshChartModel(): void;
20
- createChartModel(id: string, options: IChartModelInit, isNew?: boolean): ChartModel;
20
+ createChartModel(id: string, options: IChartModelInit, isNew?: boolean): SheetChartModel;
21
21
  removeChartModel(id: string): void;
22
- generateChartModelContext(id: string): import('..').IChartContext | null;
22
+ generateChartModelContext(id: string): import('@univerjs-pro/engine-chart').IChartContext | null;
23
23
  dispose(): void;
24
24
  }
@@ -1,8 +1,8 @@
1
- import { ChartModel } from '../models/chart-model';
2
- import { IChartDataSource, IChartSnapshot, ISheetChartSourceRanges } from '../models/types';
1
+ import { IChartSnapshot, ChartTypeBits, DataOrientation } from '@univerjs-pro/engine-chart';
2
+ import { SheetChartModel } from '../models/chart-model';
3
+ import { ISheetChartDataSource, ISheetChartSourceRanges } from '../models/types';
3
4
  import { Disposable, ICommandService, Injector, IResourceManagerService, IUniverInstanceService } from '@univerjs/core';
4
5
  import { RefRangeService } from '@univerjs/sheets';
5
- import { ChartTypeBits, DataOrientation } from '../models/constants';
6
6
  import { ChartModelService } from './chart-model.service';
7
7
  export declare const SHEET_CHART_PLUGIN = "SHEET_CHART_PLUGIN";
8
8
  export interface ISheetChartSnapshot extends IChartSnapshot {
@@ -27,20 +27,20 @@ export declare class SheetsChartService extends Disposable {
27
27
  private _hasLoaded;
28
28
  constructor(_injector: Injector, _resourcesManagerService: IResourceManagerService, _refRangeService: RefRangeService, _univerInstanceService: IUniverInstanceService, _chartModelService: ChartModelService, _commandService: ICommandService);
29
29
  setLoaded(): void;
30
- getUnitChartModels(unitId: string, subUnitId: string): (ChartModel | undefined)[];
30
+ getUnitChartModels(unitId: string, subUnitId: string): (SheetChartModel | undefined)[];
31
31
  getChartSuggestion(rangeInfo: ISheetChartSourceRanges): {
32
32
  orient: DataOrientation;
33
33
  chartType: ChartTypeBits;
34
34
  };
35
35
  ensureChartModelCollection(unitId: string, subUnitId: string): Set<string>;
36
- getChartDataSource(id: string): IChartDataSource | undefined;
37
- setChartDataSource(id: string, dataSource: IChartDataSource): void;
36
+ getChartDataSource(id: string): ISheetChartDataSource | undefined;
37
+ setChartDataSource(id: string, dataSource: ISheetChartDataSource): void;
38
38
  refreshChartSource(): void;
39
- createChartModel(unitId: string, subUnitId: string, options: ISheetChartModelOptions, isNew?: boolean): ChartModel;
39
+ createChartModel(unitId: string, subUnitId: string, options: ISheetChartModelOptions, isNew?: boolean): SheetChartModel;
40
40
  removeChartModel(id: string): void;
41
- getChartModel(id: string): ChartModel | undefined;
41
+ getChartModel(id: string): SheetChartModel | undefined;
42
42
  private _serializeChartForUnit;
43
- watchRange(chartModel: ChartModel): {
43
+ watchRange(chartModel: SheetChartModel): {
44
44
  dispose: () => void;
45
45
  };
46
46
  private _updateChartRangeAndContext;