@weng-lab/visualization 1.0.5 → 1.0.6

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":"violinPlot.d.ts","sourceRoot":"","sources":["../../../../src/components/ViolinPlot/violinPlot.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAgB,eAAe,EAAE,MAAM,SAAS,CAAC;AAUxD,QAAA,MAAM,UAAU,GAAI,CAAC,SAAS,MAAM,EAChC,OAAO,eAAe,CAAC,CAAC,CAAC,4CAuP5B,CAAA;AAED,eAAe,UAAU,CAAA"}
1
+ {"version":3,"file":"violinPlot.d.ts","sourceRoot":"","sources":["../../../../src/components/ViolinPlot/violinPlot.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAgB,eAAe,EAAE,MAAM,SAAS,CAAC;AAUxD,QAAA,MAAM,UAAU,GAAI,CAAC,SAAS,MAAM,EAChC,OAAO,eAAe,CAAC,CAAC,CAAC,4CAyQ5B,CAAA;AAED,eAAe,UAAU,CAAA"}
@@ -44904,20 +44904,29 @@ const qW = ({ crossProps: t, left: e, top: r, median: n, firstQuartile: a, third
44904
44904
  fill: "black",
44905
44905
  fontSize: i
44906
44906
  }),
44907
- tickComponent: ({ x, y: E, formattedValue: b, ...T }) => A !== "horizontal" ? /* @__PURE__ */ $.jsx(
44908
- "text",
44909
- {
44910
- ...T,
44911
- x,
44912
- y: E,
44913
- dx: A === "vertical" ? 0 : "-0.25em",
44914
- dy: A === "vertical" ? "0.50em" : A === "leftDiagonal" ? "-0.25em" : "0.25em",
44915
- transform: A === "vertical" ? `rotate(90, ${x}, ${E})` : A === "leftDiagonal" ? `rotate(-45, ${x}, ${E})` : `rotate(45, ${x}, ${E})`,
44916
- textAnchor: A === "vertical" ? "middle" : "end",
44917
- dominantBaseline: "middle",
44918
- children: b
44919
- }
44920
- ) : /* @__PURE__ */ $.jsx("text", { ...T, x, y: E, textAnchor: "end", dominantBaseline: "middle", dx: "-0.50em", children: b })
44907
+ tickComponent: ({ x, y: E, formattedValue: b, ...T }) => {
44908
+ const U = () => {
44909
+ if (!t.onViolinClicked) return;
44910
+ const Q = t.distributions.find((I) => I.label === b);
44911
+ t.onViolinClicked(Q);
44912
+ };
44913
+ return A !== "horizontal" ? /* @__PURE__ */ $.jsx(
44914
+ "text",
44915
+ {
44916
+ ...T,
44917
+ onClick: U,
44918
+ cursor: t.onViolinClicked ? "pointer" : "text",
44919
+ x,
44920
+ y: E,
44921
+ dx: A === "vertical" ? 0 : "-0.25em",
44922
+ dy: A === "vertical" ? "0.50em" : A === "leftDiagonal" ? "-0.25em" : "0.25em",
44923
+ transform: A === "vertical" ? `rotate(90, ${x}, ${E})` : A === "leftDiagonal" ? `rotate(-45, ${x}, ${E})` : `rotate(45, ${x}, ${E})`,
44924
+ textAnchor: A === "vertical" ? "middle" : "end",
44925
+ dominantBaseline: "middle",
44926
+ children: b
44927
+ }
44928
+ ) : /* @__PURE__ */ $.jsx("text", { ...T, x, y: E, textAnchor: "end", dominantBaseline: "middle", dx: "-0.50em", onClick: U, cursor: t.onViolinClicked ? "pointer" : "text", children: b });
44929
+ }
44921
44930
  },
44922
44931
  "axisBottom"
44923
44932
  )
@@ -44953,17 +44962,26 @@ const qW = ({ crossProps: t, left: e, top: r, median: n, firstQuartile: a, third
44953
44962
  fontSize: i,
44954
44963
  textAnchor: A === "vertical" || A === "leftDiagonal" ? "end" : A === "rightDiagonal" ? "start" : "middle"
44955
44964
  }),
44956
- tickComponent: ({ x, y: E, formattedValue: b, ...T }) => A !== "horizontal" ? /* @__PURE__ */ $.jsx(
44957
- "text",
44958
- {
44959
- ...T,
44960
- x,
44961
- y: E,
44962
- transform: A === "vertical" ? `rotate(-90, ${x}, ${E})` : A === "leftDiagonal" ? `rotate(-45, ${x}, ${E})` : `rotate(45, ${x}, ${E})`,
44963
- textAnchor: A === "vertical" || A === "leftDiagonal" ? "end" : A === "rightDiagonal" ? "start" : "middle",
44964
- children: b
44965
- }
44966
- ) : /* @__PURE__ */ $.jsx("text", { ...T, x, y: E, textAnchor: "middle", children: b })
44965
+ tickComponent: ({ x, y: E, formattedValue: b, ...T }) => {
44966
+ const U = () => {
44967
+ if (!t.onViolinClicked) return;
44968
+ const Q = t.distributions.find((I) => I.label === b);
44969
+ t.onViolinClicked(Q);
44970
+ };
44971
+ return A !== "horizontal" ? /* @__PURE__ */ $.jsx(
44972
+ "text",
44973
+ {
44974
+ onClick: U,
44975
+ cursor: t.onViolinClicked ? "pointer" : "text",
44976
+ ...T,
44977
+ x,
44978
+ y: E,
44979
+ transform: A === "vertical" ? `rotate(-90, ${x}, ${E})` : A === "leftDiagonal" ? `rotate(-45, ${x}, ${E})` : `rotate(45, ${x}, ${E})`,
44980
+ textAnchor: A === "vertical" || A === "leftDiagonal" ? "end" : A === "rightDiagonal" ? "start" : "middle",
44981
+ children: b
44982
+ }
44983
+ ) : /* @__PURE__ */ $.jsx("text", { ...T, x, y: E, textAnchor: "middle", onClick: U, cursor: t.onViolinClicked ? "pointer" : "text", children: b });
44984
+ }
44967
44985
  },
44968
44986
  "axisBottom"
44969
44987
  )