tiny-spark 0.1.0 → 0.1.2-beta.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/README.md CHANGED
@@ -9,6 +9,7 @@ An elegant, reactive and responsive sparkline chart solution without dependency.
9
9
 
10
10
  <img width="500" alt="image" src="https://github.com/user-attachments/assets/d312a234-8e09-44a2-89fd-5ae85a6cdbec" />
11
11
 
12
+ [DEMO](https://tiny-spark.graphieros.com/)
12
13
 
13
14
  ## Installation
14
15
 
@@ -18,6 +19,17 @@ npm i tiny-spark
18
19
 
19
20
  ## Usage
20
21
 
22
+ Import the file in your project:
23
+
24
+ ```js
25
+ import { render } from "tiny-spark/dist/tiny-spark.es";
26
+
27
+ // If you need to fetch data, call render afterwards
28
+ getData().then(render);
29
+
30
+ // If you hardcode your dataset, you can call render immediately
31
+ ```
32
+
21
33
  Just set up a div with a "tiny-spark" class, with a few data attributes to configure the chart.
22
34
 
23
35
  ```html
@@ -1,7 +1,7 @@
1
- const O = "http://www.w3.org/2000/svg";
2
- var F = /* @__PURE__ */ ((t) => (t.BAR = "data-bar", t.LINE = "data-line", t.SET = "data-set", t.RESPONSIVE = "data-responsive", t))(F || {}), h = /* @__PURE__ */ ((t) => (t.ANIMATION = "animation", t.AREA_COLOR = "areaColor", t.CURVE = "curve", t.DATES = "dates", t.INDICATOR_COLOR = "indicatorColor", t.INDICATOR_WIDTH = "indicatorWidth", t.LINE_COLOR = "lineColor", t.LINE_THICKNESS = "lineThickness", t.NUMBER_LOCALE = "numberLocale", t.NUMBER_ROUNDING = "numberRounding", t.NUMBER_SHOW_ON = "numberShowOn", t.PLOT_COLOR = "plotColor", t.PLOT_RADIUS = "plotRadius", t.SET = "set", t))(h || {});
3
- function G(t) {
4
- const { width: r, height: e } = t.parentElement.getBoundingClientRect(), o = { width: 300, height: 100 }, a = `0 0 ${r || o.width} ${e || o.height}`, i = document.createElementNS(O, "svg"), u = X();
1
+ const L = "http://www.w3.org/2000/svg";
2
+ var V = /* @__PURE__ */ ((t) => (t.BAR = "data-bar", t.LINE = "data-line", t.SET = "data-set", t.RESPONSIVE = "data-responsive", t))(V || {}), b = /* @__PURE__ */ ((t) => (t.ANIMATION = "animation", t.AREA_COLOR = "areaColor", t.CURVE = "curve", t.DATES = "dates", t.INDICATOR_COLOR = "indicatorColor", t.INDICATOR_WIDTH = "indicatorWidth", t.LINE_COLOR = "lineColor", t.LINE_THICKNESS = "lineThickness", t.NUMBER_LOCALE = "numberLocale", t.NUMBER_ROUNDING = "numberRounding", t.NUMBER_SHOW_ON = "numberShowOn", t.PLOT_COLOR = "plotColor", t.PLOT_RADIUS = "plotRadius", t.SET = "set", t))(b || {});
3
+ function U(t) {
4
+ const { width: r, height: e } = t.parentElement.getBoundingClientRect(), o = { width: 300, height: 100 }, a = `0 0 ${r || o.width} ${e || o.height}`, i = document.createElementNS(L, "svg"), u = Y();
5
5
  return i.id = u, i.setAttribute("viewBox", a), i.style.width = "100%", i.style.height = "100%", {
6
6
  svg: i,
7
7
  svgId: u,
@@ -12,13 +12,13 @@ function G(t) {
12
12
  function x(t, r = 0) {
13
13
  return isNaN(t) ? r : t;
14
14
  }
15
- function M(t) {
15
+ function _(t) {
16
16
  let r = [];
17
17
  for (let e = 0; e < t.length; e += 1)
18
18
  r.push(`${x(t[e].x)},${x(t[e].y)} `);
19
19
  return r.join(" ").trim();
20
20
  }
21
- function R(t) {
21
+ function M(t) {
22
22
  if (t.length < 1) return "0,0";
23
23
  const r = t.length - 1, e = [`${x(t[0].x)},${x(t[0].y)}`], o = [], a = [], i = [], u = [];
24
24
  for (let n = 0; n < r; n += 1)
@@ -32,18 +32,18 @@ function R(t) {
32
32
  u[n] = d;
33
33
  }
34
34
  for (let n = 0; n < r; n += 1) {
35
- const d = t[n].x, g = t[n].y, c = t[n + 1].x, C = t[n + 1].y, A = u[n], v = u[n + 1], $ = d + (c - d) / 3, S = g + A * (c - d) / 3, I = c - (c - d) / 3, y = C - v * (c - d) / 3;
36
- e.push(`C ${x($)},${x(S)} ${x(I)},${x(y)} ${x(c)},${x(C)}`);
35
+ const d = t[n].x, g = t[n].y, c = t[n + 1].x, w = t[n + 1].y, E = u[n], C = u[n + 1], A = d + (c - d) / 3, S = g + E * (c - d) / 3, k = c - (c - d) / 3, p = w - C * (c - d) / 3;
36
+ e.push(`C ${x(A)},${x(S)} ${x(k)},${x(p)} ${x(c)},${x(w)}`);
37
37
  }
38
38
  return e.join(" ");
39
39
  }
40
- function U(t, r = 1e3) {
40
+ function W(t, r = 1e3) {
41
41
  const e = t.getTotalLength();
42
42
  t.style.strokeDasharray = String(e), t.style.strokeDashoffset = String(e), t.getBoundingClientRect(), t.style.transition = `stroke-dashoffset ${r}ms ease-in-out`, t.style.strokeDashoffset = "0", t.addEventListener("transitionend", function o() {
43
43
  t.style.transition = "", t.removeEventListener("transitionend", o);
44
44
  });
45
45
  }
46
- function W(t, r, e = 1e3) {
46
+ function j(t, r, e = 1e3) {
47
47
  const o = r.getBBox(), a = o.width, i = document.createElementNS("http://www.w3.org/2000/svg", "clipPath"), u = "clip-" + Math.random().toString(36).substr(2, 9);
48
48
  i.setAttribute("id", u);
49
49
  const n = document.createElementNS("http://www.w3.org/2000/svg", "rect");
@@ -53,26 +53,26 @@ function W(t, r, e = 1e3) {
53
53
  r.removeAttribute("clip-path"), i.parentNode && i.parentNode.removeChild(i), n.removeEventListener("transitionend", g);
54
54
  });
55
55
  }
56
- function j() {
56
+ function q() {
57
57
  return document.querySelectorAll(".tiny-spark");
58
58
  }
59
- function V(t, r) {
59
+ function B(t, r) {
60
60
  return Object.keys(t.dataset).includes(r);
61
61
  }
62
- function b(t, r, e) {
63
- return V(t, r) ? t.dataset[r] : e;
62
+ function h(t, r, e) {
63
+ return B(t, r) ? t.dataset[r] : e;
64
64
  }
65
- function q(t, r) {
65
+ function K(t, r) {
66
66
  const e = new MutationObserver((o) => {
67
67
  for (const a of o)
68
- if (a.type === "attributes" && a.attributeName && Object.values(F).includes(a.attributeName)) {
68
+ if (a.type === "attributes" && a.attributeName && Object.values(V).includes(a.attributeName)) {
69
69
  r();
70
70
  break;
71
71
  }
72
72
  });
73
73
  return e.observe(t, { attributes: !0 }), e;
74
74
  }
75
- function K(t) {
75
+ function X(t) {
76
76
  if (!t) return {
77
77
  color: "#1A1A1A",
78
78
  backgroundColor: "#FFFFFF"
@@ -80,13 +80,13 @@ function K(t) {
80
80
  const r = window.getComputedStyle(t), e = r.getPropertyValue("color") || "#1A1A1A", o = r.getPropertyValue("background-color"), a = r.getPropertyValue("background");
81
81
  return { color: e, backgroundColor: o || a || "#FFFFFF" };
82
82
  }
83
- function X() {
83
+ function Y() {
84
84
  return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(t) {
85
85
  const r = Math.random() * 16 | 0;
86
86
  return (t == "x" ? r : r & 3 | 8).toString(16);
87
87
  });
88
88
  }
89
- function Y(t) {
89
+ function z(t) {
90
90
  const r = t.getAttribute("data-set");
91
91
  if (!r) return [];
92
92
  try {
@@ -112,18 +112,18 @@ function P(t) {
112
112
  max: Math.max(...t)
113
113
  };
114
114
  }
115
- function B() {
115
+ function H() {
116
116
  return new Promise((t) => setTimeout(t, 0));
117
117
  }
118
118
  function Z(t, r) {
119
- const e = String(b(t, h.NUMBER_LOCALE, navigator.language || "en-US")), o = Number(String(b(t, h.NUMBER_ROUNDING, 0)));
119
+ const e = String(h(t, b.NUMBER_LOCALE, navigator.language || "en-US")), o = Number(String(h(t, b.NUMBER_ROUNDING, 0)));
120
120
  return r.toLocaleString(e, {
121
121
  useGrouping: !0,
122
122
  minimumFractionDigits: o,
123
123
  maximumFractionDigits: o
124
124
  });
125
125
  }
126
- function z(t, r, e) {
126
+ function Q(t, r, e) {
127
127
  if (!t.createSVGPoint || !t.getScreenCTM)
128
128
  throw new Error("Your browser does not support SVG coordinate transformation.");
129
129
  const o = t.getScreenCTM();
@@ -135,100 +135,105 @@ function z(t, r, e) {
135
135
  return { x: i.x, y: i.y };
136
136
  }
137
137
  function D(t, r, e, o, a) {
138
- if (Q(o), !a) return;
139
- const { x: i, y: u } = z(t, e.x, e.y), n = document.createElement("div");
138
+ if (T(o), !a) return;
139
+ const { x: i, y: u } = Q(t, e.x, e.y), n = document.createElement("div");
140
140
  n.classList.add("tiny-spark-tooltip"), n.setAttribute("id", `tooltip_${o}`), n.style.pointerEvents = "none", n.style.position = "fixed", n.style.top = u + "px", n.style.left = i + "px", n.style.width = "fit-content", n.innerHTML = `
141
141
  <div class="tiny-spark-tooltip-content">${e.d ? `${e.d}: ` : ""}${[null, void 0].includes(e.v) ? "-" : Z(r, Number(e.v))}</div>
142
- `, document.body.appendChild(n), B().then(() => {
142
+ `, document.body.appendChild(n), H().then(() => {
143
143
  const { width: d, height: g } = n.getBoundingClientRect();
144
- n.style.left = `${i - d / 2}px`, n.style.top = `${u - g - Number(String(Number(b(r, h.PLOT_RADIUS, 3)) * 1.5))}px`;
144
+ n.style.left = `${i - d / 2}px`, n.style.top = `${u - g - Number(String(Number(h(r, b.PLOT_RADIUS, 3)) * 1.5))}px`;
145
145
  });
146
146
  }
147
- function Q(t) {
147
+ function T(t) {
148
148
  const r = document.getElementById(`tooltip_${t}`);
149
149
  r == null || r.remove();
150
150
  }
151
- function T(t) {
151
+ function tt(t) {
152
152
  t.innerHTML = "";
153
153
  }
154
- function tt(t, r) {
154
+ function et(t, r) {
155
155
  let e = r;
156
- T(t);
157
- const { svg: o, svgId: a, width: i, height: u } = G(t), { color: n, backgroundColor: d } = K(t), g = { T: 12, R: 12, B: 12, L: 12 }, c = {
156
+ tt(t);
157
+ const { svg: o, svgId: a, width: i, height: u } = U(t), { color: n, backgroundColor: d } = X(t), g = { T: 12, R: 12, B: 12, L: 12 }, c = {
158
158
  left: g.L,
159
159
  top: g.T,
160
160
  width: i - g.L - g.R,
161
161
  height: u - g.T - g.B,
162
162
  bottom: u - g.B
163
- }, C = Y(t), { min: A } = P(C), v = C.map((l) => [null, void 0].includes(l) ? l : l + (A < 0 ? Math.abs(A) : 0)), { max: $ } = P(v), S = c.width / (C.length - 1) === 1 / 0 ? c.width : c.width / (C.length - 1), I = J(t), y = v.map((l, m) => {
163
+ }, w = z(t), { min: E } = P(w), C = w.map((l) => [null, void 0].includes(l) ? l : l + (E < 0 ? Math.abs(E) : 0)), { max: A } = P(C), S = c.width / (w.length - 1) === 1 / 0 ? c.width : c.width / (w.length - 1), k = J(t), p = C.map((l, m) => {
164
164
  const s = {
165
- w: v.length === 1 ? S / 2 : 0,
166
- h: v.length === 1 ? c.height / 2 : 0
165
+ w: C.length === 1 ? S / 2 : 0,
166
+ h: C.length === 1 ? c.height / 2 : 0
167
167
  };
168
168
  return {
169
- y: (1 - (l || 0) / $) * c.height + g.T + s.h,
169
+ y: (1 - (l || 0) / A) * c.height + g.T + s.h,
170
170
  x: c.left + S * m + s.w,
171
171
  v: l,
172
- d: I[m] || null
172
+ d: k[m] || null
173
173
  };
174
- }), w = [...y].filter(({ v: l }) => ![null, void 0].includes(l)), N = document.createElementNS(O, "path");
175
- N.classList.add("tiny-spark-line-path"), !t.dataset.curve || t.dataset.curve === "true" ? N.setAttribute("d", `M ${R(w)}`) : N.setAttribute("d", `M ${M(w)}`), N.setAttribute("fill", "none"), N.setAttribute("stroke", String(b(t, h.LINE_COLOR, n))), N.setAttribute("stroke-width", String(b(t, h.LINE_THICKNESS, 2))), N.setAttribute("stroke-linecap", "round");
176
- const L = document.createElementNS(O, "path");
177
- L.classList.add("tiny-spark-line-area"), y.length && (!t.dataset.curve || t.dataset.curve === "true" ? L.setAttribute("d", `M ${w[0].x},${c.bottom} ${R(w)} L ${w.at(-1).x},${c.bottom} Z`) : L.setAttribute("d", `M ${w[0].x},${c.bottom} ${M(w)} L ${w.at(-1).x},${c.bottom} Z`)), L.setAttribute("fill", String(b(t, h.AREA_COLOR, "transparent"))), y.length > 1 && (o.appendChild(L), o.appendChild(N));
178
- const H = t.getAttribute("data-animation"), k = [];
179
- y.forEach((l, m) => {
180
- const s = document.createElementNS(O, "line");
181
- s.classList.add("tiny-spark-indicator"), s.setAttribute("id", `indicator_${a}_${m}`), s.setAttribute("x1", String(c.left + (y.length === 1 ? c.width / 2 : m * S))), s.setAttribute("x2", String(c.left + (y.length === 1 ? c.width / 2 : m * S))), s.setAttribute("y1", String(c.top)), s.setAttribute("y2", String(c.bottom)), s.setAttribute("stroke", String(b(t, h.INDICATOR_COLOR, "#1A1A1A"))), s.setAttribute("stroke-width", String(b(t, h.INDICATOR_WIDTH, "1"))), s.setAttribute("stroke-linecap", "round"), s.style.pointerEvents = "none", s.style.opacity = "0", k.push(s), o.appendChild(s);
174
+ }), v = [...p].filter(({ v: l }) => ![null, void 0].includes(l)), N = document.createElementNS(L, "path");
175
+ N.classList.add("tiny-spark-line-path"), !t.dataset.curve || t.dataset.curve === "true" ? N.setAttribute("d", `M ${M(v)}`) : N.setAttribute("d", `M ${_(v)}`), N.setAttribute("fill", "none"), N.setAttribute("stroke", String(h(t, b.LINE_COLOR, n))), N.setAttribute("stroke-width", String(h(t, b.LINE_THICKNESS, 2))), N.setAttribute("stroke-linecap", "round");
176
+ const O = document.createElementNS(L, "path");
177
+ O.classList.add("tiny-spark-line-area"), p.length && (!t.dataset.curve || t.dataset.curve === "true" ? O.setAttribute("d", `M ${v[0].x},${c.bottom} ${M(v)} L ${v.at(-1).x},${c.bottom} Z`) : O.setAttribute("d", `M ${v[0].x},${c.bottom} ${_(v)} L ${v.at(-1).x},${c.bottom} Z`)), O.setAttribute("fill", String(h(t, b.AREA_COLOR, "transparent"))), p.length > 1 && (o.appendChild(O), o.appendChild(N));
178
+ const G = t.getAttribute("data-animation"), I = [];
179
+ p.forEach((l, m) => {
180
+ const s = document.createElementNS(L, "line");
181
+ s.classList.add("tiny-spark-indicator"), s.setAttribute("id", `indicator_${a}_${m}`), s.setAttribute("x1", String(c.left + (p.length === 1 ? c.width / 2 : m * S))), s.setAttribute("x2", String(c.left + (p.length === 1 ? c.width / 2 : m * S))), s.setAttribute("y1", String(c.top)), s.setAttribute("y2", String(c.bottom)), s.setAttribute("stroke", String(h(t, b.INDICATOR_COLOR, "#1A1A1A"))), s.setAttribute("stroke-width", String(h(t, b.INDICATOR_WIDTH, "1"))), s.setAttribute("stroke-linecap", "round"), s.style.pointerEvents = "none", s.style.opacity = "0", I.push(s), o.appendChild(s);
182
182
  });
183
- let _ = [];
184
- Number(String(b(t, h.PLOT_RADIUS, 0))) > 0 && y.forEach(({ x: l, y: m, v: s }, p) => {
183
+ let R = [];
184
+ Number(String(h(t, b.PLOT_RADIUS, 0))) > 0 && p.forEach(({ x: l, y: m, v: s }, y) => {
185
185
  if (![null, void 0].includes(s)) {
186
- const f = document.createElementNS(O, "circle");
187
- f.classList.add("tiny-spark-datapoint-circle"), f.classList.add(`circle-${a}`), f.setAttribute("id", `circle_${a}_${p}`), f.setAttribute("cx", String(l)), f.setAttribute("cy", String(m)), f.setAttribute("r", String(b(t, h.PLOT_RADIUS, 3))), f.setAttribute("fill", String(b(t, h.PLOT_COLOR, String(b(t, "lineColor", n))))), f.setAttribute("stroke", d), f.style.transition = `opacity ${p * (1e3 * 2 / y.length)}ms ease-in`, f.style.opacity = "0", o.appendChild(f), _.push(f);
186
+ const f = document.createElementNS(L, "circle");
187
+ f.classList.add("tiny-spark-datapoint-circle"), f.classList.add(`circle-${a}`), f.setAttribute("id", `circle_${a}_${y}`), f.setAttribute("cx", String(l)), f.setAttribute("cy", String(m)), f.setAttribute("r", String(h(t, b.PLOT_RADIUS, 3))), f.setAttribute("fill", String(h(t, b.PLOT_COLOR, String(h(t, "lineColor", n))))), f.setAttribute("stroke", d), f.style.transition = `opacity ${y * (1e3 * 2 / p.length)}ms ease-in`, f.style.opacity = "0", o.appendChild(f), R.push(f);
188
188
  }
189
- }), y.forEach((l, m) => {
190
- const s = document.createElementNS(O, "rect");
191
- s.classList.add("tiny-spark-tooltip-trap"), s.setAttribute("x", `${y.length === 1 ? 0 : c.left + m * S - S / 2}`), s.setAttribute("y", `${c.top}`), s.setAttribute("height", `${c.height}`), s.setAttribute("width", `${S}`), s.setAttribute("fill", "transparent"), s.addEventListener("mouseenter", () => {
189
+ }), p.forEach((l, m) => {
190
+ const s = document.createElementNS(L, "rect");
191
+ s.classList.add("tiny-spark-tooltip-trap"), s.setAttribute("x", `${p.length === 1 ? 0 : c.left + m * S - S / 2}`), s.setAttribute("y", `${c.top}`), s.setAttribute("height", `${c.height}`), s.setAttribute("width", `${S}`), s.setAttribute("fill", "transparent"), s.addEventListener("mouseenter", () => {
192
192
  D(o, t, l, a, !0);
193
- const p = document.getElementById(`circle_${a}_${m}`);
194
- p == null || p.setAttribute("r", String(Number(b(t, h.PLOT_RADIUS, 3)) * 1.5)), k[m].style.opacity = "1";
193
+ const y = document.getElementById(`circle_${a}_${m}`);
194
+ y == null || y.setAttribute("r", String(Number(h(t, b.PLOT_RADIUS, 3)) * 1.5)), I[m].style.opacity = "1";
195
195
  }), s.addEventListener("mouseout", () => {
196
196
  D(o, t, l, a, !1);
197
- const p = document.getElementById(`circle_${a}_${m}`);
198
- p == null || p.setAttribute("r", String(Number(b(t, h.PLOT_RADIUS, 3)))), k.forEach((f) => f.style.opacity = "0");
197
+ const y = document.getElementById(`circle_${a}_${m}`);
198
+ y == null || y.setAttribute("r", String(Number(h(t, b.PLOT_RADIUS, 3)))), I.forEach((f) => f.style.opacity = "0");
199
199
  }), o.appendChild(s);
200
- }), H === "true" && e ? B().then(() => {
201
- _.forEach((l) => {
200
+ }), G === "true" && e ? H().then(() => {
201
+ R.forEach((l) => {
202
202
  l.style.opacity = "1";
203
- }), U(N), W(o, L);
204
- }) : _.forEach((l) => {
203
+ }), W(N), j(o, O);
204
+ }) : R.forEach((l) => {
205
205
  l.style.opacity = "1";
206
206
  }), t.appendChild(o);
207
207
  }
208
- (function() {
209
- window.addEventListener("load", () => {
210
- const r = j();
211
- r.length && Array.from(r).forEach((e) => {
212
- et(e), e.__renderCount = 0, E(e), q(e, () => E(e)), new ResizeObserver((i) => {
213
- i.forEach((u) => {
214
- E(e);
215
- });
216
- }).observe(e.parentElement), new MutationObserver((i) => {
217
- i.forEach((u) => {
218
- u.type === "attributes" && u.attributeName && u.attributeName.startsWith("data-") && E(e);
219
- });
220
- }).observe(e, { attributes: !0 });
208
+ function F() {
209
+ const t = q();
210
+ t.length && Array.from(t).forEach((r) => {
211
+ const e = r;
212
+ nt(e), e.__renderCount = 0, $(e), K(e, () => $(e));
213
+ const o = new ResizeObserver((i) => {
214
+ i.forEach(() => $(e));
221
215
  });
216
+ e.parentElement && o.observe(e.parentElement), new MutationObserver((i) => {
217
+ i.forEach((u) => {
218
+ u.type === "attributes" && u.attributeName && u.attributeName.startsWith("data-") && $(e);
219
+ });
220
+ }).observe(e, { attributes: !0 });
222
221
  });
223
- })();
224
- function E(t) {
225
- t.__renderCount += 1, V(t, "set") && tt(t, t.__renderCount < 3);
226
222
  }
227
- function et(t) {
228
- t.dataset.set || console.error(`Tiny-spark exception:
223
+ function $(t) {
224
+ t.__renderCount += 1, B(t, "set") && et(t, t.__renderCount < 3);
225
+ }
226
+ function nt(t) {
227
+ t.dataset.set || console.error(
228
+ `Tiny-spark exception:
229
229
 
230
- [data-set] data attribute is missing.
231
- Provide an array of numbers, for example:
230
+ [data-set] data attribute is missing.
231
+ Provide an array of numbers, for example:
232
232
 
233
- data-set="[1, 2, 3]"`);
233
+ data-set="[1, 2, 3]"`
234
+ );
234
235
  }
236
+ document.readyState === "loading" ? window.addEventListener("load", F) : F();
237
+ export {
238
+ F as render
239
+ };
@@ -1,8 +1,8 @@
1
- (function(S){typeof define=="function"&&define.amd?define(S):S()})(function(){"use strict";const S="http://www.w3.org/2000/svg";var M=(t=>(t.BAR="data-bar",t.LINE="data-line",t.SET="data-set",t.RESPONSIVE="data-responsive",t))(M||{}),g=(t=>(t.ANIMATION="animation",t.AREA_COLOR="areaColor",t.CURVE="curve",t.DATES="dates",t.INDICATOR_COLOR="indicatorColor",t.INDICATOR_WIDTH="indicatorWidth",t.LINE_COLOR="lineColor",t.LINE_THICKNESS="lineThickness",t.NUMBER_LOCALE="numberLocale",t.NUMBER_ROUNDING="numberRounding",t.NUMBER_SHOW_ON="numberShowOn",t.PLOT_COLOR="plotColor",t.PLOT_RADIUS="plotRadius",t.SET="set",t))(g||{});function H(t){const{width:r,height:e}=t.parentElement.getBoundingClientRect(),o={width:300,height:100},a=`0 0 ${r||o.width} ${e||o.height}`,i=document.createElementNS(S,"svg"),u=K();return i.id=u,i.setAttribute("viewBox",a),i.style.width="100%",i.style.height="100%",{svg:i,svgId:u,width:r||o.width,height:e||o.height}}function y(t,r=0){return isNaN(t)?r:t}function R(t){let r=[];for(let e=0;e<t.length;e+=1)r.push(`${y(t[e].x)},${y(t[e].y)} `);return r.join(" ").trim()}function P(t){if(t.length<1)return"0,0";const r=t.length-1,e=[`${y(t[0].x)},${y(t[0].y)}`],o=[],a=[],i=[],u=[];for(let n=0;n<r;n+=1)o[n]=t[n+1].x-t[n].x,a[n]=t[n+1].y-t[n].y,i[n]=a[n]/o[n];u[0]=i[0],u[r]=i[r-1];for(let n=1;n<r;n+=1)if(i[n-1]*i[n]<=0)u[n]=0;else{const d=2*i[n-1]*i[n]/(i[n-1]+i[n]);u[n]=d}for(let n=0;n<r;n+=1){const d=t[n].x,m=t[n].y,c=t[n+1].x,v=t[n+1].y,E=u[n],L=u[n+1],$=d+(c-d)/3,N=m+E*(c-d)/3,I=c-(c-d)/3,p=v-L*(c-d)/3;e.push(`C ${y($)},${y(N)} ${y(I)},${y(p)} ${y(c)},${y(v)}`)}return e.join(" ")}function G(t,r=1e3){const e=t.getTotalLength();t.style.strokeDasharray=String(e),t.style.strokeDashoffset=String(e),t.getBoundingClientRect(),t.style.transition=`stroke-dashoffset ${r}ms ease-in-out`,t.style.strokeDashoffset="0",t.addEventListener("transitionend",function o(){t.style.transition="",t.removeEventListener("transitionend",o)})}function U(t,r,e=1e3){const o=r.getBBox(),a=o.width,i=document.createElementNS("http://www.w3.org/2000/svg","clipPath"),u="clip-"+Math.random().toString(36).substr(2,9);i.setAttribute("id",u);const n=document.createElementNS("http://www.w3.org/2000/svg","rect");n.setAttribute("x",o.x.toString()),n.setAttribute("y",o.y.toString()),n.setAttribute("width","0"),n.setAttribute("height",o.height.toString()),i.appendChild(n);let d=t.querySelector("defs");d||(d=document.createElementNS("http://www.w3.org/2000/svg","defs"),t.insertBefore(d,t.firstChild)),d.appendChild(i),r.setAttribute("clip-path",`url(#${u})`),n.style.transition=`width ${e}ms ease-out`,n.getBoundingClientRect(),n.setAttribute("width",a.toString()),n.addEventListener("transitionend",function m(){r.removeAttribute("clip-path"),i.parentNode&&i.parentNode.removeChild(i),n.removeEventListener("transitionend",m)})}function W(){return document.querySelectorAll(".tiny-spark")}function D(t,r){return Object.keys(t.dataset).includes(r)}function f(t,r,e){return D(t,r)?t.dataset[r]:e}function j(t,r){const e=new MutationObserver(o=>{for(const a of o)if(a.type==="attributes"&&a.attributeName&&Object.values(M).includes(a.attributeName)){r();break}});return e.observe(t,{attributes:!0}),e}function q(t){if(!t)return{color:"#1A1A1A",backgroundColor:"#FFFFFF"};const r=window.getComputedStyle(t),e=r.getPropertyValue("color")||"#1A1A1A",o=r.getPropertyValue("background-color"),a=r.getPropertyValue("background");return{color:e,backgroundColor:o||a||"#FFFFFF"}}function K(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){const r=Math.random()*16|0;return(t=="x"?r:r&3|8).toString(16)})}function X(t){const r=t.getAttribute("data-set");if(!r)return[];try{const e=JSON.parse(r);return Array.isArray(e)&&e.every(o=>typeof o=="number"||[null,void 0].includes(o))?e:(console.warn("data-set is not an array of numbers."),[])}catch(e){return console.error("Error parsing data-set:",e),[]}}function Y(t){const r=t.getAttribute("data-dates");if(!r)return[];try{const e=JSON.parse(r);return Array.isArray(e)&&e.every(o=>typeof o=="string")?e:(console.warn("data-dates is not an array of strings"),[])}catch(e){return console.error("Error parsing data-dates",e),[]}}function F(t){return{min:Math.min(...t),max:Math.max(...t)}}function V(){return new Promise(t=>setTimeout(t,0))}function J(t,r){const e=String(f(t,g.NUMBER_LOCALE,navigator.language||"en-US")),o=Number(String(f(t,g.NUMBER_ROUNDING,0)));return r.toLocaleString(e,{useGrouping:!0,minimumFractionDigits:o,maximumFractionDigits:o})}function Z(t,r,e){if(!t.createSVGPoint||!t.getScreenCTM)throw new Error("Your browser does not support SVG coordinate transformation.");const o=t.getScreenCTM();if(!o)throw new Error("Cannot obtain the screen CTM.");const a=t.createSVGPoint();a.x=r,a.y=e;const i=a.matrixTransform(o);return{x:i.x,y:i.y}}function B(t,r,e,o,a){if(z(o),!a)return;const{x:i,y:u}=Z(t,e.x,e.y),n=document.createElement("div");n.classList.add("tiny-spark-tooltip"),n.setAttribute("id",`tooltip_${o}`),n.style.pointerEvents="none",n.style.position="fixed",n.style.top=u+"px",n.style.left=i+"px",n.style.width="fit-content",n.innerHTML=`
2
- <div class="tiny-spark-tooltip-content">${e.d?`${e.d}: `:""}${[null,void 0].includes(e.v)?"-":J(r,Number(e.v))}</div>
3
- `,document.body.appendChild(n),V().then(()=>{const{width:d,height:m}=n.getBoundingClientRect();n.style.left=`${i-d/2}px`,n.style.top=`${u-m-Number(String(Number(f(r,g.PLOT_RADIUS,3))*1.5))}px`})}function z(t){const r=document.getElementById(`tooltip_${t}`);r==null||r.remove()}function Q(t){t.innerHTML=""}function T(t,r){let e=r;Q(t);const{svg:o,svgId:a,width:i,height:u}=H(t),{color:n,backgroundColor:d}=q(t),m={T:12,R:12,B:12,L:12},c={left:m.L,top:m.T,width:i-m.L-m.R,height:u-m.T-m.B,bottom:u-m.B},v=X(t),{min:E}=F(v),L=v.map(l=>[null,void 0].includes(l)?l:l+(E<0?Math.abs(E):0)),{max:$}=F(L),N=c.width/(v.length-1)===1/0?c.width:c.width/(v.length-1),I=Y(t),p=L.map((l,h)=>{const s={w:L.length===1?N/2:0,h:L.length===1?c.height/2:0};return{y:(1-(l||0)/$)*c.height+m.T+s.h,x:c.left+N*h+s.w,v:l,d:I[h]||null}}),C=[...p].filter(({v:l})=>![null,void 0].includes(l)),w=document.createElementNS(S,"path");w.classList.add("tiny-spark-line-path"),!t.dataset.curve||t.dataset.curve==="true"?w.setAttribute("d",`M ${P(C)}`):w.setAttribute("d",`M ${R(C)}`),w.setAttribute("fill","none"),w.setAttribute("stroke",String(f(t,g.LINE_COLOR,n))),w.setAttribute("stroke-width",String(f(t,g.LINE_THICKNESS,2))),w.setAttribute("stroke-linecap","round");const O=document.createElementNS(S,"path");O.classList.add("tiny-spark-line-area"),p.length&&(!t.dataset.curve||t.dataset.curve==="true"?O.setAttribute("d",`M ${C[0].x},${c.bottom} ${P(C)} L ${C.at(-1).x},${c.bottom} Z`):O.setAttribute("d",`M ${C[0].x},${c.bottom} ${R(C)} L ${C.at(-1).x},${c.bottom} Z`)),O.setAttribute("fill",String(f(t,g.AREA_COLOR,"transparent"))),p.length>1&&(o.appendChild(O),o.appendChild(w));const et=t.getAttribute("data-animation"),k=[];p.forEach((l,h)=>{const s=document.createElementNS(S,"line");s.classList.add("tiny-spark-indicator"),s.setAttribute("id",`indicator_${a}_${h}`),s.setAttribute("x1",String(c.left+(p.length===1?c.width/2:h*N))),s.setAttribute("x2",String(c.left+(p.length===1?c.width/2:h*N))),s.setAttribute("y1",String(c.top)),s.setAttribute("y2",String(c.bottom)),s.setAttribute("stroke",String(f(t,g.INDICATOR_COLOR,"#1A1A1A"))),s.setAttribute("stroke-width",String(f(t,g.INDICATOR_WIDTH,"1"))),s.setAttribute("stroke-linecap","round"),s.style.pointerEvents="none",s.style.opacity="0",k.push(s),o.appendChild(s)});let _=[];Number(String(f(t,g.PLOT_RADIUS,0)))>0&&p.forEach(({x:l,y:h,v:s},x)=>{if(![null,void 0].includes(s)){const b=document.createElementNS(S,"circle");b.classList.add("tiny-spark-datapoint-circle"),b.classList.add(`circle-${a}`),b.setAttribute("id",`circle_${a}_${x}`),b.setAttribute("cx",String(l)),b.setAttribute("cy",String(h)),b.setAttribute("r",String(f(t,g.PLOT_RADIUS,3))),b.setAttribute("fill",String(f(t,g.PLOT_COLOR,String(f(t,"lineColor",n))))),b.setAttribute("stroke",d),b.style.transition=`opacity ${x*(1e3*2/p.length)}ms ease-in`,b.style.opacity="0",o.appendChild(b),_.push(b)}}),p.forEach((l,h)=>{const s=document.createElementNS(S,"rect");s.classList.add("tiny-spark-tooltip-trap"),s.setAttribute("x",`${p.length===1?0:c.left+h*N-N/2}`),s.setAttribute("y",`${c.top}`),s.setAttribute("height",`${c.height}`),s.setAttribute("width",`${N}`),s.setAttribute("fill","transparent"),s.addEventListener("mouseenter",()=>{B(o,t,l,a,!0);const x=document.getElementById(`circle_${a}_${h}`);x==null||x.setAttribute("r",String(Number(f(t,g.PLOT_RADIUS,3))*1.5)),k[h].style.opacity="1"}),s.addEventListener("mouseout",()=>{B(o,t,l,a,!1);const x=document.getElementById(`circle_${a}_${h}`);x==null||x.setAttribute("r",String(Number(f(t,g.PLOT_RADIUS,3)))),k.forEach(b=>b.style.opacity="0")}),o.appendChild(s)}),et==="true"&&e?V().then(()=>{_.forEach(l=>{l.style.opacity="1"}),G(w),U(o,O)}):_.forEach(l=>{l.style.opacity="1"}),t.appendChild(o)}(function(){window.addEventListener("load",()=>{const r=W();r.length&&Array.from(r).forEach(e=>{tt(e),e.__renderCount=0,A(e),j(e,()=>A(e)),new ResizeObserver(i=>{i.forEach(u=>{A(e)})}).observe(e.parentElement),new MutationObserver(i=>{i.forEach(u=>{u.type==="attributes"&&u.attributeName&&u.attributeName.startsWith("data-")&&A(e)})}).observe(e,{attributes:!0})})})})();function A(t){t.__renderCount+=1,D(t,"set")&&T(t,t.__renderCount<3)}function tt(t){t.dataset.set||console.error(`Tiny-spark exception:
1
+ (function(O,y){typeof exports=="object"&&typeof module<"u"?y(exports):typeof define=="function"&&define.amd?define(["exports"],y):(O=typeof globalThis<"u"?globalThis:O||self,y(O.TinySpark={}))})(this,function(O){"use strict";const y="http://www.w3.org/2000/svg";var P=(t=>(t.BAR="data-bar",t.LINE="data-line",t.SET="data-set",t.RESPONSIVE="data-responsive",t))(P||{}),g=(t=>(t.ANIMATION="animation",t.AREA_COLOR="areaColor",t.CURVE="curve",t.DATES="dates",t.INDICATOR_COLOR="indicatorColor",t.INDICATOR_WIDTH="indicatorWidth",t.LINE_COLOR="lineColor",t.LINE_THICKNESS="lineThickness",t.NUMBER_LOCALE="numberLocale",t.NUMBER_ROUNDING="numberRounding",t.NUMBER_SHOW_ON="numberShowOn",t.PLOT_COLOR="plotColor",t.PLOT_RADIUS="plotRadius",t.SET="set",t))(g||{});function U(t){const{width:r,height:e}=t.parentElement.getBoundingClientRect(),o={width:300,height:100},a=`0 0 ${r||o.width} ${e||o.height}`,i=document.createElementNS(y,"svg"),u=Y();return i.id=u,i.setAttribute("viewBox",a),i.style.width="100%",i.style.height="100%",{svg:i,svgId:u,width:r||o.width,height:e||o.height}}function x(t,r=0){return isNaN(t)?r:t}function D(t){let r=[];for(let e=0;e<t.length;e+=1)r.push(`${x(t[e].x)},${x(t[e].y)} `);return r.join(" ").trim()}function F(t){if(t.length<1)return"0,0";const r=t.length-1,e=[`${x(t[0].x)},${x(t[0].y)}`],o=[],a=[],i=[],u=[];for(let n=0;n<r;n+=1)o[n]=t[n+1].x-t[n].x,a[n]=t[n+1].y-t[n].y,i[n]=a[n]/o[n];u[0]=i[0],u[r]=i[r-1];for(let n=1;n<r;n+=1)if(i[n-1]*i[n]<=0)u[n]=0;else{const d=2*i[n-1]*i[n]/(i[n-1]+i[n]);u[n]=d}for(let n=0;n<r;n+=1){const d=t[n].x,h=t[n].y,c=t[n+1].x,C=t[n+1].y,A=u[n],L=u[n+1],I=d+(c-d)/3,N=h+A*(c-d)/3,M=c-(c-d)/3,p=C-L*(c-d)/3;e.push(`C ${x(I)},${x(N)} ${x(M)},${x(p)} ${x(c)},${x(C)}`)}return e.join(" ")}function j(t,r=1e3){const e=t.getTotalLength();t.style.strokeDasharray=String(e),t.style.strokeDashoffset=String(e),t.getBoundingClientRect(),t.style.transition=`stroke-dashoffset ${r}ms ease-in-out`,t.style.strokeDashoffset="0",t.addEventListener("transitionend",function o(){t.style.transition="",t.removeEventListener("transitionend",o)})}function W(t,r,e=1e3){const o=r.getBBox(),a=o.width,i=document.createElementNS("http://www.w3.org/2000/svg","clipPath"),u="clip-"+Math.random().toString(36).substr(2,9);i.setAttribute("id",u);const n=document.createElementNS("http://www.w3.org/2000/svg","rect");n.setAttribute("x",o.x.toString()),n.setAttribute("y",o.y.toString()),n.setAttribute("width","0"),n.setAttribute("height",o.height.toString()),i.appendChild(n);let d=t.querySelector("defs");d||(d=document.createElementNS("http://www.w3.org/2000/svg","defs"),t.insertBefore(d,t.firstChild)),d.appendChild(i),r.setAttribute("clip-path",`url(#${u})`),n.style.transition=`width ${e}ms ease-out`,n.getBoundingClientRect(),n.setAttribute("width",a.toString()),n.addEventListener("transitionend",function h(){r.removeAttribute("clip-path"),i.parentNode&&i.parentNode.removeChild(i),n.removeEventListener("transitionend",h)})}function q(){return document.querySelectorAll(".tiny-spark")}function V(t,r){return Object.keys(t.dataset).includes(r)}function f(t,r,e){return V(t,r)?t.dataset[r]:e}function K(t,r){const e=new MutationObserver(o=>{for(const a of o)if(a.type==="attributes"&&a.attributeName&&Object.values(P).includes(a.attributeName)){r();break}});return e.observe(t,{attributes:!0}),e}function X(t){if(!t)return{color:"#1A1A1A",backgroundColor:"#FFFFFF"};const r=window.getComputedStyle(t),e=r.getPropertyValue("color")||"#1A1A1A",o=r.getPropertyValue("background-color"),a=r.getPropertyValue("background");return{color:e,backgroundColor:o||a||"#FFFFFF"}}function Y(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){const r=Math.random()*16|0;return(t=="x"?r:r&3|8).toString(16)})}function z(t){const r=t.getAttribute("data-set");if(!r)return[];try{const e=JSON.parse(r);return Array.isArray(e)&&e.every(o=>typeof o=="number"||[null,void 0].includes(o))?e:(console.warn("data-set is not an array of numbers."),[])}catch(e){return console.error("Error parsing data-set:",e),[]}}function J(t){const r=t.getAttribute("data-dates");if(!r)return[];try{const e=JSON.parse(r);return Array.isArray(e)&&e.every(o=>typeof o=="string")?e:(console.warn("data-dates is not an array of strings"),[])}catch(e){return console.error("Error parsing data-dates",e),[]}}function B(t){return{min:Math.min(...t),max:Math.max(...t)}}function H(){return new Promise(t=>setTimeout(t,0))}function Z(t,r){const e=String(f(t,g.NUMBER_LOCALE,navigator.language||"en-US")),o=Number(String(f(t,g.NUMBER_ROUNDING,0)));return r.toLocaleString(e,{useGrouping:!0,minimumFractionDigits:o,maximumFractionDigits:o})}function Q(t,r,e){if(!t.createSVGPoint||!t.getScreenCTM)throw new Error("Your browser does not support SVG coordinate transformation.");const o=t.getScreenCTM();if(!o)throw new Error("Cannot obtain the screen CTM.");const a=t.createSVGPoint();a.x=r,a.y=e;const i=a.matrixTransform(o);return{x:i.x,y:i.y}}function G(t,r,e,o,a){if(T(o),!a)return;const{x:i,y:u}=Q(t,e.x,e.y),n=document.createElement("div");n.classList.add("tiny-spark-tooltip"),n.setAttribute("id",`tooltip_${o}`),n.style.pointerEvents="none",n.style.position="fixed",n.style.top=u+"px",n.style.left=i+"px",n.style.width="fit-content",n.innerHTML=`
2
+ <div class="tiny-spark-tooltip-content">${e.d?`${e.d}: `:""}${[null,void 0].includes(e.v)?"-":Z(r,Number(e.v))}</div>
3
+ `,document.body.appendChild(n),H().then(()=>{const{width:d,height:h}=n.getBoundingClientRect();n.style.left=`${i-d/2}px`,n.style.top=`${u-h-Number(String(Number(f(r,g.PLOT_RADIUS,3))*1.5))}px`})}function T(t){const r=document.getElementById(`tooltip_${t}`);r==null||r.remove()}function tt(t){t.innerHTML=""}function et(t,r){let e=r;tt(t);const{svg:o,svgId:a,width:i,height:u}=U(t),{color:n,backgroundColor:d}=X(t),h={T:12,R:12,B:12,L:12},c={left:h.L,top:h.T,width:i-h.L-h.R,height:u-h.T-h.B,bottom:u-h.B},C=z(t),{min:A}=B(C),L=C.map(l=>[null,void 0].includes(l)?l:l+(A<0?Math.abs(A):0)),{max:I}=B(L),N=c.width/(C.length-1)===1/0?c.width:c.width/(C.length-1),M=J(t),p=L.map((l,m)=>{const s={w:L.length===1?N/2:0,h:L.length===1?c.height/2:0};return{y:(1-(l||0)/I)*c.height+h.T+s.h,x:c.left+N*m+s.w,v:l,d:M[m]||null}}),w=[...p].filter(({v:l})=>![null,void 0].includes(l)),v=document.createElementNS(y,"path");v.classList.add("tiny-spark-line-path"),!t.dataset.curve||t.dataset.curve==="true"?v.setAttribute("d",`M ${F(w)}`):v.setAttribute("d",`M ${D(w)}`),v.setAttribute("fill","none"),v.setAttribute("stroke",String(f(t,g.LINE_COLOR,n))),v.setAttribute("stroke-width",String(f(t,g.LINE_THICKNESS,2))),v.setAttribute("stroke-linecap","round");const E=document.createElementNS(y,"path");E.classList.add("tiny-spark-line-area"),p.length&&(!t.dataset.curve||t.dataset.curve==="true"?E.setAttribute("d",`M ${w[0].x},${c.bottom} ${F(w)} L ${w.at(-1).x},${c.bottom} Z`):E.setAttribute("d",`M ${w[0].x},${c.bottom} ${D(w)} L ${w.at(-1).x},${c.bottom} Z`)),E.setAttribute("fill",String(f(t,g.AREA_COLOR,"transparent"))),p.length>1&&(o.appendChild(E),o.appendChild(v));const rt=t.getAttribute("data-animation"),R=[];p.forEach((l,m)=>{const s=document.createElementNS(y,"line");s.classList.add("tiny-spark-indicator"),s.setAttribute("id",`indicator_${a}_${m}`),s.setAttribute("x1",String(c.left+(p.length===1?c.width/2:m*N))),s.setAttribute("x2",String(c.left+(p.length===1?c.width/2:m*N))),s.setAttribute("y1",String(c.top)),s.setAttribute("y2",String(c.bottom)),s.setAttribute("stroke",String(f(t,g.INDICATOR_COLOR,"#1A1A1A"))),s.setAttribute("stroke-width",String(f(t,g.INDICATOR_WIDTH,"1"))),s.setAttribute("stroke-linecap","round"),s.style.pointerEvents="none",s.style.opacity="0",R.push(s),o.appendChild(s)});let _=[];Number(String(f(t,g.PLOT_RADIUS,0)))>0&&p.forEach(({x:l,y:m,v:s},S)=>{if(![null,void 0].includes(s)){const b=document.createElementNS(y,"circle");b.classList.add("tiny-spark-datapoint-circle"),b.classList.add(`circle-${a}`),b.setAttribute("id",`circle_${a}_${S}`),b.setAttribute("cx",String(l)),b.setAttribute("cy",String(m)),b.setAttribute("r",String(f(t,g.PLOT_RADIUS,3))),b.setAttribute("fill",String(f(t,g.PLOT_COLOR,String(f(t,"lineColor",n))))),b.setAttribute("stroke",d),b.style.transition=`opacity ${S*(1e3*2/p.length)}ms ease-in`,b.style.opacity="0",o.appendChild(b),_.push(b)}}),p.forEach((l,m)=>{const s=document.createElementNS(y,"rect");s.classList.add("tiny-spark-tooltip-trap"),s.setAttribute("x",`${p.length===1?0:c.left+m*N-N/2}`),s.setAttribute("y",`${c.top}`),s.setAttribute("height",`${c.height}`),s.setAttribute("width",`${N}`),s.setAttribute("fill","transparent"),s.addEventListener("mouseenter",()=>{G(o,t,l,a,!0);const S=document.getElementById(`circle_${a}_${m}`);S==null||S.setAttribute("r",String(Number(f(t,g.PLOT_RADIUS,3))*1.5)),R[m].style.opacity="1"}),s.addEventListener("mouseout",()=>{G(o,t,l,a,!1);const S=document.getElementById(`circle_${a}_${m}`);S==null||S.setAttribute("r",String(Number(f(t,g.PLOT_RADIUS,3)))),R.forEach(b=>b.style.opacity="0")}),o.appendChild(s)}),rt==="true"&&e?H().then(()=>{_.forEach(l=>{l.style.opacity="1"}),j(v),W(o,E)}):_.forEach(l=>{l.style.opacity="1"}),t.appendChild(o)}function k(){const t=q();t.length&&Array.from(t).forEach(r=>{const e=r;nt(e),e.__renderCount=0,$(e),K(e,()=>$(e));const o=new ResizeObserver(i=>{i.forEach(()=>$(e))});e.parentElement&&o.observe(e.parentElement),new MutationObserver(i=>{i.forEach(u=>{u.type==="attributes"&&u.attributeName&&u.attributeName.startsWith("data-")&&$(e)})}).observe(e,{attributes:!0})})}function $(t){t.__renderCount+=1,V(t,"set")&&et(t,t.__renderCount<3)}function nt(t){t.dataset.set||console.error(`Tiny-spark exception:
4
4
 
5
- [data-set] data attribute is missing.
6
- Provide an array of numbers, for example:
5
+ [data-set] data attribute is missing.
6
+ Provide an array of numbers, for example:
7
7
 
8
- data-set="[1, 2, 3]"`)}});
8
+ data-set="[1, 2, 3]"`)}document.readyState==="loading"?window.addEventListener("load",k):k(),O.render=k,Object.defineProperty(O,Symbol.toStringTag,{value:"Module"})});
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "tiny-spark",
3
3
  "private": false,
4
- "version": "0.1.0",
4
+ "version": "0.1.2-beta.0",
5
5
  "type": "module",
6
6
  "description": "An elegant, reactive and responsive sparkline chart solution without dependency.",
7
7
  "author": "Alec Lloyd Probert",
@@ -18,6 +18,7 @@
18
18
  "type": "git",
19
19
  "url": "git+https://github.com/graphieros/tiny-spark.git"
20
20
  },
21
+ "homepage": "https://tiny-spark.graphieros.com/",
21
22
  "scripts": {
22
23
  "dev": "vite",
23
24
  "build": "tsc && vite build"