@funnest/charts-react 0.1.0 → 0.1.1

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.
Files changed (3) hide show
  1. package/NOTICE +5 -0
  2. package/dist/index.js +8 -6
  3. package/package.json +4 -4
package/NOTICE CHANGED
@@ -2,3 +2,8 @@ Funnest Charts
2
2
  Copyright 2026 Funnest
3
3
 
4
4
  This product includes software developed by the Funnest Charts project.
5
+
6
+ Trademarks: "Funnest", "Funnest Charts" and the Funnest logos (the brand/ directory and
7
+ the logo marks in the code) are trademarks of Funnest. The Apache License 2.0 covers the
8
+ code only and grants no rights to these names or logos (Section 6). Forks and
9
+ redistributions must not use them to identify their own products.
package/dist/index.js CHANGED
@@ -517,6 +517,8 @@ function BarPlot({ seriesIds, radius = 3, groupGap = 2, getBarColor, highlightSc
517
517
  // src/viz/scrubber.tsx
518
518
  import { jsx as jsx7, jsxs as jsxs5 } from "react/jsx-runtime";
519
519
  var TIP_FONT = 12;
520
+ var ROW = 18;
521
+ var TIP_PAD = 7;
520
522
  var textWidth = (t) => [...t].reduce((w, ch) => w + (ch.charCodeAt(0) > 11904 ? TIP_FONT : TIP_FONT * 0.6), 0);
521
523
  function Scrubber({ label, seriesIds, dimFuture = true, showValues = false, valueFormatter = formatNumber }) {
522
524
  const ctx = useCartesianChart();
@@ -531,8 +533,8 @@ function Scrubber({ label, seriesIds, dimFuture = true, showValues = false, valu
531
533
  const v = s.data[i];
532
534
  return v === null || v === void 0 || !Number.isFinite(v) ? [] : [{ s, text: valueFormatter(v, s.id) }];
533
535
  }) : [];
534
- const tipW = Math.max(0, ...rows.map((r) => textWidth(r.text) + (rows.length > 1 || r.s.label ? textWidth(r.s.label ?? "") + 26 : 18))) + 12;
535
- const tipH = rows.length * 18 + 10;
536
+ const tipW = Math.max(0, ...rows.map((r) => textWidth(r.text) + (rows.length > 1 || r.s.label ? textWidth(r.s.label ?? "") + 26 : 18))) + 16;
537
+ const tipH = rows.length * ROW + TIP_PAD * 2;
536
538
  const tipRight = x + 12 + tipW <= plot.right;
537
539
  const tipX = tipRight ? x + 12 : x - 12 - tipW;
538
540
  const tipY = plot.top + 4;
@@ -550,10 +552,10 @@ function Scrubber({ label, seriesIds, dimFuture = true, showValues = false, valu
550
552
  }),
551
553
  rows.length > 0 && /* @__PURE__ */ jsxs5("g", { transform: `translate(${tipX},${tipY})`, children: [
552
554
  /* @__PURE__ */ jsx7("rect", { width: tipW, height: tipH, rx: 8, style: { fill: VAR.bg, stroke: VAR.grid }, strokeWidth: 1 }),
553
- rows.map((r, k) => /* @__PURE__ */ jsxs5("g", { transform: `translate(8,${14 + k * 18})`, children: [
554
- /* @__PURE__ */ jsx7("circle", { cx: 3, cy: -4, r: 3, style: { fill: r.s.color } }),
555
- (rows.length > 1 || r.s.label) && /* @__PURE__ */ jsx7("text", { x: 12, fontSize: TIP_FONT, style: { fill: VAR.text }, children: r.s.label ?? r.s.id }),
556
- /* @__PURE__ */ jsx7("text", { x: tipW - 16, textAnchor: "end", fontSize: TIP_FONT, fontWeight: 700, style: { fill: VAR.textStrong, fontVariantNumeric: "tabular-nums" }, children: r.text })
555
+ rows.map((r, k) => /* @__PURE__ */ jsxs5("g", { transform: `translate(10,${TIP_PAD + ROW / 2 + k * ROW})`, children: [
556
+ /* @__PURE__ */ jsx7("circle", { cx: 3, cy: 0, r: 3, style: { fill: r.s.color } }),
557
+ (rows.length > 1 || r.s.label) && /* @__PURE__ */ jsx7("text", { x: 12, dominantBaseline: "central", fontSize: TIP_FONT, style: { fill: VAR.text }, children: r.s.label ?? r.s.id }),
558
+ /* @__PURE__ */ jsx7("text", { x: tipW - 20, textAnchor: "end", dominantBaseline: "central", fontSize: TIP_FONT, fontWeight: 700, style: { fill: VAR.textStrong, fontVariantNumeric: "tabular-nums" }, children: r.text })
557
559
  ] }, r.s.id))
558
560
  ] })
559
561
  ] });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@funnest/charts-react",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "React bindings for Funnest Charts: the trading widget plus SVG line, area and bar charts",
5
5
  "keywords": [
6
6
  "react",
@@ -46,9 +46,9 @@
46
46
  "NOTICE"
47
47
  ],
48
48
  "dependencies": {
49
- "@funnest/charts": "0.1.0",
50
- "@funnest/charts-viz": "0.1.0",
51
- "@funnest/charts-ui": "0.1.0"
49
+ "@funnest/charts": "0.1.1",
50
+ "@funnest/charts-ui": "0.1.1",
51
+ "@funnest/charts-viz": "0.1.1"
52
52
  },
53
53
  "peerDependencies": {
54
54
  "react": ">=18",