@jarenjs/charts 0.34.0

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 (56) hide show
  1. package/README.md +293 -0
  2. package/dist/types/component/index.d.ts +95 -0
  3. package/dist/types/core/axis.d.ts +77 -0
  4. package/dist/types/core/cartesian.d.ts +127 -0
  5. package/dist/types/core/chart.d.ts +58 -0
  6. package/dist/types/core/domain.d.ts +96 -0
  7. package/dist/types/core/marks.d.ts +86 -0
  8. package/dist/types/core/palette.d.ts +72 -0
  9. package/dist/types/core/scale.d.ts +59 -0
  10. package/dist/types/core/session.d.ts +85 -0
  11. package/dist/types/core/stream-adapter.d.ts +187 -0
  12. package/dist/types/index.d.ts +35 -0
  13. package/dist/types/transforms/benchmark-adapter.d.ts +169 -0
  14. package/dist/types/transforms/mermaid-adapter.d.ts +30 -0
  15. package/dist/types/types/bar.d.ts +213 -0
  16. package/dist/types/types/boxplot.d.ts +116 -0
  17. package/dist/types/types/candlestick.d.ts +218 -0
  18. package/dist/types/types/gauge.d.ts +68 -0
  19. package/dist/types/types/heatmap.d.ts +104 -0
  20. package/dist/types/types/line.d.ts +272 -0
  21. package/dist/types/types/map.d.ts +137 -0
  22. package/dist/types/types/pie.d.ts +146 -0
  23. package/dist/types/types/radar.d.ts +89 -0
  24. package/dist/types/types/sankey.d.ts +100 -0
  25. package/dist/types/types/scatter.d.ts +80 -0
  26. package/dist/types/types/streamgraph.d.ts +75 -0
  27. package/dist/types/types/treemap.d.ts +118 -0
  28. package/package.json +76 -0
  29. package/schemas/chart-definition.schema.json +448 -0
  30. package/src/component/index.js +125 -0
  31. package/src/core/axis.js +221 -0
  32. package/src/core/cartesian.js +192 -0
  33. package/src/core/chart.js +101 -0
  34. package/src/core/domain.js +123 -0
  35. package/src/core/marks.js +110 -0
  36. package/src/core/palette.js +126 -0
  37. package/src/core/scale.js +106 -0
  38. package/src/core/session.js +0 -0
  39. package/src/core/stream-adapter.js +613 -0
  40. package/src/index.js +40 -0
  41. package/src/transforms/benchmark-adapter.js +298 -0
  42. package/src/transforms/mermaid-adapter.js +19 -0
  43. package/src/types/bar.js +276 -0
  44. package/src/types/boxplot.js +216 -0
  45. package/src/types/candlestick.js +274 -0
  46. package/src/types/gauge.js +140 -0
  47. package/src/types/heatmap.js +176 -0
  48. package/src/types/line.js +349 -0
  49. package/src/types/map.js +378 -0
  50. package/src/types/pie.js +163 -0
  51. package/src/types/radar.js +224 -0
  52. package/src/types/sankey.js +391 -0
  53. package/src/types/scatter.js +148 -0
  54. package/src/types/streamgraph.js +158 -0
  55. package/src/types/treemap.js +322 -0
  56. package/styles/charts.css +83 -0
@@ -0,0 +1,83 @@
1
+ /* @jarenjs/charts — component stylesheet.
2
+ *
3
+ * Defines the self-scoped `.chart` class carrying the `--chart-*` token
4
+ * vocabulary (light values plus a `.dark` override) and maps each
5
+ * `chart-*` shape class to `var(--chart-*)`. The render pass stamps the
6
+ * same variables *inline* on the root `<svg>`, and inline custom
7
+ * properties beat these stylesheet blocks — so for pipeline-rendered
8
+ * SVGs the stamp decides the colors. Re-theming a live chart goes
9
+ * through the `'host'` theme (`src/core/palette.js` `HOST_VARS`), whose
10
+ * stamped values reference the host's tokens. `toSvgString()` output
11
+ * stays standalone-valid via concrete presentation-attribute colors.
12
+ *
13
+ * Sync invariant (DESIGN.md §7): the fallback values below must match
14
+ * the `default`/`dark` token tables in `src/core/palette.js`.
15
+ */
16
+
17
+ .chart {
18
+ --chart-background: transparent;
19
+ --chart-text: #1f2020;
20
+ --chart-muted: #64748b;
21
+ --chart-grid: #e2e8f0;
22
+ --chart-axis: #94a3b8;
23
+ --chart-win: #16a34a;
24
+ --chart-loss: #dc2626;
25
+ --chart-slice-stroke: #ffffff;
26
+ }
27
+ .dark .chart {
28
+ --chart-text: #f4f4f4;
29
+ --chart-muted: #94a3b8;
30
+ --chart-grid: #334155;
31
+ --chart-axis: #64748b;
32
+ --chart-win: #4ade80;
33
+ --chart-loss: #f87171;
34
+ --chart-slice-stroke: #11141c;
35
+ }
36
+
37
+ .chart-svg { max-width: 100%; height: auto; }
38
+
39
+ .chart-pie-slice { stroke: var(--chart-slice-stroke); }
40
+ .chart-pie-legend text { fill: var(--chart-text); }
41
+
42
+ .chart-title { fill: var(--chart-text); }
43
+ .chart-tick, .chart-axis-label { fill: var(--chart-muted); }
44
+ .chart-grid { stroke: var(--chart-grid); }
45
+ .chart-axis { stroke: var(--chart-axis); }
46
+ .chart-ref { stroke: var(--chart-muted); }
47
+ .chart-gauge-track { stroke: var(--chart-grid); }
48
+ .chart-gauge-value { fill: var(--chart-text); }
49
+ .chart-box-whisker { stroke: var(--chart-axis); }
50
+ .chart-stream-band { stroke: var(--chart-slice-stroke); }
51
+ .chart-sankey-link { fill: var(--chart-muted); }
52
+ .chart-sankey-label { fill: var(--chart-text); }
53
+ .chart-candle-up { stroke: var(--chart-win); }
54
+ rect.chart-candle-up { fill: var(--chart-win); stroke: none; }
55
+ .chart-candle-down { stroke: var(--chart-loss); }
56
+ rect.chart-candle-down { fill: var(--chart-loss); stroke: none; }
57
+
58
+ /* The floating-tooltip host (`tooltipView`). Positioned at the pointer's
59
+ * viewport coordinates by the inline `left`/`top` the binding carried,
60
+ * then lifted clear of the cursor here — so the host never measures the
61
+ * box. It links the site tokens directly (DESIGN.md §7) rather than the
62
+ * `--chart-*` table: this is page chrome around the SVG, not a mark
63
+ * inside it. `pointer-events: none` keeps it from stealing the
64
+ * pointerleave that dismisses it. */
65
+ .chart-tooltip {
66
+ position: fixed;
67
+ z-index: 30;
68
+ transform: translate(-50%, calc(-100% - 12px));
69
+ padding: 4px 8px;
70
+ border-radius: var(--radius-sm, 8px);
71
+ border: 1px solid var(--border, #e2e8f0);
72
+ background: var(--surface, #ffffff);
73
+ color: var(--fg, #1f2020);
74
+ font-size: 12px;
75
+ line-height: 1.4;
76
+ white-space: nowrap;
77
+ pointer-events: none;
78
+ }
79
+ .dark .chart-tooltip {
80
+ border-color: var(--border, #334155);
81
+ background: var(--surface, #11141c);
82
+ color: var(--fg, #f4f4f4);
83
+ }