@ember-joinery/chart 0.0.0-stage → 1.0.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 (121) hide show
  1. package/CHANGELOG.md +167 -0
  2. package/LICENSE.md +9 -0
  3. package/NOTICE +532 -0
  4. package/README.md +69 -2
  5. package/addon-main.cjs +4 -0
  6. package/declarations/-private/cartesian-chart.d.ts +413 -0
  7. package/declarations/-private/cartesian-chart.d.ts.map +1 -0
  8. package/declarations/-private/cartesian.d.ts +236 -0
  9. package/declarations/-private/cartesian.d.ts.map +1 -0
  10. package/declarations/-private/config.d.ts +13 -0
  11. package/declarations/-private/config.d.ts.map +1 -0
  12. package/declarations/-private/dots.d.ts +27 -0
  13. package/declarations/-private/dots.d.ts.map +1 -0
  14. package/declarations/-private/nice-ticks.d.ts +17 -0
  15. package/declarations/-private/nice-ticks.d.ts.map +1 -0
  16. package/declarations/-private/parts.d.ts +596 -0
  17. package/declarations/-private/parts.d.ts.map +1 -0
  18. package/declarations/-private/paths.d.ts +26 -0
  19. package/declarations/-private/paths.d.ts.map +1 -0
  20. package/declarations/-private/pie-chart.d.ts +244 -0
  21. package/declarations/-private/pie-chart.d.ts.map +1 -0
  22. package/declarations/-private/polar-chart.d.ts +423 -0
  23. package/declarations/-private/polar-chart.d.ts.map +1 -0
  24. package/declarations/-private/polar-geometry.d.ts +230 -0
  25. package/declarations/-private/polar-geometry.d.ts.map +1 -0
  26. package/declarations/-private/polar-parts.d.ts +315 -0
  27. package/declarations/-private/polar-parts.d.ts.map +1 -0
  28. package/declarations/-private/polar.d.ts +156 -0
  29. package/declarations/-private/polar.d.ts.map +1 -0
  30. package/declarations/-private/registry.d.ts +9 -0
  31. package/declarations/-private/registry.d.ts.map +1 -0
  32. package/declarations/-private/text-size.d.ts +13 -0
  33. package/declarations/-private/text-size.d.ts.map +1 -0
  34. package/declarations/-private/tick-interval.d.ts +35 -0
  35. package/declarations/-private/tick-interval.d.ts.map +1 -0
  36. package/declarations/components/area-chart.d.ts +16 -0
  37. package/declarations/components/area-chart.d.ts.map +1 -0
  38. package/declarations/components/bar-chart.d.ts +16 -0
  39. package/declarations/components/bar-chart.d.ts.map +1 -0
  40. package/declarations/components/chart-container.d.ts +66 -0
  41. package/declarations/components/chart-container.d.ts.map +1 -0
  42. package/declarations/components/chart-legend-content.d.ts +42 -0
  43. package/declarations/components/chart-legend-content.d.ts.map +1 -0
  44. package/declarations/components/chart-style.d.ts +19 -0
  45. package/declarations/components/chart-style.d.ts.map +1 -0
  46. package/declarations/components/chart-tooltip-content.d.ts +94 -0
  47. package/declarations/components/chart-tooltip-content.d.ts.map +1 -0
  48. package/declarations/components/dot.d.ts +22 -0
  49. package/declarations/components/dot.d.ts.map +1 -0
  50. package/declarations/components/line-chart.d.ts +16 -0
  51. package/declarations/components/line-chart.d.ts.map +1 -0
  52. package/declarations/components/pie-chart.d.ts +13 -0
  53. package/declarations/components/pie-chart.d.ts.map +1 -0
  54. package/declarations/components/radar-chart.d.ts +21 -0
  55. package/declarations/components/radar-chart.d.ts.map +1 -0
  56. package/declarations/components/radial-bar-chart.d.ts +17 -0
  57. package/declarations/components/radial-bar-chart.d.ts.map +1 -0
  58. package/declarations/components/rectangle.d.ts +32 -0
  59. package/declarations/components/rectangle.d.ts.map +1 -0
  60. package/declarations/components/sector.d.ts +47 -0
  61. package/declarations/components/sector.d.ts.map +1 -0
  62. package/declarations/index.d.ts +24 -0
  63. package/declarations/index.d.ts.map +1 -0
  64. package/declarations/test-support/chart.d.ts +162 -0
  65. package/declarations/test-support/chart.d.ts.map +1 -0
  66. package/declarations/test-support/index.d.ts +3 -0
  67. package/declarations/test-support/index.d.ts.map +1 -0
  68. package/declarations/test-support/polar-chart.d.ts +62 -0
  69. package/declarations/test-support/polar-chart.d.ts.map +1 -0
  70. package/declarations/test-support.d.ts +2 -0
  71. package/declarations/types.d.ts +138 -0
  72. package/declarations/types.d.ts.map +1 -0
  73. package/dist/cartesian-D9hWDamz.js +1217 -0
  74. package/dist/cartesian-D9hWDamz.js.map +1 -0
  75. package/dist/cartesian-chart-BLj6Q_OB.js +1123 -0
  76. package/dist/cartesian-chart-BLj6Q_OB.js.map +1 -0
  77. package/dist/components/area-chart.js +20 -0
  78. package/dist/components/area-chart.js.map +1 -0
  79. package/dist/components/bar-chart.js +20 -0
  80. package/dist/components/bar-chart.js.map +1 -0
  81. package/dist/components/chart-container.js +54 -0
  82. package/dist/components/chart-container.js.map +1 -0
  83. package/dist/components/chart-legend-content.js +48 -0
  84. package/dist/components/chart-legend-content.js.map +1 -0
  85. package/dist/components/chart-style.js +35 -0
  86. package/dist/components/chart-style.js.map +1 -0
  87. package/dist/components/chart-tooltip-content.js +131 -0
  88. package/dist/components/chart-tooltip-content.js.map +1 -0
  89. package/dist/components/dot.js +18 -0
  90. package/dist/components/dot.js.map +1 -0
  91. package/dist/components/line-chart.js +20 -0
  92. package/dist/components/line-chart.js.map +1 -0
  93. package/dist/components/pie-chart.js +6 -0
  94. package/dist/components/pie-chart.js.map +1 -0
  95. package/dist/components/radar-chart.js +22 -0
  96. package/dist/components/radar-chart.js.map +1 -0
  97. package/dist/components/radial-bar-chart.js +20 -0
  98. package/dist/components/radial-bar-chart.js.map +1 -0
  99. package/dist/components/rectangle.js +5 -0
  100. package/dist/components/rectangle.js.map +1 -0
  101. package/dist/components/sector.js +5 -0
  102. package/dist/components/sector.js.map +1 -0
  103. package/dist/config-DnsUmxOT.js +35 -0
  104. package/dist/config-DnsUmxOT.js.map +1 -0
  105. package/dist/index.js +15 -0
  106. package/dist/index.js.map +1 -0
  107. package/dist/parts-BWLhFFjB.js +355 -0
  108. package/dist/parts-BWLhFFjB.js.map +1 -0
  109. package/dist/pie-chart-CmDtW_Ge.js +646 -0
  110. package/dist/pie-chart-CmDtW_Ge.js.map +1 -0
  111. package/dist/polar-chart-GhgOSsH9.js +2242 -0
  112. package/dist/polar-chart-GhgOSsH9.js.map +1 -0
  113. package/dist/rectangle-Cl7tbXuZ.js +166 -0
  114. package/dist/rectangle-Cl7tbXuZ.js.map +1 -0
  115. package/dist/sector-7shQPJuQ.js +565 -0
  116. package/dist/sector-7shQPJuQ.js.map +1 -0
  117. package/dist/test-support.js +470 -0
  118. package/dist/test-support.js.map +1 -0
  119. package/dist/types.js +56 -0
  120. package/dist/types.js.map +1 -0
  121. package/package.json +117 -3
package/CHANGELOG.md ADDED
@@ -0,0 +1,167 @@
1
+ # @ember-joinery/chart
2
+
3
+ ## 1.0.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [2b887bf]
8
+ - Updated dependencies [2b887bf]
9
+ - Updated dependencies [2b887bf]
10
+ - Updated dependencies [2b887bf]
11
+ - Updated dependencies [2b887bf]
12
+ - Updated dependencies [2b887bf]
13
+ - Updated dependencies [2b887bf]
14
+ - Updated dependencies [2b887bf]
15
+ - @ember-joinery/primitives@1.0.1
16
+ - @ember-joinery/ember@1.0.1
17
+ - @ember-joinery/test-support@1.0.1
18
+
19
+ ## 1.0.0
20
+
21
+ ### Major Changes
22
+
23
+ - a73065d: `@ember-joinery/chart` is a new add-on: shadcn's charts, drawn as declarative Glimmer SVG on
24
+ `d3-scale` and `d3-shape` with an API shaped like recharts. `ChartContainer` takes the chart's
25
+ `@config` (labels, icons and colours, set as `--color-<key>` variables, light and dark) and the
26
+ `@initialDimension` it draws at before it is measured, and yields `AreaChart`, `BarChart` and `LineChart`, which yield recharts' parts: `XAxis`, `YAxis`,
27
+ `CartesianGrid`, `Area`, `Bar` and `Line` (each with `LabelList`), `ChartTooltip` and
28
+ `ChartLegend`. The geometry is recharts 3's (margins, nice ticks, overlapping labels dropped,
29
+ stacking, bar bands, curves), so a chart draws the paths recharts draws, with recharts' class
30
+ names. `ChartTooltipContent` and `ChartLegendContent` are shadcn's; the tooltip follows the
31
+ pointer and, with the accessibility layer, the arrow keys, and its `@formatter` is a function
32
+ that returns an entry's text or a component that draws the entry (recharts' formatter can
33
+ return markup). `Dot` and `ChartStyle` go with them. Its `/test-support` has `ChartHarness`,
34
+ `ChartTooltipHarness` and `ChartLegendHarness`. `@ember-joinery/ember`'s CSS styles the chart,
35
+ its tooltip and its legend. The built modules that hold code ported from recharts keep
36
+ recharts' MIT notice.
37
+
38
+ ### Minor Changes
39
+
40
+ - a73065d: `ChartContainer` yields `PieChart`, recharts' pie chart: its `Pie` draws recharts 3's sectors,
41
+ with a label and a line past each one (`@label`, `true` or a component), an inner radius for a
42
+ donut, and a `@shape` that draws each sector with `Sector`; it yields `LabelList`, `Label` (a
43
+ `@content` component handed the chart's ring, for a donut's total) and `Cell`. Its tooltip shows
44
+ the sector under the pointer, and with the accessibility layer the arrow keys step through the
45
+ sectors. A bar takes the `fill` in its row and its `Cell`'s, its labels take that fill, its
46
+ `@shape` draws each bar with `Rectangle`, and a bar with no length is left out, as recharts'
47
+ are. A `ChartLegend`'s `@class` reaches its content. `ChartHarness` reads a pie's sectors, label
48
+ lists and label lines, and points at a sector. The guide's Charts section has the bar and pie
49
+ charts of shadcn's charts gallery.
50
+ - a73065d: `ChartContainer` yields `RadarChart` and `RadialBarChart`, recharts 3's polar charts, with
51
+ recharts' polar parts: `PolarGrid` (polygon or circle rings, spokes), `PolarAngleAxis` (whose
52
+ `@tick` takes a component), `PolarRadiusAxis` (yielding `Label`, whose `@content` component is
53
+ handed the chart's ring, for a total in the middle), `Radar` (with `@dot` and `@activeDot`, and
54
+ `[low, high]` pairs for a band) and `RadialBar` (with a `@background` track, `@cornerRadius`,
55
+ `@stackId`, a row's own `fill`, and `LabelList`, whose `insideStart` labels run along the bar).
56
+ They draw the paths recharts draws, with its class names; the tooltip follows the pointer round
57
+ the ring and, with the accessibility layer, the arrow keys from row to row. A bar chart's
58
+ tooltip opened by `@defaultIndex` or the keyboard now points at the row's tick half way down the
59
+ chart, as recharts' does, rather than at its bar, and a tooltip glides from row to row only
60
+ when the user doesn't prefer reduced motion (`@isAnimationActive`, `'auto'` by default, as
61
+ recharts'). `/test-support` adds `PolarChartHarness`. The guide's Charts section has the radar,
62
+ radial and tooltip charts of shadcn's charts gallery.
63
+
64
+ ### Patch Changes
65
+
66
+ - a53c07b: Type checks in package source use `@sindresorhus/is` (`isString`, `isFunction`, …) instead of `typeof`, and a lint rule keeps it that way. `@sindresorhus/is` is a new runtime dependency, so `ember-joinery add` now installs it into the app for most components, `icon` included. `isNumber` rejects `NaN`, so a `NaN` reaching a numeric check now takes the non-number branch.
67
+ - a73065d: Every package's tarball carries Joinery's `LICENSE.md` and `NOTICE`, with the licences and
68
+ notices of what it ports (shadcn/ui, ember-primitives, sonner, recharts and the rest), copied in
69
+ from the repository's root by the package's `prepack`.
70
+ - Updated dependencies [a73065d]
71
+ - Updated dependencies [a73065d]
72
+ - Updated dependencies [a73065d]
73
+ - Updated dependencies [a73065d]
74
+ - Updated dependencies [a73065d]
75
+ - Updated dependencies [a73065d]
76
+ - Updated dependencies [a73065d]
77
+ - Updated dependencies [a73065d]
78
+ - Updated dependencies [a73065d]
79
+ - Updated dependencies [a73065d]
80
+ - Updated dependencies [a73065d]
81
+ - Updated dependencies [a73065d]
82
+ - Updated dependencies [a73065d]
83
+ - Updated dependencies [a73065d]
84
+ - Updated dependencies [a73065d]
85
+ - Updated dependencies [a73065d]
86
+ - Updated dependencies [a73065d]
87
+ - Updated dependencies [a73065d]
88
+ - Updated dependencies [a73065d]
89
+ - Updated dependencies [a73065d]
90
+ - Updated dependencies [a73065d]
91
+ - Updated dependencies [a73065d]
92
+ - Updated dependencies [a73065d]
93
+ - Updated dependencies [a73065d]
94
+ - Updated dependencies [a73065d]
95
+ - Updated dependencies [a73065d]
96
+ - Updated dependencies [a73065d]
97
+ - Updated dependencies [a73065d]
98
+ - Updated dependencies [a73065d]
99
+ - Updated dependencies [a73065d]
100
+ - Updated dependencies [a73065d]
101
+ - Updated dependencies [a73065d]
102
+ - Updated dependencies [a73065d]
103
+ - Updated dependencies [a73065d]
104
+ - Updated dependencies [a73065d]
105
+ - Updated dependencies [a73065d]
106
+ - Updated dependencies [a73065d]
107
+ - Updated dependencies [17c5b5c]
108
+ - Updated dependencies [17c5b5c]
109
+ - Updated dependencies [99eab0c]
110
+ - Updated dependencies [a73065d]
111
+ - Updated dependencies [a73065d]
112
+ - Updated dependencies [a73065d]
113
+ - Updated dependencies [a73065d]
114
+ - Updated dependencies [a73065d]
115
+ - Updated dependencies [a73065d]
116
+ - Updated dependencies [a73065d]
117
+ - Updated dependencies [a73065d]
118
+ - Updated dependencies [a73065d]
119
+ - Updated dependencies [a73065d]
120
+ - Updated dependencies [a73065d]
121
+ - Updated dependencies [a73065d]
122
+ - Updated dependencies [a73065d]
123
+ - Updated dependencies [a73065d]
124
+ - Updated dependencies [a73065d]
125
+ - Updated dependencies [a73065d]
126
+ - Updated dependencies [a73065d]
127
+ - Updated dependencies [a73065d]
128
+ - Updated dependencies [a73065d]
129
+ - Updated dependencies [a73065d]
130
+ - Updated dependencies [a73065d]
131
+ - Updated dependencies [a73065d]
132
+ - Updated dependencies [a73065d]
133
+ - Updated dependencies [a73065d]
134
+ - Updated dependencies [a73065d]
135
+ - Updated dependencies [a73065d]
136
+ - Updated dependencies [a73065d]
137
+ - Updated dependencies [a73065d]
138
+ - Updated dependencies [a73065d]
139
+ - Updated dependencies [a73065d]
140
+ - Updated dependencies [a73065d]
141
+ - Updated dependencies [a73065d]
142
+ - Updated dependencies [a73065d]
143
+ - Updated dependencies [a73065d]
144
+ - Updated dependencies [a73065d]
145
+ - Updated dependencies [a73065d]
146
+ - Updated dependencies [a73065d]
147
+ - Updated dependencies [a73065d]
148
+ - Updated dependencies [a73065d]
149
+ - Updated dependencies [a73065d]
150
+ - Updated dependencies [a73065d]
151
+ - Updated dependencies [a73065d]
152
+ - Updated dependencies [a73065d]
153
+ - Updated dependencies [a73065d]
154
+ - Updated dependencies [a73065d]
155
+ - Updated dependencies [a73065d]
156
+ - Updated dependencies [a73065d]
157
+ - Updated dependencies [a73065d]
158
+ - Updated dependencies [a73065d]
159
+ - Updated dependencies [a73065d]
160
+ - Updated dependencies [a73065d]
161
+ - Updated dependencies [a73065d]
162
+ - Updated dependencies [a73065d]
163
+ - Updated dependencies [a73065d]
164
+ - Updated dependencies [a73065d]
165
+ - @ember-joinery/primitives@1.0.0
166
+ - @ember-joinery/ember@1.0.0
167
+ - @ember-joinery/test-support@1.0.0
package/LICENSE.md ADDED
@@ -0,0 +1,9 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2026 Joe Gaudet
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
+
7
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8
+
9
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.