@lionad/cx-comps-tanstack-charts 0.1.0-alpha.8 → 0.1.0-alpha.9

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 CHANGED
@@ -24,6 +24,7 @@ import { treemap } from "@tanstack/charts/hierarchy/treemap";
24
24
  import { forceLayout } from "@tanstack/charts/network/force";
25
25
  import { sankeyDiagram } from "@tanstack/charts/network/sankey";
26
26
  import { geoAlbersUsa, geoEqualEarth, geoIdentity, geoMercator, geoNaturalEarth1, geoOrthographic } from "d3-geo";
27
+ import { decorative } from "@tanstack/charts/mark/decorative";
27
28
  import { tooltip } from "@tanstack/charts/tooltip";
28
29
  import { compileTrigger, createTriggerRegistry } from "@lionad/cx-stream";
29
30
  //#region src/shared/chart-skeleton.vue
@@ -1232,20 +1233,23 @@ function buildDefinition(spec, datasets, rowsOverride) {
1232
1233
  let derivedXDomain;
1233
1234
  let derivedYDomain;
1234
1235
  let polarOnly = spec.marks.length > 0;
1236
+ const pushMark = (specMark, runtimeMark) => {
1237
+ marks.push(specMark.decorative === true ? decorative(runtimeMark) : runtimeMark);
1238
+ };
1235
1239
  for (const mark of spec.marks) {
1236
1240
  const bound = rowsOverride !== void 0 && mark.data === void 0 ? {
1237
1241
  ...mark,
1238
1242
  data: "rows"
1239
1243
  } : mark;
1240
1244
  if (!POLAR_FAMILY_TYPES.has(bound.type)) polarOnly = false;
1241
- if (bound.type === "polar") marks.push(translatePolar(bound, table));
1242
- else if (bound.type === "pie") marks.push(translatePie(bound, table));
1245
+ if (bound.type === "polar") pushMark(bound, translatePolar(bound, table));
1246
+ else if (bound.type === "pie") pushMark(bound, translatePie(bound, table));
1243
1247
  else if (COMPOSITE_TYPES.has(bound.type)) {
1244
1248
  const result = translateCompositeMark(bound, table, (child, rows) => buildDefinition(child, void 0, rows));
1245
- marks.push(...result.marks);
1249
+ for (const expanded of result.marks) pushMark(bound, expanded);
1246
1250
  if (result.xDomain) derivedXDomain = result.xDomain;
1247
1251
  if (result.yDomain) derivedYDomain = result.yDomain;
1248
- } else marks.push(translateMark(bound, table));
1252
+ } else pushMark(bound, translateMark(bound, table));
1249
1253
  }
1250
1254
  const definition = {
1251
1255
  marks,
@@ -101,6 +101,13 @@ export interface CxChartMarkSpec {
101
101
  */
102
102
  data?: readonly unknown[] | string;
103
103
  id?: string;
104
+ /**
105
+ * 装饰层开关:true 时经库 decorative() 包装——保留比例尺与绘制几何、剥离交互
106
+ * 所有权(tooltip 命中/焦点/条件高亮均跳过该 mark)。典型:辅助折线/参考线/标注
107
+ * 不抢数据点的 tooltip 命中。库层约束是带 focus/states 行为的 mark 不可包装
108
+ * (initialize 抛 TypeError),本 grammar 不暴露条件态声明,故恒安全。
109
+ */
110
+ decorative?: boolean;
104
111
  x?: string;
105
112
  y?: string;
106
113
  x1?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lionad/cx-comps-tanstack-charts",
3
- "version": "0.1.0-alpha.8",
3
+ "version": "0.1.0-alpha.9",
4
4
  "description": "cx material components wrapping TanStack Charts (@tanstack/charts/vue)",
5
5
  "keywords": [
6
6
  "charts",