@weng-lab/visualization 1.2.0 → 1.2.2

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.
@@ -1 +1 @@
1
- {"version":3,"file":"SingleNode.d.ts","sourceRoot":"","sources":["../../../../src/components/TreeMap/SingleNode.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAO1C,QAAA,MAAM,UAAU,GAAI,CAAC,EACjB,OAAO,eAAe,CAAC,CAAC,CAAC,4CAwG5B,CAAC;AAEF,eAAe,UAAU,CAAC"}
1
+ {"version":3,"file":"SingleNode.d.ts","sourceRoot":"","sources":["../../../../src/components/TreeMap/SingleNode.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAO1C,QAAA,MAAM,UAAU,GAAI,CAAC,EACjB,OAAO,eAAe,CAAC,CAAC,CAAC,4CA+G5B,CAAC;AAEF,eAAe,UAAU,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"TreeMap.d.ts","sourceRoot":"","sources":["../../../../src/components/TreeMap/TreeMap.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAe,YAAY,EAAE,MAAM,SAAS,CAAC;AAQpD,QAAA,MAAM,OAAO,GAAI,CAAC,SAAS,MAAM,EAC7B,OAAO,YAAY,CAAC,CAAC,CAAC,4CAuFzB,CAAC;AAEF,eAAe,OAAO,CAAC"}
1
+ {"version":3,"file":"TreeMap.d.ts","sourceRoot":"","sources":["../../../../src/components/TreeMap/TreeMap.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAe,YAAY,EAAE,MAAM,SAAS,CAAC;AAQpD,QAAA,MAAM,OAAO,GAAI,CAAC,SAAS,MAAM,EAC7B,OAAO,YAAY,CAAC,CAAC,CAAC,4CAmHzB,CAAC;AAEF,eAAe,OAAO,CAAC"}
@@ -1,11 +1,13 @@
1
1
  import { HierarchyRectangularNode } from '@visx/hierarchy/lib/types';
2
2
  import { AnimationType, TreemapNode, TreemapProps } from './types';
3
3
  import { Transition } from 'framer-motion';
4
- export declare function getLabelPlacement(node: HierarchyRectangularNode<TreemapNode<any>>, placement: TreemapProps<any>["labelPlacement"], showValue?: boolean): {
4
+ export declare function getLabelPlacement(node: HierarchyRectangularNode<TreemapNode<any>>, placement: TreemapProps<any>["labelPlacement"], showValue?: boolean, hasChildren?: boolean): {
5
5
  textX: number;
6
6
  textY: number;
7
7
  valueY: number;
8
- anchor: string;
8
+ valueX: number;
9
+ textAnchor: string;
10
+ valueAnchor: string;
9
11
  baseline: string;
10
12
  };
11
13
  export declare function measureTextWidth(text: string, fontSize: number, fontFamily: string): number;
@@ -1 +1 @@
1
- {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../../src/components/TreeMap/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;AACrE,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnE,OAAO,EAAW,UAAU,EAAE,MAAM,eAAe,CAAC;AAGpD,wBAAgB,iBAAiB,CAC7B,IAAI,EAAE,wBAAwB,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,EAChD,SAAS,EAAE,YAAY,CAAC,GAAG,CAAC,CAAC,gBAAgB,CAAC,EAC9C,SAAS,CAAC,EAAE,OAAO;;;;;;EAiDtB;AAGD,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,UAMlF;AAGD,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,MAAM,GACjB,MAAM,CAgBR;AAED,eAAO,MAAM,iBAAiB,GAAI,MAAM,aAAa,GAAG,SAAS,EAAE,OAAO,MAAM;;;;;gBAMhD,UAAU;;;;;;;;;;;;;;gBAAV,UAAU;;;;;;;;;;;;;;gBAAV,UAAU;;;;;;;;;;;;;;gBAAV,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4BzC,CAAC"}
1
+ {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../../src/components/TreeMap/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;AACrE,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnE,OAAO,EAAW,UAAU,EAAE,MAAM,eAAe,CAAC;AAGpD,wBAAgB,iBAAiB,CAC7B,IAAI,EAAE,wBAAwB,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,EAChD,SAAS,EAAE,YAAY,CAAC,GAAG,CAAC,CAAC,gBAAgB,CAAC,EAC9C,SAAS,CAAC,EAAE,OAAO,EACnB,WAAW,CAAC,EAAE,OAAO;;;;;;;;EA2DxB;AAGD,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,UAMlF;AAGD,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,MAAM,GACjB,MAAM,CAgBR;AAED,eAAO,MAAM,iBAAiB,GAAI,MAAM,aAAa,GAAG,SAAS,EAAE,OAAO,MAAM;;;;;gBAMhD,UAAU;;;;;;;;;;;;;;gBAAV,UAAU;;;;;;;;;;;;;;gBAAV,UAAU;;;;;;;;;;;;;;gBAAV,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4BzC,CAAC"}
@@ -6,8 +6,13 @@ export type AnimationType = "fade" | "scale" | "slideUp" | "slideRight" | "pop";
6
6
  export type TreemapNode<T> = {
7
7
  label: string;
8
8
  value: number;
9
- color?: string;
10
9
  children?: TreemapNode<T>[];
10
+ style?: {
11
+ color?: string;
12
+ labelColor?: string;
13
+ strokeWidth?: number;
14
+ strokeColor?: string;
15
+ };
11
16
  metaData?: T;
12
17
  };
13
18
  export type TreemapProps<T> = {
@@ -23,6 +28,7 @@ export type TreemapProps<T> = {
23
28
  borderRadius?: number;
24
29
  strokeWidth?: number;
25
30
  fontSize?: number;
31
+ opacity?: number;
26
32
  };
27
33
  /**
28
34
  * Visx has a few built in tiling methods that can be changed here
@@ -40,6 +46,7 @@ export type SingleNodeProps<T> = {
40
46
  isHovered: boolean;
41
47
  onHover: (hovered: boolean) => void;
42
48
  strokeWidth: number;
49
+ opacity: number;
43
50
  borderRadius: number;
44
51
  fontSize: number;
45
52
  labelPlacement: "middle" | "topRight" | "topLeft" | "bottomLeft" | "bottomRight";
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/TreeMap/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;AACrE,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AACrC,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAEnD,MAAM,MAAM,OAAO,GAAG,iBAAiB,GAAG,eAAe,GAAG,aAAa,GAAG,mBAAmB,GAAG,cAAc,GAAG,kBAAkB,CAAA;AAErI,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,GAAG,YAAY,GAAG,KAAK,CAAC;AAEhF,MAAM,MAAM,WAAW,CAAC,CAAC,IAAI;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC;IAC5B,QAAQ,CAAC,EAAE,CAAC,CAAC;CACd,CAAA;AAED,MAAM,MAAM,YAAY,CAAC,CAAC,IAAI;IAC1B,I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IACpD,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC;CACnD,CAAA;AAED,MAAM,MAAM,cAAc,GAAG;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACjB,CAAA"}
@@ -50630,15 +50630,17 @@ const Pne = {
50630
50630
  ...Tne,
50631
50631
  ...kne
50632
50632
  }, Hne = /* @__PURE__ */ Nte(Nne, Zte);
50633
- function _ne(t, e, r) {
50634
- const a = (t.x0 + t.x1) / 2, i = (t.y0 + t.y1) / 2;
50633
+ function _ne(t, e, r, n) {
50634
+ const i = (t.x0 + t.x1) / 2, o = (t.y0 + t.y1) / 2;
50635
50635
  switch (e) {
50636
50636
  case "topLeft":
50637
50637
  return {
50638
50638
  textX: t.x0 + 6,
50639
50639
  textY: t.y0 + 10,
50640
- valueY: t.y0 + 40,
50641
- anchor: "start",
50640
+ valueY: n ? t.y0 + 17 : t.y0 + 40,
50641
+ valueX: n ? t.x1 - 6 : t.x0 + 6,
50642
+ textAnchor: "start",
50643
+ valueAnchor: n ? "end" : "start",
50642
50644
  baseline: "hanging"
50643
50645
  };
50644
50646
  case "topRight":
@@ -50646,7 +50648,9 @@ function _ne(t, e, r) {
50646
50648
  textX: t.x1 - 6,
50647
50649
  textY: t.y0 + 10,
50648
50650
  valueY: t.y0 + 40,
50649
- anchor: "end",
50651
+ valueX: t.x1 - 6,
50652
+ textAnchor: "end",
50653
+ valueAnchor: "end",
50650
50654
  baseline: "hanging"
50651
50655
  };
50652
50656
  case "bottomLeft":
@@ -50654,7 +50658,9 @@ function _ne(t, e, r) {
50654
50658
  textX: t.x0 + 6,
50655
50659
  textY: r ? t.y1 - 35 : t.y1 - 15,
50656
50660
  valueY: t.y1 - 15,
50657
- anchor: "start",
50661
+ valueX: t.x0 + 6,
50662
+ textAnchor: "start",
50663
+ valueAnchor: "start",
50658
50664
  baseline: "baseline"
50659
50665
  };
50660
50666
  case "bottomRight":
@@ -50662,16 +50668,20 @@ function _ne(t, e, r) {
50662
50668
  textX: t.x1 - 6,
50663
50669
  textY: r ? t.y1 - 35 : t.y1 - 15,
50664
50670
  valueY: t.y1 - 15,
50665
- anchor: "end",
50671
+ valueX: t.x1 - 6,
50672
+ textAnchor: "end",
50673
+ valueAnchor: "end",
50666
50674
  baseline: "baseline"
50667
50675
  };
50668
50676
  case "middle":
50669
50677
  default:
50670
50678
  return {
50671
- textX: a,
50672
- textY: r ? i - 5 : i + 5,
50673
- valueY: i + 15,
50674
- anchor: "middle",
50679
+ textX: i,
50680
+ textY: r ? o - 5 : o + 5,
50681
+ valueY: o + 15,
50682
+ valueX: i,
50683
+ textAnchor: "middle",
50684
+ valueAnchor: "middle",
50675
50685
  baseline: "middle"
50676
50686
  };
50677
50687
  }
@@ -50746,29 +50756,30 @@ const Gne = (t, e) => {
50746
50756
  )
50747
50757
  ] });
50748
50758
  }, zne = (t) => {
50749
- const e = t.fontSize, r = t.node.data.color || "black", n = t.isHovered ? t.strokeWidth + 2 : t.strokeWidth, a = t.node.x1 - t.node.x0, i = t.node.y1 - t.node.y0, o = t.node.data.label, A = Kne(o, a - 8, e, "sans-serif"), s = i > 55 && a > 50, l = i > 20, { textX: u, textY: c, anchor: f, baseline: d, valueY: h } = _ne(
50759
+ const e = t.node.parent !== void 0 && t.node.parent?.data.label !== "root", r = t.node.children !== void 0 && t.node.children.length > 0, n = t.fontSize, a = e ? t.node.parent?.data.style?.color || "black" : t.node.data.style?.color || "black", i = t.node.data.style?.labelColor || a, o = t.node.data.style?.strokeColor || a, A = t.node.data.style?.strokeWidth === 0 ? 0 : t.node.data.style?.strokeWidth || t.strokeWidth, s = t.isHovered ? A + 2 : A, l = t.node.x1 - t.node.x0, u = t.node.y1 - t.node.y0, c = t.node.data.label, f = Kne(c, l - 8, n, "sans-serif"), d = u > 55 && l > 50, h = u > 20, { textX: p, textY: g, textAnchor: v, valueAnchor: y, baseline: m, valueY: w, valueX: C } = _ne(
50750
50760
  t.node,
50751
50761
  t.labelPlacement,
50752
- s
50762
+ d,
50763
+ r
50753
50764
  ), {
50754
- tooltipData: p,
50755
- tooltipLeft: g,
50756
- tooltipTop: v,
50757
- tooltipOpen: y,
50758
- showTooltip: m,
50759
- hideTooltip: w
50760
- } = $f(), C = Ke(
50761
- (b) => {
50765
+ tooltipData: T,
50766
+ tooltipLeft: b,
50767
+ tooltipTop: E,
50768
+ tooltipOpen: x,
50769
+ showTooltip: B,
50770
+ hideTooltip: F
50771
+ } = $f(), U = Ke(
50772
+ (I) => {
50762
50773
  if (!t.tooltipBody) return;
50763
- const E = t.tooltipBody(t.node.data);
50764
- m({
50765
- tooltipLeft: b.clientX + 10,
50766
- tooltipTop: b.clientY + 10,
50767
- tooltipData: E
50774
+ const L = t.tooltipBody(t.node.data);
50775
+ B({
50776
+ tooltipLeft: I.clientX + 10,
50777
+ tooltipTop: I.clientY + 10,
50778
+ tooltipData: L
50768
50779
  });
50769
50780
  },
50770
- [t.tooltipBody, t.node.data, m]
50771
- ), T = () => {
50781
+ [t.tooltipBody, t.node.data, B]
50782
+ ), S = () => {
50772
50783
  t.onNodeClicked && t.onNodeClicked(t.node.data);
50773
50784
  };
50774
50785
  return /* @__PURE__ */ V.jsxs(Ie.Fragment, { children: [
@@ -50777,10 +50788,10 @@ const Gne = (t, e) => {
50777
50788
  {
50778
50789
  onMouseEnter: () => t.onHover(!0),
50779
50790
  onMouseLeave: () => {
50780
- t.onHover(!1), w?.();
50791
+ t.onHover(!1), F?.();
50781
50792
  },
50782
- onMouseMove: C,
50783
- onClick: T,
50793
+ onMouseMove: U,
50794
+ onClick: S,
50784
50795
  style: { cursor: "pointer", transition: "stroke-width 0.2s" },
50785
50796
  children: [
50786
50797
  /* @__PURE__ */ V.jsx(
@@ -50788,42 +50799,42 @@ const Gne = (t, e) => {
50788
50799
  {
50789
50800
  x: t.node.x0,
50790
50801
  y: t.node.y0,
50791
- width: a,
50792
- height: i,
50793
- fill: r,
50794
- fillOpacity: 0.3,
50795
- stroke: r,
50796
- strokeWidth: n,
50802
+ width: l,
50803
+ height: u,
50804
+ fill: a,
50805
+ fillOpacity: t.opacity,
50806
+ stroke: o,
50807
+ strokeWidth: s,
50797
50808
  rx: t.borderRadius
50798
50809
  }
50799
50810
  ),
50800
- l && /* @__PURE__ */ V.jsx(
50811
+ h && /* @__PURE__ */ V.jsx(
50801
50812
  "text",
50802
50813
  {
50803
- x: u,
50804
- y: c,
50805
- textAnchor: f,
50806
- dominantBaseline: d,
50807
- fill: r,
50814
+ x: p,
50815
+ y: g,
50816
+ textAnchor: v,
50817
+ dominantBaseline: m,
50818
+ fill: i,
50808
50819
  fontSize: t.fontSize,
50809
50820
  fontWeight: 500,
50810
- children: A
50821
+ children: f
50811
50822
  }
50812
50823
  ),
50813
- s && /* @__PURE__ */ V.jsx(
50824
+ d && /* @__PURE__ */ V.jsx(
50814
50825
  $ne,
50815
50826
  {
50816
- cx: u,
50817
- cy: h,
50818
- color: r,
50827
+ cx: C,
50828
+ cy: w,
50829
+ color: i,
50819
50830
  value: t.node.data.value,
50820
- align: f
50831
+ align: y
50821
50832
  }
50822
50833
  )
50823
50834
  ]
50824
50835
  }
50825
50836
  ),
50826
- t.tooltipBody && y && p && /* @__PURE__ */ V.jsx(xA, { children: /* @__PURE__ */ V.jsx(Yf, { left: (g ?? 0) + 10, top: v, children: p }) })
50837
+ t.tooltipBody && x && T && /* @__PURE__ */ V.jsx(xA, { children: /* @__PURE__ */ V.jsx(Yf, { left: (b ?? 0) + 10, top: E, children: T }) })
50827
50838
  ] }, `frag-${t.node.data.label}`);
50828
50839
  }, oae = (t) => {
50829
50840
  const { parentRef: e, width: r, height: n } = rd(), [a, i] = Je(null), o = yt(null), A = lw({ label: "root", value: 0, children: t.data }).sum((f) => f.value).sort((f, d) => (d.value || 0) - (f.value || 0)), s = {
@@ -50848,24 +50859,36 @@ const Gne = (t, e) => {
50848
50859
  size: [r, n],
50849
50860
  paddingInner: u,
50850
50861
  paddingOuter: c,
50851
- tile: s[t.tileMethod ?? "treemapResquarify"],
50852
- children: (f) => f.descendants().filter((d) => d.depth > 0).map((d, h) => {
50853
- const p = d.ancestors().map((y) => y.data.label).join("/"), g = t.animation ? Hne.g : "g", v = Gne(t.animation, h);
50854
- return /* @__PURE__ */ V.jsx(g, { ...v, children: /* @__PURE__ */ V.jsx(
50855
- zne,
50856
- {
50857
- node: d,
50858
- isHovered: a === p,
50859
- onHover: (y) => i(y ? p : null),
50860
- strokeWidth: l.strokeWidth ?? 0,
50861
- borderRadius: l.borderRadius ?? 0,
50862
- fontSize: l.fontSize ?? 16,
50863
- labelPlacement: t.labelPlacement ?? "middle",
50864
- tooltipBody: t.tooltipBody,
50865
- onNodeClicked: t.onNodeClicked
50866
- }
50867
- ) }, `node-${h}`);
50868
- })
50862
+ tile: s[t.tileMethod ?? "treemapBinary"],
50863
+ children: (f) => {
50864
+ const d = l.fontSize ? l.fontSize * 2 : 32, h = (p) => {
50865
+ if (!p.children || p.children.length === 0) return;
50866
+ const g = p.y0, y = p.y1 - g;
50867
+ if (y <= d + 1) return;
50868
+ const m = (y - d) / y;
50869
+ p.children.forEach((w) => {
50870
+ w.y0 = g + d + (w.y0 - g) * m, w.y1 = g + d + (w.y1 - g) * m;
50871
+ }), p.children.forEach(h);
50872
+ };
50873
+ return f.children && f.children.forEach(h), f.descendants().filter((p) => p.depth > 0).map((p, g) => {
50874
+ const v = p.ancestors().map((w) => w.data.label).join("/"), y = t.animation ? Hne.g : "g", m = Gne(t.animation, g);
50875
+ return /* @__PURE__ */ V.jsx(y, { ...m, children: /* @__PURE__ */ V.jsx(
50876
+ zne,
50877
+ {
50878
+ node: p,
50879
+ isHovered: a === v,
50880
+ onHover: (w) => i(w ? v : null),
50881
+ strokeWidth: l.strokeWidth ?? 0,
50882
+ opacity: l.opacity ?? 0.3,
50883
+ borderRadius: l.borderRadius ?? 0,
50884
+ fontSize: l.fontSize ?? 16,
50885
+ labelPlacement: t.labelPlacement ?? "topLeft",
50886
+ tooltipBody: t.tooltipBody,
50887
+ onNodeClicked: t.onNodeClicked
50888
+ }
50889
+ ) }, `node-${g}`);
50890
+ });
50891
+ }
50869
50892
  }
50870
50893
  ) }) });
50871
50894
  }, Aae = (t, e, r) => {