@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
|
@@ -0,0 +1,933 @@
|
|
|
1
|
+
import { a as InsetsInput, n as annotationLayers, r as annotationValues, s as Rect, t as Annotation } from "./annotations-lyt0I3HU.cjs";
|
|
2
|
+
import { n as BandScale, t as BandKey } from "./band-DTcNDAFO.cjs";
|
|
3
|
+
import { a as ClassValue, i as ChildInput, l as VNode, n as Attrs, s as Props } from "./vnode-BUflsBsa.cjs";
|
|
4
|
+
import { a as timePointScale, c as NumberFormat, i as time, s as Locale } from "./time-CNVnt-B2.cjs";
|
|
5
|
+
import { n as log, r as LinearScale } from "./log-CaofN3-n.cjs";
|
|
6
|
+
import { t as hydrate } from "./hydrate-CTTmQy0x.cjs";
|
|
7
|
+
import { t as morph } from "./morph-BMxz3X2b.cjs";
|
|
8
|
+
import { a as linePath, i as areaPath, r as Point } from "./path-CwB28da0.cjs";
|
|
9
|
+
//#region src/interaction.d.ts
|
|
10
|
+
/** One series' value at a hovered position. */
|
|
11
|
+
interface HitItem {
|
|
12
|
+
/** Series name. */
|
|
13
|
+
name: string;
|
|
14
|
+
/** Position of the series in `data.series`. */
|
|
15
|
+
seriesIndex: number;
|
|
16
|
+
/** Custom series color, if one was set. */
|
|
17
|
+
color?: string;
|
|
18
|
+
value: number | null;
|
|
19
|
+
/** Value formatted for display (tooltips). */
|
|
20
|
+
text: string;
|
|
21
|
+
/** Anchor of the value in chart pixels (point, bar end); `y` is `null` for gaps. */
|
|
22
|
+
x: number;
|
|
23
|
+
y: number | null;
|
|
24
|
+
/** The mark's rectangle (bar, segment, cell), for value labels inside it. */
|
|
25
|
+
box?: Rect;
|
|
26
|
+
}
|
|
27
|
+
/** What lies under the pointer. */
|
|
28
|
+
interface Hit {
|
|
29
|
+
/** Category index. */
|
|
30
|
+
index: number;
|
|
31
|
+
/** Category label. */
|
|
32
|
+
label: string | number;
|
|
33
|
+
/** Label formatted for display (tooltips). */
|
|
34
|
+
title: string;
|
|
35
|
+
/** Anchor x of the category in chart pixels (for crosshairs and tooltips); the plot center for horizontal bars. */
|
|
36
|
+
x: number;
|
|
37
|
+
/** Plot area, in chart pixels. */
|
|
38
|
+
area: Rect;
|
|
39
|
+
/** Axis the categories run along; `'y'` for horizontal bars. Defaults to `'x'`. */
|
|
40
|
+
axis?: "x" | "y";
|
|
41
|
+
/** Center of the category along y, when categories run along y. */
|
|
42
|
+
y?: number;
|
|
43
|
+
/** The category's band in chart pixels, for band scales (bars). */
|
|
44
|
+
band?: {
|
|
45
|
+
x: number;
|
|
46
|
+
y: number;
|
|
47
|
+
width: number;
|
|
48
|
+
height: number;
|
|
49
|
+
};
|
|
50
|
+
/** Every series' value at this category. */
|
|
51
|
+
items: HitItem[];
|
|
52
|
+
/** Series of the mark directly under the pointer (e.g. a bar), if any. */
|
|
53
|
+
seriesIndex?: number;
|
|
54
|
+
/**
|
|
55
|
+
* The crosshair segment, when it is not vertical across the plot (a radar
|
|
56
|
+
* spoke). Tooltips from the keyboard then anchor on the value itself.
|
|
57
|
+
*/
|
|
58
|
+
guide?: {
|
|
59
|
+
x1: number;
|
|
60
|
+
y1: number;
|
|
61
|
+
x2: number;
|
|
62
|
+
y2: number;
|
|
63
|
+
};
|
|
64
|
+
/**
|
|
65
|
+
* A shape to highlight instead of a crosshair or band (e.g. a halo around a
|
|
66
|
+
* pie slice): path data `d`, drawn translated by `x` / `y`.
|
|
67
|
+
*/
|
|
68
|
+
mark?: {
|
|
69
|
+
d: string;
|
|
70
|
+
x: number;
|
|
71
|
+
y: number;
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
/** Maps a point in chart pixels to what lies there. */
|
|
75
|
+
type HitTester = (x: number, y: number) => Hit | null;
|
|
76
|
+
/** How a rendered chart answers pointer and keyboard interaction. */
|
|
77
|
+
interface Interaction {
|
|
78
|
+
/** What lies at a point in chart pixels. */
|
|
79
|
+
hitTest: HitTester;
|
|
80
|
+
/** The hit for a category by index (keyboard navigation), optionally focused on a series. */
|
|
81
|
+
hitIndex(index: number, seriesIndex?: number): Hit | null;
|
|
82
|
+
/** Number of categories. */
|
|
83
|
+
count: number;
|
|
84
|
+
}
|
|
85
|
+
//#endregion
|
|
86
|
+
//#region src/a11y.d.ts
|
|
87
|
+
/** The data behind a chart as text: header cells and one row per category. */
|
|
88
|
+
interface DataTable {
|
|
89
|
+
/** Column headers; the first one labels the row headers (may be empty). */
|
|
90
|
+
columns: string[];
|
|
91
|
+
/** Rows of display text; the first cell of each row is its header. */
|
|
92
|
+
rows: string[][];
|
|
93
|
+
/** Total number of rows when `rows` was cut to a limit. */
|
|
94
|
+
total?: number;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* An HTML table of the chart data, for screen readers (visually hidden by
|
|
98
|
+
* default) or as a visible fallback. Every cell is text, escaped by the renderer.
|
|
99
|
+
*/
|
|
100
|
+
declare function tableContent(table: DataTable, caption?: string): VNode;
|
|
101
|
+
/** Short sentence describing a hit, announced during keyboard navigation. */
|
|
102
|
+
declare function describeHit(hit: Hit): string;
|
|
103
|
+
//#endregion
|
|
104
|
+
//#region src/components/axis.d.ts
|
|
105
|
+
type AxisPosition = "top" | "right" | "bottom" | "left";
|
|
106
|
+
/** A single axis tick: its data value, pixel position along the axis and label. */
|
|
107
|
+
interface Tick {
|
|
108
|
+
value: number | BandKey;
|
|
109
|
+
position: number;
|
|
110
|
+
label: string;
|
|
111
|
+
}
|
|
112
|
+
interface LinearTicksOptions {
|
|
113
|
+
/** Approximate number of ticks. Defaults to `5`. */
|
|
114
|
+
count?: number;
|
|
115
|
+
format?: NumberFormat;
|
|
116
|
+
locale?: Locale;
|
|
117
|
+
}
|
|
118
|
+
/** Ticks for a linear scale, labelled with a shared precision. */
|
|
119
|
+
declare function linearTicks(scale: LinearScale, options?: LinearTicksOptions): Tick[];
|
|
120
|
+
/** Ticks at the center of every band. */
|
|
121
|
+
declare function bandTicks(scale: BandScale, format?: (key: BandKey, index: number) => string): Tick[];
|
|
122
|
+
/**
|
|
123
|
+
* Keep every n-th tick (smallest n) so labels do not overlap along the axis.
|
|
124
|
+
* The first and the last tick are always kept: when the last one does not
|
|
125
|
+
* land on the step, it replaces the last kept tick if they would collide.
|
|
126
|
+
*/
|
|
127
|
+
declare function thinTicks(ticks: readonly Tick[], position: AxisPosition, fontSize: number, gap?: number): Tick[];
|
|
128
|
+
interface AxisOptions {
|
|
129
|
+
position: AxisPosition;
|
|
130
|
+
ticks: readonly Tick[];
|
|
131
|
+
/** Plot area the axis is attached to. */
|
|
132
|
+
area: Rect;
|
|
133
|
+
/** Length of tick marks. Defaults to `0` (labels only). */
|
|
134
|
+
tickSize?: number;
|
|
135
|
+
/** Distance between tick marks and labels. Defaults to `8`. */
|
|
136
|
+
tickPadding?: number;
|
|
137
|
+
/** Draw the axis line along the plot edge. Defaults to `false`. */
|
|
138
|
+
line?: boolean;
|
|
139
|
+
}
|
|
140
|
+
/** Pixels an axis occupies perpendicular to the plot edge (for margins). */
|
|
141
|
+
declare function axisSize(position: AxisPosition, ticks: readonly Tick[], fontSize: number, options?: {
|
|
142
|
+
tickSize?: number;
|
|
143
|
+
tickPadding?: number;
|
|
144
|
+
}): number;
|
|
145
|
+
/**
|
|
146
|
+
* Render an axis as `<g class="tc-axis tc-axis-{x|y} tc-axis-{position}">`
|
|
147
|
+
* with one `<g class="tc-tick">` per tick, keyed by value so ticks can
|
|
148
|
+
* transition when the scale changes.
|
|
149
|
+
*/
|
|
150
|
+
declare function axis(options: AxisOptions): VNode;
|
|
151
|
+
//#endregion
|
|
152
|
+
//#region src/charts/cartesian.d.ts
|
|
153
|
+
/** Category label on the x axis. */
|
|
154
|
+
type Label = string | number | Date;
|
|
155
|
+
/** One data series. `null` values are gaps. */
|
|
156
|
+
interface Series {
|
|
157
|
+
/** Display name (legend, tooltip, accessibility). */
|
|
158
|
+
name: string;
|
|
159
|
+
/** One value per label; `null`/`undefined` leaves a gap. */
|
|
160
|
+
values: readonly (number | null | undefined)[];
|
|
161
|
+
/** Stable identity for keyed updates. Defaults to `name`. */
|
|
162
|
+
id?: string;
|
|
163
|
+
/**
|
|
164
|
+
* Custom color; overrides the palette slot via `--tc-series-color`.
|
|
165
|
+
* Values that could inject CSS (`;`, quotes, `url()` …) are ignored, so colors from user data are safe.
|
|
166
|
+
*/
|
|
167
|
+
color?: string;
|
|
168
|
+
/**
|
|
169
|
+
* Dashed line: dash and gap length in pixels, or a full `stroke-dasharray`
|
|
170
|
+
* such as `'6 3'`. Sets `--tc-series-dash` on the series group; values
|
|
171
|
+
* that could inject CSS are ignored, as for `color`.
|
|
172
|
+
*/
|
|
173
|
+
dash?: number | string;
|
|
174
|
+
/** Line width in pixels; overrides `--tc-stroke-width` via `--tc-series-width`. */
|
|
175
|
+
width?: number;
|
|
176
|
+
/**
|
|
177
|
+
* In a `bar` chart, draw this series as a line or a filled area over the
|
|
178
|
+
* bars instead (it is left out of stacks). Needs the line module
|
|
179
|
+
* (`@tabler/charts/line`, or `@tabler/charts`). Defaults to `'bar'`.
|
|
180
|
+
*/
|
|
181
|
+
type?: "bar" | "line" | "area";
|
|
182
|
+
/** Extra classes on the series group. */
|
|
183
|
+
class?: ClassValue;
|
|
184
|
+
/** Start hidden (toggle it back from the legend). */
|
|
185
|
+
hidden?: boolean;
|
|
186
|
+
}
|
|
187
|
+
interface CartesianData {
|
|
188
|
+
/** Categories along x. Defaults to `1…n` for the longest series. */
|
|
189
|
+
labels?: readonly Label[];
|
|
190
|
+
series: readonly Series[];
|
|
191
|
+
}
|
|
192
|
+
/** Options for the value (y) axis. */
|
|
193
|
+
interface ValueAxisOptions {
|
|
194
|
+
/** Render the axis labels. Defaults to `true`. */
|
|
195
|
+
show?: boolean;
|
|
196
|
+
/** Render horizontal grid lines. Defaults to `true`. */
|
|
197
|
+
grid?: boolean;
|
|
198
|
+
/** Fixed lower bound; overrides data and `zero`. */
|
|
199
|
+
min?: number;
|
|
200
|
+
/** Fixed upper bound. */
|
|
201
|
+
max?: number;
|
|
202
|
+
/** Include zero in the domain. */
|
|
203
|
+
zero?: boolean;
|
|
204
|
+
/** Extend the domain to round tick values. Defaults to `true`. */
|
|
205
|
+
nice?: boolean;
|
|
206
|
+
/** Approximate tick count. Defaults to one per ~60px of height. */
|
|
207
|
+
ticks?: number;
|
|
208
|
+
format?: NumberFormat;
|
|
209
|
+
/** `'log'` for a logarithmic axis (positive values only). Defaults to `'linear'`. */
|
|
210
|
+
scale?: "linear" | "log";
|
|
211
|
+
}
|
|
212
|
+
/** Options for the category (x) axis. */
|
|
213
|
+
interface CategoryAxisOptions {
|
|
214
|
+
/** Render the axis labels. Defaults to `true`. */
|
|
215
|
+
show?: boolean;
|
|
216
|
+
/** Render vertical grid lines. Defaults to `false`. */
|
|
217
|
+
grid?: boolean;
|
|
218
|
+
/** Draw the axis line along the bottom edge. Defaults to `false`. */
|
|
219
|
+
line?: boolean;
|
|
220
|
+
/** Format a label for display (axis ticks for categories, tooltips and the table). */
|
|
221
|
+
format?: (label: Label, index: number) => string;
|
|
222
|
+
/**
|
|
223
|
+
* `'time'` treats labels as dates or timestamps: line and area charts place
|
|
224
|
+
* points at their real distance in time, with calendar-aware ticks.
|
|
225
|
+
* Labels must be in ascending order. Needs `@tabler/charts/time` (included
|
|
226
|
+
* in `@tabler/charts`; candlesticks label dates without it). Defaults to `'category'`.
|
|
227
|
+
*/
|
|
228
|
+
type?: "category" | "time";
|
|
229
|
+
/** Align time ticks to UTC instead of local time (use it for SSR). */
|
|
230
|
+
utc?: boolean;
|
|
231
|
+
}
|
|
232
|
+
interface CartesianOptions {
|
|
233
|
+
data: CartesianData;
|
|
234
|
+
y?: ValueAxisOptions;
|
|
235
|
+
x?: CategoryAxisOptions;
|
|
236
|
+
/** Reference lines and bands: targets, normal ranges, events and periods. */
|
|
237
|
+
annotations?: readonly Annotation[];
|
|
238
|
+
/** Extra space around the plot area, in pixels. */
|
|
239
|
+
padding?: InsetsInput;
|
|
240
|
+
}
|
|
241
|
+
interface CartesianLayout {
|
|
242
|
+
area: Rect;
|
|
243
|
+
labels: readonly Label[];
|
|
244
|
+
/** Category scale (along x, or along y when `horizontal`). */
|
|
245
|
+
x: BandScale;
|
|
246
|
+
/** Value scale (along y, or along x when `horizontal`). */
|
|
247
|
+
y: LinearScale;
|
|
248
|
+
/** Whether categories run along y. */
|
|
249
|
+
horizontal: boolean;
|
|
250
|
+
xTicks: Tick[];
|
|
251
|
+
yTicks: Tick[];
|
|
252
|
+
/** Grid lines, drawn below the marks. */
|
|
253
|
+
background: VNode[];
|
|
254
|
+
/** Axes, drawn above the marks. */
|
|
255
|
+
foreground: VNode[];
|
|
256
|
+
/** Clip path definition and its url, for the marks group. */
|
|
257
|
+
clip: {
|
|
258
|
+
def: VNode;
|
|
259
|
+
url: string;
|
|
260
|
+
};
|
|
261
|
+
}
|
|
262
|
+
/** Stable key of a series: its `id`, or its name. */
|
|
263
|
+
declare const seriesKey: (series: Series) => string;
|
|
264
|
+
/** Legend entries for series-based charts. */
|
|
265
|
+
declare const seriesLegend: (data: CartesianData) => LegendItem[];
|
|
266
|
+
/** A niced numeric domain for `values`, honouring zero, min, max and nice. */
|
|
267
|
+
declare function domainOf(values: readonly (number | null | undefined)[], options: ValueAxisOptions, zeroDefault: boolean, count: number): [number, number];
|
|
268
|
+
/**
|
|
269
|
+
* The category axis of a cartesian layout: the labels at its edges (for the
|
|
270
|
+
* margins), its scale over a pixel range, and its ticks on that scale.
|
|
271
|
+
*/
|
|
272
|
+
interface CategoryAxis {
|
|
273
|
+
edges: readonly string[];
|
|
274
|
+
scale(range: [number, number]): BandScale;
|
|
275
|
+
ticks(scale: BandScale): Tick[];
|
|
276
|
+
/** Pixel position of a date, on time axes (after `scale()`). */
|
|
277
|
+
readonly time?: ((date: Date) => number) | undefined;
|
|
278
|
+
}
|
|
279
|
+
/**
|
|
280
|
+
* Interaction by category: the nearest category to the pointer while it is
|
|
281
|
+
* over the plot area, with every visible series' value there. `anchor`
|
|
282
|
+
* places each value (line point, bar end, and the bar's box); `markAt` names the series of the
|
|
283
|
+
* mark directly under the pointer, if the chart has distinct marks (bars).
|
|
284
|
+
* Labels and values are formatted with `x.format` / `y.format` and the locale.
|
|
285
|
+
*/
|
|
286
|
+
declare function categoryInteraction(layout: CartesianLayout, options: CartesianOptions, ctx: RenderContext, anchor: (seriesIndex: number, index: number, value: number) => {
|
|
287
|
+
x: number;
|
|
288
|
+
y: number;
|
|
289
|
+
box?: Rect;
|
|
290
|
+
}, markAt?: (x: number, y: number, index: number) => number | undefined): Interaction;
|
|
291
|
+
/** Accessible table of series values: one row per category, one column per visible series. */
|
|
292
|
+
declare function seriesTable(options: CartesianOptions, ctx: RenderContext, limit?: number): DataTable;
|
|
293
|
+
//#endregion
|
|
294
|
+
//#region src/charts/dates.d.ts
|
|
295
|
+
/**
|
|
296
|
+
* Formatter for date labels on a time axis (tooltips, tables, band axes):
|
|
297
|
+
* the date, with the time of day when the labels span less than a few days.
|
|
298
|
+
*/
|
|
299
|
+
declare function dateLabels(labels: readonly Label[], utc: boolean | undefined, locale: Locale): (label: Label) => string;
|
|
300
|
+
//#endregion
|
|
301
|
+
//#region src/charts/log-axis.d.ts
|
|
302
|
+
/** Domain of a log axis: positive values only, niced to whole powers of ten. */
|
|
303
|
+
declare function logDomain(values: readonly (number | null | undefined)[], options: ValueAxisOptions): [number, number];
|
|
304
|
+
/** Ticks of a log axis, each power formatted as is. */
|
|
305
|
+
declare function logTicks(scale: LinearScale, count: number, format: NumberFormat | undefined, locale: Locale): Tick[];
|
|
306
|
+
//#endregion
|
|
307
|
+
//#region src/legend.d.ts
|
|
308
|
+
/** One legend entry: a series (or a slice, for part-to-whole charts). */
|
|
309
|
+
interface LegendItem {
|
|
310
|
+
/** Stable identity, used to toggle it. */
|
|
311
|
+
key: string;
|
|
312
|
+
name: string;
|
|
313
|
+
/** Color slot: the entry wears `.tc-series-{index + 1}`. */
|
|
314
|
+
index: number;
|
|
315
|
+
/** Custom color overriding the slot. */
|
|
316
|
+
color?: string;
|
|
317
|
+
/** Hidden by default (e.g. `series.hidden`). */
|
|
318
|
+
hidden?: boolean;
|
|
319
|
+
}
|
|
320
|
+
interface LegendOptions {
|
|
321
|
+
/** Place the legend above or below the chart. Defaults to `'top'`. */
|
|
322
|
+
position?: "top" | "bottom";
|
|
323
|
+
}
|
|
324
|
+
/**
|
|
325
|
+
* Legend content: one toggle button per entry. Buttons are native, so they
|
|
326
|
+
* are focusable and work with Enter/Space; `aria-pressed` reflects visibility.
|
|
327
|
+
*/
|
|
328
|
+
declare function legendContent(items: readonly LegendItem[], hidden: ReadonlySet<string>): VNode;
|
|
329
|
+
/** Keys hidden by default, from the entries' own `hidden` flags. */
|
|
330
|
+
declare function defaultHidden(items: readonly LegendItem[]): Set<string>;
|
|
331
|
+
//#endregion
|
|
332
|
+
//#region src/charts/patterns.d.ts
|
|
333
|
+
/** `<pattern>` elements for the legend entries of a chart. */
|
|
334
|
+
declare function patternDefs(items: readonly LegendItem[], id: string): VNode[];
|
|
335
|
+
/** The `--tc-pattern-{n}` references for the chart root. */
|
|
336
|
+
declare function patternVars(items: readonly LegendItem[], id: string): Record<string, string>;
|
|
337
|
+
/**
|
|
338
|
+
* The pattern fills of a chart: its root class (`tc-patterned` with
|
|
339
|
+
* `patterns: true`, `tc-patterns-auto` for forced colors), the root's
|
|
340
|
+
* `--tc-pattern-{n}` references and the `<defs>` with the patterns;
|
|
341
|
+
* `undefined` for a chart without legend entries.
|
|
342
|
+
*/
|
|
343
|
+
declare function patternFills(config: ChartConfig<object>, id: string): [string, Record<string, string>, VNode] | undefined;
|
|
344
|
+
//#endregion
|
|
345
|
+
//#region src/charts/point-shapes.d.ts
|
|
346
|
+
/** The path of slot `slot`'s marker of radius `r` around (`x`, `y`). */
|
|
347
|
+
declare function markerPath(slot: number, x: number, y: number, r: number): string;
|
|
348
|
+
/** The step that gives the points of charts with `shapes` (or `patterns: true`) their shapes. */
|
|
349
|
+
declare const shapesStep: PostStep;
|
|
350
|
+
//#endregion
|
|
351
|
+
//#region src/charts/time-axis.d.ts
|
|
352
|
+
/**
|
|
353
|
+
* A time category axis: points at their real distance in time, ticks on
|
|
354
|
+
* calendar boundaries labelled for the span (or with `x.format`).
|
|
355
|
+
*/
|
|
356
|
+
declare function timeAxis(labels: readonly Label[], keys: readonly BandKey[], options: CategoryAxisOptions, count: number, locale: Locale): CategoryAxis;
|
|
357
|
+
//#endregion
|
|
358
|
+
//#region src/export-chart.d.ts
|
|
359
|
+
interface ExportOptions {
|
|
360
|
+
/**
|
|
361
|
+
* Background color, `'auto'` for the chart's surface (`--tc-surface`), or
|
|
362
|
+
* `false` for none (transparent). Defaults to `'auto'`.
|
|
363
|
+
*/
|
|
364
|
+
background?: string | false;
|
|
365
|
+
/** Draw the legend into the image, as the page shows it. Defaults to `true`. */
|
|
366
|
+
legend?: boolean;
|
|
367
|
+
}
|
|
368
|
+
interface ImageOptions extends ExportOptions {
|
|
369
|
+
/** Image type. Defaults to `'image/png'`. */
|
|
370
|
+
type?: "image/png" | "image/jpeg" | "image/webp";
|
|
371
|
+
/** Pixels per chart pixel. Defaults to `2`. */
|
|
372
|
+
scale?: number;
|
|
373
|
+
/** Quality of lossy types, `0…1`. */
|
|
374
|
+
quality?: number;
|
|
375
|
+
}
|
|
376
|
+
interface DownloadOptions extends ImageOptions {
|
|
377
|
+
/** File name without the extension. Defaults to the chart's title, or `chart`. */
|
|
378
|
+
filename?: string;
|
|
379
|
+
/** File format. Defaults to `'png'`. */
|
|
380
|
+
format?: "svg" | "png" | "jpeg" | "webp";
|
|
381
|
+
}
|
|
382
|
+
/** A chart, its container, or its root `<svg>`. */
|
|
383
|
+
type ExportTarget = Chart<object> | Element;
|
|
384
|
+
/**
|
|
385
|
+
* The chart as a standalone SVG document: the computed styles are inlined,
|
|
386
|
+
* hover marks left out and running animations finished first.
|
|
387
|
+
*
|
|
388
|
+
* ```ts
|
|
389
|
+
* const svg = exportSVG(chart)
|
|
390
|
+
* ```
|
|
391
|
+
*/
|
|
392
|
+
declare function exportSVG(target: ExportTarget, options?: ExportOptions): string;
|
|
393
|
+
/**
|
|
394
|
+
* The chart as an image (PNG by default), drawn from `exportSVG()` at
|
|
395
|
+
* `scale` pixels per chart pixel.
|
|
396
|
+
*
|
|
397
|
+
* ```ts
|
|
398
|
+
* const blob = await exportImage(chart, { scale: 3 })
|
|
399
|
+
* ```
|
|
400
|
+
*/
|
|
401
|
+
declare function exportImage(target: ExportTarget, options?: ImageOptions): Promise<Blob>;
|
|
402
|
+
/**
|
|
403
|
+
* Save the chart as a file: PNG by default, or SVG, JPEG or WebP.
|
|
404
|
+
*
|
|
405
|
+
* ```ts
|
|
406
|
+
* button.onclick = () => downloadChart(chart, { format: 'svg', filename: 'sales' })
|
|
407
|
+
* ```
|
|
408
|
+
*/
|
|
409
|
+
declare function downloadChart(target: ExportTarget, options?: DownloadOptions): Promise<void>;
|
|
410
|
+
//#endregion
|
|
411
|
+
//#region src/render/sweep.d.ts
|
|
412
|
+
/**
|
|
413
|
+
* Take `el` from the arc of its last render, `prev`, to the arc of `next`.
|
|
414
|
+
* Returns the attributes left for the caller to patch (all but `d`, set
|
|
415
|
+
* here frame by frame), or nothing when there is no sweep: not an arc, the
|
|
416
|
+
* same path, no arc to come from, or a chart without transitions.
|
|
417
|
+
*/
|
|
418
|
+
declare function sweep(el: Element, prev: VNode, next: VNode): Attrs | undefined;
|
|
419
|
+
//#endregion
|
|
420
|
+
//#region src/features.d.ts
|
|
421
|
+
/**
|
|
422
|
+
* Optional features that chart types look up at render time. Each lives in
|
|
423
|
+
* its own module (`@tabler/charts/time`, `/log`, `/decimate`, `/line`, `/annotations`) and registers
|
|
424
|
+
* itself when imported; `@tabler/charts` registers all of them, while
|
|
425
|
+
* `@tabler/charts/core` starts empty so unused code never ships.
|
|
426
|
+
*/
|
|
427
|
+
interface Features {
|
|
428
|
+
/** Time scale (and the point scale over it) behind `x: { type: 'time' }`. */
|
|
429
|
+
time?: {
|
|
430
|
+
scale: typeof time;
|
|
431
|
+
points: typeof timePointScale;
|
|
432
|
+
axis: typeof timeAxis;
|
|
433
|
+
};
|
|
434
|
+
/** Date labels behind `x: { type: 'time' }` (also registered by `@tabler/charts/candlestick`). */
|
|
435
|
+
dates?: typeof dateLabels;
|
|
436
|
+
/** Log scale and axis behind `scale: 'log'`. */
|
|
437
|
+
log?: {
|
|
438
|
+
scale: typeof log;
|
|
439
|
+
domain: typeof logDomain;
|
|
440
|
+
ticks: typeof logTicks;
|
|
441
|
+
};
|
|
442
|
+
/** Downsampling behind `decimate: N`: indices of the points to keep. */
|
|
443
|
+
decimate?: (points: readonly Point[], threshold: number) => number[];
|
|
444
|
+
/**
|
|
445
|
+
* Taking over server-rendered markup node by node (without it, the server
|
|
446
|
+
* svg is replaced on the first render).
|
|
447
|
+
*/
|
|
448
|
+
hydrate?: typeof hydrate;
|
|
449
|
+
/** Path morphing on data updates where CSS cannot transition `d` (Safari). */
|
|
450
|
+
morph?: typeof morph;
|
|
451
|
+
/** Arcs turning to their new angles on data updates (set by pie, donut and gauge). */
|
|
452
|
+
sweep?: typeof sweep;
|
|
453
|
+
/** Line and area paths behind `series.type: 'line' | 'area'` in bar charts. */
|
|
454
|
+
line?: {
|
|
455
|
+
linePath: typeof linePath;
|
|
456
|
+
areaPath: typeof areaPath;
|
|
457
|
+
};
|
|
458
|
+
/** Reference lines and bands behind `annotations` in cartesian charts. */
|
|
459
|
+
annotations?: {
|
|
460
|
+
layers: typeof annotationLayers;
|
|
461
|
+
values: typeof annotationValues;
|
|
462
|
+
};
|
|
463
|
+
/** Pattern fills behind `patterns` (and forced colors, with `'auto'`). */
|
|
464
|
+
patterns?: typeof patternFills;
|
|
465
|
+
/**
|
|
466
|
+
* Steps that finish a chart's rendered content (see `addPost`): point
|
|
467
|
+
* shapes, value labels.
|
|
468
|
+
*/
|
|
469
|
+
post?: PostStep;
|
|
470
|
+
/** Point shapes by color slot, behind `shapes`. */
|
|
471
|
+
"point-shapes"?: typeof markerPath;
|
|
472
|
+
/** Saving a chart as a file, behind the `download` menu. */
|
|
473
|
+
export?: typeof downloadChart;
|
|
474
|
+
}
|
|
475
|
+
declare const features: Features;
|
|
476
|
+
/** Register optional features (idempotent). */
|
|
477
|
+
declare function register(added: Features): void;
|
|
478
|
+
/** A step that finishes rendered chart content, e.g. by adding value labels. */
|
|
479
|
+
type PostStep = (config: ChartConfig<object>, content: ChildInput, interaction: Interaction | undefined, ctx: RenderContext) => ChildInput;
|
|
480
|
+
/** The registered feature, or a helpful error naming the import that provides it. */
|
|
481
|
+
declare function feature<K extends keyof Features>(name: K): NonNullable<Features[K]>;
|
|
482
|
+
//#endregion
|
|
483
|
+
//#region src/charts/value-labels.d.ts
|
|
484
|
+
interface ValueLabelOptions {
|
|
485
|
+
/** Format of the values. Defaults to the value axis format (slices: their share in percent). */
|
|
486
|
+
format?: NumberFormat;
|
|
487
|
+
/** Which points of lines, areas and scatters get a label. Defaults to `'last'`. */
|
|
488
|
+
points?: "last" | "all";
|
|
489
|
+
}
|
|
490
|
+
/** The labels layer of a chart, or `null` when nothing gets one. */
|
|
491
|
+
declare function valueLabels(config: ChartConfig<object>, interaction: Interaction, ctx: RenderContext): VNode | null;
|
|
492
|
+
/** The step that adds the labels over the content of charts with `valueLabels`. */
|
|
493
|
+
declare const labelsStep: PostStep;
|
|
494
|
+
//#endregion
|
|
495
|
+
//#region src/plugin.d.ts
|
|
496
|
+
/** What a plugin sees before the chart measures itself and renders. */
|
|
497
|
+
interface BeforeRenderState {
|
|
498
|
+
config: ChartConfig<object>;
|
|
499
|
+
legend: ResolvedLegend;
|
|
500
|
+
hidden: ReadonlySet<string>;
|
|
501
|
+
}
|
|
502
|
+
/** What a plugin sees after the chart rendered into the DOM. */
|
|
503
|
+
interface AfterRenderState extends BeforeRenderState {
|
|
504
|
+
size: Size;
|
|
505
|
+
/** Whether the chart content was rebuilt (config, size or hidden series changed). */
|
|
506
|
+
stale: boolean;
|
|
507
|
+
/** Whether the config or the hidden series changed (`stale` also covers size and font). */
|
|
508
|
+
changed: boolean;
|
|
509
|
+
}
|
|
510
|
+
/** Hooks of an installed plugin; every one is optional. */
|
|
511
|
+
interface PluginInstance {
|
|
512
|
+
/** Runs first on every render, e.g. to render a legend that takes up space. */
|
|
513
|
+
beforeRender?(state: BeforeRenderState): void;
|
|
514
|
+
/** Vertical space the plugin takes from the container in `height: 'container'` mode. */
|
|
515
|
+
reservedHeight?(): number;
|
|
516
|
+
/** Extra attributes for the root `<svg>`. */
|
|
517
|
+
svgAttrs?(config: ChartConfig<object>): Props | undefined;
|
|
518
|
+
/** SVG drawn below (`under`) and above (`over`) the chart content for the active hit. */
|
|
519
|
+
layers?(hit: Hit, config: ChartConfig<object>): {
|
|
520
|
+
under?: ChildInput;
|
|
521
|
+
over?: ChildInput;
|
|
522
|
+
};
|
|
523
|
+
/** Runs after the SVG is in the DOM, e.g. to place a tooltip. */
|
|
524
|
+
afterRender?(state: AfterRenderState): void;
|
|
525
|
+
/** Clean up DOM and listeners. */
|
|
526
|
+
destroy?(): void;
|
|
527
|
+
}
|
|
528
|
+
/**
|
|
529
|
+
* A chart feature that can be left out of the bundle: tooltip, legend, data
|
|
530
|
+
* table, keyboard navigation, hover highlight. `install` runs once per chart.
|
|
531
|
+
*
|
|
532
|
+
* ```ts
|
|
533
|
+
* import { Chart, tooltip } from '@tabler/charts/core'
|
|
534
|
+
* new Chart(el, { type: line, data, plugins: [tooltip()] })
|
|
535
|
+
* ```
|
|
536
|
+
*/
|
|
537
|
+
interface ChartPlugin {
|
|
538
|
+
readonly name: string;
|
|
539
|
+
install(chart: Chart<object>): PluginInstance;
|
|
540
|
+
}
|
|
541
|
+
//#endregion
|
|
542
|
+
//#region src/plugins/download.d.ts
|
|
543
|
+
/** A file format of the download menu. */
|
|
544
|
+
type DownloadFormat = "png" | "svg" | "jpeg" | "webp";
|
|
545
|
+
/** The `download` option as an object. */
|
|
546
|
+
interface DownloadMenuOptions {
|
|
547
|
+
/** Formats offered, in this order. Defaults to `['png', 'svg']`. */
|
|
548
|
+
formats?: readonly DownloadFormat[];
|
|
549
|
+
/** File name without the extension. Defaults to the chart's title, or `chart`. */
|
|
550
|
+
filename?: string;
|
|
551
|
+
/** Accessible name of the menu button. Defaults to `'Download'`. */
|
|
552
|
+
label?: string;
|
|
553
|
+
/**
|
|
554
|
+
* Background color, `'auto'` for the chart's surface (`--tc-surface`), or
|
|
555
|
+
* `false` for none (transparent). Defaults to `'auto'`.
|
|
556
|
+
*/
|
|
557
|
+
background?: string | false;
|
|
558
|
+
/** Draw the legend into the file. Defaults to `true`. */
|
|
559
|
+
legend?: boolean;
|
|
560
|
+
/** Pixels per chart pixel in images. Defaults to `2`. */
|
|
561
|
+
scale?: number;
|
|
562
|
+
}
|
|
563
|
+
/** The `download` option: on, a list of formats, or the options. */
|
|
564
|
+
type DownloadOption = boolean | readonly DownloadFormat[] | DownloadMenuOptions;
|
|
565
|
+
/**
|
|
566
|
+
* A download menu in the chart's corner (`.tc-download`): a button that opens
|
|
567
|
+
* a list of file formats, PNG and SVG by default. Shown with the `download`
|
|
568
|
+
* option. The files come from `@tabler/charts/export`, which must be imported
|
|
569
|
+
* (the chart says so otherwise): that way charts without a download never
|
|
570
|
+
* carry the export code.
|
|
571
|
+
*/
|
|
572
|
+
declare function download(): ChartPlugin;
|
|
573
|
+
//#endregion
|
|
574
|
+
//#region src/tooltip.d.ts
|
|
575
|
+
/**
|
|
576
|
+
* Where a tooltip for `hit` belongs, in chart pixels: the pointer when it
|
|
577
|
+
* drives the highlight, otherwise the focused value (keyboard).
|
|
578
|
+
*/
|
|
579
|
+
declare function hitAnchor(hit: Hit, pointer?: {
|
|
580
|
+
x: number;
|
|
581
|
+
y: number;
|
|
582
|
+
}): {
|
|
583
|
+
x: number;
|
|
584
|
+
y: number;
|
|
585
|
+
};
|
|
586
|
+
interface TooltipOptions {
|
|
587
|
+
/**
|
|
588
|
+
* Colors of the tooltip: `'dark'` (the default) is a dark box with light
|
|
589
|
+
* text, `'light'` a white one with dark text. Both keep their colors in
|
|
590
|
+
* dark mode; the `--tc-tooltip-*` tokens tune them.
|
|
591
|
+
*/
|
|
592
|
+
theme?: "dark" | "light";
|
|
593
|
+
/**
|
|
594
|
+
* Custom content for a hit: VNodes built with `h()` or plain text.
|
|
595
|
+
* Rendered safely (no HTML parsing), inside `.tc-tooltip`.
|
|
596
|
+
*/
|
|
597
|
+
format?: (hit: Hit) => ChildInput;
|
|
598
|
+
/** Extra content below the default rows (e.g. a total), in `.tc-tooltip-footer`. */
|
|
599
|
+
footer?: (hit: Hit) => ChildInput;
|
|
600
|
+
}
|
|
601
|
+
/** Default tooltip content: the category title and one row per series. */
|
|
602
|
+
declare function tooltipContent(hit: Hit, options?: TooltipOptions): VNode;
|
|
603
|
+
interface TooltipPlacement {
|
|
604
|
+
x: number;
|
|
605
|
+
y: number;
|
|
606
|
+
side: "left" | "right";
|
|
607
|
+
}
|
|
608
|
+
/**
|
|
609
|
+
* Place a `width × height` tooltip next to an anchor within `bounds` (from
|
|
610
|
+
* `bounds.x`, `bounds.y`, 0 by default): right of the anchor, or left when it
|
|
611
|
+
* would overflow, vertically centered on the pointer and clamped.
|
|
612
|
+
*/
|
|
613
|
+
declare function placeTooltip(anchor: {
|
|
614
|
+
x: number;
|
|
615
|
+
y: number;
|
|
616
|
+
}, size: {
|
|
617
|
+
width: number;
|
|
618
|
+
height: number;
|
|
619
|
+
}, bounds: {
|
|
620
|
+
x?: number;
|
|
621
|
+
y?: number;
|
|
622
|
+
width: number;
|
|
623
|
+
height: number;
|
|
624
|
+
}, offset?: number): TooltipPlacement;
|
|
625
|
+
//#endregion
|
|
626
|
+
//#region src/chart.d.ts
|
|
627
|
+
/** Size and environment a chart type renders into. */
|
|
628
|
+
interface RenderContext {
|
|
629
|
+
width: number;
|
|
630
|
+
height: number;
|
|
631
|
+
/** Font size used to estimate label sizes. */
|
|
632
|
+
fontSize: number;
|
|
633
|
+
locale: Locale;
|
|
634
|
+
/** Unique, stable prefix for ids inside this chart. */
|
|
635
|
+
id: string;
|
|
636
|
+
/** Register how pointer and keyboard map to data (ignored in SSR). */
|
|
637
|
+
onHitTest(interaction: Interaction): void;
|
|
638
|
+
/** Keys of legend entries (series) currently hidden. */
|
|
639
|
+
hidden: ReadonlySet<string>;
|
|
640
|
+
}
|
|
641
|
+
/**
|
|
642
|
+
* A chart type plugin (`line`, `bar`, …). Receives the chart options and
|
|
643
|
+
* returns the content of the root `<svg>`.
|
|
644
|
+
*/
|
|
645
|
+
interface ChartType<O extends object = object> {
|
|
646
|
+
readonly name: string;
|
|
647
|
+
/**
|
|
648
|
+
* Clean options that may come from outside (data, annotations, axis
|
|
649
|
+
* bounds from users, APIs, JSON) into the shape `render()` expects; called
|
|
650
|
+
* as the config comes in, before anything reads it.
|
|
651
|
+
*/
|
|
652
|
+
clean?(options: O): unknown;
|
|
653
|
+
render(options: O, context: RenderContext): ChildInput;
|
|
654
|
+
/** Entries for the legend (series, slices); charts without it get no legend. */
|
|
655
|
+
legend?(options: O): LegendItem[];
|
|
656
|
+
/**
|
|
657
|
+
* The data as a text table, for screen readers and the visible table
|
|
658
|
+
* option. `limit` is the most rows wanted; report the real count in `total`.
|
|
659
|
+
*/
|
|
660
|
+
table?(options: O, context: RenderContext, limit: number): DataTable;
|
|
661
|
+
/**
|
|
662
|
+
* Whether the chart should be focusable and keyboard-navigable by default
|
|
663
|
+
* (`keyboard` in the config overrides it). Decorative types such as
|
|
664
|
+
* sparklines opt out so a page of stat tiles does not multiply tab stops.
|
|
665
|
+
*/
|
|
666
|
+
readonly keyboard?: boolean;
|
|
667
|
+
/**
|
|
668
|
+
* How value labels (`valueLabels`) read this chart type, when not as bars
|
|
669
|
+
* or points: `marks: 'slice'` writes each value as its share, inside its
|
|
670
|
+
* slice; `marks: 'cell'` writes it in the middle of its mark. `format`
|
|
671
|
+
* names the number format of the values in the options (by default a label
|
|
672
|
+
* shows the text of the tooltip).
|
|
673
|
+
*/
|
|
674
|
+
readonly valueLabels?: {
|
|
675
|
+
marks?: "slice" | "cell";
|
|
676
|
+
format?(options: O): NumberFormat | undefined;
|
|
677
|
+
};
|
|
678
|
+
}
|
|
679
|
+
/** Options shared by every chart type. */
|
|
680
|
+
interface BaseOptions {
|
|
681
|
+
/** Fixed width in pixels. Defaults to the container width. */
|
|
682
|
+
width?: number;
|
|
683
|
+
/**
|
|
684
|
+
* Height in pixels, or `'container'` to follow the container's height (the
|
|
685
|
+
* container then needs a height of its own). Defaults to width / aspectRatio.
|
|
686
|
+
*/
|
|
687
|
+
height?: number | "container";
|
|
688
|
+
/** Width to height ratio used when `height` is not set. Defaults to `2`. */
|
|
689
|
+
aspectRatio?: number;
|
|
690
|
+
/** Accessible name of the chart. */
|
|
691
|
+
title?: string;
|
|
692
|
+
/** Longer accessible description. */
|
|
693
|
+
description?: string;
|
|
694
|
+
/** Extra classes on the root `<svg>`. */
|
|
695
|
+
class?: ClassValue;
|
|
696
|
+
/** Locale for number and date formatting. Set it explicitly for SSR. */
|
|
697
|
+
locale?: Locale;
|
|
698
|
+
/**
|
|
699
|
+
* Font size used to lay out labels. In the browser it is read from the
|
|
700
|
+
* `--tc-font-size` custom property of the container when not set; set it
|
|
701
|
+
* explicitly for SSR so server and client layouts match. Defaults to `12`.
|
|
702
|
+
*/
|
|
703
|
+
fontSize?: number;
|
|
704
|
+
/** Id prefix; set it explicitly for SSR so server and client ids match. */
|
|
705
|
+
id?: string;
|
|
706
|
+
/** Show a tooltip on hover, optionally with custom content. Defaults to `true`. */
|
|
707
|
+
tooltip?: boolean | TooltipOptions;
|
|
708
|
+
/** Show a vertical crosshair on hover (point charts). Defaults to `true`. */
|
|
709
|
+
crosshair?: boolean;
|
|
710
|
+
/** Show a legend with toggles. Defaults to showing it for two or more entries. */
|
|
711
|
+
legend?: boolean | LegendOptions;
|
|
712
|
+
/**
|
|
713
|
+
* Animate entrances and data updates (reduced motion always wins). By
|
|
714
|
+
* default charts animate unless they draw more than 1000 elements (e.g. a
|
|
715
|
+
* scatter of a thousand points), where transitions cost far more frame
|
|
716
|
+
* time than they show; `true` animates those too.
|
|
717
|
+
*/
|
|
718
|
+
animate?: boolean;
|
|
719
|
+
/**
|
|
720
|
+
* Fill bars, areas, slices, rings and bubbles with patterns (and dash
|
|
721
|
+
* lines), so series do not depend on color alone: `true` always, `'auto'`
|
|
722
|
+
* (the default) only in forced colors (Windows High Contrast), where the
|
|
723
|
+
* colors are gone, `false` never. Needs `@tabler/charts/patterns` on the
|
|
724
|
+
* core (`@tabler/charts` includes it).
|
|
725
|
+
*/
|
|
726
|
+
patterns?: boolean | "auto";
|
|
727
|
+
/**
|
|
728
|
+
* Write the values on the marks: bars at their end, stacked segments,
|
|
729
|
+
* cells and slices inside (slices show their share), lines and points
|
|
730
|
+
* above their last point (`points: 'all'` for every one). Labels that do
|
|
731
|
+
* not fit are left out. Needs `@tabler/charts/value-labels` on the core
|
|
732
|
+
* (`@tabler/charts` includes it).
|
|
733
|
+
*/
|
|
734
|
+
valueLabels?: boolean | ValueLabelOptions;
|
|
735
|
+
/**
|
|
736
|
+
* Share the hover with the other charts of this group: the category under
|
|
737
|
+
* the pointer is highlighted in all of them (matched by label), with its
|
|
738
|
+
* tooltip. Needs the `sync()` plugin (the `Chart` of `@tabler/charts` has it).
|
|
739
|
+
*/
|
|
740
|
+
sync?: string;
|
|
741
|
+
/**
|
|
742
|
+
* Give the points of each series a shape of their own (circle, square,
|
|
743
|
+
* triangle, diamond…) in line, radar and scatter charts, so they do not
|
|
744
|
+
* depend on color alone. Defaults to `patterns === true`. Needs
|
|
745
|
+
* `@tabler/charts/point-shapes` on the core (`@tabler/charts` includes it).
|
|
746
|
+
*/
|
|
747
|
+
shapes?: boolean;
|
|
748
|
+
/**
|
|
749
|
+
* Render the data as an HTML table: visually hidden for screen readers
|
|
750
|
+
* (`true`, the default), shown below the chart (`'visible'`), or not at all.
|
|
751
|
+
* An object sets `visible` and `maxRows` (default 1000; longer data is cut
|
|
752
|
+
* and the caption says so).
|
|
753
|
+
*/
|
|
754
|
+
table?: boolean | "visible" | {
|
|
755
|
+
visible?: boolean;
|
|
756
|
+
maxRows?: number;
|
|
757
|
+
};
|
|
758
|
+
/** Make the chart focusable and navigable with arrow keys. Defaults to `true`. */
|
|
759
|
+
keyboard?: boolean;
|
|
760
|
+
/**
|
|
761
|
+
* A download menu in the chart's corner: `true` offers PNG and SVG, a list
|
|
762
|
+
* picks the formats (`['png', 'svg', 'jpeg', 'webp']`), an object also
|
|
763
|
+
* sets the file name and the export options. Needs `@tabler/charts/export`
|
|
764
|
+
* imported, and on the core the `download()` plugin (the `Chart` of
|
|
765
|
+
* `@tabler/charts` has it).
|
|
766
|
+
*/
|
|
767
|
+
download?: DownloadOption;
|
|
768
|
+
/**
|
|
769
|
+
* Extra plugins, installed when the chart is created. The default `Chart`
|
|
770
|
+
* from `@tabler/charts` already includes the built-in ones; the bare `Chart`
|
|
771
|
+
* from `@tabler/charts/core` only runs these.
|
|
772
|
+
*/
|
|
773
|
+
plugins?: readonly ChartPlugin[];
|
|
774
|
+
}
|
|
775
|
+
/** Full chart configuration: base options, the chart type and its options. */
|
|
776
|
+
type ChartConfig<O extends object = object> = BaseOptions & O & {
|
|
777
|
+
type: ChartType<O>;
|
|
778
|
+
};
|
|
779
|
+
interface Size {
|
|
780
|
+
width: number;
|
|
781
|
+
height: number;
|
|
782
|
+
}
|
|
783
|
+
/** Resolve the final pixel size from options and the measured container size. */
|
|
784
|
+
declare function resolveSize(options: BaseOptions, measured?: Partial<Size>): Size;
|
|
785
|
+
/** Render context for a config and size (also used by plugins such as the data table). */
|
|
786
|
+
declare function renderContext<O extends object>(config: ChartConfig<O>, size: Size, id: string, onHitTest: (interaction: Interaction) => void, hidden: ReadonlySet<string>, measuredFontSize?: number): RenderContext;
|
|
787
|
+
/** Legend entries of a config, whether a legend is shown and where. */
|
|
788
|
+
interface ResolvedLegend {
|
|
789
|
+
items: LegendItem[];
|
|
790
|
+
show: boolean;
|
|
791
|
+
position: "top" | "bottom";
|
|
792
|
+
}
|
|
793
|
+
/** Legend entries of a config, and whether the legend is shown. */
|
|
794
|
+
declare function resolveLegend<O extends object>(config: ChartConfig<O>): ResolvedLegend;
|
|
795
|
+
/**
|
|
796
|
+
* The chart's accessible name: its `title`, or else the chart type and its
|
|
797
|
+
* legend entries ("line chart: Visitors, Sign-ups"), since an image without
|
|
798
|
+
* a name is announced as nothing at all. Set `title` for a name in the
|
|
799
|
+
* page's language.
|
|
800
|
+
*/
|
|
801
|
+
declare function chartLabel(config: ChartConfig<object>): string;
|
|
802
|
+
/**
|
|
803
|
+
* Build the VNode tree of a chart: a pure function of the config and size,
|
|
804
|
+
* shared by the DOM chart and server-side rendering.
|
|
805
|
+
*/
|
|
806
|
+
declare function buildChart<O extends object>(config: ChartConfig<O>, size: Size, id?: string, onHitTest?: (interaction: Interaction) => void): VNode;
|
|
807
|
+
/**
|
|
808
|
+
* Render a chart to an SVG string, e.g. on the server.
|
|
809
|
+
*
|
|
810
|
+
* ```ts
|
|
811
|
+
* chartToString({ type: line, data, id: 'sales', locale: 'en-US' }, { width: 600, height: 300 })
|
|
812
|
+
* ```
|
|
813
|
+
*/
|
|
814
|
+
declare function chartToString<O extends object>(config: ChartConfig<O>, size: Size): string;
|
|
815
|
+
interface ChartEvents {
|
|
816
|
+
/** A legend entry was toggled (by the user or `toggleSeries()`). */
|
|
817
|
+
"legend-toggle": {
|
|
818
|
+
key: string;
|
|
819
|
+
name: string;
|
|
820
|
+
index: number;
|
|
821
|
+
hidden: boolean;
|
|
822
|
+
};
|
|
823
|
+
/** After the chart content rendered into the DOM (not on hover-only updates). */
|
|
824
|
+
render: {
|
|
825
|
+
size: Size;
|
|
826
|
+
};
|
|
827
|
+
/**
|
|
828
|
+
* The highlighted category (or mark) changed, or its data changed while
|
|
829
|
+
* highlighted. `hit` is `null` when the pointer left the plot.
|
|
830
|
+
*/
|
|
831
|
+
hover: {
|
|
832
|
+
hit: Hit | null;
|
|
833
|
+
event?: PointerEvent;
|
|
834
|
+
};
|
|
835
|
+
/** A click on the plot. */
|
|
836
|
+
click: {
|
|
837
|
+
hit: Hit;
|
|
838
|
+
event: MouseEvent;
|
|
839
|
+
};
|
|
840
|
+
}
|
|
841
|
+
/** The name of every chart event, for adapters that pass them all on. */
|
|
842
|
+
declare const chartEvents: readonly (keyof ChartEvents)[];
|
|
843
|
+
type Handler<T> = (event: T) => void;
|
|
844
|
+
/**
|
|
845
|
+
* A chart bound to a DOM element: measures its container, renders SVG into
|
|
846
|
+
* it and re-renders on `update()` and resize (batched per animation frame).
|
|
847
|
+
* Features such as the tooltip, the legend and pointer input (`hover` /
|
|
848
|
+
* `click` events, from `pointer()`, which the highlight and tooltip plugins
|
|
849
|
+
* turn on themselves) are plugins; the `Chart` exported by `@tabler/charts`
|
|
850
|
+
* installs the built-in ones.
|
|
851
|
+
*
|
|
852
|
+
* ```ts
|
|
853
|
+
* const chart = new Chart('#sales', { type: line, data })
|
|
854
|
+
* chart.update({ data: next })
|
|
855
|
+
* ```
|
|
856
|
+
*/
|
|
857
|
+
declare class Chart<O extends object = object> {
|
|
858
|
+
#private;
|
|
859
|
+
/** Element the chart renders into. */
|
|
860
|
+
readonly element: Element;
|
|
861
|
+
/** Id prefix used for elements inside the chart. */
|
|
862
|
+
readonly id: string;
|
|
863
|
+
constructor(target: Element | string, config: ChartConfig<O>, defaultPlugins?: readonly ChartPlugin[]);
|
|
864
|
+
/** Current configuration. */
|
|
865
|
+
get config(): ChartConfig<O>;
|
|
866
|
+
/** Size of the last render. */
|
|
867
|
+
get size(): Size;
|
|
868
|
+
/** Font size used by the last render (explicit, measured, or the default). */
|
|
869
|
+
get fontSize(): number;
|
|
870
|
+
/** How pointer and keyboard map to data for the current render. */
|
|
871
|
+
get interaction(): Interaction | undefined;
|
|
872
|
+
/** The highlighted category (hover or keyboard), or `null`. */
|
|
873
|
+
get active(): Hit | null;
|
|
874
|
+
/**
|
|
875
|
+
* The pointer in chart pixels while it drives the highlight (`undefined`
|
|
876
|
+
* for keyboard highlights). `hitAnchor(chart.active, chart.pointer)` gives
|
|
877
|
+
* where a tooltip belongs either way.
|
|
878
|
+
*/
|
|
879
|
+
get pointer(): {
|
|
880
|
+
x: number;
|
|
881
|
+
y: number;
|
|
882
|
+
} | undefined;
|
|
883
|
+
/** Whether the highlight comes from the pointer or from `highlightIndex()` (keyboard). */
|
|
884
|
+
get highlightSource(): "pointer" | "index" | undefined;
|
|
885
|
+
/**
|
|
886
|
+
* Highlight a category by index (and optionally one series in it), as
|
|
887
|
+
* keyboard navigation does. Returns the hit, or `null` for an invalid index.
|
|
888
|
+
*/
|
|
889
|
+
highlightIndex(index: number, seriesIndex?: number): Hit | null;
|
|
890
|
+
/**
|
|
891
|
+
* Highlight what lies at a point in chart pixels, as the pointer does (the
|
|
892
|
+
* `pointer()` plugin calls it). Returns the hit, or `null` for none.
|
|
893
|
+
*/
|
|
894
|
+
highlightAt(x: number, y: number, event?: PointerEvent): Hit | null;
|
|
895
|
+
/** Remove any highlight. */
|
|
896
|
+
clearHighlight(event?: PointerEvent): void;
|
|
897
|
+
/**
|
|
898
|
+
* Show or hide a legend entry (series) by key, name or index; toggles when
|
|
899
|
+
* `hidden` is omitted. Re-renders in the next frame.
|
|
900
|
+
*/
|
|
901
|
+
toggleSeries(target: string | number, hidden?: boolean): this;
|
|
902
|
+
/** Whether a legend entry is hidden. */
|
|
903
|
+
isHidden(key: string): boolean;
|
|
904
|
+
/** Merge `options` into the configuration and re-render in the next frame. */
|
|
905
|
+
update(options: Partial<ChartConfig<O>>): this;
|
|
906
|
+
/**
|
|
907
|
+
* Replace the whole configuration and re-render in the next frame: options
|
|
908
|
+
* left out go back to their defaults (`update()` would keep them).
|
|
909
|
+
*/
|
|
910
|
+
setConfig(config: ChartConfig<O>): this;
|
|
911
|
+
/** Replace the data and re-render in the next frame. */
|
|
912
|
+
setData(data: O extends {
|
|
913
|
+
data: infer D;
|
|
914
|
+
} ? D : never): this;
|
|
915
|
+
/**
|
|
916
|
+
* Re-measure the container and re-render in the next frame. Call it when a
|
|
917
|
+
* container taken out of the page without `destroy()` comes back.
|
|
918
|
+
*/
|
|
919
|
+
resize(): this;
|
|
920
|
+
/** Render synchronously now. */
|
|
921
|
+
render(): this;
|
|
922
|
+
/** What lies at a point in chart pixels, or `null`. */
|
|
923
|
+
hitTest(x: number, y: number): Hit | null;
|
|
924
|
+
/** Subscribe to an event; returns a function that unsubscribes. */
|
|
925
|
+
on<K extends keyof ChartEvents>(name: K, handler: Handler<ChartEvents[K]>): () => void;
|
|
926
|
+
/** Remove the chart from the DOM and stop observing its container. */
|
|
927
|
+
destroy(): void;
|
|
928
|
+
/** Call the handlers of an event (plugins emit `click`, for instance). */
|
|
929
|
+
emit<K extends keyof ChartEvents>(name: K, event: ChartEvents[K]): void;
|
|
930
|
+
}
|
|
931
|
+
//#endregion
|
|
932
|
+
export { CartesianOptions as $, labelsStep as A, downloadChart as B, DownloadOption as C, HitTester as Ct, ChartPlugin as D, BeforeRenderState as E, register as F, patternDefs as G, exportSVG as H, DownloadOptions as I, LegendItem as J, patternFills as K, ExportOptions as L, Features as M, feature as N, PluginInstance as O, features as P, CartesianData as Q, ExportTarget as R, DownloadMenuOptions as S, HitItem as St, AfterRenderState as T, markerPath as U, exportImage as V, shapesStep as W, defaultHidden as X, LegendOptions as Y, legendContent as Z, TooltipPlacement as _, thinTicks as _t, ChartType as a, domainOf as at, tooltipContent as b, tableContent as bt, Size as c, seriesTable as ct, chartLabel as d, LinearTicksOptions as dt, CategoryAxisOptions as et, chartToString as f, Tick as ft, TooltipOptions as g, linearTicks as gt, resolveSize as h, bandTicks as ht, ChartEvents as i, categoryInteraction as it, valueLabels as j, ValueLabelOptions as k, buildChart as l, AxisOptions as lt, resolveLegend as m, axisSize as mt, Chart as n, Series as nt, RenderContext as o, seriesKey as ot, renderContext as p, axis as pt, patternVars as q, ChartConfig as r, ValueAxisOptions as rt, ResolvedLegend as s, seriesLegend as st, BaseOptions as t, Label as tt, chartEvents as u, AxisPosition as ut, hitAnchor as v, DataTable as vt, download as w, Interaction as wt, DownloadFormat as x, Hit as xt, placeTooltip as y, describeHit as yt, ImageOptions as z };
|
|
933
|
+
//# sourceMappingURL=chart-D7ooEFnk.d.cts.map
|