@lionad/cx-comps-tanstack-charts 0.1.0-alpha.10
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 -0
- package/dist/area/index.d.ts +26 -0
- package/dist/area/src/index.vue.d.ts +3 -0
- package/dist/bar/index.d.ts +26 -0
- package/dist/bar/src/index.vue.d.ts +3 -0
- package/dist/chart/index.d.ts +26 -0
- package/dist/chart/src/index.vue.d.ts +3 -0
- package/dist/dot/index.d.ts +26 -0
- package/dist/dot/src/index.vue.d.ts +3 -0
- package/dist/index.d.ts +37 -0
- package/dist/index.mjs +2106 -0
- package/dist/line/index.d.ts +26 -0
- package/dist/line/src/index.vue.d.ts +3 -0
- package/dist/pie/index.d.ts +26 -0
- package/dist/pie/src/index.vue.d.ts +3 -0
- package/dist/shared/chart-skeleton.vue.d.ts +8 -0
- package/dist/shared/curve-options.d.ts +9 -0
- package/dist/shared/streaming.d.ts +5 -0
- package/dist/shared/translate/axis.d.ts +9 -0
- package/dist/shared/translate/composite.d.ts +13 -0
- package/dist/shared/translate/curve.d.ts +18 -0
- package/dist/shared/translate/definition.d.ts +7 -0
- package/dist/shared/translate/index.d.ts +15 -0
- package/dist/shared/translate/mark.d.ts +14 -0
- package/dist/shared/translate/polar.d.ts +19 -0
- package/dist/shared/translate/scale.d.ts +8 -0
- package/dist/shared/translate/transforms.d.ts +11 -0
- package/dist/shared/translate/types.d.ts +476 -0
- package/dist/shared/use-chart-props.d.ts +32 -0
- package/dist/shared/use-pie-chart.d.ts +20 -0
- package/dist/shared/use-preset-chart.d.ts +25 -0
- package/dist/stream-triggers.d.ts +9 -0
- package/package.json +64 -0
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
declare const _default: import("vue").Component & import("@lionad/cx-definition").NormalizeKey<Required<{
|
|
2
|
+
name: string;
|
|
3
|
+
getName?: (opts: {
|
|
4
|
+
cx: import("@lionad/cx-definition").CxLoaderInstance;
|
|
5
|
+
comp: import("@lionad/cx-definition").CxComponentRuntime;
|
|
6
|
+
data?: Record<string, unknown>;
|
|
7
|
+
}) => string;
|
|
8
|
+
icon: string;
|
|
9
|
+
description: string;
|
|
10
|
+
key: string;
|
|
11
|
+
aliasKeys?: string | string[];
|
|
12
|
+
component: import("vue").Component;
|
|
13
|
+
headless?: boolean;
|
|
14
|
+
async?: boolean;
|
|
15
|
+
props?: import("@lionad/cx-definition").CxComponentMetaProps;
|
|
16
|
+
emits?: import("@lionad/cx-definition").CxComponentMetaEmits;
|
|
17
|
+
exposes?: import("@lionad/cx-definition").CxComponentMetaExposes;
|
|
18
|
+
slots?: import("@lionad/cx-definition").CxComponentMetaSlots;
|
|
19
|
+
url?: string;
|
|
20
|
+
umdExportsName?: string;
|
|
21
|
+
type?: "umd" | "esm" | "local";
|
|
22
|
+
rules?: {
|
|
23
|
+
edit: Record<string, unknown>;
|
|
24
|
+
};
|
|
25
|
+
}>>;
|
|
26
|
+
export default _default;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
2
|
+
declare const _default: typeof __VLS_export;
|
|
3
|
+
export default _default;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
declare const _default: import("vue").Component & import("@lionad/cx-definition").NormalizeKey<Required<{
|
|
2
|
+
name: string;
|
|
3
|
+
getName?: (opts: {
|
|
4
|
+
cx: import("@lionad/cx-definition").CxLoaderInstance;
|
|
5
|
+
comp: import("@lionad/cx-definition").CxComponentRuntime;
|
|
6
|
+
data?: Record<string, unknown>;
|
|
7
|
+
}) => string;
|
|
8
|
+
icon: string;
|
|
9
|
+
description: string;
|
|
10
|
+
key: string;
|
|
11
|
+
aliasKeys?: string | string[];
|
|
12
|
+
component: import("vue").Component;
|
|
13
|
+
headless?: boolean;
|
|
14
|
+
async?: boolean;
|
|
15
|
+
props?: import("@lionad/cx-definition").CxComponentMetaProps;
|
|
16
|
+
emits?: import("@lionad/cx-definition").CxComponentMetaEmits;
|
|
17
|
+
exposes?: import("@lionad/cx-definition").CxComponentMetaExposes;
|
|
18
|
+
slots?: import("@lionad/cx-definition").CxComponentMetaSlots;
|
|
19
|
+
url?: string;
|
|
20
|
+
umdExportsName?: string;
|
|
21
|
+
type?: "umd" | "esm" | "local";
|
|
22
|
+
rules?: {
|
|
23
|
+
edit: Record<string, unknown>;
|
|
24
|
+
};
|
|
25
|
+
}>>;
|
|
26
|
+
export default _default;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
2
|
+
declare const _default: typeof __VLS_export;
|
|
3
|
+
export default _default;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
height?: number;
|
|
3
|
+
};
|
|
4
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
5
|
+
height: number;
|
|
6
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
7
|
+
declare const _default: typeof __VLS_export;
|
|
8
|
+
export default _default;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ChartAxisOptions } from '@tanstack/charts';
|
|
2
|
+
import type { CxChartAxisSpec } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* axis 声明式 → ChartAxisOptions;scale 缺省按轴位回退(x→point、y→linear)。
|
|
5
|
+
* undefined(含流式中间态:definition 开容器后 x/y 字段尚未传到)注入缺省 axis——
|
|
6
|
+
* 库对「mark 物化 channel 但 axis 无 scale 配置」抛错,缺席不等于无轴。
|
|
7
|
+
* null 原样保留(polar 等 scale 值为 never 的 definition 显式无轴)。
|
|
8
|
+
*/
|
|
9
|
+
export declare function translateAxis(spec: CxChartAxisSpec | null | undefined, fallbackKind: 'point' | 'linear'): ChartAxisOptions | null;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ChartMark } from '@tanstack/charts';
|
|
2
|
+
import type { CxChartDatasets, CxChartMarkSpec, CxChartSpec } from './types';
|
|
3
|
+
/** 复合 type 守卫(definition 组装层据此分流;sunburst 虽属 polar 族约定,分发仍走此处) */
|
|
4
|
+
export declare const COMPOSITE_TYPES: ReadonlySet<string>;
|
|
5
|
+
/**
|
|
6
|
+
* 复合 mark 分发。tree/forceGraph 展开为多 mark;forceGraph 额外回传轴域推导结果。
|
|
7
|
+
* translateChild 仅 facet 需要。
|
|
8
|
+
*/
|
|
9
|
+
export declare function translateCompositeMark(spec: CxChartMarkSpec, datasets: CxChartDatasets | undefined, translateChild: (spec: CxChartSpec, rows: readonly unknown[]) => unknown): {
|
|
10
|
+
marks: ChartMark<unknown, any, any>[];
|
|
11
|
+
xDomain?: [number, number];
|
|
12
|
+
yDomain?: [number, number];
|
|
13
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { ChartCurve } from '@tanstack/charts';
|
|
2
|
+
import type { AreaXCurve } from '@tanstack/charts/area-x';
|
|
3
|
+
import type { CurveFactory } from 'd3-shape';
|
|
4
|
+
import type { CxChartCurveName } from './types';
|
|
5
|
+
/** curve 枚举白名单:预设物料组装 spec 前的运行时校验(JSON 输入不受 TS 约束) */
|
|
6
|
+
export declare const CX_CHART_CURVE_NAMES: CxChartCurveName[];
|
|
7
|
+
/** curve 枚举 → ChartCurve(line+area 函数对);未知枚举显式抛错(JSON 输入不受 TS 约束,运行时防御) */
|
|
8
|
+
export declare function translateCurve(name: CxChartCurveName): ChartCurve;
|
|
9
|
+
/**
|
|
10
|
+
* curve 枚举 → AreaXCurve:violinY 等水平展开面积 mark 的专用包装
|
|
11
|
+
* (ViolinYCurve = AreaXCurve,d3Curve 产物不提供 areaX 生成器)。
|
|
12
|
+
*/
|
|
13
|
+
export declare function translateAreaXCurve(name: CxChartCurveName): AreaXCurve;
|
|
14
|
+
/**
|
|
15
|
+
* curve 枚举 → 原生 d3 CurveFactory:polar radial 系(radialLine/radialArea)
|
|
16
|
+
* 的 curve 参数直接消费 d3 工厂而非 ChartCurve 包装(库签名实证 CurveFactory)。
|
|
17
|
+
*/
|
|
18
|
+
export declare function translateRadialCurve(name: CxChartCurveName): CurveFactory;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { DomChartDefinition } from '@tanstack/charts';
|
|
2
|
+
import type { CxChartDatasets, CxChartSpec } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* 声明式 spec → DomChartDefinition(物料渲染入口)。
|
|
5
|
+
* datasets:命名数据集表(数据顶层化契约),marks 内字符串引用在此解析。
|
|
6
|
+
*/
|
|
7
|
+
export declare function translateChartSpec(spec: CxChartSpec, datasets?: CxChartDatasets): DomChartDefinition;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 声明式 JSON → TanStack Charts 运行时定义的翻译层(桶文件)。
|
|
3
|
+
* 模块分工:types(声明式契约)/ curve / scale / axis / mark(基础+spatial)/
|
|
4
|
+
* transforms(数据预处理管道)/ polar(极坐标族)/ composite(七类命名复合)/
|
|
5
|
+
* definition(translateChartSpec 组装入口)。
|
|
6
|
+
*/
|
|
7
|
+
export type { CxChartAxisSpec, CxChartCurveName, CxChartDatasets, CxChartForceSpec, CxChartLayoutSpec, CxChartMarkSpec, CxChartMarkType, CxChartPolarGuideSpec, CxChartReduce, CxChartScaleSpec, CxChartSpec, CxChartTransformOutputs, CxChartTransformSpec, } from './types';
|
|
8
|
+
export { CX_CHART_CURVE_NAMES, translateCurve } from './curve';
|
|
9
|
+
export { translateScale } from './scale';
|
|
10
|
+
export { translateAxis } from './axis';
|
|
11
|
+
export { resolveMarkData, translateMark } from './mark';
|
|
12
|
+
export { applyTransforms, translateOutputs, translateReduce, translateTransform } from './transforms';
|
|
13
|
+
export { POLAR_FAMILY_TYPES, translatePie, translatePolar } from './polar';
|
|
14
|
+
export { COMPOSITE_TYPES, translateCompositeMark } from './composite';
|
|
15
|
+
export { translateChartSpec } from './definition';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ChartMark } from '@tanstack/charts';
|
|
2
|
+
import type { CxChartDatasets, CxChartMarkSpec } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* mark data 解析:字符串 → datasets 查表;数组原样透传。
|
|
5
|
+
* 未命中一律回退空数组——流式中间态(definition 先闭合、数据集在途;多数据集
|
|
6
|
+
* 部分到达)与 LLM 笔误在运行时不可区分,渲染层容错优先(与「渲染链路不过 zod,
|
|
7
|
+
* fallback 从简」契约一致);笔误显式化归生成期校验(spec 渲染断言门)。
|
|
8
|
+
*/
|
|
9
|
+
export declare function resolveMarkData(data: readonly unknown[] | string | undefined, datasets: CxChartDatasets | undefined): readonly unknown[];
|
|
10
|
+
/**
|
|
11
|
+
* 单 mark 声明式 → ChartMark;多余样式键对 mark 工厂无害(按名读取)。
|
|
12
|
+
* polar/pie/sankey 等容器与复合 type 不在此处(polar.ts / composite.ts 分支处理)。
|
|
13
|
+
*/
|
|
14
|
+
export declare function translateMark(spec: CxChartMarkSpec, datasets?: CxChartDatasets): ChartMark<unknown, any, any>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ChartMark } from '@tanstack/charts';
|
|
2
|
+
import type { CxChartDatasets, CxChartMarkSpec } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* polar 容器:{ type:'polar', marks:[radialXxx...], angleAxis, radiusAxis, radiusRatio,
|
|
5
|
+
* startAngle, endAngle, inset, polarGuides } → polar({...})。
|
|
6
|
+
* extraMarks:调用方预组装的 PolarMark(sunburst 等自包含层级 mark 不走 radial 直译)。
|
|
7
|
+
*/
|
|
8
|
+
export declare function translatePolar(spec: CxChartMarkSpec, datasets: CxChartDatasets | undefined, extraMarks?: readonly unknown[]): ChartMark<unknown, any, any>;
|
|
9
|
+
/**
|
|
10
|
+
* pie 命名复合:{ type:'pie', data, value, key, color, innerRadiusRatio, ... } →
|
|
11
|
+
* pie() 角度分配预处理 + polar(radialArc) 一体展开(donut = innerRadiusRatio > 0)。
|
|
12
|
+
* startAngle/endAngle/padAngle 并入 transform options(transform 侧字段名 gapAngle;
|
|
13
|
+
* 容器层同名字段只作用于 angle scale 映射,radialArc 直接读 datum 弧度——
|
|
14
|
+
* 不传 transform 则声明静默失效)。返回 polar 容器 mark,definition 层按 polar 族
|
|
15
|
+
* 约定处理无轴(见 definition.ts)。
|
|
16
|
+
*/
|
|
17
|
+
export declare function translatePie(spec: CxChartMarkSpec, datasets: CxChartDatasets | undefined): ChartMark<unknown, any, any>;
|
|
18
|
+
/** polar 族 type 判定(definition 组装层据此应用无轴约定) */
|
|
19
|
+
export declare const POLAR_FAMILY_TYPES: ReadonlySet<string>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { CxChartScaleSpec } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* scale 声明式 → ChartScaleInput。
|
|
4
|
+
* 无 domain 时返回工厂形态(库从 marks channel 推断 domain);
|
|
5
|
+
* 有 domain 时返回实例(保留配置,库不再推断)。
|
|
6
|
+
* 时间系(utc/time)domain 为 ISO 8601 字符串,翻译为 Date 实例(JSON 不可表达 Date)。
|
|
7
|
+
*/
|
|
8
|
+
export declare function translateScale(spec: CxChartScaleSpec): unknown;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { CxChartDatasets, CxChartReduce, CxChartTransformOutputs, CxChartTransformSpec } from './types';
|
|
2
|
+
/** reduce 声明式 → 库归约器;字符串枚举 count/sum/mean/min/max 原样透传,其余映射函数引用 */
|
|
3
|
+
export declare function translateReduce(reduce: CxChartReduce): unknown;
|
|
4
|
+
export declare function translateOutputs(outputs: CxChartTransformOutputs): Record<string, unknown>;
|
|
5
|
+
/** 单步 transform → 行数组;源数据经 data 名查 datasets 表(缺省 rows,未命中回退空数组) */
|
|
6
|
+
export declare function translateTransform(spec: CxChartTransformSpec, datasets: CxChartDatasets): readonly unknown[];
|
|
7
|
+
/**
|
|
8
|
+
* 执行 transforms 管道:产物以 name 注册进 datasets 副本(不污染调用方表;
|
|
9
|
+
* 源数据集引用未命中时回退空数组——与 resolveMarkData 同一容错语义)。
|
|
10
|
+
*/
|
|
11
|
+
export declare function applyTransforms(transforms: readonly CxChartTransformSpec[], datasets: CxChartDatasets): CxChartDatasets;
|