@univerjs-pro/engine-chart 0.7.0-nightly.202505111606 → 0.7.0-nightly.202505131607
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/index.js +1 -1
- package/lib/es/index.js +1 -1
- package/lib/index.js +1 -1
- package/lib/types/model/chart-model.d.ts +6 -0
- package/lib/types/model/chart-theme.service.d.ts +16 -2
- package/lib/types/model/mode-converter/render-spec-operators/tools.d.ts +2 -0
- package/lib/types/types.d.ts +10 -0
- package/lib/umd/index.js +1 -1
- package/package.json +4 -3
|
@@ -98,6 +98,8 @@ export declare class ChartModel extends Disposable {
|
|
|
98
98
|
datazoomLabelColor?: string | undefined;
|
|
99
99
|
} | undefined;
|
|
100
100
|
} | undefined;
|
|
101
|
+
getRenderColor?: {} | undefined;
|
|
102
|
+
isDarkMode?: boolean | undefined;
|
|
101
103
|
hasSecondaryAxis?: boolean | undefined;
|
|
102
104
|
localeService?: {
|
|
103
105
|
readonly currentLocale$?: {
|
|
@@ -888,6 +890,8 @@ export declare class ChartModel extends Disposable {
|
|
|
888
890
|
datazoomLabelColor?: string | undefined;
|
|
889
891
|
} | undefined;
|
|
890
892
|
} | undefined;
|
|
893
|
+
getRenderColor?: {} | undefined;
|
|
894
|
+
isDarkMode?: boolean | undefined;
|
|
891
895
|
hasSecondaryAxis?: boolean | undefined;
|
|
892
896
|
localeService?: {
|
|
893
897
|
readonly currentLocale$?: {
|
|
@@ -1678,6 +1682,8 @@ export declare class ChartModel extends Disposable {
|
|
|
1678
1682
|
datazoomLabelColor?: string | undefined;
|
|
1679
1683
|
} | undefined;
|
|
1680
1684
|
} | undefined;
|
|
1685
|
+
getRenderColor?: {} | undefined;
|
|
1686
|
+
isDarkMode?: boolean | undefined;
|
|
1681
1687
|
hasSecondaryAxis?: boolean | undefined;
|
|
1682
1688
|
localeService?: {
|
|
1683
1689
|
readonly currentLocale$?: {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { Injector, Disposable } from '@univerjs/core';
|
|
1
|
+
import { Injector, Disposable, ThemeService } from '@univerjs/core';
|
|
2
2
|
import { IEchartTheme } from './constants/build-in-theme';
|
|
3
|
+
import { ICanvasColorService } from '@univerjs/engine-render';
|
|
3
4
|
export interface IChartTheme {
|
|
4
5
|
colors: string[];
|
|
5
6
|
}
|
|
@@ -11,9 +12,22 @@ export interface IChartThemeService {
|
|
|
11
12
|
getDefaultTheme(): IEchartTheme;
|
|
12
13
|
}
|
|
13
14
|
export declare class ChartThemeService extends Disposable {
|
|
15
|
+
private readonly _themeService;
|
|
16
|
+
private readonly _canvasColorService;
|
|
14
17
|
private _themeMap;
|
|
15
18
|
private _hasRegistered;
|
|
16
|
-
constructor();
|
|
19
|
+
constructor(_themeService: ThemeService, _canvasColorService: ICanvasColorService);
|
|
20
|
+
/**
|
|
21
|
+
* Get the univer color system theme is dark mode or not.
|
|
22
|
+
* @returns {boolean} - true if dark mode, false otherwise.
|
|
23
|
+
*/
|
|
24
|
+
getSystemThemeIsDarkMode(): boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Get the real color for rendering.It will check the system theme is dark mode or not.
|
|
27
|
+
* @param {string} color - The color to be rendered.
|
|
28
|
+
* @returns {string} - The color to be rendered.
|
|
29
|
+
*/
|
|
30
|
+
getRenderColor(color: string): string;
|
|
17
31
|
getColors(name: string | undefined): string[];
|
|
18
32
|
initBuildInThemes(): void;
|
|
19
33
|
getRegisteredThemes(): string[];
|
package/lib/types/types.d.ts
CHANGED
|
@@ -136,6 +136,16 @@ export interface IChartRuntimeContext {
|
|
|
136
136
|
themeColors?: string[];
|
|
137
137
|
axes: IRuntimeAxis[];
|
|
138
138
|
themeInfo: IEchartTheme;
|
|
139
|
+
/**
|
|
140
|
+
* The function to transform the color to the render color with considering the system theme is dark mode or not.
|
|
141
|
+
* @param {string} color - The color to be rendered.
|
|
142
|
+
* @returns {string} - The color to be rendered.
|
|
143
|
+
*/
|
|
144
|
+
getRenderColor(color: string): string;
|
|
145
|
+
/**
|
|
146
|
+
* The current theme is dark mode or not.
|
|
147
|
+
*/
|
|
148
|
+
isDarkMode: boolean;
|
|
139
149
|
hasSecondaryAxis: boolean;
|
|
140
150
|
localeService: LocaleService;
|
|
141
151
|
wordCloudImageMaskMap: Map<string, HTMLImageElement>;
|