@univerjs-pro/sheets-chart 1.0.0-alpha.2 → 1.0.0-alpha.3
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 +8 -2
- 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-source/chart-source.d.ts +0 -1
- package/lib/types/commands/commands/sheets-chart.command.d.ts +3 -4
- package/lib/types/commands/mutations/sheets-chart.mutation.d.ts +15 -5
- package/lib/types/common/util.d.ts +1 -1
- package/lib/types/facade/chart-facade-adapter.d.ts +30 -20
- package/lib/types/facade/chart-facade-builders.d.ts +6 -1
- package/lib/types/facade/chart-facade-types.d.ts +109 -290
- package/lib/types/facade/f-chart.d.ts +26 -3
- package/lib/types/facade/f-worksheet-charts.d.ts +66 -1
- package/lib/types/facade/f-worksheet.d.ts +3 -0
- package/lib/types/facade/index.d.ts +1 -0
- package/lib/types/index.d.ts +5 -6
- package/lib/types/models/chart-model.d.ts +3 -3
- package/lib/types/models/types.d.ts +4 -1
- package/lib/types/plugin.d.ts +1 -0
- package/lib/types/services/chart-model.service.d.ts +2 -0
- package/lib/types/services/sheet-chart-range-watcher.d.ts +22 -0
- package/lib/types/services/sheets-chart.service.d.ts +8 -8
- 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 +10 -10
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { ChartStyle, ChartTypeBits, IChartContext, IChartDataAggregation, IChartLocaleTexts } from '@univerjs-pro/engine-chart';
|
|
2
2
|
import type { Injector } from '@univerjs/core';
|
|
3
|
-
import type { ChartDataSourceSingle } from '../chart-source/chart-source';
|
|
4
3
|
import type { ISheetChartDataSource } from './types';
|
|
5
4
|
import { ChartModel } from '@univerjs-pro/engine-chart';
|
|
6
5
|
import { LocaleService } from '@univerjs/core';
|
|
@@ -14,8 +13,9 @@ export interface IChartModelInit {
|
|
|
14
13
|
}
|
|
15
14
|
export declare function buildLocaleTexts(localeService: LocaleService): IChartLocaleTexts;
|
|
16
15
|
export declare class SheetChartModel extends ChartModel {
|
|
17
|
-
_dataSource:
|
|
18
|
-
get dataSource():
|
|
16
|
+
protected _dataSource: ISheetChartDataSource;
|
|
17
|
+
get dataSource(): ISheetChartDataSource;
|
|
18
|
+
replaceDataSource(dataSource: ISheetChartDataSource): void;
|
|
19
19
|
constructor(id: string, options: IChartModelInit, _injector: Injector);
|
|
20
20
|
_init(): void;
|
|
21
21
|
dispose(): void;
|
|
@@ -14,7 +14,10 @@ export interface IChartSourceRangeItem {
|
|
|
14
14
|
subUnitId: string;
|
|
15
15
|
unitId: string;
|
|
16
16
|
}
|
|
17
|
-
export
|
|
17
|
+
export interface IChartSourceMultiRangeItem {
|
|
18
|
+
header?: IChartSourceRangeItem;
|
|
19
|
+
range: IChartSourceRangeItem;
|
|
20
|
+
}
|
|
18
21
|
/**
|
|
19
22
|
* @description
|
|
20
23
|
* the chart source range maybe a single range or a multi ranges
|
package/lib/types/plugin.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { IChartContext } from '@univerjs-pro/engine-chart';
|
|
2
2
|
import type { Nullable } from '@univerjs/core';
|
|
3
3
|
import type { IChartModelInit } from '../models/chart-model';
|
|
4
|
+
import type { ISheetChartDataSource } from '../models/types';
|
|
4
5
|
import { Disposable, Injector, LocaleService } from '@univerjs/core';
|
|
5
6
|
import { SheetChartModel } from '../models/chart-model';
|
|
6
7
|
export declare const SHEET_CHART_PLUGIN = "SHEET_CHART_PLUGIN";
|
|
@@ -24,5 +25,6 @@ export declare class ChartModelService extends Disposable {
|
|
|
24
25
|
createChartModel(id: string, options: IChartModelInit, isNew?: boolean): SheetChartModel;
|
|
25
26
|
removeChartModel(id: string): void;
|
|
26
27
|
generateChartModelContext(id: string): IChartContext | undefined;
|
|
28
|
+
generateChartModelContextForDataSource(id: string, dataSource: ISheetChartDataSource): IChartContext | undefined;
|
|
27
29
|
dispose(): void;
|
|
28
30
|
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { SheetChartModel } from '../models/chart-model';
|
|
2
|
+
import type { ISheetChartSourceRanges } from '../models/types';
|
|
3
|
+
import { Disposable, ICommandService } from '@univerjs/core';
|
|
4
|
+
import { RefRangeService } from '@univerjs/sheets';
|
|
5
|
+
export interface ISheetChartRangeWatcherCallbacks {
|
|
6
|
+
onDataChanged(model: SheetChartModel): void;
|
|
7
|
+
onRangeChanged(model: SheetChartModel, rangeInfo: ISheetChartSourceRanges): void;
|
|
8
|
+
}
|
|
9
|
+
export declare class SheetChartRangeWatcher extends Disposable {
|
|
10
|
+
private readonly _commandService;
|
|
11
|
+
private readonly _refRangeService;
|
|
12
|
+
private readonly _bindings;
|
|
13
|
+
constructor(_commandService: ICommandService, _refRangeService: RefRangeService);
|
|
14
|
+
bind(model: SheetChartModel, callbacks: ISheetChartRangeWatcherCallbacks): void;
|
|
15
|
+
unbind(chartId: string): void;
|
|
16
|
+
private _watchRange;
|
|
17
|
+
private _watchSingleRange;
|
|
18
|
+
private _watchMultiRange;
|
|
19
|
+
private _watchSourceCommands;
|
|
20
|
+
private _emptyRange;
|
|
21
|
+
dispose(): void;
|
|
22
|
+
}
|
|
@@ -3,9 +3,9 @@ import type { Nullable } from '@univerjs/core';
|
|
|
3
3
|
import type { SheetChartModel } from '../models/chart-model';
|
|
4
4
|
import type { ISheetChartDataSource, ISheetChartSourceRanges } from '../models/types';
|
|
5
5
|
import { ChartTypeBits, DataOrientation } from '@univerjs-pro/engine-chart';
|
|
6
|
-
import { Disposable,
|
|
7
|
-
import { RefRangeService } from '@univerjs/sheets';
|
|
6
|
+
import { Disposable, IResourceManagerService, IUniverInstanceService } from '@univerjs/core';
|
|
8
7
|
import { ChartModelService } from './chart-model.service';
|
|
8
|
+
import { SheetChartRangeWatcher } from './sheet-chart-range-watcher';
|
|
9
9
|
export declare const SHEET_CHART_PLUGIN = "SHEET_CHART_PLUGIN";
|
|
10
10
|
export interface ISheetChartSnapshot extends IChartSnapshot {
|
|
11
11
|
rangeInfo: ISheetChartSourceRanges;
|
|
@@ -19,14 +19,13 @@ export interface ISheetsChartResource {
|
|
|
19
19
|
}
|
|
20
20
|
export declare class SheetsChartService extends Disposable {
|
|
21
21
|
private readonly _resourcesManagerService;
|
|
22
|
-
private readonly _refRangeService;
|
|
23
22
|
private readonly _univerInstanceService;
|
|
24
23
|
private readonly _chartModelService;
|
|
25
|
-
private readonly
|
|
24
|
+
private readonly _rangeWatcher;
|
|
26
25
|
private _chartModelIdMap;
|
|
27
26
|
private _dataSourceMap;
|
|
28
27
|
private _hasLoaded;
|
|
29
|
-
constructor(_resourcesManagerService: IResourceManagerService,
|
|
28
|
+
constructor(_resourcesManagerService: IResourceManagerService, _univerInstanceService: IUniverInstanceService, _chartModelService: ChartModelService, _rangeWatcher: SheetChartRangeWatcher);
|
|
30
29
|
setLoaded(): void;
|
|
31
30
|
getSubUnitId(unitId: string, chartModelId: string): Nullable<string>;
|
|
32
31
|
getUnitChartModels(unitId: string, subUnitId: string): (SheetChartModel | undefined)[];
|
|
@@ -39,14 +38,15 @@ export declare class SheetsChartService extends Disposable {
|
|
|
39
38
|
ensureChartModelCollection(unitId: string, subUnitId: string): Set<string>;
|
|
40
39
|
getChartDataSource(id: string): ISheetChartDataSource | undefined;
|
|
41
40
|
setChartDataSource(id: string, dataSource: ISheetChartDataSource): void;
|
|
41
|
+
replaceChartDataSource(id: string, rangeInfo: ISheetChartSourceRanges): boolean;
|
|
42
|
+
generateChartModelContextForSource(id: string, rangeInfo: ISheetChartSourceRanges): import("@univerjs-pro/engine-chart").IChartContext | undefined;
|
|
42
43
|
refreshChartSource(): void;
|
|
43
44
|
createChartModel(unitId: string, subUnitId: string, options: ISheetChartModelOptions, isNew?: boolean): SheetChartModel;
|
|
44
45
|
removeChartModel(id: string): void;
|
|
45
46
|
getChartModel(id: string): SheetChartModel | undefined;
|
|
46
47
|
private _serializeChartForUnit;
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
};
|
|
48
|
+
private _refreshChartDataAndContext;
|
|
49
|
+
private _bindRangeWatcher;
|
|
50
50
|
private _updateChartRangeAndContext;
|
|
51
51
|
private _deserializeChartForUnit;
|
|
52
52
|
private _initSnapshot;
|