@lionad/cx-comps-tanstack-charts 0.1.0-alpha.21 → 0.1.0-alpha.23
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/dist/index.mjs +29 -24
- package/dist/shared/translate/types.d.ts +3 -0
- package/dist/stream-triggers.d.ts +5 -1
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -1308,7 +1308,8 @@ function translateTooltip(tooltip$1) {
|
|
|
1308
1308
|
"visibility",
|
|
1309
1309
|
"anchor",
|
|
1310
1310
|
"sort",
|
|
1311
|
-
"items"
|
|
1311
|
+
"items",
|
|
1312
|
+
"className"
|
|
1312
1313
|
]) if (tooltip$1[key] !== void 0) options[key] = tooltip$1[key];
|
|
1313
1314
|
return {
|
|
1314
1315
|
use: tooltip,
|
|
@@ -2269,26 +2270,30 @@ var pie_default = define({
|
|
|
2269
2270
|
* arrayKey 恒为 'data'(单层字段名契约);props 声明序通道字段(x/y/curve/
|
|
2270
2271
|
* name/value/innerRadiusRatio)前置、data 殿后——回放剧本序列化序使增量帧
|
|
2271
2272
|
* 首行起即携带通道配置,尾随标量(height/ariaLabel)不入增量帧由终帧兜底。
|
|
2272
|
-
* - array 1 件:通用 chart
|
|
2273
|
-
*
|
|
2274
|
-
*
|
|
2273
|
+
* - array 1 件:通用 chart 走通配主数组契约(arrayKey '*')——data 下任意
|
|
2274
|
+
* 数组字段皆为主数组,逐字段按元素边界截断。图表数据形态多元:常规形态
|
|
2275
|
+
* rows、关系型 nodes+links(桑基/力导向)、嵌套环 innerRows+outerRows、
|
|
2276
|
+
* 仪表 bandRows+tickRows、地图 land/sphere/graticule/route,通配使各形态
|
|
2277
|
+
* 统一获得流式效果且新增数据形态无需改触发器。definition 序列化在任何数据
|
|
2278
|
+
* 数组之前,首条数据闭合时坐标系必然完整——图表以完整坐标系挂载、数据逐条
|
|
2279
|
+
* 生长(三段式:骨架→空坐标→数据生长)。多数据集按序列化序接力生长
|
|
2280
|
+
* (如 nodes 全量后 links 逐条),各自按自身传输进度截断、互不牵连。
|
|
2275
2281
|
* - 不适用 0 件。计数校验:6 array + 0 scalar + 0 不适用(差集派生兜底)。
|
|
2276
2282
|
*
|
|
2277
2283
|
* produced 语义(增量提取器对中间态与终态走同一 buildPartial,实证
|
|
2278
2284
|
* packages/stream/src/core/incremental.ts Step 5):
|
|
2279
|
-
* -
|
|
2280
|
-
*
|
|
2281
|
-
*
|
|
2282
|
-
*
|
|
2283
|
-
*
|
|
2284
|
-
* 防流结束后 pending 永驻。
|
|
2285
|
+
* - 出帧由任一主数组的完整元素驱动;尚无完整元素时保持 pending(骨架期由
|
|
2286
|
+
* 渲染管线承担)。
|
|
2287
|
+
* - emptyPassthrough:任一数据数组闭合为空(如 rows=[])时终态透传节点,
|
|
2288
|
+
* 由组件空态渲染接管,防流结束后 pending 永驻;判定据 parse 结果中的空
|
|
2289
|
+
* 数组字段(截断语义下「闭合的空数组」以 [] 在场、「未开始传输」缺席)。
|
|
2285
2290
|
*
|
|
2286
|
-
* 骨架裁决:不设 skeletonFields
|
|
2287
|
-
*
|
|
2291
|
+
* 骨架裁决:不设 skeletonFields——首条数据闭合即出帧逐条生长,天然有实时
|
|
2292
|
+
* 反馈;首条前的 pending 期由渲染管线承担(与预设物料同语义),物料内骨架
|
|
2288
2293
|
* 判定保留兼容上游 _cx_streaming 注入。
|
|
2289
2294
|
*
|
|
2290
2295
|
* fallback 从简:渲染链路不过 zod,包装层无模板直访(useAttrs 平铺 +
|
|
2291
|
-
* composable 全回退,缺席不 TypeError
|
|
2296
|
+
* composable 全回退,缺席不 TypeError);数据数组缺席的中间态经翻译层
|
|
2292
2297
|
* resolveMarkData 回退空数组,translateChartSpec 组装不抛错(增量帧翻译
|
|
2293
2298
|
* 实证进包内测试)。
|
|
2294
2299
|
*
|
|
@@ -2311,16 +2316,7 @@ const TANSTACK_CHARTS_STREAM_TRIGGERS = [{
|
|
|
2311
2316
|
key: keyOf("cx-chart"),
|
|
2312
2317
|
sections: [{
|
|
2313
2318
|
kind: "array",
|
|
2314
|
-
arrayKey: "
|
|
2315
|
-
extraScanPaths: [[
|
|
2316
|
-
"data",
|
|
2317
|
-
"nodes",
|
|
2318
|
-
"*"
|
|
2319
|
-
], [
|
|
2320
|
-
"data",
|
|
2321
|
-
"links",
|
|
2322
|
-
"*"
|
|
2323
|
-
]]
|
|
2319
|
+
arrayKey: "*"
|
|
2324
2320
|
}],
|
|
2325
2321
|
stateBranch: { emptyPassthrough: true },
|
|
2326
2322
|
frameStride: 10
|
|
@@ -2344,10 +2340,19 @@ function createTanstackChartsTriggerRegistry() {
|
|
|
2344
2340
|
for (const config of TANSTACK_CHARTS_STREAM_TRIGGERS) registry.register(config.key, compileTrigger(config));
|
|
2345
2341
|
return registry;
|
|
2346
2342
|
}
|
|
2347
|
-
/**
|
|
2343
|
+
/**
|
|
2344
|
+
* 增量节点的主数组(回放计数展示用);非数组增长型物料或数组缺席时返回 null。
|
|
2345
|
+
* 通配主数组形态(arrayKey '*')无单一主数组,取最长数组字段为主数据集
|
|
2346
|
+
* (如桑基的 links 之于 nodes);并列时取序列化序靠前者。
|
|
2347
|
+
*/
|
|
2348
2348
|
function mainArrayOf(node) {
|
|
2349
2349
|
const section = TANSTACK_CHARTS_STREAM_TRIGGERS.find((c) => c.key === node.key)?.sections.find((s) => s.kind === "array");
|
|
2350
2350
|
if (!section || section.kind !== "array") return null;
|
|
2351
|
+
if (section.arrayKey === "*") {
|
|
2352
|
+
let longest = null;
|
|
2353
|
+
for (const value of Object.values(node.data ?? {})) if (Array.isArray(value) && (longest === null || value.length > longest.length)) longest = value;
|
|
2354
|
+
return longest;
|
|
2355
|
+
}
|
|
2351
2356
|
const arr = node.data?.[section.arrayKey];
|
|
2352
2357
|
return Array.isArray(arr) ? arr : null;
|
|
2353
2358
|
}
|
|
@@ -538,6 +538,9 @@ export interface CxChartSpec {
|
|
|
538
538
|
y?: 'point' | 'pointer' | 'value' | 'group-center' | 'plot-top' | 'plot-center' | 'plot-bottom';
|
|
539
539
|
};
|
|
540
540
|
sort?: 'visual' | 'color-domain' | 'focus';
|
|
541
|
+
/** 追加到 tooltip 根元素的自定义类名(`ts-chart-tooltip <className>`),
|
|
542
|
+
* 供物料/宿主用 CSS 分化指示器等外壳样式 */
|
|
543
|
+
className?: string;
|
|
541
544
|
items?: ('x' | 'y' | 'group' | {
|
|
542
545
|
channel: 'x' | 'y' | 'group';
|
|
543
546
|
label?: string;
|
|
@@ -2,7 +2,11 @@ import type { CxSpec, StreamTriggerConfig, TriggerRegistry } from '@lionad/cx-st
|
|
|
2
2
|
export declare const TANSTACK_CHARTS_STREAM_TRIGGERS: StreamTriggerConfig[];
|
|
3
3
|
/** 装配 TanStack Charts 物料的 trigger 注册表(size 恒 6) */
|
|
4
4
|
export declare function createTanstackChartsTriggerRegistry(): TriggerRegistry<CxSpec>;
|
|
5
|
-
/**
|
|
5
|
+
/**
|
|
6
|
+
* 增量节点的主数组(回放计数展示用);非数组增长型物料或数组缺席时返回 null。
|
|
7
|
+
* 通配主数组形态(arrayKey '*')无单一主数组,取最长数组字段为主数据集
|
|
8
|
+
* (如桑基的 links 之于 nodes);并列时取序列化序靠前者。
|
|
9
|
+
*/
|
|
6
10
|
export declare function mainArrayOf(node: {
|
|
7
11
|
key: string;
|
|
8
12
|
data?: Record<string, unknown>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lionad/cx-comps-tanstack-charts",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.23",
|
|
4
4
|
"description": "cx material components wrapping TanStack Charts (@tanstack/charts/vue)",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"charts",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@lionad/cx-definition": "0.1.0-alpha.10",
|
|
39
|
-
"@lionad/cx-stream": "0.1.0-alpha.
|
|
39
|
+
"@lionad/cx-stream": "0.1.0-alpha.12",
|
|
40
40
|
"@lionad/cx-vue": "0.1.0-alpha.10",
|
|
41
41
|
"d3-geo": "^3.1.1",
|
|
42
42
|
"d3-scale": "^4.0.2",
|