@lytjs/plugin-chart 6.9.0 → 6.9.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/package.json +2 -2
- package/dist/index.d.cts +0 -79
- package/dist/index.d.ts +0 -79
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lytjs/plugin-chart",
|
|
3
|
-
"version": "6.9.
|
|
3
|
+
"version": "6.9.1",
|
|
4
4
|
"description": "LytJS official chart plugin for rendering charts using Canvas API with zero dependencies",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"clean": "rm -rf dist"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@lytjs/core": "
|
|
32
|
+
"@lytjs/core": "workspace:*"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"tsup": "^8.0.0",
|
package/dist/index.d.cts
DELETED
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import * as _lytjs_core from '@lytjs/core';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* @lytjs/plugin-chart types
|
|
5
|
-
*
|
|
6
|
-
* Type definitions for the chart plugin
|
|
7
|
-
*/
|
|
8
|
-
/** 图表数据点 */
|
|
9
|
-
interface ChartDataPoint {
|
|
10
|
-
/** 标签 */
|
|
11
|
-
label: string;
|
|
12
|
-
/** 数值 */
|
|
13
|
-
value: number;
|
|
14
|
-
/** 颜色(可选) */
|
|
15
|
-
color?: string;
|
|
16
|
-
}
|
|
17
|
-
/** 数据集 */
|
|
18
|
-
interface ChartDataset {
|
|
19
|
-
/** 数据集标签 */
|
|
20
|
-
label: string;
|
|
21
|
-
/** 数据点数组 */
|
|
22
|
-
data: ChartDataPoint[];
|
|
23
|
-
/** 颜色(可选,应用于整个数据集) */
|
|
24
|
-
color?: string;
|
|
25
|
-
/** 边框宽度(可选) */
|
|
26
|
-
borderWidth?: number;
|
|
27
|
-
}
|
|
28
|
-
/** 图表类型 */
|
|
29
|
-
type ChartType = 'bar' | 'line' | 'pie' | 'doughnut';
|
|
30
|
-
/** 图表配置 */
|
|
31
|
-
interface ChartConfig {
|
|
32
|
-
/** 图表类型 */
|
|
33
|
-
type: ChartType;
|
|
34
|
-
/** 数据集 */
|
|
35
|
-
datasets: ChartDataset[];
|
|
36
|
-
/** 标题(可选) */
|
|
37
|
-
title?: string;
|
|
38
|
-
/** 是否显示图例 */
|
|
39
|
-
showLegend?: boolean;
|
|
40
|
-
/** 是否显示网格线 */
|
|
41
|
-
showGrid?: boolean;
|
|
42
|
-
/** 图表宽度 */
|
|
43
|
-
width?: number;
|
|
44
|
-
/** 图表高度 */
|
|
45
|
-
height?: number;
|
|
46
|
-
/** 动画持续时间(毫秒) */
|
|
47
|
-
animationDuration?: number;
|
|
48
|
-
/** 内边距 */
|
|
49
|
-
padding?: number;
|
|
50
|
-
}
|
|
51
|
-
/** 图表实例接口 */
|
|
52
|
-
interface ChartInstance {
|
|
53
|
-
/** 渲染图表 */
|
|
54
|
-
render(): void;
|
|
55
|
-
/** 更新数据 */
|
|
56
|
-
updateData(datasets: ChartDataset[]): void;
|
|
57
|
-
/** 销毁图表 */
|
|
58
|
-
destroy(): void;
|
|
59
|
-
/** 获取 Canvas 元素 */
|
|
60
|
-
getCanvas(): HTMLCanvasElement;
|
|
61
|
-
}
|
|
62
|
-
/** 图表插件选项 */
|
|
63
|
-
interface ChartPluginOptions {
|
|
64
|
-
/** 默认颜色 palette */
|
|
65
|
-
defaultColors?: string[];
|
|
66
|
-
/** 默认动画持续时间 */
|
|
67
|
-
defaultAnimationDuration?: number;
|
|
68
|
-
/** 响应式配置 */
|
|
69
|
-
responsive?: boolean;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
declare const DEFAULT_COLORS: string[];
|
|
73
|
-
/**
|
|
74
|
-
* 创建图表实例
|
|
75
|
-
*/
|
|
76
|
-
declare function createChart(canvas: HTMLCanvasElement, config: ChartConfig, options?: ChartPluginOptions): ChartInstance;
|
|
77
|
-
declare const pluginChart: _lytjs_core.PluginDefinition<unknown>;
|
|
78
|
-
|
|
79
|
-
export { type ChartConfig, type ChartDataPoint, type ChartDataset, type ChartInstance, type ChartPluginOptions, type ChartType, DEFAULT_COLORS, createChart, pluginChart as default };
|
package/dist/index.d.ts
DELETED
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import * as _lytjs_core from '@lytjs/core';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* @lytjs/plugin-chart types
|
|
5
|
-
*
|
|
6
|
-
* Type definitions for the chart plugin
|
|
7
|
-
*/
|
|
8
|
-
/** 图表数据点 */
|
|
9
|
-
interface ChartDataPoint {
|
|
10
|
-
/** 标签 */
|
|
11
|
-
label: string;
|
|
12
|
-
/** 数值 */
|
|
13
|
-
value: number;
|
|
14
|
-
/** 颜色(可选) */
|
|
15
|
-
color?: string;
|
|
16
|
-
}
|
|
17
|
-
/** 数据集 */
|
|
18
|
-
interface ChartDataset {
|
|
19
|
-
/** 数据集标签 */
|
|
20
|
-
label: string;
|
|
21
|
-
/** 数据点数组 */
|
|
22
|
-
data: ChartDataPoint[];
|
|
23
|
-
/** 颜色(可选,应用于整个数据集) */
|
|
24
|
-
color?: string;
|
|
25
|
-
/** 边框宽度(可选) */
|
|
26
|
-
borderWidth?: number;
|
|
27
|
-
}
|
|
28
|
-
/** 图表类型 */
|
|
29
|
-
type ChartType = 'bar' | 'line' | 'pie' | 'doughnut';
|
|
30
|
-
/** 图表配置 */
|
|
31
|
-
interface ChartConfig {
|
|
32
|
-
/** 图表类型 */
|
|
33
|
-
type: ChartType;
|
|
34
|
-
/** 数据集 */
|
|
35
|
-
datasets: ChartDataset[];
|
|
36
|
-
/** 标题(可选) */
|
|
37
|
-
title?: string;
|
|
38
|
-
/** 是否显示图例 */
|
|
39
|
-
showLegend?: boolean;
|
|
40
|
-
/** 是否显示网格线 */
|
|
41
|
-
showGrid?: boolean;
|
|
42
|
-
/** 图表宽度 */
|
|
43
|
-
width?: number;
|
|
44
|
-
/** 图表高度 */
|
|
45
|
-
height?: number;
|
|
46
|
-
/** 动画持续时间(毫秒) */
|
|
47
|
-
animationDuration?: number;
|
|
48
|
-
/** 内边距 */
|
|
49
|
-
padding?: number;
|
|
50
|
-
}
|
|
51
|
-
/** 图表实例接口 */
|
|
52
|
-
interface ChartInstance {
|
|
53
|
-
/** 渲染图表 */
|
|
54
|
-
render(): void;
|
|
55
|
-
/** 更新数据 */
|
|
56
|
-
updateData(datasets: ChartDataset[]): void;
|
|
57
|
-
/** 销毁图表 */
|
|
58
|
-
destroy(): void;
|
|
59
|
-
/** 获取 Canvas 元素 */
|
|
60
|
-
getCanvas(): HTMLCanvasElement;
|
|
61
|
-
}
|
|
62
|
-
/** 图表插件选项 */
|
|
63
|
-
interface ChartPluginOptions {
|
|
64
|
-
/** 默认颜色 palette */
|
|
65
|
-
defaultColors?: string[];
|
|
66
|
-
/** 默认动画持续时间 */
|
|
67
|
-
defaultAnimationDuration?: number;
|
|
68
|
-
/** 响应式配置 */
|
|
69
|
-
responsive?: boolean;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
declare const DEFAULT_COLORS: string[];
|
|
73
|
-
/**
|
|
74
|
-
* 创建图表实例
|
|
75
|
-
*/
|
|
76
|
-
declare function createChart(canvas: HTMLCanvasElement, config: ChartConfig, options?: ChartPluginOptions): ChartInstance;
|
|
77
|
-
declare const pluginChart: _lytjs_core.PluginDefinition<unknown>;
|
|
78
|
-
|
|
79
|
-
export { type ChartConfig, type ChartDataPoint, type ChartDataset, type ChartInstance, type ChartPluginOptions, type ChartType, DEFAULT_COLORS, createChart, pluginChart as default };
|