@tabler/charts 0.0.0-stage → 0.0.1-alpha.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 +248 -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/area-BFvkc-ZM.d.cts +20 -0
- package/dist/area-DQsLERhx.js +26 -0
- package/dist/area-DQsLERhx.js.map +1 -0
- package/dist/area-DaO4MQl4.d.ts +20 -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-C-7zR2qp.cjs +243 -0
- package/dist/bar-C-7zR2qp.cjs.map +1 -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-DdsDxk3W.d.ts +43 -0
- package/dist/bar-a0h9KC8A.d.cts +43 -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-BKdPyorY.d.cts +44 -0
- package/dist/candlestick-BnUG1SGi.d.ts +44 -0
- package/dist/candlestick-DuXwAFID.js +145 -0
- package/dist/candlestick-DuXwAFID.js.map +1 -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-Qa417fJo.d.cts +927 -0
- package/dist/chart-iJGxMz9z.d.ts +927 -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-C7fPm6t7.cjs +976 -0
- package/dist/core-C7fPm6t7.cjs.map +1 -0
- package/dist/core-CjgbhS_v.d.ts +219 -0
- package/dist/core-CnGFKojH.d.cts +219 -0
- package/dist/core-plobgBC7.js +875 -0
- package/dist/core-plobgBC7.js.map +1 -0
- package/dist/core.cjs +113 -0
- package/dist/core.d.cts +20 -0
- package/dist/core.d.ts +20 -0
- package/dist/core.js +24 -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-CEfkWXSu.cjs +235 -0
- package/dist/gauge-CEfkWXSu.cjs.map +1 -0
- package/dist/gauge-Cu9jttC0.d.ts +65 -0
- package/dist/gauge-Cu_OFxBd.d.cts +65 -0
- package/dist/gauge-_ljQHrMN.js +230 -0
- package/dist/gauge-_ljQHrMN.js.map +1 -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-BwS-y0c6.d.cts +81 -0
- package/dist/heatmap-DSZ2bVIa.js +242 -0
- package/dist/heatmap-DSZ2bVIa.js.map +1 -0
- package/dist/heatmap-PhLPXIg1.d.ts +81 -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 +211 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +45 -0
- package/dist/index.d.ts +45 -0
- package/dist/index.js +113 -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-CMDGH6q5.d.cts +47 -0
- package/dist/line-D5kb8e6w.d.ts +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/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-B8UlOZiq.d.ts +58 -0
- package/dist/pie-C1Pa6W_l.cjs +211 -0
- package/dist/pie-C1Pa6W_l.cjs.map +1 -0
- package/dist/pie-DnQQmxkk.d.cts +58 -0
- package/dist/pie-RnMTQWMS.js +200 -0
- package/dist/pie-RnMTQWMS.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-BB13CGmq.d.cts +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-pFI6fvOq.d.ts +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-B9JYnx7e.d.cts +67 -0
- package/dist/sankey-Bacx4fVe.cjs +425 -0
- package/dist/sankey-Bacx4fVe.cjs.map +1 -0
- package/dist/sankey-Bm518bqL.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-Bl7nasE6.d.ts +61 -0
- package/dist/scatter-DgMN9zRy.cjs +250 -0
- package/dist/scatter-DgMN9zRy.cjs.map +1 -0
- package/dist/scatter-DrJ8xYz4.d.cts +61 -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-BG13V4Pz.d.cts +43 -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-iWuXbKpd.d.ts +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-Duowaput.cjs +369 -0
- package/dist/sweep-Duowaput.cjs.map +1 -0
- package/dist/sweep-WSgn2etB.js +334 -0
- package/dist/sweep-WSgn2etB.js.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 +310 -3
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { i as patchAttrs, n as childNamespace, o as rendered, r as createNode } from "./dom-vP3IcMak.js";
|
|
2
|
+
//#region src/render/hydrate.ts
|
|
3
|
+
/** Whether existing DOM `node` can stand for `vnode` in namespace `ns`. */
|
|
4
|
+
function matches(node, vnode, ns) {
|
|
5
|
+
return node.nodeType === 1 && node.localName === vnode.tag && node.namespaceURI === ns;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Claim server-rendered DOM for a tree: the element takes the vnode's
|
|
9
|
+
* attributes (extra ones are removed), and its children are matched by
|
|
10
|
+
* position: text with text, elements with the same tag (hydrated in turn).
|
|
11
|
+
* Anything that does not match is created in place, leftovers are removed.
|
|
12
|
+
* Afterwards the nodes are tracked like freshly rendered ones.
|
|
13
|
+
*/
|
|
14
|
+
function hydrateElement(el, vnode) {
|
|
15
|
+
const current = {};
|
|
16
|
+
for (const name of el.getAttributeNames()) current[name] = el.getAttribute(name);
|
|
17
|
+
if (current.style) current.style = "";
|
|
18
|
+
patchAttrs(el, current, vnode.attrs);
|
|
19
|
+
const texts = vnode.children.some((child) => typeof child === "string");
|
|
20
|
+
for (const node of Array.from(el.childNodes)) if (node.nodeType === 8 || !texts && node.nodeType === 3) el.removeChild(node);
|
|
21
|
+
const ns = childNamespace(el);
|
|
22
|
+
let node = el.firstChild;
|
|
23
|
+
for (const child of vnode.children) {
|
|
24
|
+
const next = node ? node.nextSibling : null;
|
|
25
|
+
if (typeof child === "string" ? node?.nodeType === 3 : node && matches(node, child, child.tag === "svg" ? "http://www.w3.org/2000/svg" : ns)) {
|
|
26
|
+
if (typeof child === "string") {
|
|
27
|
+
if (node.data !== child) node.data = child;
|
|
28
|
+
rendered.set(node, child);
|
|
29
|
+
} else hydrateElement(node, child);
|
|
30
|
+
node = next;
|
|
31
|
+
} else {
|
|
32
|
+
const created = createNode(child, ns, el.ownerDocument);
|
|
33
|
+
if (created) el.insertBefore(created, node);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
while (node) {
|
|
37
|
+
const extra = node;
|
|
38
|
+
node = node.nextSibling;
|
|
39
|
+
el.removeChild(extra);
|
|
40
|
+
}
|
|
41
|
+
rendered.set(el, vnode);
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Hydrate `el` for the root `vnode` when it is foreign markup (not rendered
|
|
45
|
+
* here) with the root's tag in namespace `ns`. Returns whether it did.
|
|
46
|
+
*/
|
|
47
|
+
function hydrate(el, vnode, ns) {
|
|
48
|
+
if (rendered.has(el) || !matches(el, vnode, ns)) return false;
|
|
49
|
+
hydrateElement(el, vnode);
|
|
50
|
+
return true;
|
|
51
|
+
}
|
|
52
|
+
//#endregion
|
|
53
|
+
export { hydrate as t };
|
|
54
|
+
|
|
55
|
+
//# sourceMappingURL=hydrate-DDNIHYv_.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hydrate-DDNIHYv_.js","names":[],"sources":["../src/render/hydrate.ts"],"sourcesContent":["import type { Attrs, VNode } from '../vnode.ts'\nimport { childNamespace, createNode, patchAttrs, rendered, SVG_NS } from './dom.ts'\n\n/** Whether existing DOM `node` can stand for `vnode` in namespace `ns`. */\nfunction matches(node: Node, vnode: VNode, ns: string): node is Element {\n return (\n node.nodeType === 1 &&\n (node as Element).localName === vnode.tag &&\n (node as Element).namespaceURI === ns\n )\n}\n\n/**\n * Claim server-rendered DOM for a tree: the element takes the vnode's\n * attributes (extra ones are removed), and its children are matched by\n * position: text with text, elements with the same tag (hydrated in turn).\n * Anything that does not match is created in place, leftovers are removed.\n * Afterwards the nodes are tracked like freshly rendered ones.\n */\nexport function hydrateElement(el: Element, vnode: VNode): void {\n // The server attributes are the previous state to patch from.\n const current: Attrs = {}\n for (const name of el.getAttributeNames()) current[name] = el.getAttribute(name) as string\n // A strict CSP ignores style attributes in markup: set them again, through the CSSOM.\n if (current.style) current.style = ''\n patchAttrs(el, current, vnode.attrs)\n\n // Comments never stand for anything, and neither does text where the tree has none\n // (whitespace between elements). Text only ever sits in leaf elements here.\n const texts = vnode.children.some((child) => typeof child === 'string')\n for (const node of Array.from(el.childNodes)) {\n if (node.nodeType === 8 || (!texts && node.nodeType === 3)) el.removeChild(node)\n }\n\n const ns = childNamespace(el)\n let node: Node | null = el.firstChild\n for (const child of vnode.children) {\n const next: Node | null = node ? node.nextSibling : null\n if (\n typeof child === 'string'\n ? node?.nodeType === 3\n : node && matches(node, child, child.tag === 'svg' ? SVG_NS : ns)\n ) {\n if (typeof child === 'string') {\n if ((node as Text).data !== child) (node as Text).data = child\n rendered.set(node as Node, child)\n } else {\n hydrateElement(node as Element, child)\n }\n node = next\n } else {\n const created = createNode(child, ns, el.ownerDocument)\n if (created) el.insertBefore(created, node)\n }\n }\n while (node) {\n const extra: Node = node\n node = node.nextSibling\n el.removeChild(extra)\n }\n rendered.set(el, vnode)\n}\n\n/**\n * Hydrate `el` for the root `vnode` when it is foreign markup (not rendered\n * here) with the root's tag in namespace `ns`. Returns whether it did.\n */\nexport function hydrate(el: Element, vnode: VNode, ns: string): boolean {\n if (rendered.has(el) || !matches(el, vnode, ns)) return false\n hydrateElement(el, vnode)\n return true\n}\n"],"mappings":";;;AAIA,SAAS,QAAQ,MAAY,OAAc,IAA6B;CACtE,OACE,KAAK,aAAa,KACjB,KAAiB,cAAc,MAAM,OACrC,KAAiB,iBAAiB;AAEvC;;;;;;;;AASA,SAAgB,eAAe,IAAa,OAAoB;CAE9D,MAAM,UAAiB,CAAC;CACxB,KAAK,MAAM,QAAQ,GAAG,kBAAkB,GAAG,QAAQ,QAAQ,GAAG,aAAa,IAAI;CAE/E,IAAI,QAAQ,OAAO,QAAQ,QAAQ;CACnC,WAAW,IAAI,SAAS,MAAM,KAAK;CAInC,MAAM,QAAQ,MAAM,SAAS,MAAM,UAAU,OAAO,UAAU,QAAQ;CACtE,KAAK,MAAM,QAAQ,MAAM,KAAK,GAAG,UAAU,GACzC,IAAI,KAAK,aAAa,KAAM,CAAC,SAAS,KAAK,aAAa,GAAI,GAAG,YAAY,IAAI;CAGjF,MAAM,KAAK,eAAe,EAAE;CAC5B,IAAI,OAAoB,GAAG;CAC3B,KAAK,MAAM,SAAS,MAAM,UAAU;EAClC,MAAM,OAAoB,OAAO,KAAK,cAAc;EACpD,IACE,OAAO,UAAU,WACb,MAAM,aAAa,IACnB,QAAQ,QAAQ,MAAM,OAAO,MAAM,QAAQ,QAAA,+BAAiB,EAAE,GAClE;GACA,IAAI,OAAO,UAAU,UAAU;IAC7B,IAAK,KAAc,SAAS,OAAO,KAAe,OAAO;IACzD,SAAS,IAAI,MAAc,KAAK;GAClC,OACE,eAAe,MAAiB,KAAK;GAEvC,OAAO;EACT,OAAO;GACL,MAAM,UAAU,WAAW,OAAO,IAAI,GAAG,aAAa;GACtD,IAAI,SAAS,GAAG,aAAa,SAAS,IAAI;EAC5C;CACF;CACA,OAAO,MAAM;EACX,MAAM,QAAc;EACpB,OAAO,KAAK;EACZ,GAAG,YAAY,KAAK;CACtB;CACA,SAAS,IAAI,IAAI,KAAK;AACxB;;;;;AAMA,SAAgB,QAAQ,IAAa,OAAc,IAAqB;CACtE,IAAI,SAAS,IAAI,EAAE,KAAK,CAAC,QAAQ,IAAI,OAAO,EAAE,GAAG,OAAO;CACxD,eAAe,IAAI,KAAK;CACxB,OAAO;AACT"}
|
package/dist/hydrate.cjs
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_features = require("./features-BclHgg2W.cjs");
|
|
3
|
+
const require_hydrate = require("./hydrate-CxwTXDqO.cjs");
|
|
4
|
+
//#region src/hydrate.ts
|
|
5
|
+
/**
|
|
6
|
+
* Standalone entry: `import '@tabler/charts/hydrate'` lets a chart take over
|
|
7
|
+
* server-rendered markup node by node instead of replacing it.
|
|
8
|
+
*/
|
|
9
|
+
require_features.register({ hydrate: require_hydrate.hydrate });
|
|
10
|
+
//#endregion
|
|
11
|
+
exports.hydrate = require_hydrate.hydrate;
|
|
12
|
+
|
|
13
|
+
//# sourceMappingURL=hydrate.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hydrate.cjs","names":["register"],"sources":["../src/hydrate.ts"],"sourcesContent":["/**\n * Standalone entry: `import '@tabler/charts/hydrate'` lets a chart take over\n * server-rendered markup node by node instead of replacing it.\n */\nimport { register } from './features.ts'\nimport { hydrate } from './render/hydrate.ts'\n\nregister({ hydrate })\n\nexport { hydrate }\n"],"mappings":";;;;;;;;AAOAA,iBAAAA,SAAS,EAAE,SAAA,gBAAA,QAAQ,CAAC"}
|
package/dist/hydrate.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { i as register } from "./features-wASyHGic.js";
|
|
2
|
+
import { t as hydrate } from "./hydrate-DDNIHYv_.js";
|
|
3
|
+
//#region src/hydrate.ts
|
|
4
|
+
/**
|
|
5
|
+
* Standalone entry: `import '@tabler/charts/hydrate'` lets a chart take over
|
|
6
|
+
* server-rendered markup node by node instead of replacing it.
|
|
7
|
+
*/
|
|
8
|
+
register({ hydrate });
|
|
9
|
+
//#endregion
|
|
10
|
+
export { hydrate };
|
|
11
|
+
|
|
12
|
+
//# sourceMappingURL=hydrate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hydrate.js","names":[],"sources":["../src/hydrate.ts"],"sourcesContent":["/**\n * Standalone entry: `import '@tabler/charts/hydrate'` lets a chart take over\n * server-rendered markup node by node instead of replacing it.\n */\nimport { register } from './features.ts'\nimport { hydrate } from './render/hydrate.ts'\n\nregister({ hydrate })\n\nexport { hydrate }\n"],"mappings":";;;;;;;AAOA,SAAS,EAAE,QAAQ,CAAC"}
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_layout = require("./layout-CtMBhNd9.cjs");
|
|
3
|
+
const require_vnode = require("./vnode-CkQ27Cxe.cjs");
|
|
4
|
+
const require_format = require("./format-B0yKXBTH.cjs");
|
|
5
|
+
const require_cartesian = require("./cartesian-BoDfgBCV.cjs");
|
|
6
|
+
const require_features = require("./features-BclHgg2W.cjs");
|
|
7
|
+
const require_extent = require("./extent-DsFWvAHJ.cjs");
|
|
8
|
+
const require_annotations = require("./annotations-DpETO8dE.cjs");
|
|
9
|
+
const require_dates = require("./dates-Btm7Zm6W.cjs");
|
|
10
|
+
const require_log_axis = require("./log-axis-83rSpvL5.cjs");
|
|
11
|
+
const require_chart = require("./chart-CowF_lWY.cjs");
|
|
12
|
+
const require_dom = require("./dom-CLF868Qs.cjs");
|
|
13
|
+
const require_patterns = require("./patterns-LfcQAWCy.cjs");
|
|
14
|
+
const require_point_shapes = require("./point-shapes-CGl4dugc.cjs");
|
|
15
|
+
const require_time_axis = require("./time-axis-VSX34_Tb.cjs");
|
|
16
|
+
const require_value_labels = require("./value-labels-B0WJoJ7x.cjs");
|
|
17
|
+
const require_hydrate = require("./hydrate-CxwTXDqO.cjs");
|
|
18
|
+
const require_morph = require("./morph-CqYDu1bY.cjs");
|
|
19
|
+
const require_decimate = require("./decimate-tLhDk1ys.cjs");
|
|
20
|
+
const require_fade = require("./fade-Cs74puQS.cjs");
|
|
21
|
+
const require_core = require("./core-C7fPm6t7.cjs");
|
|
22
|
+
const require_line = require("./line-fQbtP_jL.cjs");
|
|
23
|
+
const require_area = require("./area-sHCE3pg5.cjs");
|
|
24
|
+
const require_bar = require("./bar-DGuUN3nc.cjs");
|
|
25
|
+
const require_bar$1 = require("./bar-C-7zR2qp.cjs");
|
|
26
|
+
const require_candlestick = require("./candlestick-B5r1w3kc.cjs");
|
|
27
|
+
const require_sweep = require("./sweep-Duowaput.cjs");
|
|
28
|
+
const require_gauge = require("./gauge-CEfkWXSu.cjs");
|
|
29
|
+
const require_heatmap = require("./heatmap-BK18EBgJ.cjs");
|
|
30
|
+
const require_pie = require("./pie-C1Pa6W_l.cjs");
|
|
31
|
+
const require_radar = require("./radar-CoGUNNSb.cjs");
|
|
32
|
+
const require_sankey = require("./sankey-Bacx4fVe.cjs");
|
|
33
|
+
const require_scatter = require("./scatter-DgMN9zRy.cjs");
|
|
34
|
+
const require_sparkline = require("./sparkline-BS9-hltA.cjs");
|
|
35
|
+
const require_export_chart = require("./export-chart-BhhYgksr.cjs");
|
|
36
|
+
//#region src/chart-default.ts
|
|
37
|
+
/**
|
|
38
|
+
* A chart with every built-in plugin installed: hover highlight, legend,
|
|
39
|
+
* tooltip, data table and keyboard navigation. Each can be switched off in
|
|
40
|
+
* the config (`tooltip: false`, …). For the smallest bundle, use the bare
|
|
41
|
+
* `Chart` from `@tabler/charts/core` and pick plugins explicitly.
|
|
42
|
+
*
|
|
43
|
+
* ```ts
|
|
44
|
+
* const chart = new Chart('#sales', { type: line, data })
|
|
45
|
+
* ```
|
|
46
|
+
*/
|
|
47
|
+
var Chart = class extends require_chart.Chart {
|
|
48
|
+
constructor(target, config) {
|
|
49
|
+
super(target, config, require_core.defaultPlugins());
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
//#endregion
|
|
53
|
+
//#region src/chart-types.ts
|
|
54
|
+
/**
|
|
55
|
+
* Every built-in chart type by its name, for charts declared in markup
|
|
56
|
+
* (`<tabler-chart type="line">`, `data-tc-chart="line"`). Importing it
|
|
57
|
+
* brings every type along: code that knows its types imports them directly.
|
|
58
|
+
*/
|
|
59
|
+
const types = {
|
|
60
|
+
line: require_line.line,
|
|
61
|
+
area: require_area.area,
|
|
62
|
+
bar: require_bar$1.bar,
|
|
63
|
+
pie: require_pie.pie,
|
|
64
|
+
donut: require_pie.donut,
|
|
65
|
+
scatter: require_scatter.scatter,
|
|
66
|
+
sparkline: require_sparkline.sparkline,
|
|
67
|
+
gauge: require_gauge.gauge,
|
|
68
|
+
heatmap: require_heatmap.heatmap,
|
|
69
|
+
candlestick: require_candlestick.candlestick,
|
|
70
|
+
radar: require_radar.radar,
|
|
71
|
+
sankey: require_sankey.sankey
|
|
72
|
+
};
|
|
73
|
+
//#endregion
|
|
74
|
+
//#region src/index.ts
|
|
75
|
+
/**
|
|
76
|
+
* `@tabler/charts`: everything from `@tabler/charts/core`, with a `Chart`
|
|
77
|
+
* that installs the built-in plugins (tooltip, legend, keyboard, …) and
|
|
78
|
+
* every optional feature registered (time and log axes, decimation,
|
|
79
|
+
* annotations, pattern fills, value labels, point shapes). The one exception
|
|
80
|
+
* is the `download` menu's saver: `import '@tabler/charts/export'` adds it,
|
|
81
|
+
* so charts that never offer a download do not carry the export code.
|
|
82
|
+
*/
|
|
83
|
+
require_features.register({
|
|
84
|
+
time: {
|
|
85
|
+
scale: require_time_axis.time,
|
|
86
|
+
points: require_time_axis.timePointScale,
|
|
87
|
+
axis: require_time_axis.timeAxis
|
|
88
|
+
},
|
|
89
|
+
dates: require_dates.dateLabels,
|
|
90
|
+
log: {
|
|
91
|
+
scale: require_log_axis.log,
|
|
92
|
+
domain: require_log_axis.logDomain,
|
|
93
|
+
ticks: require_log_axis.logTicks
|
|
94
|
+
},
|
|
95
|
+
decimate: require_decimate.lttbIndices,
|
|
96
|
+
line: {
|
|
97
|
+
linePath: require_fade.linePath,
|
|
98
|
+
areaPath: require_fade.areaPath
|
|
99
|
+
},
|
|
100
|
+
annotations: {
|
|
101
|
+
layers: require_annotations.annotationLayers,
|
|
102
|
+
values: require_annotations.annotationValues
|
|
103
|
+
},
|
|
104
|
+
patterns: require_patterns.patternFills,
|
|
105
|
+
"point-shapes": require_point_shapes.markerPath,
|
|
106
|
+
hydrate: require_hydrate.hydrate,
|
|
107
|
+
morph: require_morph.morph
|
|
108
|
+
});
|
|
109
|
+
require_features.addPost(require_point_shapes.shapesStep);
|
|
110
|
+
require_features.addPost(require_value_labels.labelsStep);
|
|
111
|
+
//#endregion
|
|
112
|
+
exports.Chart = Chart;
|
|
113
|
+
exports.LINE_HEIGHT = require_layout.LINE_HEIGHT;
|
|
114
|
+
exports.VERSION = require_core.VERSION;
|
|
115
|
+
exports.arcCentroid = require_sweep.arcCentroid;
|
|
116
|
+
exports.arcPathStable = require_sweep.arcPathStable;
|
|
117
|
+
exports.area = require_area.area;
|
|
118
|
+
exports.areaPath = require_fade.areaPath;
|
|
119
|
+
exports.axis = require_cartesian.axis;
|
|
120
|
+
exports.axisSize = require_cartesian.axisSize;
|
|
121
|
+
exports.band = require_cartesian.band;
|
|
122
|
+
exports.bandTicks = require_cartesian.bandTicks;
|
|
123
|
+
exports.bar = require_bar$1.bar;
|
|
124
|
+
exports.barPath = require_bar.barPath;
|
|
125
|
+
exports.buildChart = require_chart.buildChart;
|
|
126
|
+
exports.cancel = require_chart.cancel;
|
|
127
|
+
exports.candlestick = require_candlestick.candlestick;
|
|
128
|
+
exports.categoryInteraction = require_cartesian.categoryInteraction;
|
|
129
|
+
exports.chartEvents = require_chart.chartEvents;
|
|
130
|
+
exports.chartLabel = require_chart.chartLabel;
|
|
131
|
+
exports.chartToString = require_chart.chartToString;
|
|
132
|
+
exports.dataTable = require_core.dataTable;
|
|
133
|
+
exports.defaultHidden = require_chart.defaultHidden;
|
|
134
|
+
exports.defaultPlugins = require_core.defaultPlugins;
|
|
135
|
+
exports.describeHit = require_core.describeHit;
|
|
136
|
+
exports.domainOf = require_cartesian.domainOf;
|
|
137
|
+
exports.donut = require_pie.donut;
|
|
138
|
+
exports.download = require_core.download;
|
|
139
|
+
exports.downloadChart = require_export_chart.downloadChart;
|
|
140
|
+
exports.escapeAttr = require_chart.escapeAttr;
|
|
141
|
+
exports.escapeText = require_chart.escapeText;
|
|
142
|
+
exports.estimateTextWidth = require_layout.estimateTextWidth;
|
|
143
|
+
exports.exportImage = require_export_chart.exportImage;
|
|
144
|
+
exports.exportSVG = require_export_chart.exportSVG;
|
|
145
|
+
exports.extent = require_extent.extent;
|
|
146
|
+
exports.feature = require_features.feature;
|
|
147
|
+
exports.features = require_features.features;
|
|
148
|
+
exports.flush = require_chart.flush;
|
|
149
|
+
exports.formatDate = require_format.formatDate;
|
|
150
|
+
exports.formatDetail = require_format.formatDetail;
|
|
151
|
+
exports.formatNumber = require_format.formatNumber;
|
|
152
|
+
exports.formatTicks = require_format.formatTicks;
|
|
153
|
+
exports.gauge = require_gauge.gauge;
|
|
154
|
+
exports.getDateFormat = require_format.getDateFormat;
|
|
155
|
+
exports.getNumberFormat = require_format.getNumberFormat;
|
|
156
|
+
exports.grid = require_cartesian.grid;
|
|
157
|
+
exports.h = require_vnode.h;
|
|
158
|
+
exports.hbarPath = require_bar.hbarPath;
|
|
159
|
+
exports.heatmap = require_heatmap.heatmap;
|
|
160
|
+
exports.highlight = require_core.highlight;
|
|
161
|
+
exports.hitAnchor = require_core.hitAnchor;
|
|
162
|
+
exports.hoverOverlay = require_core.hoverOverlay;
|
|
163
|
+
exports.hoverUnderlay = require_core.hoverUnderlay;
|
|
164
|
+
exports.innerRect = require_layout.innerRect;
|
|
165
|
+
exports.insets = require_layout.insets;
|
|
166
|
+
exports.keyboard = require_core.keyboard;
|
|
167
|
+
exports.legend = require_core.legend;
|
|
168
|
+
exports.legendContent = require_chart.legendContent;
|
|
169
|
+
exports.line = require_line.line;
|
|
170
|
+
exports.linePath = require_fade.linePath;
|
|
171
|
+
exports.linear = require_cartesian.linear;
|
|
172
|
+
exports.linearTicks = require_cartesian.linearTicks;
|
|
173
|
+
exports.log = require_log_axis.log;
|
|
174
|
+
exports.lttb = require_decimate.lttb;
|
|
175
|
+
exports.lttbIndices = require_decimate.lttbIndices;
|
|
176
|
+
exports.niceDomain = require_cartesian.niceDomain;
|
|
177
|
+
exports.normalizeClass = require_vnode.normalizeClass;
|
|
178
|
+
exports.normalizeStyle = require_vnode.normalizeStyle;
|
|
179
|
+
exports.padAngleForGap = require_sweep.padAngleForGap;
|
|
180
|
+
exports.pie = require_pie.pie;
|
|
181
|
+
exports.placeTooltip = require_core.placeTooltip;
|
|
182
|
+
exports.point = require_cartesian.point;
|
|
183
|
+
exports.pointer = require_core.pointer;
|
|
184
|
+
exports.radar = require_radar.radar;
|
|
185
|
+
exports.register = require_features.register;
|
|
186
|
+
exports.render = require_dom.render;
|
|
187
|
+
exports.renderContext = require_chart.renderContext;
|
|
188
|
+
exports.renderToString = require_chart.renderToString;
|
|
189
|
+
exports.resolveLegend = require_chart.resolveLegend;
|
|
190
|
+
exports.resolveSize = require_chart.resolveSize;
|
|
191
|
+
exports.sankey = require_sankey.sankey;
|
|
192
|
+
exports.scatter = require_scatter.scatter;
|
|
193
|
+
exports.schedule = require_chart.schedule;
|
|
194
|
+
exports.seriesKey = require_cartesian.seriesKey;
|
|
195
|
+
exports.seriesLegend = require_cartesian.seriesLegend;
|
|
196
|
+
exports.seriesTable = require_cartesian.seriesTable;
|
|
197
|
+
exports.sparkline = require_sparkline.sparkline;
|
|
198
|
+
exports.stepPrecision = require_format.stepPrecision;
|
|
199
|
+
exports.sync = require_core.sync;
|
|
200
|
+
exports.tableContent = require_core.tableContent;
|
|
201
|
+
exports.thinTicks = require_cartesian.thinTicks;
|
|
202
|
+
exports.tickIncrement = require_cartesian.tickIncrement;
|
|
203
|
+
exports.tickStep = require_cartesian.tickStep;
|
|
204
|
+
exports.ticks = require_cartesian.ticks;
|
|
205
|
+
exports.time = require_time_axis.time;
|
|
206
|
+
exports.timePointScale = require_time_axis.timePointScale;
|
|
207
|
+
exports.tooltip = require_core.tooltip;
|
|
208
|
+
exports.tooltipContent = require_core.tooltipContent;
|
|
209
|
+
exports.types = types;
|
|
210
|
+
|
|
211
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["CoreChart","defaultPlugins","register","time","timePointScale","timeAxis","dateLabels","log","logDomain","logTicks","lttbIndices","annotationLayers","annotationValues","patternFills","markerPath","addPost","shapesStep","labelsStep"],"sources":["../src/chart-default.ts","../src/chart-types.ts","../src/index.ts"],"sourcesContent":["import { type ChartConfig, Chart as CoreChart } from './chart.ts'\nimport { defaultPlugins } from './plugins/index.ts'\n\n/**\n * A chart with every built-in plugin installed: hover highlight, legend,\n * tooltip, data table and keyboard navigation. Each can be switched off in\n * the config (`tooltip: false`, …). For the smallest bundle, use the bare\n * `Chart` from `@tabler/charts/core` and pick plugins explicitly.\n *\n * ```ts\n * const chart = new Chart('#sales', { type: line, data })\n * ```\n */\nexport class Chart<O extends object = object> extends CoreChart<O> {\n constructor(target: Element | string, config: ChartConfig<O>) {\n super(target, config, defaultPlugins())\n }\n}\n","import type { ChartType } from './chart.ts'\nimport { area } from './charts/area.ts'\nimport { bar } from './charts/bar.ts'\nimport { candlestick } from './charts/candlestick.ts'\nimport { gauge } from './charts/gauge.ts'\nimport { heatmap } from './charts/heatmap.ts'\nimport { line } from './charts/line.ts'\nimport { donut, pie } from './charts/pie.ts'\nimport { radar } from './charts/radar.ts'\nimport { sankey } from './charts/sankey.ts'\nimport { scatter } from './charts/scatter.ts'\nimport { sparkline } from './charts/sparkline.ts'\n\n/**\n * Every built-in chart type by its name, for charts declared in markup\n * (`<tabler-chart type=\"line\">`, `data-tc-chart=\"line\"`). Importing it\n * brings every type along: code that knows its types imports them directly.\n */\nexport const types: Readonly<Record<string, ChartType<never>>> = {\n line,\n area,\n bar,\n pie,\n donut,\n scatter,\n sparkline,\n gauge,\n heatmap,\n candlestick,\n radar,\n sankey,\n} as Record<string, ChartType<never>>\n","/**\n * `@tabler/charts`: everything from `@tabler/charts/core`, with a `Chart`\n * that installs the built-in plugins (tooltip, legend, keyboard, …) and\n * every optional feature registered (time and log axes, decimation,\n * annotations, pattern fills, value labels, point shapes). The one exception\n * is the `download` menu's saver: `import '@tabler/charts/export'` adds it,\n * so charts that never offer a download do not carry the export code.\n */\n\nimport { annotationLayers, annotationValues } from './charts/annotations.ts'\nimport { dateLabels } from './charts/dates.ts'\nimport { logDomain, logTicks } from './charts/log-axis.ts'\nimport { patternFills } from './charts/patterns.ts'\nimport { markerPath, shapesStep } from './charts/point-shapes.ts'\nimport { timeAxis } from './charts/time-axis.ts'\nimport { labelsStep } from './charts/value-labels.ts'\nimport { addPost, register } from './features.ts'\nimport { hydrate } from './render/hydrate.ts'\nimport { morph } from './render/morph.ts'\nimport { log } from './scales/log.ts'\nimport { time, timePointScale } from './scales/time.ts'\nimport { lttb, lttbIndices } from './shapes/decimate.ts'\nimport { areaPath, linePath } from './shapes/path.ts'\n\n// Registered here, in the entry itself, so no bundler can shake it away.\nregister({\n time: { scale: time, points: timePointScale, axis: timeAxis },\n dates: dateLabels,\n log: { scale: log, domain: logDomain, ticks: logTicks },\n decimate: lttbIndices,\n line: { linePath, areaPath },\n annotations: { layers: annotationLayers, values: annotationValues },\n patterns: patternFills,\n 'point-shapes': markerPath,\n hydrate,\n morph,\n})\n\n// Steps that finish the content: shapes first, then the labels over them.\naddPost(shapesStep)\naddPost(labelsStep)\n\nexport { Chart } from './chart-default.ts'\nexport { types } from './chart-types.ts'\nexport * from './core.ts'\nexport type { DownloadOptions, ExportOptions, ExportTarget, ImageOptions } from './export-chart.ts'\nexport { downloadChart, exportImage, exportSVG } from './export-chart.ts'\nexport type { LogScaleOptions } from './scales/log.ts'\nexport type { TimeScale, TimeScaleOptions, TimeValue } from './scales/time.ts'\nexport { log, lttb, lttbIndices, time, timePointScale }\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAaA,IAAa,QAAb,cAAsDA,cAAAA,MAAa;CACjE,YAAY,QAA0B,QAAwB;EAC5D,MAAM,QAAQ,QAAQC,aAAAA,eAAe,CAAC;CACxC;AACF;;;;;;;;ACCA,MAAa,QAAoD;CAC/D,MAAA,aAAA;CACA,MAAA,aAAA;CACA,KAAA,cAAA;CACA,KAAA,YAAA;CACA,OAAA,YAAA;CACA,SAAA,gBAAA;CACA,WAAA,kBAAA;CACA,OAAA,cAAA;CACA,SAAA,gBAAA;CACA,aAAA,oBAAA;CACA,OAAA,cAAA;CACA,QAAA,eAAA;AACF;;;;;;;;;;;ACNAC,iBAAAA,SAAS;CACP,MAAM;EAAE,OAAOC,kBAAAA;EAAM,QAAQC,kBAAAA;EAAgB,MAAMC,kBAAAA;CAAS;CAC5D,OAAOC,cAAAA;CACP,KAAK;EAAE,OAAOC,iBAAAA;EAAK,QAAQC,iBAAAA;EAAW,OAAOC,iBAAAA;CAAS;CACtD,UAAUC,iBAAAA;CACV,MAAM;EAAE,UAAA,aAAA;EAAU,UAAA,aAAA;CAAS;CAC3B,aAAa;EAAE,QAAQC,oBAAAA;EAAkB,QAAQC,oBAAAA;CAAiB;CAClE,UAAUC,iBAAAA;CACV,gBAAgBC,qBAAAA;CAChB,SAAA,gBAAA;CACA,OAAA,cAAA;AACF,CAAC;AAGDC,iBAAAA,QAAQC,qBAAAA,UAAU;AAClBD,iBAAAA,QAAQE,qBAAAA,UAAU"}
|
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { a as InsetsInput, c as estimateTextWidth, i as Insets, l as innerRect, o as LINE_HEIGHT, s as Rect, t as Annotation, u as insets } from "./annotations-lyt0I3HU.cjs";
|
|
2
|
+
import { a as point, i as band, n as BandScale, r as BandScaleOptions, t as BandKey } from "./band-DTcNDAFO.cjs";
|
|
3
|
+
import { a as ClassValue, c as StyleValue, d as normalizeClass, f as normalizeStyle, i as ChildInput, l as VNode, n as Attrs, o as Key, r as Child, s as Props, t as AttrValue, u as h } from "./vnode-BUflsBsa.cjs";
|
|
4
|
+
import { $ as CartesianOptions, B as downloadChart, C as DownloadOption, Ct as HitTester, D as ChartPlugin, E as BeforeRenderState, F as register, H as exportSVG, I as DownloadOptions, J as LegendItem, L as ExportOptions, M as Features, N as feature, O as PluginInstance, P as features, Q as CartesianData, R as ExportTarget, S as DownloadMenuOptions, St as HitItem, T as AfterRenderState, V as exportImage, X as defaultHidden, Y as LegendOptions, Z as legendContent, _ as TooltipPlacement, _t as thinTicks, a as ChartType, at as domainOf, b as tooltipContent, bt as tableContent, c as Size, ct as seriesTable, d as chartLabel, dt as LinearTicksOptions, et as CategoryAxisOptions, f as chartToString, ft as Tick, g as TooltipOptions, gt as linearTicks, h as resolveSize, ht as bandTicks, i as ChartEvents, it as categoryInteraction, l as buildChart, lt as AxisOptions, m as resolveLegend, mt as axisSize, n as Chart$1, nt as Series, o as RenderContext, ot as seriesKey, p as renderContext, pt as axis, r as ChartConfig, rt as ValueAxisOptions, s as ResolvedLegend, st as seriesLegend, t as BaseOptions, tt as Label, u as chartEvents, ut as AxisPosition, v as hitAnchor, vt as DataTable, w as download, wt as Interaction, x as DownloadFormat, xt as Hit, y as placeTooltip, yt as describeHit, z as ImageOptions } from "./chart-Qa417fJo.cjs";
|
|
5
|
+
import { a as timePointScale, c as NumberFormat, d as formatDetail, f as formatNumber, g as stepPrecision, h as getNumberFormat, i as time, l as NumberFormatOptions, m as getDateFormat, n as TimeScaleOptions, o as DateFormat, p as formatTicks, r as TimeValue, s as Locale, t as TimeScale, u as formatDate } from "./time-CNVnt-B2.cjs";
|
|
6
|
+
import { a as linear, i as LinearScaleOptions, n as log, r as LinearScale, t as LogScaleOptions } from "./log-CaofN3-n.cjs";
|
|
7
|
+
import { A as arcCentroid, C as keyboard, D as GridOptions, E as hoverUnderlay, M as padAngleForGap, O as grid, S as legend, T as hoverOverlay, _ as defaultPlugins, a as flush, b as sync, c as tickIncrement, d as extent, f as RenderToStringOptions, g as render, h as renderToString, i as cancel, j as arcPathStable, k as ArcOptions, l as tickStep, m as escapeText, n as barPath, o as schedule, p as escapeAttr, r as hbarPath, s as niceDomain, t as VERSION, u as ticks, v as tooltip, w as highlight, x as pointer, y as dataTable } from "./core-CnGFKojH.cjs";
|
|
8
|
+
import { a as linePath, i as areaPath, n as PathOptions, r as Point, t as Curve } from "./path-CwB28da0.cjs";
|
|
9
|
+
import { n as line, t as LineOptions } from "./line-CMDGH6q5.cjs";
|
|
10
|
+
import { n as area, t as AreaOptions } from "./area-BFvkc-ZM.cjs";
|
|
11
|
+
import { n as bar, t as BarOptions } from "./bar-a0h9KC8A.cjs";
|
|
12
|
+
import { n as CandlestickOptions, r as candlestick, t as Candle } from "./candlestick-BKdPyorY.cjs";
|
|
13
|
+
import { n as GaugeRing, r as gauge, t as GaugeOptions } from "./gauge-Cu_OFxBd.cjs";
|
|
14
|
+
import { n as HeatmapRange, r as heatmap, t as HeatmapOptions } from "./heatmap-BwS-y0c6.cjs";
|
|
15
|
+
import { i as pie, n as PieSlice, r as donut, t as PieOptions } from "./pie-DnQQmxkk.cjs";
|
|
16
|
+
import { n as RadialAxisOptions, r as radar, t as RadarOptions } from "./radar-BB13CGmq.cjs";
|
|
17
|
+
import { a as sankey, i as SankeyOptions, n as SankeyLink, r as SankeyNode, t as SankeyData } from "./sankey-B9JYnx7e.cjs";
|
|
18
|
+
import { i as scatter, n as ScatterPoint, r as ScatterSeries, t as ScatterOptions } from "./scatter-DrJ8xYz4.cjs";
|
|
19
|
+
import { n as sparkline, t as SparklineOptions } from "./sparkline-BG13V4Pz.cjs";
|
|
20
|
+
import { n as lttbIndices, t as lttb } from "./decimate-CNSpgGa5.cjs";
|
|
21
|
+
//#region src/chart-default.d.ts
|
|
22
|
+
/**
|
|
23
|
+
* A chart with every built-in plugin installed: hover highlight, legend,
|
|
24
|
+
* tooltip, data table and keyboard navigation. Each can be switched off in
|
|
25
|
+
* the config (`tooltip: false`, …). For the smallest bundle, use the bare
|
|
26
|
+
* `Chart` from `@tabler/charts/core` and pick plugins explicitly.
|
|
27
|
+
*
|
|
28
|
+
* ```ts
|
|
29
|
+
* const chart = new Chart('#sales', { type: line, data })
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
export declare class Chart<O extends object = object> extends Chart$1<O> {
|
|
33
|
+
constructor(target: Element | string, config: ChartConfig<O>);
|
|
34
|
+
}
|
|
35
|
+
//#endregion
|
|
36
|
+
//#region src/chart-types.d.ts
|
|
37
|
+
/**
|
|
38
|
+
* Every built-in chart type by its name, for charts declared in markup
|
|
39
|
+
* (`<tabler-chart type="line">`, `data-tc-chart="line"`). Importing it
|
|
40
|
+
* brings every type along: code that knows its types imports them directly.
|
|
41
|
+
*/
|
|
42
|
+
export declare const types: Readonly<Record<string, ChartType<never>>>;
|
|
43
|
+
//#endregion
|
|
44
|
+
export { type AfterRenderState, type Annotation, type ArcOptions, type AreaOptions, type AttrValue, type Attrs, type AxisOptions, type AxisPosition, type BandKey, type BandScale, type BandScaleOptions, type BarOptions, type BaseOptions, type BeforeRenderState, type Candle, type CandlestickOptions, type CartesianData, type CartesianOptions, type CategoryAxisOptions, type ChartConfig, type ChartEvents, type ChartPlugin, type ChartType, type Child, type ChildInput, type ClassValue, type Curve, type DataTable, type DateFormat, type DownloadFormat, type DownloadMenuOptions, type DownloadOption, type DownloadOptions, type ExportOptions, type ExportTarget, type Features, type GaugeOptions, type GaugeRing, type GridOptions, type HeatmapOptions, type HeatmapRange, type Hit, type HitItem, type HitTester, type ImageOptions, type Insets, type InsetsInput, type Interaction, type Key, LINE_HEIGHT, type Label, type LegendItem, type LegendOptions, type LineOptions, type LinearScale, type LinearScaleOptions, type LinearTicksOptions, type Locale, type LogScaleOptions, type NumberFormat, type NumberFormatOptions, type PathOptions, type PieOptions, type PieSlice, type PluginInstance, type Point, type Props, type RadarOptions, type RadialAxisOptions, type Rect, type RenderContext, type RenderToStringOptions, type ResolvedLegend, type SankeyData, type SankeyLink, type SankeyNode, type SankeyOptions, type ScatterOptions, type ScatterPoint, type ScatterSeries, type Series, type Size, type SparklineOptions, type StyleValue, type Tick, type TimeScale, type TimeScaleOptions, type TimeValue, type TooltipOptions, type TooltipPlacement, VERSION, type VNode, type ValueAxisOptions, arcCentroid, arcPathStable, area, areaPath, axis, axisSize, band, bandTicks, bar, barPath, buildChart, cancel, candlestick, categoryInteraction, chartEvents, chartLabel, chartToString, dataTable, defaultHidden, defaultPlugins, describeHit, domainOf, donut, download, downloadChart, escapeAttr, escapeText, estimateTextWidth, exportImage, exportSVG, extent, feature, features, flush, formatDate, formatDetail, formatNumber, formatTicks, gauge, getDateFormat, getNumberFormat, grid, h, hbarPath, heatmap, highlight, hitAnchor, hoverOverlay, hoverUnderlay, innerRect, insets, keyboard, legend, legendContent, line, linePath, linear, linearTicks, log, lttb, lttbIndices, niceDomain, normalizeClass, normalizeStyle, padAngleForGap, pie, placeTooltip, point, pointer, radar, register, render, renderContext, renderToString, resolveLegend, resolveSize, sankey, scatter, schedule, seriesKey, seriesLegend, seriesTable, sparkline, stepPrecision, sync, tableContent, thinTicks, tickIncrement, tickStep, ticks, time, timePointScale, tooltip, tooltipContent };
|
|
45
|
+
//# sourceMappingURL=index.d.cts.map
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { a as InsetsInput, c as estimateTextWidth, i as Insets, l as innerRect, o as LINE_HEIGHT, s as Rect, t as Annotation, u as insets } from "./annotations-Bp7HwtF5.js";
|
|
2
|
+
import { a as point, i as band, n as BandScale, r as BandScaleOptions, t as BandKey } from "./band-DTcNDAFO.js";
|
|
3
|
+
import { a as ClassValue, c as StyleValue, d as normalizeClass, f as normalizeStyle, i as ChildInput, l as VNode, n as Attrs, o as Key, r as Child, s as Props, t as AttrValue, u as h } from "./vnode-BUflsBsa.js";
|
|
4
|
+
import { $ as CartesianOptions, B as downloadChart, C as DownloadOption, Ct as HitTester, D as ChartPlugin, E as BeforeRenderState, F as register, H as exportSVG, I as DownloadOptions, J as LegendItem, L as ExportOptions, M as Features, N as feature, O as PluginInstance, P as features, Q as CartesianData, R as ExportTarget, S as DownloadMenuOptions, St as HitItem, T as AfterRenderState, V as exportImage, X as defaultHidden, Y as LegendOptions, Z as legendContent, _ as TooltipPlacement, _t as thinTicks, a as ChartType, at as domainOf, b as tooltipContent, bt as tableContent, c as Size, ct as seriesTable, d as chartLabel, dt as LinearTicksOptions, et as CategoryAxisOptions, f as chartToString, ft as Tick, g as TooltipOptions, gt as linearTicks, h as resolveSize, ht as bandTicks, i as ChartEvents, it as categoryInteraction, l as buildChart, lt as AxisOptions, m as resolveLegend, mt as axisSize, n as Chart$1, nt as Series, o as RenderContext, ot as seriesKey, p as renderContext, pt as axis, r as ChartConfig, rt as ValueAxisOptions, s as ResolvedLegend, st as seriesLegend, t as BaseOptions, tt as Label, u as chartEvents, ut as AxisPosition, v as hitAnchor, vt as DataTable, w as download, wt as Interaction, x as DownloadFormat, xt as Hit, y as placeTooltip, yt as describeHit, z as ImageOptions } from "./chart-iJGxMz9z.js";
|
|
5
|
+
import { a as timePointScale, c as NumberFormat, d as formatDetail, f as formatNumber, g as stepPrecision, h as getNumberFormat, i as time, l as NumberFormatOptions, m as getDateFormat, n as TimeScaleOptions, o as DateFormat, p as formatTicks, r as TimeValue, s as Locale, t as TimeScale, u as formatDate } from "./time-CHjiY9Q4.js";
|
|
6
|
+
import { a as linear, i as LinearScaleOptions, n as log, r as LinearScale, t as LogScaleOptions } from "./log-CaofN3-n.js";
|
|
7
|
+
import { A as arcCentroid, C as keyboard, D as GridOptions, E as hoverUnderlay, M as padAngleForGap, O as grid, S as legend, T as hoverOverlay, _ as defaultPlugins, a as flush, b as sync, c as tickIncrement, d as extent, f as RenderToStringOptions, g as render, h as renderToString, i as cancel, j as arcPathStable, k as ArcOptions, l as tickStep, m as escapeText, n as barPath, o as schedule, p as escapeAttr, r as hbarPath, s as niceDomain, t as VERSION, u as ticks, v as tooltip, w as highlight, x as pointer, y as dataTable } from "./core-CjgbhS_v.js";
|
|
8
|
+
import { a as linePath, i as areaPath, n as PathOptions, r as Point, t as Curve } from "./path-CwB28da0.js";
|
|
9
|
+
import { n as line, t as LineOptions } from "./line-D5kb8e6w.js";
|
|
10
|
+
import { n as area, t as AreaOptions } from "./area-DaO4MQl4.js";
|
|
11
|
+
import { n as bar, t as BarOptions } from "./bar-DdsDxk3W.js";
|
|
12
|
+
import { n as CandlestickOptions, r as candlestick, t as Candle } from "./candlestick-BnUG1SGi.js";
|
|
13
|
+
import { n as GaugeRing, r as gauge, t as GaugeOptions } from "./gauge-Cu9jttC0.js";
|
|
14
|
+
import { n as HeatmapRange, r as heatmap, t as HeatmapOptions } from "./heatmap-PhLPXIg1.js";
|
|
15
|
+
import { i as pie, n as PieSlice, r as donut, t as PieOptions } from "./pie-B8UlOZiq.js";
|
|
16
|
+
import { n as RadialAxisOptions, r as radar, t as RadarOptions } from "./radar-pFI6fvOq.js";
|
|
17
|
+
import { a as sankey, i as SankeyOptions, n as SankeyLink, r as SankeyNode, t as SankeyData } from "./sankey-Bm518bqL.js";
|
|
18
|
+
import { i as scatter, n as ScatterPoint, r as ScatterSeries, t as ScatterOptions } from "./scatter-Bl7nasE6.js";
|
|
19
|
+
import { n as sparkline, t as SparklineOptions } from "./sparkline-iWuXbKpd.js";
|
|
20
|
+
import { n as lttbIndices, t as lttb } from "./decimate-BGg9XgF0.js";
|
|
21
|
+
//#region src/chart-default.d.ts
|
|
22
|
+
/**
|
|
23
|
+
* A chart with every built-in plugin installed: hover highlight, legend,
|
|
24
|
+
* tooltip, data table and keyboard navigation. Each can be switched off in
|
|
25
|
+
* the config (`tooltip: false`, …). For the smallest bundle, use the bare
|
|
26
|
+
* `Chart` from `@tabler/charts/core` and pick plugins explicitly.
|
|
27
|
+
*
|
|
28
|
+
* ```ts
|
|
29
|
+
* const chart = new Chart('#sales', { type: line, data })
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
export declare class Chart<O extends object = object> extends Chart$1<O> {
|
|
33
|
+
constructor(target: Element | string, config: ChartConfig<O>);
|
|
34
|
+
}
|
|
35
|
+
//#endregion
|
|
36
|
+
//#region src/chart-types.d.ts
|
|
37
|
+
/**
|
|
38
|
+
* Every built-in chart type by its name, for charts declared in markup
|
|
39
|
+
* (`<tabler-chart type="line">`, `data-tc-chart="line"`). Importing it
|
|
40
|
+
* brings every type along: code that knows its types imports them directly.
|
|
41
|
+
*/
|
|
42
|
+
export declare const types: Readonly<Record<string, ChartType<never>>>;
|
|
43
|
+
//#endregion
|
|
44
|
+
export { type AfterRenderState, type Annotation, type ArcOptions, type AreaOptions, type AttrValue, type Attrs, type AxisOptions, type AxisPosition, type BandKey, type BandScale, type BandScaleOptions, type BarOptions, type BaseOptions, type BeforeRenderState, type Candle, type CandlestickOptions, type CartesianData, type CartesianOptions, type CategoryAxisOptions, type ChartConfig, type ChartEvents, type ChartPlugin, type ChartType, type Child, type ChildInput, type ClassValue, type Curve, type DataTable, type DateFormat, type DownloadFormat, type DownloadMenuOptions, type DownloadOption, type DownloadOptions, type ExportOptions, type ExportTarget, type Features, type GaugeOptions, type GaugeRing, type GridOptions, type HeatmapOptions, type HeatmapRange, type Hit, type HitItem, type HitTester, type ImageOptions, type Insets, type InsetsInput, type Interaction, type Key, LINE_HEIGHT, type Label, type LegendItem, type LegendOptions, type LineOptions, type LinearScale, type LinearScaleOptions, type LinearTicksOptions, type Locale, type LogScaleOptions, type NumberFormat, type NumberFormatOptions, type PathOptions, type PieOptions, type PieSlice, type PluginInstance, type Point, type Props, type RadarOptions, type RadialAxisOptions, type Rect, type RenderContext, type RenderToStringOptions, type ResolvedLegend, type SankeyData, type SankeyLink, type SankeyNode, type SankeyOptions, type ScatterOptions, type ScatterPoint, type ScatterSeries, type Series, type Size, type SparklineOptions, type StyleValue, type Tick, type TimeScale, type TimeScaleOptions, type TimeValue, type TooltipOptions, type TooltipPlacement, VERSION, type VNode, type ValueAxisOptions, arcCentroid, arcPathStable, area, areaPath, axis, axisSize, band, bandTicks, bar, barPath, buildChart, cancel, candlestick, categoryInteraction, chartEvents, chartLabel, chartToString, dataTable, defaultHidden, defaultPlugins, describeHit, domainOf, donut, download, downloadChart, escapeAttr, escapeText, estimateTextWidth, exportImage, exportSVG, extent, feature, features, flush, formatDate, formatDetail, formatNumber, formatTicks, gauge, getDateFormat, getNumberFormat, grid, h, hbarPath, heatmap, highlight, hitAnchor, hoverOverlay, hoverUnderlay, innerRect, insets, keyboard, legend, legendContent, line, linePath, linear, linearTicks, log, lttb, lttbIndices, niceDomain, normalizeClass, normalizeStyle, padAngleForGap, pie, placeTooltip, point, pointer, radar, register, render, renderContext, renderToString, resolveLegend, resolveSize, sankey, scatter, schedule, seriesKey, seriesLegend, seriesTable, sparkline, stepPrecision, sync, tableContent, thinTicks, tickIncrement, tickStep, ticks, time, timePointScale, tooltip, tooltipContent };
|
|
45
|
+
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { i as insets, n as estimateTextWidth, r as innerRect, t as LINE_HEIGHT } from "./layout-B3hiqVEw.js";
|
|
2
|
+
import { n as normalizeClass, r as normalizeStyle, t as h } from "./vnode-tCWItoUH.js";
|
|
3
|
+
import { a as getDateFormat, i as formatTicks, n as formatDetail, o as getNumberFormat, r as formatNumber, s as stepPrecision, t as formatDate } from "./format-lStwuc1L.js";
|
|
4
|
+
import { A as tickIncrement, C as grid, D as linearTicks, E as bandTicks, M as ticks, O as thinTicks, S as point, T as axisSize, b as linear, f as seriesKey, j as tickStep, k as niceDomain, m as seriesTable, n as categoryInteraction, p as seriesLegend, r as domainOf, w as axis, x as band } from "./cartesian-Cr0AF0nG.js";
|
|
5
|
+
import { i as register, n as feature, r as features, t as addPost } from "./features-wASyHGic.js";
|
|
6
|
+
import { t as extent } from "./extent-BAMZo0Nq.js";
|
|
7
|
+
import { n as annotationValues, t as annotationLayers } from "./annotations-BszTTjf9.js";
|
|
8
|
+
import { t as dateLabels } from "./dates-CG-FvioW.js";
|
|
9
|
+
import { n as logTicks, r as log, t as logDomain } from "./log-axis-B_uvvOFc.js";
|
|
10
|
+
import { _ as defaultHidden, a as chartToString, c as resolveSize, g as renderToString, h as escapeText, i as chartLabel, l as cancel, m as escapeAttr, n as buildChart, o as renderContext, p as schedule, r as chartEvents, s as resolveLegend, t as Chart$1, u as flush, v as legendContent } from "./chart-BF2CK9I_.js";
|
|
11
|
+
import { a as render } from "./dom-vP3IcMak.js";
|
|
12
|
+
import { n as patternFills } from "./patterns-DtgcnA8o.js";
|
|
13
|
+
import { n as shapesStep, t as markerPath } from "./point-shapes-DI84NNpI.js";
|
|
14
|
+
import { n as time, r as timePointScale, t as timeAxis } from "./time-axis-Bc9eHX1r.js";
|
|
15
|
+
import { t as labelsStep } from "./value-labels-IZIQPhfk.js";
|
|
16
|
+
import { t as hydrate } from "./hydrate-DDNIHYv_.js";
|
|
17
|
+
import { t as morph } from "./morph-Bgg-24l8.js";
|
|
18
|
+
import { n as lttbIndices, t as lttb } from "./decimate-C87cl_Sp.js";
|
|
19
|
+
import { n as areaPath, r as linePath } from "./fade-D3NxH5Qg.js";
|
|
20
|
+
import { _ as download, a as placeTooltip, c as sync, d as describeHit, f as tableContent, g as hoverUnderlay, h as hoverOverlay, i as hitAnchor, l as legend, m as pointer, n as defaultPlugins, o as tooltipContent, p as highlight, r as tooltip, s as dataTable, t as VERSION, u as keyboard } from "./core-plobgBC7.js";
|
|
21
|
+
import { t as line } from "./line-B3Ed6u7j.js";
|
|
22
|
+
import { t as area } from "./area-DQsLERhx.js";
|
|
23
|
+
import { n as hbarPath, t as barPath } from "./bar-DM16NUvV.js";
|
|
24
|
+
import { t as bar } from "./bar-jZEoao74.js";
|
|
25
|
+
import { t as candlestick } from "./candlestick-DuXwAFID.js";
|
|
26
|
+
import { a as arcPathStable, i as arcCentroid, o as padAngleForGap } from "./sweep-WSgn2etB.js";
|
|
27
|
+
import { t as gauge } from "./gauge-_ljQHrMN.js";
|
|
28
|
+
import { t as heatmap } from "./heatmap-DSZ2bVIa.js";
|
|
29
|
+
import { n as pie, t as donut } from "./pie-RnMTQWMS.js";
|
|
30
|
+
import { t as radar } from "./radar-CYPab_I4.js";
|
|
31
|
+
import { t as sankey } from "./sankey-B4PNKusJ.js";
|
|
32
|
+
import { t as scatter } from "./scatter-kgtgR318.js";
|
|
33
|
+
import { t as sparkline } from "./sparkline-BQzt27Fr.js";
|
|
34
|
+
import { n as exportImage, r as exportSVG, t as downloadChart } from "./export-chart-9w8t3rjZ.js";
|
|
35
|
+
//#region src/chart-default.ts
|
|
36
|
+
/**
|
|
37
|
+
* A chart with every built-in plugin installed: hover highlight, legend,
|
|
38
|
+
* tooltip, data table and keyboard navigation. Each can be switched off in
|
|
39
|
+
* the config (`tooltip: false`, …). For the smallest bundle, use the bare
|
|
40
|
+
* `Chart` from `@tabler/charts/core` and pick plugins explicitly.
|
|
41
|
+
*
|
|
42
|
+
* ```ts
|
|
43
|
+
* const chart = new Chart('#sales', { type: line, data })
|
|
44
|
+
* ```
|
|
45
|
+
*/
|
|
46
|
+
var Chart = class extends Chart$1 {
|
|
47
|
+
constructor(target, config) {
|
|
48
|
+
super(target, config, defaultPlugins());
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
//#endregion
|
|
52
|
+
//#region src/chart-types.ts
|
|
53
|
+
/**
|
|
54
|
+
* Every built-in chart type by its name, for charts declared in markup
|
|
55
|
+
* (`<tabler-chart type="line">`, `data-tc-chart="line"`). Importing it
|
|
56
|
+
* brings every type along: code that knows its types imports them directly.
|
|
57
|
+
*/
|
|
58
|
+
const types = {
|
|
59
|
+
line,
|
|
60
|
+
area,
|
|
61
|
+
bar,
|
|
62
|
+
pie,
|
|
63
|
+
donut,
|
|
64
|
+
scatter,
|
|
65
|
+
sparkline,
|
|
66
|
+
gauge,
|
|
67
|
+
heatmap,
|
|
68
|
+
candlestick,
|
|
69
|
+
radar,
|
|
70
|
+
sankey
|
|
71
|
+
};
|
|
72
|
+
//#endregion
|
|
73
|
+
//#region src/index.ts
|
|
74
|
+
/**
|
|
75
|
+
* `@tabler/charts`: everything from `@tabler/charts/core`, with a `Chart`
|
|
76
|
+
* that installs the built-in plugins (tooltip, legend, keyboard, …) and
|
|
77
|
+
* every optional feature registered (time and log axes, decimation,
|
|
78
|
+
* annotations, pattern fills, value labels, point shapes). The one exception
|
|
79
|
+
* is the `download` menu's saver: `import '@tabler/charts/export'` adds it,
|
|
80
|
+
* so charts that never offer a download do not carry the export code.
|
|
81
|
+
*/
|
|
82
|
+
register({
|
|
83
|
+
time: {
|
|
84
|
+
scale: time,
|
|
85
|
+
points: timePointScale,
|
|
86
|
+
axis: timeAxis
|
|
87
|
+
},
|
|
88
|
+
dates: dateLabels,
|
|
89
|
+
log: {
|
|
90
|
+
scale: log,
|
|
91
|
+
domain: logDomain,
|
|
92
|
+
ticks: logTicks
|
|
93
|
+
},
|
|
94
|
+
decimate: lttbIndices,
|
|
95
|
+
line: {
|
|
96
|
+
linePath,
|
|
97
|
+
areaPath
|
|
98
|
+
},
|
|
99
|
+
annotations: {
|
|
100
|
+
layers: annotationLayers,
|
|
101
|
+
values: annotationValues
|
|
102
|
+
},
|
|
103
|
+
patterns: patternFills,
|
|
104
|
+
"point-shapes": markerPath,
|
|
105
|
+
hydrate,
|
|
106
|
+
morph
|
|
107
|
+
});
|
|
108
|
+
addPost(shapesStep);
|
|
109
|
+
addPost(labelsStep);
|
|
110
|
+
//#endregion
|
|
111
|
+
export { Chart, LINE_HEIGHT, VERSION, arcCentroid, arcPathStable, area, areaPath, axis, axisSize, band, bandTicks, bar, barPath, buildChart, cancel, candlestick, categoryInteraction, chartEvents, chartLabel, chartToString, dataTable, defaultHidden, defaultPlugins, describeHit, domainOf, donut, download, downloadChart, escapeAttr, escapeText, estimateTextWidth, exportImage, exportSVG, extent, feature, features, flush, formatDate, formatDetail, formatNumber, formatTicks, gauge, getDateFormat, getNumberFormat, grid, h, hbarPath, heatmap, highlight, hitAnchor, hoverOverlay, hoverUnderlay, innerRect, insets, keyboard, legend, legendContent, line, linePath, linear, linearTicks, log, lttb, lttbIndices, niceDomain, normalizeClass, normalizeStyle, padAngleForGap, pie, placeTooltip, point, pointer, radar, register, render, renderContext, renderToString, resolveLegend, resolveSize, sankey, scatter, schedule, seriesKey, seriesLegend, seriesTable, sparkline, stepPrecision, sync, tableContent, thinTicks, tickIncrement, tickStep, ticks, time, timePointScale, tooltip, tooltipContent, types };
|
|
112
|
+
|
|
113
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["CoreChart"],"sources":["../src/chart-default.ts","../src/chart-types.ts","../src/index.ts"],"sourcesContent":["import { type ChartConfig, Chart as CoreChart } from './chart.ts'\nimport { defaultPlugins } from './plugins/index.ts'\n\n/**\n * A chart with every built-in plugin installed: hover highlight, legend,\n * tooltip, data table and keyboard navigation. Each can be switched off in\n * the config (`tooltip: false`, …). For the smallest bundle, use the bare\n * `Chart` from `@tabler/charts/core` and pick plugins explicitly.\n *\n * ```ts\n * const chart = new Chart('#sales', { type: line, data })\n * ```\n */\nexport class Chart<O extends object = object> extends CoreChart<O> {\n constructor(target: Element | string, config: ChartConfig<O>) {\n super(target, config, defaultPlugins())\n }\n}\n","import type { ChartType } from './chart.ts'\nimport { area } from './charts/area.ts'\nimport { bar } from './charts/bar.ts'\nimport { candlestick } from './charts/candlestick.ts'\nimport { gauge } from './charts/gauge.ts'\nimport { heatmap } from './charts/heatmap.ts'\nimport { line } from './charts/line.ts'\nimport { donut, pie } from './charts/pie.ts'\nimport { radar } from './charts/radar.ts'\nimport { sankey } from './charts/sankey.ts'\nimport { scatter } from './charts/scatter.ts'\nimport { sparkline } from './charts/sparkline.ts'\n\n/**\n * Every built-in chart type by its name, for charts declared in markup\n * (`<tabler-chart type=\"line\">`, `data-tc-chart=\"line\"`). Importing it\n * brings every type along: code that knows its types imports them directly.\n */\nexport const types: Readonly<Record<string, ChartType<never>>> = {\n line,\n area,\n bar,\n pie,\n donut,\n scatter,\n sparkline,\n gauge,\n heatmap,\n candlestick,\n radar,\n sankey,\n} as Record<string, ChartType<never>>\n","/**\n * `@tabler/charts`: everything from `@tabler/charts/core`, with a `Chart`\n * that installs the built-in plugins (tooltip, legend, keyboard, …) and\n * every optional feature registered (time and log axes, decimation,\n * annotations, pattern fills, value labels, point shapes). The one exception\n * is the `download` menu's saver: `import '@tabler/charts/export'` adds it,\n * so charts that never offer a download do not carry the export code.\n */\n\nimport { annotationLayers, annotationValues } from './charts/annotations.ts'\nimport { dateLabels } from './charts/dates.ts'\nimport { logDomain, logTicks } from './charts/log-axis.ts'\nimport { patternFills } from './charts/patterns.ts'\nimport { markerPath, shapesStep } from './charts/point-shapes.ts'\nimport { timeAxis } from './charts/time-axis.ts'\nimport { labelsStep } from './charts/value-labels.ts'\nimport { addPost, register } from './features.ts'\nimport { hydrate } from './render/hydrate.ts'\nimport { morph } from './render/morph.ts'\nimport { log } from './scales/log.ts'\nimport { time, timePointScale } from './scales/time.ts'\nimport { lttb, lttbIndices } from './shapes/decimate.ts'\nimport { areaPath, linePath } from './shapes/path.ts'\n\n// Registered here, in the entry itself, so no bundler can shake it away.\nregister({\n time: { scale: time, points: timePointScale, axis: timeAxis },\n dates: dateLabels,\n log: { scale: log, domain: logDomain, ticks: logTicks },\n decimate: lttbIndices,\n line: { linePath, areaPath },\n annotations: { layers: annotationLayers, values: annotationValues },\n patterns: patternFills,\n 'point-shapes': markerPath,\n hydrate,\n morph,\n})\n\n// Steps that finish the content: shapes first, then the labels over them.\naddPost(shapesStep)\naddPost(labelsStep)\n\nexport { Chart } from './chart-default.ts'\nexport { types } from './chart-types.ts'\nexport * from './core.ts'\nexport type { DownloadOptions, ExportOptions, ExportTarget, ImageOptions } from './export-chart.ts'\nexport { downloadChart, exportImage, exportSVG } from './export-chart.ts'\nexport type { LogScaleOptions } from './scales/log.ts'\nexport type { TimeScale, TimeScaleOptions, TimeValue } from './scales/time.ts'\nexport { log, lttb, lttbIndices, time, timePointScale }\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAaA,IAAa,QAAb,cAAsDA,QAAa;CACjE,YAAY,QAA0B,QAAwB;EAC5D,MAAM,QAAQ,QAAQ,eAAe,CAAC;CACxC;AACF;;;;;;;;ACCA,MAAa,QAAoD;CAC/D;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;;;;;;;;;;;ACNA,SAAS;CACP,MAAM;EAAE,OAAO;EAAM,QAAQ;EAAgB,MAAM;CAAS;CAC5D,OAAO;CACP,KAAK;EAAE,OAAO;EAAK,QAAQ;EAAW,OAAO;CAAS;CACtD,UAAU;CACV,MAAM;EAAE;EAAU;CAAS;CAC3B,aAAa;EAAE,QAAQ;EAAkB,QAAQ;CAAiB;CAClE,UAAU;CACV,gBAAgB;CAChB;CACA;AACF,CAAC;AAGD,QAAQ,UAAU;AAClB,QAAQ,UAAU"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
//#region src/layout.ts
|
|
2
|
+
/** Normalize an {@link InsetsInput}; missing sides fall back to `fallback`. */
|
|
3
|
+
function insets(value, fallback = 0) {
|
|
4
|
+
const side = (key) => {
|
|
5
|
+
const v = typeof value === "number" ? value : value?.[key];
|
|
6
|
+
return Number.isFinite(v) ? v : fallback;
|
|
7
|
+
};
|
|
8
|
+
return {
|
|
9
|
+
top: side("top"),
|
|
10
|
+
right: side("right"),
|
|
11
|
+
bottom: side("bottom"),
|
|
12
|
+
left: side("left")
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
/** Rectangle left inside `width × height` after `margins`; never negative. */
|
|
16
|
+
function innerRect(width, height, margins) {
|
|
17
|
+
return {
|
|
18
|
+
x: margins.left,
|
|
19
|
+
y: margins.top,
|
|
20
|
+
width: Math.max(0, width - margins.left - margins.right),
|
|
21
|
+
height: Math.max(0, height - margins.top - margins.bottom)
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
const THIN = " !'.,:;|ijlI`";
|
|
25
|
+
const NARROW = "()[]{}-/frt";
|
|
26
|
+
const ROUND = "CDGHNOQU";
|
|
27
|
+
const WIDE = "%@MWmw";
|
|
28
|
+
/**
|
|
29
|
+
* Full-width characters, a whole em each: Hangul, CJK and kana, compatibility
|
|
30
|
+
* ideographs, fullwidth forms and pictographs (emoji).
|
|
31
|
+
*/
|
|
32
|
+
const isWide = (code) => code >= 4352 && (code <= 4447 || code >= 11904 && code <= 42191 || code >= 44032 && code <= 55203 || code >= 63744 && code <= 64255 || code >= 65280 && code <= 65376 || code >= 127744);
|
|
33
|
+
/** The width of an ASCII character, in em. */
|
|
34
|
+
function charWidth(char) {
|
|
35
|
+
if (char >= "0" && char <= "9") return char === "1" ? .45 : .63;
|
|
36
|
+
if (THIN.includes(char)) return .27;
|
|
37
|
+
if (NARROW.includes(char)) return .38;
|
|
38
|
+
if (WIDE.includes(char)) return .88;
|
|
39
|
+
if (ROUND.includes(char)) return .76;
|
|
40
|
+
if (char >= "A" && char <= "Z") return .66;
|
|
41
|
+
return .57;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Estimate the rendered width of `text` without a DOM, for layout on the
|
|
45
|
+
* server and in workers. Tuned for common UI sans-serif fonts; deterministic,
|
|
46
|
+
* so SSR and client layouts agree.
|
|
47
|
+
*/
|
|
48
|
+
function estimateTextWidth(text, fontSize) {
|
|
49
|
+
let em = 0;
|
|
50
|
+
for (let i = 0; i < text.length; i++) {
|
|
51
|
+
const point = text.codePointAt(i);
|
|
52
|
+
em += ASCII[point] ?? (isWide(point) ? 1 : .57);
|
|
53
|
+
if (point > 65535) i++;
|
|
54
|
+
}
|
|
55
|
+
return em * fontSize;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* The width of every ASCII character, looked up instead of worked out: an
|
|
59
|
+
* axis of 100,000 long labels estimates millions of characters per render.
|
|
60
|
+
*/
|
|
61
|
+
const ASCII = /* @__PURE__ */ Array.from({ length: 128 }, (_, code) => charWidth(String.fromCharCode(code)));
|
|
62
|
+
/** A pixel value rounded to two decimals, as written into attributes and path data. */
|
|
63
|
+
const round = (value) => Math.round(value * 100) / 100;
|
|
64
|
+
/** Line height used for single-line labels, relative to the font size. */
|
|
65
|
+
const LINE_HEIGHT = 1.25;
|
|
66
|
+
//#endregion
|
|
67
|
+
export { round as a, insets as i, estimateTextWidth as n, innerRect as r, LINE_HEIGHT as t };
|
|
68
|
+
|
|
69
|
+
//# sourceMappingURL=layout-B3hiqVEw.js.map
|