@tabler/charts 0.0.0-stage → 0.1.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.
- package/LICENSE +21 -0
- package/README.md +258 -2
- package/dist/annotations-Bp7HwtF5.d.ts +86 -0
- package/dist/annotations-BszTTjf9.js +202 -0
- package/dist/annotations-BszTTjf9.js.map +1 -0
- package/dist/annotations-DpETO8dE.cjs +213 -0
- package/dist/annotations-DpETO8dE.cjs.map +1 -0
- package/dist/annotations-lyt0I3HU.d.cts +86 -0
- package/dist/annotations.cjs +14 -0
- package/dist/annotations.cjs.map +1 -0
- package/dist/annotations.d.cts +2 -0
- package/dist/annotations.d.ts +2 -0
- package/dist/annotations.js +12 -0
- package/dist/annotations.js.map +1 -0
- package/dist/arc-BXpLrt9b.cjs +301 -0
- package/dist/arc-BXpLrt9b.cjs.map +1 -0
- package/dist/arc-a1tRTEw7.js +278 -0
- package/dist/arc-a1tRTEw7.js.map +1 -0
- package/dist/area-CF__HOwL.d.ts +20 -0
- package/dist/area-DIxaAbYZ.d.cts +20 -0
- package/dist/area-DQsLERhx.js +26 -0
- package/dist/area-DQsLERhx.js.map +1 -0
- package/dist/area-sHCE3pg5.cjs +31 -0
- package/dist/area-sHCE3pg5.cjs.map +1 -0
- package/dist/area.cjs +3 -0
- package/dist/area.d.cts +2 -0
- package/dist/area.d.ts +2 -0
- package/dist/area.js +2 -0
- package/dist/band-DTcNDAFO.d.cts +50 -0
- package/dist/band-DTcNDAFO.d.ts +50 -0
- package/dist/bar-BBM8RhoL.d.ts +43 -0
- package/dist/bar-C-7zR2qp.cjs +243 -0
- package/dist/bar-C-7zR2qp.cjs.map +1 -0
- package/dist/bar-CRKLDg98.d.cts +43 -0
- package/dist/bar-DGuUN3nc.cjs +67 -0
- package/dist/bar-DGuUN3nc.cjs.map +1 -0
- package/dist/bar-DM16NUvV.js +56 -0
- package/dist/bar-DM16NUvV.js.map +1 -0
- package/dist/bar-jZEoao74.js +238 -0
- package/dist/bar-jZEoao74.js.map +1 -0
- package/dist/bar.cjs +3 -0
- package/dist/bar.d.cts +2 -0
- package/dist/bar.d.ts +2 -0
- package/dist/bar.js +2 -0
- package/dist/candlestick-B5r1w3kc.cjs +150 -0
- package/dist/candlestick-B5r1w3kc.cjs.map +1 -0
- package/dist/candlestick-D_vV0_XZ.d.ts +44 -0
- package/dist/candlestick-DuXwAFID.js +145 -0
- package/dist/candlestick-DuXwAFID.js.map +1 -0
- package/dist/candlestick-__pXl_pV.d.cts +44 -0
- package/dist/candlestick.cjs +11 -0
- package/dist/candlestick.cjs.map +1 -0
- package/dist/candlestick.d.cts +2 -0
- package/dist/candlestick.d.ts +2 -0
- package/dist/candlestick.js +10 -0
- package/dist/candlestick.js.map +1 -0
- package/dist/cartesian-BoDfgBCV.cjs +900 -0
- package/dist/cartesian-BoDfgBCV.cjs.map +1 -0
- package/dist/cartesian-Cr0AF0nG.js +709 -0
- package/dist/cartesian-Cr0AF0nG.js.map +1 -0
- package/dist/chart-BF2CK9I_.js +790 -0
- package/dist/chart-BF2CK9I_.js.map +1 -0
- package/dist/chart-CowF_lWY.cjs +903 -0
- package/dist/chart-CowF_lWY.cjs.map +1 -0
- package/dist/chart-D7ooEFnk.d.cts +933 -0
- package/dist/chart-DyN7bcx8.d.ts +933 -0
- package/dist/circle-BQMuAfls.cjs +12 -0
- package/dist/circle-BQMuAfls.cjs.map +1 -0
- package/dist/circle-Z7YfCoCM.js +7 -0
- package/dist/circle-Z7YfCoCM.js.map +1 -0
- package/dist/clean-Byl6kzf0.cjs +115 -0
- package/dist/clean-Byl6kzf0.cjs.map +1 -0
- package/dist/clean-o1vDEhFV.js +56 -0
- package/dist/clean-o1vDEhFV.js.map +1 -0
- package/dist/core-CegR_j55.js +884 -0
- package/dist/core-CegR_j55.js.map +1 -0
- package/dist/core-D1vO1LrC.d.cts +220 -0
- package/dist/core-DcbemzGf.d.ts +220 -0
- package/dist/core-RzS9IQO5.cjs +985 -0
- package/dist/core-RzS9IQO5.cjs.map +1 -0
- package/dist/core.cjs +115 -0
- package/dist/core.d.cts +21 -0
- package/dist/core.d.ts +21 -0
- package/dist/core.js +25 -0
- package/dist/dates-Btm7Zm6W.cjs +32 -0
- package/dist/dates-Btm7Zm6W.cjs.map +1 -0
- package/dist/dates-CG-FvioW.js +27 -0
- package/dist/dates-CG-FvioW.js.map +1 -0
- package/dist/decimate-BGg9XgF0.d.ts +17 -0
- package/dist/decimate-C87cl_Sp.js +84 -0
- package/dist/decimate-C87cl_Sp.js.map +1 -0
- package/dist/decimate-CNSpgGa5.d.cts +17 -0
- package/dist/decimate-tLhDk1ys.cjs +95 -0
- package/dist/decimate-tLhDk1ys.cjs.map +1 -0
- package/dist/decimate.cjs +14 -0
- package/dist/decimate.cjs.map +1 -0
- package/dist/decimate.d.cts +2 -0
- package/dist/decimate.d.ts +2 -0
- package/dist/decimate.js +12 -0
- package/dist/decimate.js.map +1 -0
- package/dist/dom-CLF868Qs.cjs +222 -0
- package/dist/dom-CLF868Qs.cjs.map +1 -0
- package/dist/dom-vP3IcMak.js +175 -0
- package/dist/dom-vP3IcMak.js.map +1 -0
- package/dist/export-chart-9w8t3rjZ.js +232 -0
- package/dist/export-chart-9w8t3rjZ.js.map +1 -0
- package/dist/export-chart-BhhYgksr.cjs +249 -0
- package/dist/export-chart-BhhYgksr.cjs.map +1 -0
- package/dist/export.cjs +18 -0
- package/dist/export.cjs.map +1 -0
- package/dist/export.d.cts +2 -0
- package/dist/export.d.ts +2 -0
- package/dist/export.js +15 -0
- package/dist/export.js.map +1 -0
- package/dist/extent-BAMZo0Nq.js +19 -0
- package/dist/extent-BAMZo0Nq.js.map +1 -0
- package/dist/extent-DsFWvAHJ.cjs +24 -0
- package/dist/extent-DsFWvAHJ.cjs.map +1 -0
- package/dist/fade-Cs74puQS.cjs +217 -0
- package/dist/fade-Cs74puQS.cjs.map +1 -0
- package/dist/fade-D3NxH5Qg.js +200 -0
- package/dist/fade-D3NxH5Qg.js.map +1 -0
- package/dist/features-BclHgg2W.cjs +48 -0
- package/dist/features-BclHgg2W.cjs.map +1 -0
- package/dist/features-wASyHGic.js +25 -0
- package/dist/features-wASyHGic.js.map +1 -0
- package/dist/format-B0yKXBTH.cjs +183 -0
- package/dist/format-B0yKXBTH.cjs.map +1 -0
- package/dist/format-lStwuc1L.js +142 -0
- package/dist/format-lStwuc1L.js.map +1 -0
- package/dist/gauge-D-FYhuds.cjs +236 -0
- package/dist/gauge-D-FYhuds.cjs.map +1 -0
- package/dist/gauge-DP_EB2z3.d.cts +65 -0
- package/dist/gauge-Dh423FHh.js +231 -0
- package/dist/gauge-Dh423FHh.js.map +1 -0
- package/dist/gauge-zpia05t2.d.ts +65 -0
- package/dist/gauge.cjs +3 -0
- package/dist/gauge.d.cts +2 -0
- package/dist/gauge.d.ts +2 -0
- package/dist/gauge.js +2 -0
- package/dist/heatmap-BK18EBgJ.cjs +247 -0
- package/dist/heatmap-BK18EBgJ.cjs.map +1 -0
- package/dist/heatmap-BectCEeE.d.ts +81 -0
- package/dist/heatmap-CCso6m61.d.cts +81 -0
- package/dist/heatmap-DSZ2bVIa.js +242 -0
- package/dist/heatmap-DSZ2bVIa.js.map +1 -0
- package/dist/heatmap.cjs +3 -0
- package/dist/heatmap.d.cts +2 -0
- package/dist/heatmap.d.ts +2 -0
- package/dist/heatmap.js +2 -0
- package/dist/hydrate-CTTmQy0x.d.cts +10 -0
- package/dist/hydrate-CxwTXDqO.cjs +60 -0
- package/dist/hydrate-CxwTXDqO.cjs.map +1 -0
- package/dist/hydrate-CzfxLfTv.d.ts +10 -0
- package/dist/hydrate-DDNIHYv_.js +55 -0
- package/dist/hydrate-DDNIHYv_.js.map +1 -0
- package/dist/hydrate.cjs +13 -0
- package/dist/hydrate.cjs.map +1 -0
- package/dist/hydrate.d.cts +2 -0
- package/dist/hydrate.d.ts +2 -0
- package/dist/hydrate.js +12 -0
- package/dist/hydrate.js.map +1 -0
- package/dist/index.cjs +214 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +46 -0
- package/dist/index.d.ts +46 -0
- package/dist/index.js +115 -0
- package/dist/index.js.map +1 -0
- package/dist/layout-B3hiqVEw.js +69 -0
- package/dist/layout-B3hiqVEw.js.map +1 -0
- package/dist/layout-CtMBhNd9.cjs +98 -0
- package/dist/layout-CtMBhNd9.cjs.map +1 -0
- package/dist/line-B3Ed6u7j.js +120 -0
- package/dist/line-B3Ed6u7j.js.map +1 -0
- package/dist/line-CN4uZ9ZX.d.ts +47 -0
- package/dist/line-W7VD_qs1.d.cts +47 -0
- package/dist/line-fQbtP_jL.cjs +131 -0
- package/dist/line-fQbtP_jL.cjs.map +1 -0
- package/dist/line.cjs +14 -0
- package/dist/line.cjs.map +1 -0
- package/dist/line.d.cts +2 -0
- package/dist/line.d.ts +2 -0
- package/dist/line.js +13 -0
- package/dist/line.js.map +1 -0
- package/dist/log-CaofN3-n.d.cts +48 -0
- package/dist/log-CaofN3-n.d.ts +48 -0
- package/dist/log-axis-83rSpvL5.cjs +130 -0
- package/dist/log-axis-83rSpvL5.cjs.map +1 -0
- package/dist/log-axis-B_uvvOFc.js +113 -0
- package/dist/log-axis-B_uvvOFc.js.map +1 -0
- package/dist/log.cjs +17 -0
- package/dist/log.cjs.map +1 -0
- package/dist/log.d.cts +2 -0
- package/dist/log.d.ts +2 -0
- package/dist/log.js +16 -0
- package/dist/log.js.map +1 -0
- package/dist/morph-BMxz3X2b.d.cts +10 -0
- package/dist/morph-BMxz3X2b.d.ts +10 -0
- package/dist/morph-Bgg-24l8.js +36 -0
- package/dist/morph-Bgg-24l8.js.map +1 -0
- package/dist/morph-CqYDu1bY.cjs +41 -0
- package/dist/morph-CqYDu1bY.cjs.map +1 -0
- package/dist/morph.cjs +14 -0
- package/dist/morph.cjs.map +1 -0
- package/dist/morph.d.cts +2 -0
- package/dist/morph.d.ts +2 -0
- package/dist/morph.js +13 -0
- package/dist/morph.js.map +1 -0
- package/dist/named-BWWb5LQJ.cjs +50 -0
- package/dist/named-BWWb5LQJ.cjs.map +1 -0
- package/dist/named-DE15TOgh.js +33 -0
- package/dist/named-DE15TOgh.js.map +1 -0
- package/dist/parliament-1Zv2Xh0D.d.ts +69 -0
- package/dist/parliament-CpWnoEvG.cjs +308 -0
- package/dist/parliament-CpWnoEvG.cjs.map +1 -0
- package/dist/parliament-DdrLVZwt.d.cts +69 -0
- package/dist/parliament-Dw0sOERi.js +303 -0
- package/dist/parliament-Dw0sOERi.js.map +1 -0
- package/dist/parliament.cjs +3 -0
- package/dist/parliament.d.cts +2 -0
- package/dist/parliament.d.ts +2 -0
- package/dist/parliament.js +2 -0
- package/dist/path-CwB28da0.d.cts +29 -0
- package/dist/path-CwB28da0.d.ts +29 -0
- package/dist/patterns-DtgcnA8o.js +85 -0
- package/dist/patterns-DtgcnA8o.js.map +1 -0
- package/dist/patterns-LfcQAWCy.cjs +102 -0
- package/dist/patterns-LfcQAWCy.cjs.map +1 -0
- package/dist/patterns.cjs +15 -0
- package/dist/patterns.cjs.map +1 -0
- package/dist/patterns.d.cts +2 -0
- package/dist/patterns.d.ts +2 -0
- package/dist/patterns.js +12 -0
- package/dist/patterns.js.map +1 -0
- package/dist/pie-5z1fDdKO.d.ts +58 -0
- package/dist/pie-BF9yI5mE.d.cts +58 -0
- package/dist/pie-BxTZt6Go.cjs +212 -0
- package/dist/pie-BxTZt6Go.cjs.map +1 -0
- package/dist/pie-DzUXDTcn.js +201 -0
- package/dist/pie-DzUXDTcn.js.map +1 -0
- package/dist/pie.cjs +4 -0
- package/dist/pie.d.cts +2 -0
- package/dist/pie.d.ts +2 -0
- package/dist/pie.js +2 -0
- package/dist/point-shapes-CGl4dugc.cjs +166 -0
- package/dist/point-shapes-CGl4dugc.cjs.map +1 -0
- package/dist/point-shapes-DI84NNpI.js +155 -0
- package/dist/point-shapes-DI84NNpI.js.map +1 -0
- package/dist/point-shapes.cjs +15 -0
- package/dist/point-shapes.cjs.map +1 -0
- package/dist/point-shapes.d.cts +2 -0
- package/dist/point-shapes.d.ts +2 -0
- package/dist/point-shapes.js +13 -0
- package/dist/point-shapes.js.map +1 -0
- package/dist/radar-1-EryihA.d.ts +60 -0
- package/dist/radar-CYPab_I4.js +285 -0
- package/dist/radar-CYPab_I4.js.map +1 -0
- package/dist/radar-CoGUNNSb.cjs +290 -0
- package/dist/radar-CoGUNNSb.cjs.map +1 -0
- package/dist/radar-DBW4O0Vt.d.cts +60 -0
- package/dist/radar.cjs +3 -0
- package/dist/radar.d.cts +2 -0
- package/dist/radar.d.ts +2 -0
- package/dist/radar.js +2 -0
- package/dist/sankey-B4PNKusJ.js +420 -0
- package/dist/sankey-B4PNKusJ.js.map +1 -0
- package/dist/sankey-Bacx4fVe.cjs +425 -0
- package/dist/sankey-Bacx4fVe.cjs.map +1 -0
- package/dist/sankey-DuGI3Qc5.d.cts +67 -0
- package/dist/sankey-OV_WoPrl.d.ts +67 -0
- package/dist/sankey.cjs +3 -0
- package/dist/sankey.d.cts +2 -0
- package/dist/sankey.d.ts +2 -0
- package/dist/sankey.js +2 -0
- package/dist/scatter-BqzgJqdX.d.ts +61 -0
- package/dist/scatter-DbxLyZX0.d.cts +61 -0
- package/dist/scatter-DgMN9zRy.cjs +250 -0
- package/dist/scatter-DgMN9zRy.cjs.map +1 -0
- package/dist/scatter-kgtgR318.js +245 -0
- package/dist/scatter-kgtgR318.js.map +1 -0
- package/dist/scatter.cjs +3 -0
- package/dist/scatter.d.cts +2 -0
- package/dist/scatter.d.ts +2 -0
- package/dist/scatter.js +2 -0
- package/dist/sparkline-BQzt27Fr.js +171 -0
- package/dist/sparkline-BQzt27Fr.js.map +1 -0
- package/dist/sparkline-BS9-hltA.cjs +176 -0
- package/dist/sparkline-BS9-hltA.cjs.map +1 -0
- package/dist/sparkline-BfyO_oNM.d.ts +43 -0
- package/dist/sparkline-CWlJDKyh.d.cts +43 -0
- package/dist/sparkline.cjs +3 -0
- package/dist/sparkline.d.cts +2 -0
- package/dist/sparkline.d.ts +2 -0
- package/dist/sparkline.js +2 -0
- package/dist/stack-CpR6RGKd.d.cts +6 -0
- package/dist/stack-CpR6RGKd.d.ts +6 -0
- package/dist/stack-DRbwTeF3.js +66 -0
- package/dist/stack-DRbwTeF3.js.map +1 -0
- package/dist/stack-DVhJWaki.cjs +77 -0
- package/dist/stack-DVhJWaki.cjs.map +1 -0
- package/dist/style.css +2 -0
- package/dist/sweep-CbfR7--d.js +60 -0
- package/dist/sweep-CbfR7--d.js.map +1 -0
- package/dist/sweep-DaTEDDuC.cjs +71 -0
- package/dist/sweep-DaTEDDuC.cjs.map +1 -0
- package/dist/time-CHjiY9Q4.d.ts +112 -0
- package/dist/time-CNVnt-B2.d.cts +112 -0
- package/dist/time-axis-Bc9eHX1r.js +365 -0
- package/dist/time-axis-Bc9eHX1r.js.map +1 -0
- package/dist/time-axis-VSX34_Tb.cjs +382 -0
- package/dist/time-axis-VSX34_Tb.cjs.map +1 -0
- package/dist/time.cjs +22 -0
- package/dist/time.cjs.map +1 -0
- package/dist/time.d.cts +2 -0
- package/dist/time.d.ts +2 -0
- package/dist/time.js +20 -0
- package/dist/time.js.map +1 -0
- package/dist/tween-BCYd0RTY.js +40 -0
- package/dist/tween-BCYd0RTY.js.map +1 -0
- package/dist/tween-CIGBlryn.cjs +51 -0
- package/dist/tween-CIGBlryn.cjs.map +1 -0
- package/dist/value-labels-B0WJoJ7x.cjs +134 -0
- package/dist/value-labels-B0WJoJ7x.cjs.map +1 -0
- package/dist/value-labels-IZIQPhfk.js +123 -0
- package/dist/value-labels-IZIQPhfk.js.map +1 -0
- package/dist/value-labels.cjs +14 -0
- package/dist/value-labels.cjs.map +1 -0
- package/dist/value-labels.d.cts +2 -0
- package/dist/value-labels.d.ts +2 -0
- package/dist/value-labels.js +12 -0
- package/dist/value-labels.js.map +1 -0
- package/dist/vnode-BUflsBsa.d.cts +66 -0
- package/dist/vnode-BUflsBsa.d.ts +66 -0
- package/dist/vnode-CkQ27Cxe.cjs +110 -0
- package/dist/vnode-CkQ27Cxe.cjs.map +1 -0
- package/dist/vnode-tCWItoUH.js +93 -0
- package/dist/vnode-tCWItoUH.js.map +1 -0
- package/package.json +320 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 The Tabler Authors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,259 @@
|
|
|
1
|
-
|
|
1
|
+
<p align="center">
|
|
2
|
+
<picture>
|
|
3
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/tabler/tabler-charts/main/docs/images/logo-white.svg">
|
|
4
|
+
<img src="https://raw.githubusercontent.com/tabler/tabler-charts/main/docs/images/logo.svg" alt="Tabler Charts" width="280">
|
|
5
|
+
</picture>
|
|
6
|
+
</p>
|
|
2
7
|
|
|
3
|
-
|
|
8
|
+
# @tabler/charts
|
|
9
|
+
|
|
10
|
+
Zero-dependency SVG charts styled with CSS: the engine, every chart type, the plugins and the stylesheet.
|
|
11
|
+
|
|
12
|
+
<p align="center">
|
|
13
|
+
<picture>
|
|
14
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/tabler/tabler-charts/main/docs/images/og-image-dark.png">
|
|
15
|
+
<img src="https://raw.githubusercontent.com/tabler/tabler-charts/main/docs/images/og-image.png" alt="Tabler Charts: charts styled entirely with CSS" width="800">
|
|
16
|
+
</picture>
|
|
17
|
+
</p>
|
|
18
|
+
|
|
19
|
+
> 🚧 **Pre-release.** Not on npm yet; the API may still change.
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
npm install @tabler/charts
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Quick start
|
|
26
|
+
|
|
27
|
+
```js
|
|
28
|
+
import { Chart, line } from '@tabler/charts'
|
|
29
|
+
import '@tabler/charts/style.css'
|
|
30
|
+
|
|
31
|
+
const chart = new Chart('#sales', {
|
|
32
|
+
type: line,
|
|
33
|
+
data: {
|
|
34
|
+
labels: ['Jan', 'Feb', 'Mar', 'Apr'],
|
|
35
|
+
series: [
|
|
36
|
+
{ name: 'Revenue', values: [42, 51, 47, 63] },
|
|
37
|
+
{ name: 'Costs', values: [31, 35, null, 40] }, // null leaves a gap
|
|
38
|
+
],
|
|
39
|
+
},
|
|
40
|
+
y: { format: { style: 'currency', currency: 'USD' } },
|
|
41
|
+
locale: 'en-US',
|
|
42
|
+
})
|
|
43
|
+
|
|
44
|
+
chart.setData({ labels, series }) // new data animates from the old
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
The chart fills its container's width (height = width / `aspectRatio`, 2 by default) and follows it when it resizes.
|
|
48
|
+
|
|
49
|
+
## Two entries: everything, or only what you use
|
|
50
|
+
|
|
51
|
+
| Import | You get |
|
|
52
|
+
| --- | --- |
|
|
53
|
+
| `@tabler/charts` | `Chart` with every built-in plugin (highlight, tooltip, legend, data table, keyboard) and every optional feature registered |
|
|
54
|
+
| `@tabler/charts/core` | A bare `Chart` with no plugins and no features: add what you need |
|
|
55
|
+
|
|
56
|
+
```js
|
|
57
|
+
import { Chart, highlight, tooltip } from '@tabler/charts/core'
|
|
58
|
+
import { line } from '@tabler/charts/line'
|
|
59
|
+
import '@tabler/charts/time' // only if you use x: { type: 'time' }
|
|
60
|
+
|
|
61
|
+
new Chart('#el', { type: line, data, plugins: [highlight(), tooltip()] })
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
Chart types have their own entries (`@tabler/charts/line`, `/bar`, `/pie` …). Optional features register themselves when imported:
|
|
65
|
+
|
|
66
|
+
| Entry | Enables |
|
|
67
|
+
| --- | --- |
|
|
68
|
+
| `@tabler/charts/time` | `x: { type: 'time' }`: points at their real distance in time, calendar ticks, date labels |
|
|
69
|
+
| `@tabler/charts/log` | `y: { scale: 'log' }` |
|
|
70
|
+
| `@tabler/charts/decimate` | `decimate: 500` on line and area charts (LTTB downsampling) |
|
|
71
|
+
| `@tabler/charts/annotations` | `annotations` on line, area, bar and candlestick charts |
|
|
72
|
+
| `@tabler/charts/hydrate` | Taking over server-rendered markup node by node (otherwise it is replaced) |
|
|
73
|
+
| `@tabler/charts/export` | `exportSVG()`, `exportImage()`, `downloadChart()`, and the `download` menu option (also with the default `Chart`) |
|
|
74
|
+
|
|
75
|
+
A feature you use but did not import throws an error that names the import.
|
|
76
|
+
|
|
77
|
+
## Chart types
|
|
78
|
+
|
|
79
|
+
| Type | Data | Notable options |
|
|
80
|
+
| --- | --- | --- |
|
|
81
|
+
| `line` | `{ labels, series }` | `curve` (`'monotone'`, `'linear'`, `'step'` …), `points` (`'none'`, `'last'`, `'all'`), `area`, `stacked`, `connectNulls`, `decimate` |
|
|
82
|
+
| `area` | `{ labels, series }` | as `line`, filled; `fill: 'gradient' \| 'solid'` |
|
|
83
|
+
| `bar` | `{ labels, series }` | `stacked` (`true` or `'percent'`), `orientation: 'horizontal'`, `radius`, `gap`, `maxBarWidth`; `series[].type: 'line' \| 'area'` mixes in lines |
|
|
84
|
+
| `pie`, `donut` | `[{ name, value }]` | `innerRadius`, `gap`, `cornerRadius`, `center` (text in the middle) |
|
|
85
|
+
| `gauge` | a number, a ring or rings | `max`, `startAngle`, `angle` (`270` for a dial), `thickness`, `center` |
|
|
86
|
+
| `radar` | `{ labels, series }` | `grid: 'polygon' \| 'circle'`, `fill`, `points`, `r` (radial axis), `labelWidth` (long spoke labels wrap at their spaces, by default past a quarter of the width) |
|
|
87
|
+
| `sankey` | `{ nodes?, links: [{ from, to, value }] }` | `nodeWidth`, `nodePadding`, `align: 'justify' \| 'left'`, `format`; nodes with a `color` make the legend |
|
|
88
|
+
| `parliament` | `[{ name, seats }]` | `total` (vacant seats), `rows`, `angle` (`180` for a hemicycle), `innerRadius`, `gap`, `center` |
|
|
89
|
+
| `scatter` | `{ series: [{ name, points: [{ x, y, size? }] }] }` | `radius`, `size` (bubble radii); points with `size` are bubbles |
|
|
90
|
+
| `heatmap` | `{ labels, series }` (rows) | `min`, `max`, `ranges`, `colors` + `mid` (scales), `colorBy: 'series'` |
|
|
91
|
+
| `candlestick` | `[{ x, open, high, low, close }]` | time axes, `maxCandleWidth` |
|
|
92
|
+
| `sparkline` | `number[]` | `variant` (`'line'`, `'area'`, `'bar'`, `'tristate'`), `point`, `markers: 'minmax'` |
|
|
93
|
+
|
|
94
|
+
`types` (from `@tabler/charts`) has every type by its name, for charts declared in markup (`types[name]`); it brings all of them into the bundle.
|
|
95
|
+
|
|
96
|
+
Series take `name`, `values`, and optionally `id` (stable identity), `color`, `dash`, `width`, `class` and `hidden`.
|
|
97
|
+
|
|
98
|
+
Cartesian charts share two axes:
|
|
99
|
+
- `x`: `format`, `type: 'time'`, `utc`, `grid`, `line`, `show`.
|
|
100
|
+
- `y`: `min`, `max`, `zero`, `nice`, `ticks`, `format`, `scale: 'log'`, `grid`, `show`.
|
|
101
|
+
|
|
102
|
+
A number `format` is `Intl.NumberFormat` options or a function. `notation: 'compact'` shortens long numbers in the locale's words ("1.1M", "1,1 mln" in Polish); `compactSymbols` writes suffixes of your own in the locale's separators instead:
|
|
103
|
+
|
|
104
|
+
```js
|
|
105
|
+
y: { format: { notation: 'compact', compactSymbols: true } } // 1K, 1,1M, 2,5B in pl-PL
|
|
106
|
+
y: { format: { notation: 'compact', compactSymbols: ['k', 'M', 'G'] } } // 1k, 1.1M, 2.5G
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
They also share `annotations`:
|
|
110
|
+
|
|
111
|
+
```js
|
|
112
|
+
annotations: [
|
|
113
|
+
{ y: 99.9, label: 'SLA' }, // a line at a value
|
|
114
|
+
{ y: [40, 60], label: 'Normal' }, // a band between values
|
|
115
|
+
{ x: 'Jun', label: 'Launch' }, // a line at a category (or a date)
|
|
116
|
+
]
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
### Value labels
|
|
120
|
+
|
|
121
|
+
`valueLabels: true` writes the values on the marks: bars at their end (inside when there is no room outside), stacked segments and heatmap cells inside, slices their share, lines and scatters above their last point (`valueLabels: { points: 'all' }` for every point). Values take the axis format (`valueLabels: { format }` overrides it). A label that does not fit its mark or the chart, or would cover another label or mark, is left out: labels never overlap. On the core, `import '@tabler/charts/value-labels'` enables them.
|
|
122
|
+
|
|
123
|
+
```js
|
|
124
|
+
new Chart('#el', { type: bar, data, valueLabels: true })
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
A chart type of your own gets labels from its hits like the built-in ones. Its `valueLabels` says what its marks are, when not bars or points (`{ marks: 'slice' }` for shares inside slices, `{ marks: 'cell' }` for values in the middle of cells), and where its number format is (`{ format: (options) => options.format }`).
|
|
128
|
+
|
|
129
|
+
### Synced hover
|
|
130
|
+
|
|
131
|
+
Charts with the same `sync` group share the hover: the category under the pointer is highlighted in every chart of the group, with its crosshair and tooltip, and they clear together. Categories are matched by label, so the charts need not have the same data; a chart without that label clears. Keyboard highlights stay in their own chart. On the core, add the `sync()` plugin.
|
|
132
|
+
|
|
133
|
+
```js
|
|
134
|
+
new Chart('#visitors', { type: line, data: visitors, sync: 'week' })
|
|
135
|
+
new Chart('#signups', { type: bar, data: signups, sync: 'week' })
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
### Data from outside
|
|
139
|
+
|
|
140
|
+
Data, annotations and axis bounds often come from users, APIs or JSON and are not always what the types say. Charts take them as they are and never throw or draw `NaN` over them: a value that is not a finite number (`null`, `'42'`, `NaN`, `Infinity`, an object) is a gap, as are numbers too large to plot (beyond ±1e300); names become text; a color that is not a string falls back to the palette; series, slices, points or annotations that are not objects are left out. Numbers in strings are not parsed: convert them first if your API sends them.
|
|
141
|
+
|
|
142
|
+
An option that is `NaN` or infinite (a `radius`, a `startAngle`, a `width`, a side of `padding`…) counts as left out: its default applies.
|
|
143
|
+
|
|
144
|
+
## Options every chart takes
|
|
145
|
+
|
|
146
|
+
| Option | Default | |
|
|
147
|
+
| --- | --- | --- |
|
|
148
|
+
| `width`, `height` | container width, width / `aspectRatio` | `height: 'container'` follows the container's height |
|
|
149
|
+
| `aspectRatio` | `2` | |
|
|
150
|
+
| `title`, `description` | | Accessible name and description; without a title the name lists the series ("line chart: Revenue, Costs") |
|
|
151
|
+
| `locale` | runtime default | For `Intl` number and date formatting; set it for SSR |
|
|
152
|
+
| `fontSize` | `--tc-font-size` | Used to lay out labels; set it for SSR |
|
|
153
|
+
| `id` | generated | Prefix of ids inside the SVG; set it for SSR |
|
|
154
|
+
| `legend` | for 2+ entries | `false`, `true` or `{ position: 'bottom' }` |
|
|
155
|
+
| `tooltip` | `true` | `false`, or `{ theme, format, footer }`: `theme: 'light'` for a white tooltip instead of the dark one, `format` and `footer` for custom content |
|
|
156
|
+
| `crosshair` | `true` | |
|
|
157
|
+
| `table` | `true` | Hidden data table for screen readers; `'visible'` shows it |
|
|
158
|
+
| `keyboard` | `true` | Arrow keys walk the data; sparklines opt out |
|
|
159
|
+
| `animate` | `true` | Charts with more than 1000 elements skip transitions unless `true` |
|
|
160
|
+
| `patterns` | `'auto'` | Pattern fills: `true` always, `'auto'` in forced colors only, `false` never |
|
|
161
|
+
| `valueLabels` | `false` | Values on the marks: `true`, or `{ points: 'all', format }` (see below) |
|
|
162
|
+
| `sync` | | A group name: charts of the same group share the hover (see below) |
|
|
163
|
+
| `shapes` | with `patterns: true` | A point shape per series in line, radar and scatter charts |
|
|
164
|
+
| `class` | | Extra classes on the `<svg>` |
|
|
165
|
+
| `plugins` | | Extra plugins |
|
|
166
|
+
|
|
167
|
+
## The `Chart` instance
|
|
168
|
+
|
|
169
|
+
```js
|
|
170
|
+
chart.update({ stacked: true }) // merge options, re-render in the next frame
|
|
171
|
+
chart.setConfig({ type: bar, data }) // replace every option: the ones left out go back to defaults
|
|
172
|
+
chart.setData(data)
|
|
173
|
+
chart.toggleSeries('Costs') // by key, name or index
|
|
174
|
+
chart.highlightIndex(2) // as keyboard navigation does
|
|
175
|
+
chart.clearHighlight()
|
|
176
|
+
chart.resize()
|
|
177
|
+
chart.destroy()
|
|
178
|
+
|
|
179
|
+
const off = chart.on('hover', ({ hit }) => {}) // also: click, legend-toggle, render
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
`chartEvents` lists the event names, for code that passes all of them on (as the adapters do).
|
|
183
|
+
|
|
184
|
+
Updates are batched into one animation frame for every chart on the page. `flush()` runs them right away (useful in tests).
|
|
185
|
+
|
|
186
|
+
An element holds one chart: a new `Chart` on it replaces the one already there. Call `destroy()` when the chart goes away (the React, Vue, element and data API wrappers do it for you). A container taken out of the page without it is still let go, and if you put the same container back, call `chart.resize()` so it follows its size again.
|
|
187
|
+
|
|
188
|
+
## Theming
|
|
189
|
+
|
|
190
|
+
Everything visual is CSS. The stylesheet defines tokens on `:root` (light and dark), and every element has semantic classes:
|
|
191
|
+
|
|
192
|
+
```css
|
|
193
|
+
.revenue-chart {
|
|
194
|
+
--tc-color-1: oklch(60% 0.2 250); /* palette slots --tc-color-1 … 8 */
|
|
195
|
+
--tc-stroke-width: 3px;
|
|
196
|
+
--tc-font-size: 13px;
|
|
197
|
+
}
|
|
198
|
+
.revenue-chart .tc-series-2 .tc-line { stroke-dasharray: 4 4; }
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
Tokens include `--tc-color-1` … `--tc-color-8`, `--tc-surface`, `--tc-text-color`, `--tc-text-muted`, `--tc-grid-color`, `--tc-baseline-color`, `--tc-font-family`, `--tc-font-size`, `--tc-stroke-width`, `--tc-area-opacity`, `--tc-duration`, `--tc-easing` and the `--tc-tooltip-*` set (`-bg`, `-color`, `-muted`, `-border`, `-shadow`, `-radius`, and `--tc-tooltip-light-*` for the white variant).
|
|
202
|
+
|
|
203
|
+
On a [Tabler](https://tabler.io) page the colors come from the theme: each color token reads the matching `--tblr-*` variable first (`--tc-color-1` is `--tblr-primary`, series 2–8 are Tabler's orange, teal, yellow, pink, green, indigo and red, the surface is `--tblr-bg-surface`, text and borders, radius, shadow and font follow too) and falls back to the chart's own palette when the variable is not defined. Tabler switches its variables for dark mode itself; without Tabler the fallbacks have their own dark values.
|
|
204
|
+
|
|
205
|
+
Colors given in data (`series.color`, slice, ring, heatmap and annotation colors, `series.dash`) may come from users: any CSS color works, `var(--…)` and `color-mix()` included, but a value that could inject CSS (a `;`, quotes, `url()` and the like) is ignored and the palette color stays.
|
|
206
|
+
|
|
207
|
+
Dark mode follows `prefers-color-scheme`, and `data-theme="dark"` / `"light"` on any ancestor overrides it. `prefers-reduced-motion` turns animations off, and forced colors (Windows High Contrast) are supported.
|
|
208
|
+
|
|
209
|
+
## Server-side rendering
|
|
210
|
+
|
|
211
|
+
```js
|
|
212
|
+
import { chartToString, line } from '@tabler/charts'
|
|
213
|
+
|
|
214
|
+
const svg = chartToString(
|
|
215
|
+
{ type: line, data, id: 'sales', locale: 'en-US', fontSize: 12 },
|
|
216
|
+
{ width: 600, height: 300 },
|
|
217
|
+
)
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
Put the SVG in the chart's container. A `Chart` created on the same element later takes the markup over node by node (with `@tabler/charts`, or `@tabler/charts/hydrate` on the core). Set `id`, `locale` and `fontSize` explicitly so the server and browser layouts match. The React and Vue adapters do all of this for you.
|
|
221
|
+
|
|
222
|
+
## Content Security Policy
|
|
223
|
+
|
|
224
|
+
Charts work under a strict CSP (`style-src 'self'`, no `'unsafe-inline'`): the browser renderer sets styles through the CSSOM, which such a policy allows, and injects no `<style>` elements. Server-rendered markup is the exception: the browser blocks (and reports) its style attributes as it parses the page, and hydration then sets them again, so the chart still ends up right. The React and Vue components always start from that markup. To keep the reports out, allow style attributes only: `style-src 'self'; style-src-attr 'unsafe-inline'`.
|
|
225
|
+
|
|
226
|
+
## Export
|
|
227
|
+
|
|
228
|
+
```js
|
|
229
|
+
import { downloadChart, exportImage, exportSVG } from '@tabler/charts'
|
|
230
|
+
|
|
231
|
+
const svg = exportSVG(chart) // standalone SVG string
|
|
232
|
+
const png = await exportImage(chart, { scale: 3 }) // Blob; also image/jpeg, image/webp
|
|
233
|
+
await downloadChart(chart, { format: 'svg' }) // saves "<title>.svg"
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
The export copies the computed styles into the SVG, so CSS theming comes along. It also draws the legend in, leaves hover marks out and paints the surface color behind the chart (`background: false` for none).
|
|
237
|
+
|
|
238
|
+
Or let the chart offer it: `download: true` puts a small menu button in the chart's corner (`.tc-download`) with PNG and SVG. A list picks the formats, an object also sets the file name and the export options:
|
|
239
|
+
|
|
240
|
+
```js
|
|
241
|
+
new Chart('#sales', { type: line, data, download: true })
|
|
242
|
+
new Chart('#sales', { type: line, data, download: ['png', 'svg', 'jpeg', 'webp'] })
|
|
243
|
+
new Chart('#sales', { type: line, data, download: { formats: ['svg'], filename: 'sales', background: false, scale: 3 } })
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
The menu is a `download()` plugin (in the default `Chart`; install it yourself on the core). The saving comes from `import '@tabler/charts/export'`, so charts without a download menu never carry the export code; the chart tells you when the import is missing.
|
|
247
|
+
|
|
248
|
+
## Accessibility
|
|
249
|
+
|
|
250
|
+
- **Name and description:** every chart is a `role="img"` with an accessible name and, with `description`, a description.
|
|
251
|
+
- **Data table:** a data table is there for screen readers; it is visually hidden unless `table: 'visible'`.
|
|
252
|
+
- **Keyboard:** Left and Right walk the categories, Up and Down the series, Home and End jump to the ends, and Escape clears the highlight. The tooltip follows.
|
|
253
|
+
- **Palette:** the default palette is checked for colorblind separation, and the legend gives every series a name, never color alone.
|
|
254
|
+
- **Point shapes:** with `shapes: true` (and with `patterns: true`), the points of line, radar and scatter charts and the active points of the hover take a shape per series (circle, square, triangle, diamond, triangle down, plus, cross, star), and so do the legend and tooltip swatches. On the core, `import '@tabler/charts/point-shapes'` enables them.
|
|
255
|
+
- **Patterns:** with `patterns: true`, bars, areas, slices, rings and bubbles wear a pattern of their color slot (diagonal lines, dots, hatching, grid…) and lines a dash, so series do not depend on color at all (color vision deficiency, grayscale print). The legend and tooltip swatches match, and exports keep them. By default (`'auto'`) they appear only in forced colors (Windows High Contrast), where the colors are gone. `--tc-pattern-color` sets the color of the lines and dots (the surface by default). On the core, `import '@tabler/charts/patterns'` enables them.
|
|
256
|
+
|
|
257
|
+
## License
|
|
258
|
+
|
|
259
|
+
MIT
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { n as BandScale, t as BandKey } from "./band-DTcNDAFO.js";
|
|
2
|
+
import { a as ClassValue, l as VNode } from "./vnode-BUflsBsa.js";
|
|
3
|
+
//#region src/layout.d.ts
|
|
4
|
+
/** Axis-aligned rectangle in pixels. */
|
|
5
|
+
interface Rect {
|
|
6
|
+
x: number;
|
|
7
|
+
y: number;
|
|
8
|
+
width: number;
|
|
9
|
+
height: number;
|
|
10
|
+
}
|
|
11
|
+
/** Space around a box, in pixels. */
|
|
12
|
+
interface Insets {
|
|
13
|
+
top: number;
|
|
14
|
+
right: number;
|
|
15
|
+
bottom: number;
|
|
16
|
+
left: number;
|
|
17
|
+
}
|
|
18
|
+
/** Insets given as one number for all sides or per side. */
|
|
19
|
+
type InsetsInput = number | Partial<Insets>;
|
|
20
|
+
/** Normalize an {@link InsetsInput}; missing sides fall back to `fallback`. */
|
|
21
|
+
declare function insets(value: InsetsInput | undefined, fallback?: number): Insets;
|
|
22
|
+
/** Rectangle left inside `width × height` after `margins`; never negative. */
|
|
23
|
+
declare function innerRect(width: number, height: number, margins: Insets): Rect;
|
|
24
|
+
/**
|
|
25
|
+
* Estimate the rendered width of `text` without a DOM, for layout on the
|
|
26
|
+
* server and in workers. Tuned for common UI sans-serif fonts; deterministic,
|
|
27
|
+
* so SSR and client layouts agree.
|
|
28
|
+
*/
|
|
29
|
+
declare function estimateTextWidth(text: string, fontSize: number): number;
|
|
30
|
+
/** Line height used for single-line labels, relative to the font size. */
|
|
31
|
+
declare const LINE_HEIGHT = 1.25;
|
|
32
|
+
//#endregion
|
|
33
|
+
//#region src/charts/annotations.d.ts
|
|
34
|
+
/** A category label, a number, or a date (on a time axis). */
|
|
35
|
+
type AnnotationLabel = string | number | Date;
|
|
36
|
+
/**
|
|
37
|
+
* A reference line or band drawn with the series: a target on the value
|
|
38
|
+
* axis (`y: 99.9`), a normal range (`y: [40, 60]`), an event on the category
|
|
39
|
+
* axis (`x: 'Jun'`, or a date on a time axis) or a period (`x: [from, to]`).
|
|
40
|
+
*/
|
|
41
|
+
interface Annotation {
|
|
42
|
+
/** A line at a value, or a band between two values, on the value axis. */
|
|
43
|
+
y?: number | readonly [number, number];
|
|
44
|
+
/** A line at a category (or a date on a time axis), or a band between two, on the category axis. */
|
|
45
|
+
x?: AnnotationLabel | readonly [AnnotationLabel, AnnotationLabel];
|
|
46
|
+
/** Short text next to the line or inside the band. */
|
|
47
|
+
label?: string;
|
|
48
|
+
/** Where the label sits along the line or band. Defaults to `'end'` (right, or top). */
|
|
49
|
+
position?: "start" | "end";
|
|
50
|
+
/**
|
|
51
|
+
* Any CSS color; sets `--tc-annotation-color`.
|
|
52
|
+
* Values that could inject CSS (`;`, quotes, `url()` …) are ignored, so colors from user data are safe.
|
|
53
|
+
*/
|
|
54
|
+
color?: string;
|
|
55
|
+
/** Extra classes on the annotation group. */
|
|
56
|
+
class?: ClassValue;
|
|
57
|
+
/** Stable identity for keyed updates. Defaults to the position in the list. */
|
|
58
|
+
id?: string;
|
|
59
|
+
}
|
|
60
|
+
/** How the layout maps data to pixels for annotations. */
|
|
61
|
+
interface AnnotationScales {
|
|
62
|
+
area: Rect;
|
|
63
|
+
/** Whether categories run along y (horizontal bars). */
|
|
64
|
+
horizontal: boolean;
|
|
65
|
+
fontSize: number;
|
|
66
|
+
/** Pixel position of a value along the value axis. */
|
|
67
|
+
value: (v: number) => number;
|
|
68
|
+
/** The category scale, and the keys of its categories in order. */
|
|
69
|
+
band: BandScale;
|
|
70
|
+
keys: readonly BandKey[];
|
|
71
|
+
/** Pixel position of a date, when the category axis is a time axis. */
|
|
72
|
+
time?: ((date: Date) => number) | undefined;
|
|
73
|
+
}
|
|
74
|
+
/** Values the value axis should include so every annotation shows. */
|
|
75
|
+
declare function annotationValues(annotations: readonly Annotation[] | undefined): number[];
|
|
76
|
+
/**
|
|
77
|
+
* Annotation layers: bands go below the series, lines and labels above
|
|
78
|
+
* them. Annotations outside the plot area are skipped.
|
|
79
|
+
*/
|
|
80
|
+
declare function annotationLayers(annotations: readonly Annotation[] | undefined, scales: AnnotationScales): {
|
|
81
|
+
under: VNode | null;
|
|
82
|
+
over: VNode | null;
|
|
83
|
+
};
|
|
84
|
+
//#endregion
|
|
85
|
+
export { InsetsInput as a, estimateTextWidth as c, Insets as i, innerRect as l, annotationLayers as n, LINE_HEIGHT as o, annotationValues as r, Rect as s, Annotation as t, insets as u };
|
|
86
|
+
//# sourceMappingURL=annotations-Bp7HwtF5.d.ts.map
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
import { a as round, n as estimateTextWidth } from "./layout-B3hiqVEw.js";
|
|
2
|
+
import { t as h } from "./vnode-tCWItoUH.js";
|
|
3
|
+
import { g as toMs, o as labelKey } from "./cartesian-Cr0AF0nG.js";
|
|
4
|
+
import { i as finite, l as records, o as label, u as text } from "./clean-o1vDEhFV.js";
|
|
5
|
+
//#region src/charts/annotations.ts
|
|
6
|
+
/** Pixel span of a category (or a date on a time axis), or `undefined` if it is not on the axis. */
|
|
7
|
+
function categorySpan(scales, label) {
|
|
8
|
+
if (scales.time) {
|
|
9
|
+
const p = scales.time(new Date(toMs(label)));
|
|
10
|
+
return Number.isFinite(p) ? [p, p] : void 0;
|
|
11
|
+
}
|
|
12
|
+
const i = scales.keys.indexOf(labelKey(label));
|
|
13
|
+
return i < 0 ? void 0 : [scales.band.at(i), scales.band.at(i) + scales.band.bandwidth];
|
|
14
|
+
}
|
|
15
|
+
/** A value or a [from, to] pair, cleaned by `f`; `null` when anything is off. */
|
|
16
|
+
const span = (v, f) => {
|
|
17
|
+
if (!Array.isArray(v)) return f(v);
|
|
18
|
+
const pair = v.map(f);
|
|
19
|
+
return pair.length === 2 && !pair.includes(null) ? pair : null;
|
|
20
|
+
};
|
|
21
|
+
/** Annotations from outside: lines or bands at finite values or labels, with text labels. */
|
|
22
|
+
const cleanAnnotations = (v) => v === void 0 ? v : records(v, (a) => ({
|
|
23
|
+
...a,
|
|
24
|
+
y: a.y === void 0 ? a.y : span(a.y, finite),
|
|
25
|
+
x: a.x === void 0 ? a.x : span(a.x, label),
|
|
26
|
+
label: a.label == null ? void 0 : text(a.label),
|
|
27
|
+
color: typeof a.color === "string" ? a.color : void 0
|
|
28
|
+
})).filter((a) => a.y !== null && a.x !== null && (a.x ?? a.y) !== void 0);
|
|
29
|
+
const isPair = (v) => Array.isArray(v);
|
|
30
|
+
/** Values the value axis should include so every annotation shows. */
|
|
31
|
+
function annotationValues(annotations) {
|
|
32
|
+
const out = [];
|
|
33
|
+
for (const a of cleanAnnotations(annotations) ?? []) {
|
|
34
|
+
if (a.y === void 0) continue;
|
|
35
|
+
for (const v of isPair(a.y) ? a.y : [a.y]) if (Number.isFinite(v)) out.push(v);
|
|
36
|
+
}
|
|
37
|
+
return out;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Annotation layers: bands go below the series, lines and labels above
|
|
41
|
+
* them. Annotations outside the plot area are skipped.
|
|
42
|
+
*/
|
|
43
|
+
function annotationLayers(annotations, scales) {
|
|
44
|
+
annotations = cleanAnnotations(annotations);
|
|
45
|
+
if (!annotations?.length) return {
|
|
46
|
+
under: null,
|
|
47
|
+
over: null
|
|
48
|
+
};
|
|
49
|
+
const { area, horizontal, fontSize } = scales;
|
|
50
|
+
const bands = [];
|
|
51
|
+
const lines = [];
|
|
52
|
+
const x0 = area.x;
|
|
53
|
+
const x1 = area.x + area.width;
|
|
54
|
+
const y0 = area.y;
|
|
55
|
+
const y1 = area.y + area.height;
|
|
56
|
+
const inside = (p, lo, hi) => p >= lo - .5 && p <= hi + .5;
|
|
57
|
+
const pad = 4;
|
|
58
|
+
/**
|
|
59
|
+
* Where an annotation lands: the pixel span it covers within the plot, and
|
|
60
|
+
* whether it runs across x (a vertical line); `undefined` when it is off
|
|
61
|
+
* the plot or names nothing on the axes.
|
|
62
|
+
*/
|
|
63
|
+
const geometry = (a) => {
|
|
64
|
+
let span;
|
|
65
|
+
let vertical;
|
|
66
|
+
if (a.y !== void 0) {
|
|
67
|
+
const [from, to] = isPair(a.y) ? a.y : [a.y, a.y];
|
|
68
|
+
if (!Number.isFinite(from) || !Number.isFinite(to)) return void 0;
|
|
69
|
+
span = [scales.value(from), scales.value(to)];
|
|
70
|
+
vertical = horizontal;
|
|
71
|
+
} else if (a.x !== void 0) {
|
|
72
|
+
const [from, to] = isPair(a.x) ? a.x : [a.x, a.x];
|
|
73
|
+
const start = categorySpan(scales, from);
|
|
74
|
+
const stop = categorySpan(scales, to);
|
|
75
|
+
if (!start || !stop) return void 0;
|
|
76
|
+
span = isPair(a.x) ? [Math.min(start[0], stop[0]), Math.max(start[1], stop[1])] : [(start[0] + start[1]) / 2, (start[0] + start[1]) / 2];
|
|
77
|
+
vertical = !horizontal;
|
|
78
|
+
} else return;
|
|
79
|
+
const lo = Math.min(span[0], span[1]);
|
|
80
|
+
const hi = Math.max(span[0], span[1]);
|
|
81
|
+
const [min, max] = vertical ? [x0, x1] : [y0, y1];
|
|
82
|
+
if (!inside(lo, min, max) && !inside(hi, min, max) && !(lo < min && hi > max)) return void 0;
|
|
83
|
+
return {
|
|
84
|
+
a0: Math.max(lo, min),
|
|
85
|
+
a1: Math.min(hi, max),
|
|
86
|
+
vertical
|
|
87
|
+
};
|
|
88
|
+
};
|
|
89
|
+
const shapes = annotations.map(geometry);
|
|
90
|
+
/** Boxes labels keep clear of: the labels placed so far, and every line. */
|
|
91
|
+
const placed = [];
|
|
92
|
+
const obstacles = [];
|
|
93
|
+
shapes.forEach((g, i) => {
|
|
94
|
+
if (!g || g.a1 - g.a0 > .5) return;
|
|
95
|
+
const at = g.a0;
|
|
96
|
+
obstacles.push([i, g.vertical ? [
|
|
97
|
+
at - 1.5,
|
|
98
|
+
y0,
|
|
99
|
+
at + 1.5,
|
|
100
|
+
y1
|
|
101
|
+
] : [
|
|
102
|
+
x0,
|
|
103
|
+
at - 1.5,
|
|
104
|
+
x1,
|
|
105
|
+
at + 1.5
|
|
106
|
+
]]);
|
|
107
|
+
});
|
|
108
|
+
const apart = (box, [l, t, r, b]) => box[2] <= l || box[0] >= r || box[3] <= t || box[1] >= b;
|
|
109
|
+
const clearOfLabels = (box) => placed.every((p) => apart(box, p));
|
|
110
|
+
const clear = (box, own) => clearOfLabels(box) && obstacles.every(([i, l]) => i === own || apart(box, l));
|
|
111
|
+
annotations.forEach((a, index) => {
|
|
112
|
+
const key = a.id ?? index;
|
|
113
|
+
const attrs = (part) => ({
|
|
114
|
+
key: part ? `${key}-${part}` : key,
|
|
115
|
+
class: [
|
|
116
|
+
"tc-annotation",
|
|
117
|
+
a.y !== void 0 ? "tc-annotation-y" : "tc-annotation-x",
|
|
118
|
+
a.class
|
|
119
|
+
],
|
|
120
|
+
style: { "--tc-annotation-color": a.color }
|
|
121
|
+
});
|
|
122
|
+
const end = a.position !== "start";
|
|
123
|
+
const shape = shapes[index];
|
|
124
|
+
if (!shape) return;
|
|
125
|
+
const { a0, a1, vertical } = shape;
|
|
126
|
+
let label;
|
|
127
|
+
if (a.label) {
|
|
128
|
+
const w = estimateTextWidth(a.label, fontSize * .92);
|
|
129
|
+
const line = a1 - a0 <= .5;
|
|
130
|
+
const spots = [];
|
|
131
|
+
if (vertical) {
|
|
132
|
+
const after = a0 + pad;
|
|
133
|
+
const before = line ? a0 - pad - w : Math.max(x0, a1 - pad - w);
|
|
134
|
+
const sides = after + w <= x1 ? [after, before] : [before, after];
|
|
135
|
+
const top = end ? y0 + fontSize : y1 - pad;
|
|
136
|
+
const step = (end ? 1 : -1) * fontSize * 1.2;
|
|
137
|
+
for (const x of sides) {
|
|
138
|
+
if (x < x0 || x + w > x1) continue;
|
|
139
|
+
for (let k = 0; k < 3; k++) spots.push([x, top + k * step]);
|
|
140
|
+
}
|
|
141
|
+
if (!spots.length) spots.push([Math.max(x0 + pad, sides[0]), top]);
|
|
142
|
+
} else {
|
|
143
|
+
const near = end ? x1 - pad - w : x0 + pad;
|
|
144
|
+
const far = end ? x0 + pad : x1 - pad - w;
|
|
145
|
+
for (const x of [near, far]) if (line) spots.push([x, a0 - pad], [x, a0 + fontSize]);
|
|
146
|
+
else spots.push([x, a0 + fontSize], [x, a1 - pad]);
|
|
147
|
+
}
|
|
148
|
+
const box = ([x, y]) => [
|
|
149
|
+
x,
|
|
150
|
+
y - fontSize,
|
|
151
|
+
x + w,
|
|
152
|
+
y + fontSize * .25
|
|
153
|
+
];
|
|
154
|
+
const spot = spots.find((s) => clear(box(s), index)) ?? spots.find((s) => clearOfLabels(box(s))) ?? spots[0];
|
|
155
|
+
placed.push(box(spot));
|
|
156
|
+
label = h("text", {
|
|
157
|
+
class: "tc-annotation-label",
|
|
158
|
+
x: round(spot[0]),
|
|
159
|
+
y: round(spot[1])
|
|
160
|
+
}, a.label);
|
|
161
|
+
}
|
|
162
|
+
if (a1 - a0 > .5) {
|
|
163
|
+
const d = vertical ? `M${round(a0)},${round(y0)}H${round(a1)}V${round(y1)}H${round(a0)}Z` : `M${round(x0)},${round(a0)}H${round(x1)}V${round(a1)}H${round(x0)}Z`;
|
|
164
|
+
bands.push(h("g", attrs(), h("path", {
|
|
165
|
+
class: "tc-annotation-band",
|
|
166
|
+
d
|
|
167
|
+
})));
|
|
168
|
+
if (label) lines.push(h("g", attrs("label"), label));
|
|
169
|
+
return;
|
|
170
|
+
}
|
|
171
|
+
const at = round(a0);
|
|
172
|
+
lines.push(h("g", attrs(), h("line", vertical ? {
|
|
173
|
+
class: "tc-annotation-line",
|
|
174
|
+
x1: at,
|
|
175
|
+
x2: at,
|
|
176
|
+
y1: round(y0),
|
|
177
|
+
y2: round(y1)
|
|
178
|
+
} : {
|
|
179
|
+
class: "tc-annotation-line",
|
|
180
|
+
x1: round(x0),
|
|
181
|
+
x2: round(x1),
|
|
182
|
+
y1: at,
|
|
183
|
+
y2: at
|
|
184
|
+
}), label));
|
|
185
|
+
});
|
|
186
|
+
return {
|
|
187
|
+
under: bands.length ? h("g", {
|
|
188
|
+
key: "annotations-under",
|
|
189
|
+
class: "tc-annotations",
|
|
190
|
+
"aria-hidden": "true"
|
|
191
|
+
}, bands) : null,
|
|
192
|
+
over: lines.length ? h("g", {
|
|
193
|
+
key: "annotations-over",
|
|
194
|
+
class: "tc-annotations",
|
|
195
|
+
"aria-hidden": "true"
|
|
196
|
+
}, lines) : null
|
|
197
|
+
};
|
|
198
|
+
}
|
|
199
|
+
//#endregion
|
|
200
|
+
export { annotationValues as n, annotationLayers as t };
|
|
201
|
+
|
|
202
|
+
//# sourceMappingURL=annotations-BszTTjf9.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"annotations-BszTTjf9.js","names":[],"sources":["../src/charts/annotations.ts"],"sourcesContent":["import { estimateTextWidth, type Rect, round } from '../layout.ts'\nimport type { BandKey, BandScale } from '../scales/band.ts'\nimport { type ClassValue, h, type VNode } from '../vnode.ts'\nimport { labelKey, toMs } from './cartesian.ts'\nimport { finite, label, records, text } from './clean.ts'\n\n/** A category label, a number, or a date (on a time axis). */\ntype AnnotationLabel = string | number | Date\n\n/**\n * A reference line or band drawn with the series: a target on the value\n * axis (`y: 99.9`), a normal range (`y: [40, 60]`), an event on the category\n * axis (`x: 'Jun'`, or a date on a time axis) or a period (`x: [from, to]`).\n */\nexport interface Annotation {\n /** A line at a value, or a band between two values, on the value axis. */\n y?: number | readonly [number, number]\n /** A line at a category (or a date on a time axis), or a band between two, on the category axis. */\n x?: AnnotationLabel | readonly [AnnotationLabel, AnnotationLabel]\n /** Short text next to the line or inside the band. */\n label?: string\n /** Where the label sits along the line or band. Defaults to `'end'` (right, or top). */\n position?: 'start' | 'end'\n /**\n * Any CSS color; sets `--tc-annotation-color`.\n * Values that could inject CSS (`;`, quotes, `url()` …) are ignored, so colors from user data are safe.\n */\n color?: string\n /** Extra classes on the annotation group. */\n class?: ClassValue\n /** Stable identity for keyed updates. Defaults to the position in the list. */\n id?: string\n}\n\n/** How the layout maps data to pixels for annotations. */\nexport interface AnnotationScales {\n area: Rect\n /** Whether categories run along y (horizontal bars). */\n horizontal: boolean\n fontSize: number\n /** Pixel position of a value along the value axis. */\n value: (v: number) => number\n /** The category scale, and the keys of its categories in order. */\n band: BandScale\n keys: readonly BandKey[]\n /** Pixel position of a date, when the category axis is a time axis. */\n time?: ((date: Date) => number) | undefined\n}\n\n/** Pixel span of a category (or a date on a time axis), or `undefined` if it is not on the axis. */\nfunction categorySpan(\n scales: AnnotationScales,\n label: AnnotationLabel,\n): readonly [number, number] | undefined {\n if (scales.time) {\n const p = scales.time(new Date(toMs(label)))\n return Number.isFinite(p) ? [p, p] : undefined\n }\n const i = scales.keys.indexOf(labelKey(label))\n return i < 0 ? undefined : [scales.band.at(i), scales.band.at(i) + scales.band.bandwidth]\n}\n\n/** A value or a [from, to] pair, cleaned by `f`; `null` when anything is off. */\nconst span = <T>(v: unknown, f: (x: unknown) => T | null): T | readonly T[] | null => {\n if (!Array.isArray(v)) return f(v)\n const pair = v.map(f)\n return pair.length === 2 && !pair.includes(null) ? (pair as T[]) : null\n}\n\n/** Annotations from outside: lines or bands at finite values or labels, with text labels. */\nexport const cleanAnnotations = (v: unknown): Annotation[] | undefined =>\n v === undefined\n ? v\n : (records(v, (a) => ({\n ...a,\n y: a.y === undefined ? a.y : span(a.y, finite),\n x: a.x === undefined ? a.x : span(a.x, label),\n label: a.label == null ? undefined : text(a.label),\n color: typeof a.color === 'string' ? a.color : undefined,\n })).filter((a) => a.y !== null && a.x !== null && (a.x ?? a.y) !== undefined) as Annotation[])\n\nconst isPair = <T>(v: T | readonly [T, T]): v is readonly [T, T] => Array.isArray(v)\n\n/** Values the value axis should include so every annotation shows. */\nexport function annotationValues(annotations: readonly Annotation[] | undefined): number[] {\n const out: number[] = []\n for (const a of cleanAnnotations(annotations) ?? []) {\n if (a.y === undefined) continue\n for (const v of isPair(a.y) ? a.y : [a.y]) if (Number.isFinite(v)) out.push(v)\n }\n return out\n}\n\n/**\n * Annotation layers: bands go below the series, lines and labels above\n * them. Annotations outside the plot area are skipped.\n */\nexport function annotationLayers(\n annotations: readonly Annotation[] | undefined,\n scales: AnnotationScales,\n): { under: VNode | null; over: VNode | null } {\n // Annotations may come from outside (thresholds from an API).\n annotations = cleanAnnotations(annotations)\n if (!annotations?.length) return { under: null, over: null }\n const { area, horizontal, fontSize } = scales\n const bands: VNode[] = []\n const lines: VNode[] = []\n // Plot edges: \"across\" is the axis the annotation spans, \"along\" the one it marks.\n const x0 = area.x\n const x1 = area.x + area.width\n const y0 = area.y\n const y1 = area.y + area.height\n const inside = (p: number, lo: number, hi: number) => p >= lo - 0.5 && p <= hi + 0.5\n const pad = 4\n /**\n * Where an annotation lands: the pixel span it covers within the plot, and\n * whether it runs across x (a vertical line); `undefined` when it is off\n * the plot or names nothing on the axes.\n */\n const geometry = (a: Annotation): { a0: number; a1: number; vertical: boolean } | undefined => {\n let span: readonly [number, number]\n let vertical: boolean\n if (a.y !== undefined) {\n const [from, to] = isPair(a.y) ? a.y : [a.y, a.y]\n if (!Number.isFinite(from) || !Number.isFinite(to)) return undefined\n span = [scales.value(from), scales.value(to)]\n vertical = horizontal\n } else if (a.x !== undefined) {\n const [from, to] = isPair(a.x) ? a.x : [a.x, a.x]\n const start = categorySpan(scales, from)\n const stop = categorySpan(scales, to)\n if (!start || !stop) return undefined\n // A single category: its center; a range: from the start of one to the end of the other.\n span = isPair(a.x)\n ? [Math.min(start[0], stop[0]), Math.max(start[1], stop[1])]\n : [(start[0] + start[1]) / 2, (start[0] + start[1]) / 2]\n vertical = !horizontal\n } else {\n return undefined\n }\n const lo = Math.min(span[0], span[1])\n const hi = Math.max(span[0], span[1])\n const [min, max] = vertical ? [x0, x1] : [y0, y1]\n if (!inside(lo, min, max) && !inside(hi, min, max) && !(lo < min && hi > max)) return undefined\n return { a0: Math.max(lo, min), a1: Math.min(hi, max), vertical }\n }\n const shapes = annotations.map(geometry)\n\n type Box = [number, number, number, number]\n /** Boxes labels keep clear of: the labels placed so far, and every line. */\n const placed: Box[] = []\n const obstacles: [number, Box][] = []\n shapes.forEach((g, i) => {\n if (!g || g.a1 - g.a0 > 0.5) return\n const at = g.a0\n obstacles.push([i, g.vertical ? [at - 1.5, y0, at + 1.5, y1] : [x0, at - 1.5, x1, at + 1.5]])\n })\n const apart = (box: Box, [l, t, r, b]: Box) =>\n box[2] <= l || box[0] >= r || box[3] <= t || box[1] >= b\n const clearOfLabels = (box: Box) => placed.every((p) => apart(box, p))\n const clear = (box: Box, own: number) =>\n clearOfLabels(box) && obstacles.every(([i, l]) => i === own || apart(box, l))\n\n annotations.forEach((a, index) => {\n const key = a.id ?? index\n // Groups are named by axis; the line, band and label inside by what they are.\n const attrs = (part?: string) => ({\n key: part ? `${key}-${part}` : key,\n class: ['tc-annotation', a.y !== undefined ? 'tc-annotation-y' : 'tc-annotation-x', a.class],\n style: { '--tc-annotation-color': a.color },\n })\n const end = a.position !== 'start'\n\n const shape = shapes[index]\n if (!shape) return\n const { a0, a1, vertical } = shape\n\n // Label: candidate spots in order of preference, inside the plot area; the\n // first that covers neither an earlier label nor another line wins (or the first one).\n let label: VNode | false | undefined\n if (a.label) {\n const w = estimateTextWidth(a.label, fontSize * 0.92)\n const line = a1 - a0 <= 0.5\n // [left edge, baseline] of each spot.\n const spots: [number, number][] = []\n if (vertical) {\n // Beside a line or at the start of a band; on the other side if it would\n // run out, and then on the other side anyway, stepping along the line.\n const after = a0 + pad\n const before = line ? a0 - pad - w : Math.max(x0, a1 - pad - w)\n const sides = after + w <= x1 ? [after, before] : [before, after]\n const top = end ? y0 + fontSize : y1 - pad\n const step = (end ? 1 : -1) * fontSize * 1.2\n for (const x of sides) {\n if (x < x0 || x + w > x1) continue\n for (let k = 0; k < 3; k++) spots.push([x, top + k * step])\n }\n if (!spots.length) spots.push([Math.max(x0 + pad, sides[0] as number), top])\n } else {\n // At the preferred end above or below, then at the other end.\n const near = end ? x1 - pad - w : x0 + pad\n const far = end ? x0 + pad : x1 - pad - w\n for (const x of [near, far]) {\n if (line) spots.push([x, a0 - pad], [x, a0 + fontSize])\n else spots.push([x, a0 + fontSize], [x, a1 - pad])\n }\n }\n const box = ([x, y]: [number, number]): Box => [x, y - fontSize, x + w, y + fontSize * 0.25]\n // Nothing free: at least keep off the other labels; a line through text reads better than text on text.\n const spot =\n spots.find((s) => clear(box(s), index)) ??\n spots.find((s) => clearOfLabels(box(s))) ??\n (spots[0] as [number, number])\n placed.push(box(spot))\n label = h(\n 'text',\n { class: 'tc-annotation-label', x: round(spot[0]), y: round(spot[1]) },\n a.label,\n )\n }\n\n if (a1 - a0 > 0.5) {\n // A band below the series; its label goes with the lines, above them.\n const d = vertical\n ? `M${round(a0)},${round(y0)}H${round(a1)}V${round(y1)}H${round(a0)}Z`\n : `M${round(x0)},${round(a0)}H${round(x1)}V${round(a1)}H${round(x0)}Z`\n bands.push(h('g', attrs(), h('path', { class: 'tc-annotation-band', d })))\n if (label) lines.push(h('g', attrs('label'), label))\n return\n }\n // A line across the plot area.\n const at = round(a0)\n lines.push(\n h(\n 'g',\n attrs(),\n h(\n 'line',\n vertical\n ? { class: 'tc-annotation-line', x1: at, x2: at, y1: round(y0), y2: round(y1) }\n : { class: 'tc-annotation-line', x1: round(x0), x2: round(x1), y1: at, y2: at },\n ),\n label,\n ),\n )\n })\n\n return {\n under: bands.length\n ? h('g', { key: 'annotations-under', class: 'tc-annotations', 'aria-hidden': 'true' }, bands)\n : null,\n over: lines.length\n ? h('g', { key: 'annotations-over', class: 'tc-annotations', 'aria-hidden': 'true' }, lines)\n : null,\n }\n}\n"],"mappings":";;;;;;AAkDA,SAAS,aACP,QACA,OACuC;CACvC,IAAI,OAAO,MAAM;EACf,MAAM,IAAI,OAAO,KAAK,IAAI,KAAK,KAAK,KAAK,CAAC,CAAC;EAC3C,OAAO,OAAO,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,KAAA;CACvC;CACA,MAAM,IAAI,OAAO,KAAK,QAAQ,SAAS,KAAK,CAAC;CAC7C,OAAO,IAAI,IAAI,KAAA,IAAY,CAAC,OAAO,KAAK,GAAG,CAAC,GAAG,OAAO,KAAK,GAAG,CAAC,IAAI,OAAO,KAAK,SAAS;AAC1F;;AAGA,MAAM,QAAW,GAAY,MAAyD;CACpF,IAAI,CAAC,MAAM,QAAQ,CAAC,GAAG,OAAO,EAAE,CAAC;CACjC,MAAM,OAAO,EAAE,IAAI,CAAC;CACpB,OAAO,KAAK,WAAW,KAAK,CAAC,KAAK,SAAS,IAAI,IAAK,OAAe;AACrE;;AAGA,MAAa,oBAAoB,MAC/B,MAAM,KAAA,IACF,IACC,QAAQ,IAAI,OAAO;CAClB,GAAG;CACH,GAAG,EAAE,MAAM,KAAA,IAAY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