@damoqiongqiu/ice-chart 0.17.0
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/LICENSE +21 -0
- package/README.md +530 -0
- package/dist/index.cjs +25 -0
- package/dist/index.mjs +25 -0
- package/dist/index.umd.js +25 -0
- package/dist/types/ICEChart.d.mts +330 -0
- package/dist/types/ICEChart.d.ts +330 -0
- package/dist/types/a11y.d.mts +85 -0
- package/dist/types/a11y.d.ts +85 -0
- package/dist/types/animation/motion.d.mts +11 -0
- package/dist/types/animation/motion.d.ts +11 -0
- package/dist/types/components/Axis.d.mts +60 -0
- package/dist/types/components/Axis.d.ts +60 -0
- package/dist/types/components/Brush.d.mts +19 -0
- package/dist/types/components/Brush.d.ts +19 -0
- package/dist/types/components/ChartComponent.d.mts +48 -0
- package/dist/types/components/ChartComponent.d.ts +48 -0
- package/dist/types/components/Crosshair.d.mts +40 -0
- package/dist/types/components/Crosshair.d.ts +40 -0
- package/dist/types/components/DataZoomSlider.d.mts +30 -0
- package/dist/types/components/DataZoomSlider.d.ts +30 -0
- package/dist/types/components/GridLines.d.mts +37 -0
- package/dist/types/components/GridLines.d.ts +37 -0
- package/dist/types/components/Highlight.d.mts +34 -0
- package/dist/types/components/Highlight.d.ts +34 -0
- package/dist/types/components/Legend.d.mts +26 -0
- package/dist/types/components/Legend.d.ts +26 -0
- package/dist/types/components/PlotArea.d.mts +21 -0
- package/dist/types/components/PlotArea.d.ts +21 -0
- package/dist/types/components/PolarGrid.d.mts +34 -0
- package/dist/types/components/PolarGrid.d.ts +34 -0
- package/dist/types/components/RadarGrid.d.mts +25 -0
- package/dist/types/components/RadarGrid.d.ts +25 -0
- package/dist/types/components/Title.d.mts +14 -0
- package/dist/types/components/Title.d.ts +14 -0
- package/dist/types/components/Tooltip.d.mts +48 -0
- package/dist/types/components/Tooltip.d.ts +48 -0
- package/dist/types/components/series/AreaSeries.d.mts +14 -0
- package/dist/types/components/series/AreaSeries.d.ts +14 -0
- package/dist/types/components/series/BarSeries.d.mts +39 -0
- package/dist/types/components/series/BarSeries.d.ts +39 -0
- package/dist/types/components/series/BoxplotSeries.d.mts +16 -0
- package/dist/types/components/series/BoxplotSeries.d.ts +16 -0
- package/dist/types/components/series/CandlestickSeries.d.mts +13 -0
- package/dist/types/components/series/CandlestickSeries.d.ts +13 -0
- package/dist/types/components/series/CurveSeriesBase.d.mts +58 -0
- package/dist/types/components/series/CurveSeriesBase.d.ts +58 -0
- package/dist/types/components/series/FunctionSeries.d.mts +22 -0
- package/dist/types/components/series/FunctionSeries.d.ts +22 -0
- package/dist/types/components/series/FunnelSeries.d.mts +38 -0
- package/dist/types/components/series/FunnelSeries.d.ts +38 -0
- package/dist/types/components/series/GaugeSeries.d.mts +45 -0
- package/dist/types/components/series/GaugeSeries.d.ts +45 -0
- package/dist/types/components/series/GraphSeries.d.mts +39 -0
- package/dist/types/components/series/GraphSeries.d.ts +39 -0
- package/dist/types/components/series/HeatmapSeries.d.mts +21 -0
- package/dist/types/components/series/HeatmapSeries.d.ts +21 -0
- package/dist/types/components/series/LineSeries.d.mts +31 -0
- package/dist/types/components/series/LineSeries.d.ts +31 -0
- package/dist/types/components/series/LiquidSeries.d.mts +55 -0
- package/dist/types/components/series/LiquidSeries.d.ts +55 -0
- package/dist/types/components/series/ParametricSeries.d.mts +30 -0
- package/dist/types/components/series/ParametricSeries.d.ts +30 -0
- package/dist/types/components/series/PieSeries.d.mts +44 -0
- package/dist/types/components/series/PieSeries.d.ts +44 -0
- package/dist/types/components/series/RadarSeries.d.mts +30 -0
- package/dist/types/components/series/RadarSeries.d.ts +30 -0
- package/dist/types/components/series/SankeySeries.d.mts +34 -0
- package/dist/types/components/series/SankeySeries.d.ts +34 -0
- package/dist/types/components/series/ScatterSeries.d.mts +11 -0
- package/dist/types/components/series/ScatterSeries.d.ts +11 -0
- package/dist/types/components/series/SeriesBase.d.mts +214 -0
- package/dist/types/components/series/SeriesBase.d.ts +214 -0
- package/dist/types/components/series/TreemapSeries.d.mts +48 -0
- package/dist/types/components/series/TreemapSeries.d.ts +48 -0
- package/dist/types/components/series/WaterfallSeries.d.mts +17 -0
- package/dist/types/components/series/WaterfallSeries.d.ts +17 -0
- package/dist/types/components/series/createSeries.d.mts +10 -0
- package/dist/types/components/series/createSeries.d.ts +10 -0
- package/dist/types/components/series/index.d.mts +29 -0
- package/dist/types/components/series/index.d.ts +29 -0
- package/dist/types/expr/diagnostics.d.mts +45 -0
- package/dist/types/expr/diagnostics.d.ts +45 -0
- package/dist/types/expr/expr.d.mts +44 -0
- package/dist/types/expr/expr.d.ts +44 -0
- package/dist/types/expr/sample.d.mts +34 -0
- package/dist/types/expr/sample.d.ts +34 -0
- package/dist/types/index.d.mts +80 -0
- package/dist/types/index.d.ts +80 -0
- package/dist/types/interaction/ChartLink.d.mts +16 -0
- package/dist/types/interaction/ChartLink.d.ts +16 -0
- package/dist/types/interaction/HitResolver.d.mts +44 -0
- package/dist/types/interaction/HitResolver.d.ts +44 -0
- package/dist/types/interaction/InteractionController.d.mts +147 -0
- package/dist/types/interaction/InteractionController.d.ts +147 -0
- package/dist/types/internal.d.mts +232 -0
- package/dist/types/internal.d.ts +232 -0
- package/dist/types/layout/force.d.mts +48 -0
- package/dist/types/layout/force.d.ts +48 -0
- package/dist/types/layout/layout.d.mts +9 -0
- package/dist/types/layout/layout.d.ts +9 -0
- package/dist/types/layout/sankey.d.mts +47 -0
- package/dist/types/layout/sankey.d.ts +47 -0
- package/dist/types/layout/treemap.d.mts +35 -0
- package/dist/types/layout/treemap.d.ts +35 -0
- package/dist/types/option/normalize.d.mts +68 -0
- package/dist/types/option/normalize.d.ts +68 -0
- package/dist/types/scale/BandScale.d.mts +36 -0
- package/dist/types/scale/BandScale.d.ts +36 -0
- package/dist/types/scale/LinearScale.d.mts +21 -0
- package/dist/types/scale/LinearScale.d.ts +21 -0
- package/dist/types/scale/LogScale.d.mts +24 -0
- package/dist/types/scale/LogScale.d.ts +24 -0
- package/dist/types/scale/Scale.d.mts +38 -0
- package/dist/types/scale/Scale.d.ts +38 -0
- package/dist/types/scale/TimeScale.d.mts +28 -0
- package/dist/types/scale/TimeScale.d.ts +28 -0
- package/dist/types/scale/format.d.mts +5 -0
- package/dist/types/scale/format.d.ts +5 -0
- package/dist/types/scale/index.d.mts +7 -0
- package/dist/types/scale/index.d.ts +7 -0
- package/dist/types/theme/chartTheme.d.mts +54 -0
- package/dist/types/theme/chartTheme.d.ts +54 -0
- package/dist/types/types.d.mts +689 -0
- package/dist/types/types.d.ts +689 -0
- package/dist/types/util/emitter.d.mts +11 -0
- package/dist/types/util/emitter.d.ts +11 -0
- package/dist/types/util/math.d.mts +14 -0
- package/dist/types/util/math.d.ts +14 -0
- package/dist/types/util/text.d.mts +10 -0
- package/dist/types/util/text.d.ts +10 -0
- package/package.json +100 -0
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { ChartComponent } from './ChartComponent';
|
|
2
|
+
import type { ChartTheme, GridOption } from '../types';
|
|
3
|
+
import type { Rect } from '../internal';
|
|
4
|
+
import type { Scale } from '../scale';
|
|
5
|
+
/** 网格线。绘制在 series 之下,不参与命中测试。 */
|
|
6
|
+
export declare class GridLines extends ChartComponent {
|
|
7
|
+
xScale: Scale | null;
|
|
8
|
+
yScale: Scale | null;
|
|
9
|
+
/** 水平网格线:每个 y 轴一组(默认只有主轴画网格线)。 */
|
|
10
|
+
horizontal: Array<{
|
|
11
|
+
scale: Scale;
|
|
12
|
+
ticks: any[];
|
|
13
|
+
index?: number;
|
|
14
|
+
}>;
|
|
15
|
+
plot: Rect;
|
|
16
|
+
grid: GridOption;
|
|
17
|
+
theme: ChartTheme | null;
|
|
18
|
+
/** 坐标轴组件:网格线的位置**全部问坐标轴要**,保证过渡期间两者不脱节。 */
|
|
19
|
+
axisX: any;
|
|
20
|
+
axisYList: any[];
|
|
21
|
+
constructor(props: {
|
|
22
|
+
width: number;
|
|
23
|
+
height: number;
|
|
24
|
+
zIndex?: number;
|
|
25
|
+
});
|
|
26
|
+
/**
|
|
27
|
+
* 由 ICEChart 在坐标轴同步之后调用。
|
|
28
|
+
*
|
|
29
|
+
* 网格线不自己算位置(位置全部读坐标轴的 `renderedTickPos`),但必须**每帧重绘**,
|
|
30
|
+
* 所以借一条与刻度同长的补间当「脏驱动」——否则标签在滑动、网格线却停在旧位置。
|
|
31
|
+
*/
|
|
32
|
+
syncTicks(): void;
|
|
33
|
+
/** 某个 y 轴刻度的当前渲染位置(过渡中取中间值)。 */
|
|
34
|
+
private yTickPos;
|
|
35
|
+
private xTickPos;
|
|
36
|
+
protected doRender(): void;
|
|
37
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { ChartComponent } from './ChartComponent.mjs';
|
|
2
|
+
import type { ChartTheme } from '../types.mjs';
|
|
3
|
+
export interface HighlightItem {
|
|
4
|
+
/** 标记中心:圆环是圆心,柱形是矩形中心。 */
|
|
5
|
+
x: number;
|
|
6
|
+
y: number;
|
|
7
|
+
color: string;
|
|
8
|
+
/** 圆点标记的直径(shape 为 circle 时使用)。 */
|
|
9
|
+
size: number;
|
|
10
|
+
/** 标记形状:数据点用圆环,柱形用矩形描边(更贴合图形语义)。 */
|
|
11
|
+
shape?: 'circle' | 'rect';
|
|
12
|
+
/** shape 为 rect 时的尺寸(以 x/y 为中心的宽高)。 */
|
|
13
|
+
width?: number;
|
|
14
|
+
height?: number;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* 高亮层:悬停标记环 + 选中标记环。
|
|
18
|
+
*
|
|
19
|
+
* 它是一块独立的小组件,而不是让 series 重绘自己 —— 鼠标在数据点上移动时,
|
|
20
|
+
* 只有这一个组件变脏,脏矩形就是标记环那一小块像素,series 的折线/柱子完全不动。
|
|
21
|
+
*/
|
|
22
|
+
export declare class Highlight extends ChartComponent {
|
|
23
|
+
theme: ChartTheme | null;
|
|
24
|
+
hoverItems: HighlightItem[];
|
|
25
|
+
selectionItems: HighlightItem[];
|
|
26
|
+
constructor(props: {
|
|
27
|
+
width: number;
|
|
28
|
+
height: number;
|
|
29
|
+
zIndex?: number;
|
|
30
|
+
});
|
|
31
|
+
setHover(items: HighlightItem[]): this;
|
|
32
|
+
setSelection(items: HighlightItem[]): this;
|
|
33
|
+
protected doRender(): void;
|
|
34
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { ChartComponent } from './ChartComponent';
|
|
2
|
+
import type { ChartTheme } from '../types';
|
|
3
|
+
export interface HighlightItem {
|
|
4
|
+
/** 标记中心:圆环是圆心,柱形是矩形中心。 */
|
|
5
|
+
x: number;
|
|
6
|
+
y: number;
|
|
7
|
+
color: string;
|
|
8
|
+
/** 圆点标记的直径(shape 为 circle 时使用)。 */
|
|
9
|
+
size: number;
|
|
10
|
+
/** 标记形状:数据点用圆环,柱形用矩形描边(更贴合图形语义)。 */
|
|
11
|
+
shape?: 'circle' | 'rect';
|
|
12
|
+
/** shape 为 rect 时的尺寸(以 x/y 为中心的宽高)。 */
|
|
13
|
+
width?: number;
|
|
14
|
+
height?: number;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* 高亮层:悬停标记环 + 选中标记环。
|
|
18
|
+
*
|
|
19
|
+
* 它是一块独立的小组件,而不是让 series 重绘自己 —— 鼠标在数据点上移动时,
|
|
20
|
+
* 只有这一个组件变脏,脏矩形就是标记环那一小块像素,series 的折线/柱子完全不动。
|
|
21
|
+
*/
|
|
22
|
+
export declare class Highlight extends ChartComponent {
|
|
23
|
+
theme: ChartTheme | null;
|
|
24
|
+
hoverItems: HighlightItem[];
|
|
25
|
+
selectionItems: HighlightItem[];
|
|
26
|
+
constructor(props: {
|
|
27
|
+
width: number;
|
|
28
|
+
height: number;
|
|
29
|
+
zIndex?: number;
|
|
30
|
+
});
|
|
31
|
+
setHover(items: HighlightItem[]): this;
|
|
32
|
+
setSelection(items: HighlightItem[]): this;
|
|
33
|
+
protected doRender(): void;
|
|
34
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { ChartComponent } from './ChartComponent.mjs';
|
|
2
|
+
import type { ChartTheme } from '../types.mjs';
|
|
3
|
+
import type { ChartLayout, LegendItemLayout } from '../internal.mjs';
|
|
4
|
+
/**
|
|
5
|
+
* 图例。每个图例项都是命中目标:containsLocalPoint 只在自己项的矩形内返回 true,
|
|
6
|
+
* 因此引擎的命中测试会把点击精确交给图例本身,而不是整块画布。
|
|
7
|
+
*/
|
|
8
|
+
export declare class Legend extends ChartComponent {
|
|
9
|
+
layout: ChartLayout | null;
|
|
10
|
+
theme: ChartTheme | null;
|
|
11
|
+
selectable: boolean;
|
|
12
|
+
/** 当前悬停的图例项下标;-1 表示无。 */
|
|
13
|
+
hoverIndex: number;
|
|
14
|
+
constructor(props: {
|
|
15
|
+
width: number;
|
|
16
|
+
height: number;
|
|
17
|
+
zIndex?: number;
|
|
18
|
+
});
|
|
19
|
+
get items(): LegendItemLayout[];
|
|
20
|
+
/** 命中项下标;-1 表示没命中。 */
|
|
21
|
+
hitItem(localX: number, localY: number): number;
|
|
22
|
+
protected containsLocalPoint(localX: number, localY: number): boolean;
|
|
23
|
+
protected doRender(): void;
|
|
24
|
+
}
|
|
25
|
+
/** 圆角矩形路径(不依赖 roundRect API,兼容小程序基础库)。 */
|
|
26
|
+
export declare function roundRect(ctx: any, x: number, y: number, w: number, h: number, r: number): void;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { ChartComponent } from './ChartComponent';
|
|
2
|
+
import type { ChartTheme } from '../types';
|
|
3
|
+
import type { ChartLayout, LegendItemLayout } from '../internal';
|
|
4
|
+
/**
|
|
5
|
+
* 图例。每个图例项都是命中目标:containsLocalPoint 只在自己项的矩形内返回 true,
|
|
6
|
+
* 因此引擎的命中测试会把点击精确交给图例本身,而不是整块画布。
|
|
7
|
+
*/
|
|
8
|
+
export declare class Legend extends ChartComponent {
|
|
9
|
+
layout: ChartLayout | null;
|
|
10
|
+
theme: ChartTheme | null;
|
|
11
|
+
selectable: boolean;
|
|
12
|
+
/** 当前悬停的图例项下标;-1 表示无。 */
|
|
13
|
+
hoverIndex: number;
|
|
14
|
+
constructor(props: {
|
|
15
|
+
width: number;
|
|
16
|
+
height: number;
|
|
17
|
+
zIndex?: number;
|
|
18
|
+
});
|
|
19
|
+
get items(): LegendItemLayout[];
|
|
20
|
+
/** 命中项下标;-1 表示没命中。 */
|
|
21
|
+
hitItem(localX: number, localY: number): number;
|
|
22
|
+
protected containsLocalPoint(localX: number, localY: number): boolean;
|
|
23
|
+
protected doRender(): void;
|
|
24
|
+
}
|
|
25
|
+
/** 圆角矩形路径(不依赖 roundRect API,兼容小程序基础库)。 */
|
|
26
|
+
export declare function roundRect(ctx: any, x: number, y: number, w: number, h: number, r: number): void;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ChartComponent } from './ChartComponent.mjs';
|
|
2
|
+
/**
|
|
3
|
+
* 绘图区背景 + 空白处交互面。
|
|
4
|
+
*
|
|
5
|
+
* 它存在的意义不只是背景色:当指针落在绘图区但**没有命中任何数据标记**时
|
|
6
|
+
* (系列组件的 containsLocalPoint 返回 false),引擎的命中测试会落到这个组件上,
|
|
7
|
+
* 于是「拖拽平移 / 框选 / 点击空白取消选中」才有明确的宿主。
|
|
8
|
+
*/
|
|
9
|
+
export declare class PlotArea extends ChartComponent {
|
|
10
|
+
background: string | null;
|
|
11
|
+
borderColor: string | null;
|
|
12
|
+
constructor(props: {
|
|
13
|
+
left: number;
|
|
14
|
+
top: number;
|
|
15
|
+
width: number;
|
|
16
|
+
height: number;
|
|
17
|
+
zIndex?: number;
|
|
18
|
+
});
|
|
19
|
+
setBackground(color: string | null): this;
|
|
20
|
+
protected doRender(): void;
|
|
21
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ChartComponent } from './ChartComponent';
|
|
2
|
+
/**
|
|
3
|
+
* 绘图区背景 + 空白处交互面。
|
|
4
|
+
*
|
|
5
|
+
* 它存在的意义不只是背景色:当指针落在绘图区但**没有命中任何数据标记**时
|
|
6
|
+
* (系列组件的 containsLocalPoint 返回 false),引擎的命中测试会落到这个组件上,
|
|
7
|
+
* 于是「拖拽平移 / 框选 / 点击空白取消选中」才有明确的宿主。
|
|
8
|
+
*/
|
|
9
|
+
export declare class PlotArea extends ChartComponent {
|
|
10
|
+
background: string | null;
|
|
11
|
+
borderColor: string | null;
|
|
12
|
+
constructor(props: {
|
|
13
|
+
left: number;
|
|
14
|
+
top: number;
|
|
15
|
+
width: number;
|
|
16
|
+
height: number;
|
|
17
|
+
zIndex?: number;
|
|
18
|
+
});
|
|
19
|
+
setBackground(color: string | null): this;
|
|
20
|
+
protected doRender(): void;
|
|
21
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { ChartComponent } from './ChartComponent.mjs';
|
|
2
|
+
import type { ChartTheme, PolarGridOption } from '../types.mjs';
|
|
3
|
+
import type { ChartLayout, Rect } from '../internal.mjs';
|
|
4
|
+
import type { Scale } from '../scale.mjs';
|
|
5
|
+
export interface PolarGridCoord {
|
|
6
|
+
plot: Rect;
|
|
7
|
+
/** 直角坐标的比例尺:极坐标网格画在直角坐标场景里(配合 aspect: 'equal')。 */
|
|
8
|
+
xScale: Scale;
|
|
9
|
+
yScale: Scale;
|
|
10
|
+
options: PolarGridOption;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* 极坐标网格:同心圆 + 角度辐条 + 角度刻度(MATLAB `polarplot` 的那套底图)。
|
|
14
|
+
*
|
|
15
|
+
* 为什么画在直角坐标场景里:`r(θ)` 曲线本身就是 `(r·cosθ, r·sinθ)` 的参数曲线,
|
|
16
|
+
* 只要坐标轴等比(`aspect: 'equal'`),几何就是圆的;网格跟着同一套比例尺走即可,
|
|
17
|
+
* 不需要再造一个极坐标场景(雷达图那套有指标轴,语义不同)。
|
|
18
|
+
*
|
|
19
|
+
* 圆心取 **比例尺映射后的原点**(不是绘图区中心)—— 数据域不对称时原点并不在中心。
|
|
20
|
+
* 半径取「原点到最近一条绘图区边界的距离」,保证同心圆始终完整落在绘图区内。
|
|
21
|
+
*/
|
|
22
|
+
export declare class PolarGrid extends ChartComponent {
|
|
23
|
+
coord: PolarGridCoord | null;
|
|
24
|
+
theme: ChartTheme | null;
|
|
25
|
+
layout: ChartLayout | null;
|
|
26
|
+
constructor(props: {
|
|
27
|
+
width: number;
|
|
28
|
+
height: number;
|
|
29
|
+
zIndex?: number;
|
|
30
|
+
});
|
|
31
|
+
/** 网格半径(数据单位)与圆心像素:半径 = 原点到最近边界。 */
|
|
32
|
+
private geometry;
|
|
33
|
+
protected doRender(): void;
|
|
34
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { ChartComponent } from './ChartComponent';
|
|
2
|
+
import type { ChartTheme, PolarGridOption } from '../types';
|
|
3
|
+
import type { ChartLayout, Rect } from '../internal';
|
|
4
|
+
import type { Scale } from '../scale';
|
|
5
|
+
export interface PolarGridCoord {
|
|
6
|
+
plot: Rect;
|
|
7
|
+
/** 直角坐标的比例尺:极坐标网格画在直角坐标场景里(配合 aspect: 'equal')。 */
|
|
8
|
+
xScale: Scale;
|
|
9
|
+
yScale: Scale;
|
|
10
|
+
options: PolarGridOption;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* 极坐标网格:同心圆 + 角度辐条 + 角度刻度(MATLAB `polarplot` 的那套底图)。
|
|
14
|
+
*
|
|
15
|
+
* 为什么画在直角坐标场景里:`r(θ)` 曲线本身就是 `(r·cosθ, r·sinθ)` 的参数曲线,
|
|
16
|
+
* 只要坐标轴等比(`aspect: 'equal'`),几何就是圆的;网格跟着同一套比例尺走即可,
|
|
17
|
+
* 不需要再造一个极坐标场景(雷达图那套有指标轴,语义不同)。
|
|
18
|
+
*
|
|
19
|
+
* 圆心取 **比例尺映射后的原点**(不是绘图区中心)—— 数据域不对称时原点并不在中心。
|
|
20
|
+
* 半径取「原点到最近一条绘图区边界的距离」,保证同心圆始终完整落在绘图区内。
|
|
21
|
+
*/
|
|
22
|
+
export declare class PolarGrid extends ChartComponent {
|
|
23
|
+
coord: PolarGridCoord | null;
|
|
24
|
+
theme: ChartTheme | null;
|
|
25
|
+
layout: ChartLayout | null;
|
|
26
|
+
constructor(props: {
|
|
27
|
+
width: number;
|
|
28
|
+
height: number;
|
|
29
|
+
zIndex?: number;
|
|
30
|
+
});
|
|
31
|
+
/** 网格半径(数据单位)与圆心像素:半径 = 原点到最近边界。 */
|
|
32
|
+
private geometry;
|
|
33
|
+
protected doRender(): void;
|
|
34
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ChartComponent } from './ChartComponent.mjs';
|
|
2
|
+
import type { ChartTheme } from '../types.mjs';
|
|
3
|
+
import type { ChartLayout, PolarLayout, Rect } from '../internal.mjs';
|
|
4
|
+
export interface RadarGridCoord {
|
|
5
|
+
polar: PolarLayout;
|
|
6
|
+
plot: Rect;
|
|
7
|
+
indicators: Array<{
|
|
8
|
+
name: string;
|
|
9
|
+
max: number;
|
|
10
|
+
}>;
|
|
11
|
+
shape: 'polygon' | 'circle';
|
|
12
|
+
splitNumber: number;
|
|
13
|
+
}
|
|
14
|
+
/** 雷达图的网格:同心环 + 指标轴 + 指标名。 */
|
|
15
|
+
export declare class RadarGrid extends ChartComponent {
|
|
16
|
+
coord: RadarGridCoord | null;
|
|
17
|
+
theme: ChartTheme | null;
|
|
18
|
+
layout: ChartLayout | null;
|
|
19
|
+
constructor(props: {
|
|
20
|
+
width: number;
|
|
21
|
+
height: number;
|
|
22
|
+
zIndex?: number;
|
|
23
|
+
});
|
|
24
|
+
protected doRender(): void;
|
|
25
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ChartComponent } from './ChartComponent';
|
|
2
|
+
import type { ChartTheme } from '../types';
|
|
3
|
+
import type { ChartLayout, PolarLayout, Rect } from '../internal';
|
|
4
|
+
export interface RadarGridCoord {
|
|
5
|
+
polar: PolarLayout;
|
|
6
|
+
plot: Rect;
|
|
7
|
+
indicators: Array<{
|
|
8
|
+
name: string;
|
|
9
|
+
max: number;
|
|
10
|
+
}>;
|
|
11
|
+
shape: 'polygon' | 'circle';
|
|
12
|
+
splitNumber: number;
|
|
13
|
+
}
|
|
14
|
+
/** 雷达图的网格:同心环 + 指标轴 + 指标名。 */
|
|
15
|
+
export declare class RadarGrid extends ChartComponent {
|
|
16
|
+
coord: RadarGridCoord | null;
|
|
17
|
+
theme: ChartTheme | null;
|
|
18
|
+
layout: ChartLayout | null;
|
|
19
|
+
constructor(props: {
|
|
20
|
+
width: number;
|
|
21
|
+
height: number;
|
|
22
|
+
zIndex?: number;
|
|
23
|
+
});
|
|
24
|
+
protected doRender(): void;
|
|
25
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ChartComponent } from './ChartComponent.mjs';
|
|
2
|
+
import type { ChartTheme } from '../types.mjs';
|
|
3
|
+
import type { ChartLayout } from '../internal.mjs';
|
|
4
|
+
/** 标题 / 副标题。 */
|
|
5
|
+
export declare class Title extends ChartComponent {
|
|
6
|
+
layout: ChartLayout | null;
|
|
7
|
+
theme: ChartTheme | null;
|
|
8
|
+
constructor(props: {
|
|
9
|
+
width: number;
|
|
10
|
+
height: number;
|
|
11
|
+
zIndex?: number;
|
|
12
|
+
});
|
|
13
|
+
protected doRender(): void;
|
|
14
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ChartComponent } from './ChartComponent';
|
|
2
|
+
import type { ChartTheme } from '../types';
|
|
3
|
+
import type { ChartLayout } from '../internal';
|
|
4
|
+
/** 标题 / 副标题。 */
|
|
5
|
+
export declare class Title extends ChartComponent {
|
|
6
|
+
layout: ChartLayout | null;
|
|
7
|
+
theme: ChartTheme | null;
|
|
8
|
+
constructor(props: {
|
|
9
|
+
width: number;
|
|
10
|
+
height: number;
|
|
11
|
+
zIndex?: number;
|
|
12
|
+
});
|
|
13
|
+
protected doRender(): void;
|
|
14
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { ChartComponent } from './ChartComponent.mjs';
|
|
2
|
+
import type { ChartTheme, TooltipOption } from '../types.mjs';
|
|
3
|
+
import type { ChartLayout } from '../internal.mjs';
|
|
4
|
+
export interface TooltipRow {
|
|
5
|
+
name: string;
|
|
6
|
+
value: string;
|
|
7
|
+
color: string;
|
|
8
|
+
}
|
|
9
|
+
export interface TooltipContent {
|
|
10
|
+
title: string;
|
|
11
|
+
rows: TooltipRow[];
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* 提示框。画在画布内(不使用 HTML 浮层),因此小程序等无 DOM 运行时同样可用,
|
|
15
|
+
* 也能被引擎的离屏缓存 / 脏矩形机制正确擦除。
|
|
16
|
+
*/
|
|
17
|
+
export declare class Tooltip extends ChartComponent {
|
|
18
|
+
theme: ChartTheme | null;
|
|
19
|
+
option: TooltipOption;
|
|
20
|
+
layout: ChartLayout | null;
|
|
21
|
+
content: TooltipContent | null;
|
|
22
|
+
anchor: [number, number];
|
|
23
|
+
/** 是否让提示框跟随指针(axis 触发器常关掉,让它固定在数据列上方)。 */
|
|
24
|
+
follow: boolean;
|
|
25
|
+
/** 最近一次实际绘制的面板矩形(图表坐标系),供外观审计 / 测试断言使用。 */
|
|
26
|
+
lastRect: {
|
|
27
|
+
x: number;
|
|
28
|
+
y: number;
|
|
29
|
+
width: number;
|
|
30
|
+
height: number;
|
|
31
|
+
} | null;
|
|
32
|
+
/** 淡出中:等透明度到 0 再清内容(避免「淡入很柔、消失很硬」)。 */
|
|
33
|
+
private pendingClear;
|
|
34
|
+
constructor(props: {
|
|
35
|
+
width: number;
|
|
36
|
+
height: number;
|
|
37
|
+
zIndex?: number;
|
|
38
|
+
});
|
|
39
|
+
show(content: TooltipContent, anchor: [number, number]): this;
|
|
40
|
+
hide(): this;
|
|
41
|
+
/** 绘制用的透明度:没有动画状态时按「完全不透明」处理(向后兼容)。 */
|
|
42
|
+
panelOpacity(): number;
|
|
43
|
+
/** 动画起点用的当前透明度:还没有任何状态时是 0(面板尚未出现)。 */
|
|
44
|
+
private currentOpacity;
|
|
45
|
+
/** 面板出现/消失:淡入 + 轻微上移(消失只淡出,不做位移,避免「飘走」的错觉)。 */
|
|
46
|
+
private playFade;
|
|
47
|
+
protected doRender(): void;
|
|
48
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { ChartComponent } from './ChartComponent';
|
|
2
|
+
import type { ChartTheme, TooltipOption } from '../types';
|
|
3
|
+
import type { ChartLayout } from '../internal';
|
|
4
|
+
export interface TooltipRow {
|
|
5
|
+
name: string;
|
|
6
|
+
value: string;
|
|
7
|
+
color: string;
|
|
8
|
+
}
|
|
9
|
+
export interface TooltipContent {
|
|
10
|
+
title: string;
|
|
11
|
+
rows: TooltipRow[];
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* 提示框。画在画布内(不使用 HTML 浮层),因此小程序等无 DOM 运行时同样可用,
|
|
15
|
+
* 也能被引擎的离屏缓存 / 脏矩形机制正确擦除。
|
|
16
|
+
*/
|
|
17
|
+
export declare class Tooltip extends ChartComponent {
|
|
18
|
+
theme: ChartTheme | null;
|
|
19
|
+
option: TooltipOption;
|
|
20
|
+
layout: ChartLayout | null;
|
|
21
|
+
content: TooltipContent | null;
|
|
22
|
+
anchor: [number, number];
|
|
23
|
+
/** 是否让提示框跟随指针(axis 触发器常关掉,让它固定在数据列上方)。 */
|
|
24
|
+
follow: boolean;
|
|
25
|
+
/** 最近一次实际绘制的面板矩形(图表坐标系),供外观审计 / 测试断言使用。 */
|
|
26
|
+
lastRect: {
|
|
27
|
+
x: number;
|
|
28
|
+
y: number;
|
|
29
|
+
width: number;
|
|
30
|
+
height: number;
|
|
31
|
+
} | null;
|
|
32
|
+
/** 淡出中:等透明度到 0 再清内容(避免「淡入很柔、消失很硬」)。 */
|
|
33
|
+
private pendingClear;
|
|
34
|
+
constructor(props: {
|
|
35
|
+
width: number;
|
|
36
|
+
height: number;
|
|
37
|
+
zIndex?: number;
|
|
38
|
+
});
|
|
39
|
+
show(content: TooltipContent, anchor: [number, number]): this;
|
|
40
|
+
hide(): this;
|
|
41
|
+
/** 绘制用的透明度:没有动画状态时按「完全不透明」处理(向后兼容)。 */
|
|
42
|
+
panelOpacity(): number;
|
|
43
|
+
/** 动画起点用的当前透明度:还没有任何状态时是 0(面板尚未出现)。 */
|
|
44
|
+
private currentOpacity;
|
|
45
|
+
/** 面板出现/消失:淡入 + 轻微上移(消失只淡出,不做位移,避免「飘走」的错觉)。 */
|
|
46
|
+
private playFade;
|
|
47
|
+
protected doRender(): void;
|
|
48
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { LineSeries } from './LineSeries.mjs';
|
|
2
|
+
import type { SeriesType } from '../../types.mjs';
|
|
3
|
+
import type { InternalSeries } from '../../internal.mjs';
|
|
4
|
+
/** 面积图:折线 + 到基线的填充(堆叠时基线为前序堆叠值)。 */
|
|
5
|
+
export declare class AreaSeries extends LineSeries {
|
|
6
|
+
seriesType: SeriesType;
|
|
7
|
+
constructor(series: InternalSeries, props: {
|
|
8
|
+
left: number;
|
|
9
|
+
top: number;
|
|
10
|
+
width: number;
|
|
11
|
+
height: number;
|
|
12
|
+
zIndex?: number;
|
|
13
|
+
});
|
|
14
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { LineSeries } from './LineSeries';
|
|
2
|
+
import type { SeriesType } from '../../types';
|
|
3
|
+
import type { InternalSeries } from '../../internal';
|
|
4
|
+
/** 面积图:折线 + 到基线的填充(堆叠时基线为前序堆叠值)。 */
|
|
5
|
+
export declare class AreaSeries extends LineSeries {
|
|
6
|
+
seriesType: SeriesType;
|
|
7
|
+
constructor(series: InternalSeries, props: {
|
|
8
|
+
left: number;
|
|
9
|
+
top: number;
|
|
10
|
+
width: number;
|
|
11
|
+
height: number;
|
|
12
|
+
zIndex?: number;
|
|
13
|
+
});
|
|
14
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { SeriesBase } from './SeriesBase.mjs';
|
|
2
|
+
import type { SeriesType } from '../../types.mjs';
|
|
3
|
+
import type { Rect } from '../../internal.mjs';
|
|
4
|
+
/** 柱状图(支持分组与堆叠)。 */
|
|
5
|
+
export declare class BarSeries extends SeriesBase {
|
|
6
|
+
seriesType: SeriesType;
|
|
7
|
+
protected clipToBox: boolean;
|
|
8
|
+
private barCacheKey;
|
|
9
|
+
/** 横向柱状图:类目在 y 轴上(排行榜最常见的形式)。 */
|
|
10
|
+
private isHorizontal;
|
|
11
|
+
/**
|
|
12
|
+
* 像素缓存 = 每根柱子的中心。
|
|
13
|
+
* 基类按「xValue → x 比例尺」映射,横向图上 xValue 是类目、x 轴是数值,映射不出坐标;
|
|
14
|
+
* 柱子本来就是矩形,用矩形中心作为「数据点的位置」才是对的(高亮、提示框锚点都受益)。
|
|
15
|
+
*/
|
|
16
|
+
protected rebuildPixels(): void;
|
|
17
|
+
/** 单根柱子的像素矩形(组件本地坐标)。 */
|
|
18
|
+
barRectAt(index: number): Rect | null;
|
|
19
|
+
private resolveBarWidth;
|
|
20
|
+
/**
|
|
21
|
+
* 单根柱子的颜色(瀑布图按增/减/合计覆写)。
|
|
22
|
+
*
|
|
23
|
+
* 支持**逐项配色**:数据项写成 `{ value, color }` 就按项取色 ——
|
|
24
|
+
* 「红涨绿跌」「告警分级」「正负值分色」这类大屏常见需求都靠它,
|
|
25
|
+
* 以前只有系列级颜色,只能靠拆成多个系列去凑(还会把柱子排成一组一组的)。
|
|
26
|
+
*/
|
|
27
|
+
protected barColorAt(index: number): string;
|
|
28
|
+
/**
|
|
29
|
+
* 悬停时实际绘制的矩形:沿柱子的「值方向」外扩一点点,锚点始终在基线,
|
|
30
|
+
* 所以柱子只会变长,不会整体平移(水平柱同理,往值增大的方向伸长)。
|
|
31
|
+
* 越出绘图区的部分由引擎裁剪,不会盖到坐标轴。
|
|
32
|
+
*
|
|
33
|
+
* `t` 用来取「动画到某个进度时」的矩形:高亮描边层用 `t = 1` 取终态,
|
|
34
|
+
* 这样描边始终贴着柱子的最终轮廓,不会出现「描边画在柱子中间」的接缝。
|
|
35
|
+
*/
|
|
36
|
+
barDrawRectAt(index: number, t?: number): Rect | null;
|
|
37
|
+
protected doRender(): void;
|
|
38
|
+
hitTestIndex(localX: number, localY: number): number;
|
|
39
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { SeriesBase } from './SeriesBase';
|
|
2
|
+
import type { SeriesType } from '../../types';
|
|
3
|
+
import type { Rect } from '../../internal';
|
|
4
|
+
/** 柱状图(支持分组与堆叠)。 */
|
|
5
|
+
export declare class BarSeries extends SeriesBase {
|
|
6
|
+
seriesType: SeriesType;
|
|
7
|
+
protected clipToBox: boolean;
|
|
8
|
+
private barCacheKey;
|
|
9
|
+
/** 横向柱状图:类目在 y 轴上(排行榜最常见的形式)。 */
|
|
10
|
+
private isHorizontal;
|
|
11
|
+
/**
|
|
12
|
+
* 像素缓存 = 每根柱子的中心。
|
|
13
|
+
* 基类按「xValue → x 比例尺」映射,横向图上 xValue 是类目、x 轴是数值,映射不出坐标;
|
|
14
|
+
* 柱子本来就是矩形,用矩形中心作为「数据点的位置」才是对的(高亮、提示框锚点都受益)。
|
|
15
|
+
*/
|
|
16
|
+
protected rebuildPixels(): void;
|
|
17
|
+
/** 单根柱子的像素矩形(组件本地坐标)。 */
|
|
18
|
+
barRectAt(index: number): Rect | null;
|
|
19
|
+
private resolveBarWidth;
|
|
20
|
+
/**
|
|
21
|
+
* 单根柱子的颜色(瀑布图按增/减/合计覆写)。
|
|
22
|
+
*
|
|
23
|
+
* 支持**逐项配色**:数据项写成 `{ value, color }` 就按项取色 ——
|
|
24
|
+
* 「红涨绿跌」「告警分级」「正负值分色」这类大屏常见需求都靠它,
|
|
25
|
+
* 以前只有系列级颜色,只能靠拆成多个系列去凑(还会把柱子排成一组一组的)。
|
|
26
|
+
*/
|
|
27
|
+
protected barColorAt(index: number): string;
|
|
28
|
+
/**
|
|
29
|
+
* 悬停时实际绘制的矩形:沿柱子的「值方向」外扩一点点,锚点始终在基线,
|
|
30
|
+
* 所以柱子只会变长,不会整体平移(水平柱同理,往值增大的方向伸长)。
|
|
31
|
+
* 越出绘图区的部分由引擎裁剪,不会盖到坐标轴。
|
|
32
|
+
*
|
|
33
|
+
* `t` 用来取「动画到某个进度时」的矩形:高亮描边层用 `t = 1` 取终态,
|
|
34
|
+
* 这样描边始终贴着柱子的最终轮廓,不会出现「描边画在柱子中间」的接缝。
|
|
35
|
+
*/
|
|
36
|
+
barDrawRectAt(index: number, t?: number): Rect | null;
|
|
37
|
+
protected doRender(): void;
|
|
38
|
+
hitTestIndex(localX: number, localY: number): number;
|
|
39
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { SeriesBase } from './SeriesBase.mjs';
|
|
2
|
+
import type { SeriesType } from '../../types.mjs';
|
|
3
|
+
import type { Rect } from '../../internal.mjs';
|
|
4
|
+
/** 箱线图:每个数据项是 [min, Q1, median, Q3, max]。 */
|
|
5
|
+
export declare class BoxplotSeries extends SeriesBase {
|
|
6
|
+
seriesType: SeriesType;
|
|
7
|
+
protected clipToBox: boolean;
|
|
8
|
+
private boxCacheKey;
|
|
9
|
+
private boxWidthAt;
|
|
10
|
+
/** 每个箱线图的像素几何(本地坐标)。 */
|
|
11
|
+
boxRectAt(index: number): Rect | null;
|
|
12
|
+
/** 像素缓存 = 箱体中心(高亮与提示框锚点)。 */
|
|
13
|
+
protected rebuildPixels(): void;
|
|
14
|
+
hitTestIndex(localX: number, localY: number): number;
|
|
15
|
+
protected doRender(): void;
|
|
16
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { SeriesBase } from './SeriesBase';
|
|
2
|
+
import type { SeriesType } from '../../types';
|
|
3
|
+
import type { Rect } from '../../internal';
|
|
4
|
+
/** 箱线图:每个数据项是 [min, Q1, median, Q3, max]。 */
|
|
5
|
+
export declare class BoxplotSeries extends SeriesBase {
|
|
6
|
+
seriesType: SeriesType;
|
|
7
|
+
protected clipToBox: boolean;
|
|
8
|
+
private boxCacheKey;
|
|
9
|
+
private boxWidthAt;
|
|
10
|
+
/** 每个箱线图的像素几何(本地坐标)。 */
|
|
11
|
+
boxRectAt(index: number): Rect | null;
|
|
12
|
+
/** 像素缓存 = 箱体中心(高亮与提示框锚点)。 */
|
|
13
|
+
protected rebuildPixels(): void;
|
|
14
|
+
hitTestIndex(localX: number, localY: number): number;
|
|
15
|
+
protected doRender(): void;
|
|
16
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { SeriesBase } from './SeriesBase.mjs';
|
|
2
|
+
import type { SeriesType } from '../../types.mjs';
|
|
3
|
+
/** K 线(蜡烛图):每个数据项是 [open, close, low, high]。 */
|
|
4
|
+
export declare class CandlestickSeries extends SeriesBase {
|
|
5
|
+
seriesType: SeriesType;
|
|
6
|
+
protected supportsSampling: boolean;
|
|
7
|
+
protected clipToBox: boolean;
|
|
8
|
+
hitTestIndex(localX: number, localY: number): number;
|
|
9
|
+
/** 每根蜡烛的外接矩形(影线 + 实体),本地坐标。 */
|
|
10
|
+
private candleRects;
|
|
11
|
+
private resolveBodyWidth;
|
|
12
|
+
protected doRender(): void;
|
|
13
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { SeriesBase } from './SeriesBase';
|
|
2
|
+
import type { SeriesType } from '../../types';
|
|
3
|
+
/** K 线(蜡烛图):每个数据项是 [open, close, low, high]。 */
|
|
4
|
+
export declare class CandlestickSeries extends SeriesBase {
|
|
5
|
+
seriesType: SeriesType;
|
|
6
|
+
protected supportsSampling: boolean;
|
|
7
|
+
protected clipToBox: boolean;
|
|
8
|
+
hitTestIndex(localX: number, localY: number): number;
|
|
9
|
+
/** 每根蜡烛的外接矩形(影线 + 实体),本地坐标。 */
|
|
10
|
+
private candleRects;
|
|
11
|
+
private resolveBodyWidth;
|
|
12
|
+
protected doRender(): void;
|
|
13
|
+
}
|