@wick-charts/vue 0.6.2 → 0.6.4
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 +2 -2
- package/dist/BandSeries.vue.js +50 -0
- package/dist/BandSeries.vue2.js +4 -0
- package/dist/ChartContainer.vue.js +45 -39
- package/dist/composables.js +39 -26
- package/dist/core/dist/animation/config.js +92 -75
- package/dist/core/dist/axis/dom-labels.js +56 -43
- package/dist/core/dist/chart/badge-animator.js +30 -22
- package/dist/core/dist/chart/edge-indicators.js +22 -21
- package/dist/core/dist/chart/last-value.js +33 -26
- package/dist/core/dist/chart/options.js +5 -5
- package/dist/core/dist/chart/scale-guards.js +26 -0
- package/dist/core/dist/chart/y-target.js +46 -19
- package/dist/core/dist/chart.js +670 -518
- package/dist/core/dist/components/crosshair.js +8 -8
- package/dist/core/dist/components/grid.js +26 -17
- package/dist/core/dist/components/marker.js +28 -28
- package/dist/core/dist/components/reference-line.js +16 -16
- package/dist/core/dist/data/decimation.js +58 -39
- package/dist/core/dist/interactions/handler.js +3 -2
- package/dist/core/dist/interactions/zoom.js +6 -5
- package/dist/core/dist/navigator/controller.js +47 -44
- package/dist/core/dist/perf/perf-hud.js +3 -3
- package/dist/core/dist/scales/log-scale.js +76 -0
- package/dist/core/dist/scales/y-scale.js +134 -35
- package/dist/core/dist/series/band.js +670 -0
- package/dist/core/dist/series/bar-intro.js +11 -11
- package/dist/core/dist/series/bar.js +301 -251
- package/dist/core/dist/series/base-multi-layer.js +100 -76
- package/dist/core/dist/series/candlestick.js +238 -235
- package/dist/core/dist/series/heatmap.js +5 -5
- package/dist/core/dist/series/line-intro.js +50 -40
- package/dist/core/dist/series/line.js +561 -483
- package/dist/core/dist/series/painters/builtins.js +4 -4
- package/dist/core/dist/series/painters/canvas-path.js +64 -52
- package/dist/core/dist/series/register-builtins.js +9 -8
- package/dist/core/dist/series/scale-stack.js +25 -0
- package/dist/core/dist/snapshots.js +36 -35
- package/dist/core/dist/tooltip-position.js +5 -5
- package/dist/core/dist/utils/point.js +10 -0
- package/dist/index.d.ts +501 -128
- package/dist/index.js +195 -189
- package/dist/ui/Crosshair.vue.js +14 -14
- package/dist/ui/HeatmapTooltip.vue.js +6 -6
- package/dist/ui/InfoBar.vue.js +100 -81
- package/dist/ui/PieTooltip.vue.js +4 -4
- package/dist/ui/TimeAxis.vue.js +23 -22
- package/dist/ui/Tooltip.vue.js +140 -111
- package/dist/ui/YAxis.vue.js +25 -24
- package/dist/ui/YLabel.vue.js +63 -70
- package/package.json +2 -2
- package/src/BandSeries.vue +87 -0
- package/src/ChartContainer.vue +20 -8
- package/src/composables.ts +35 -1
- package/src/index.ts +13 -0
- package/src/ui/Crosshair.vue +2 -2
- package/src/ui/InfoBar.vue +20 -1
- package/src/ui/TimeAxis.vue +7 -4
- package/src/ui/Tooltip.vue +40 -3
- package/src/ui/YAxis.vue +5 -3
- package/src/ui/YLabel.vue +5 -16
|
@@ -5,7 +5,7 @@ import { sampleRamp as Y, deriveHeatmapRamp as st, mixColors as et, isLightColor
|
|
|
5
5
|
import { formatCompact as ot } from "../utils/format.js";
|
|
6
6
|
import { clamp as v, smoothToward as z } from "../utils/math.js";
|
|
7
7
|
import { fillRoundedRect as nt } from "./painters/canvas-path.js";
|
|
8
|
-
const
|
|
8
|
+
const E = {
|
|
9
9
|
fontSize: 10
|
|
10
10
|
};
|
|
11
11
|
function ht(r, s) {
|
|
@@ -20,9 +20,9 @@ const lt = {
|
|
|
20
20
|
updateMs: Q
|
|
21
21
|
};
|
|
22
22
|
function rt(r) {
|
|
23
|
-
return r === void 0 || r === !1 ? !1 : r === !0 ?
|
|
23
|
+
return r === void 0 || r === !1 ? !1 : r === !0 ? E : { ...E, ...r };
|
|
24
24
|
}
|
|
25
|
-
function
|
|
25
|
+
function P(r, s) {
|
|
26
26
|
const t = {
|
|
27
27
|
...r,
|
|
28
28
|
...s,
|
|
@@ -92,7 +92,7 @@ class ct {
|
|
|
92
92
|
/** Data extent cached by {@link #rebuildGrid} — see {@link #domain}. */
|
|
93
93
|
#M = { min: 0, max: 1 };
|
|
94
94
|
constructor(s, t) {
|
|
95
|
-
this.#t =
|
|
95
|
+
this.#t = P(lt, s ?? {}), this.#r = this.#t.entryMs === 0, this.#g = t ?? null;
|
|
96
96
|
}
|
|
97
97
|
// --- Data ingest -----------------------------------------------------------
|
|
98
98
|
setData(s) {
|
|
@@ -118,7 +118,7 @@ class ct {
|
|
|
118
118
|
}
|
|
119
119
|
updateOptions(s) {
|
|
120
120
|
const t = this.#t.columns, e = this.#t.rows;
|
|
121
|
-
this.#t =
|
|
121
|
+
this.#t = P(this.#t, s ?? {}), (this.#t.columns !== t || this.#t.rows !== e) && this.#b(), this.#t.entryMs === 0 && (this.#r = !0), this.#t.updateMs === 0 && (this.#u = !1), this.#o = null;
|
|
122
122
|
}
|
|
123
123
|
// --- Layer model (single-layer no-ops, mirroring pie) ----------------------
|
|
124
124
|
getLayerCount() {
|
|
@@ -3,59 +3,59 @@ function l(e) {
|
|
|
3
3
|
return e <= 0 ? 0 : e >= 1 ? 1 : e;
|
|
4
4
|
}
|
|
5
5
|
function g(e) {
|
|
6
|
-
const
|
|
6
|
+
const n = f(e.progress), t = e.range.from + n * (e.range.to - e.range.from);
|
|
7
7
|
return { x: e.timeToX(t), time: t };
|
|
8
8
|
}
|
|
9
|
-
function
|
|
10
|
-
const
|
|
9
|
+
function I(e = {}) {
|
|
10
|
+
const n = e.head ?? !0;
|
|
11
11
|
return (t) => {
|
|
12
12
|
const r = g(t);
|
|
13
|
-
return { clip: { toX: r.x }, heads:
|
|
13
|
+
return { clip: { toX: r.x }, heads: n ? [r] : void 0 };
|
|
14
14
|
};
|
|
15
15
|
}
|
|
16
|
-
function
|
|
17
|
-
const
|
|
16
|
+
function v(e = {}) {
|
|
17
|
+
const n = Math.min(l(e.stagger ?? 0.35), 0.9);
|
|
18
18
|
return (t) => ({
|
|
19
|
-
value: ({ layerIndex: r, value:
|
|
20
|
-
const
|
|
21
|
-
if (
|
|
22
|
-
const
|
|
23
|
-
return
|
|
19
|
+
value: ({ layerIndex: r, value: s, position: u }) => {
|
|
20
|
+
const i = t.layerMean(r);
|
|
21
|
+
if (i === null || !Number.isFinite(s)) return s;
|
|
22
|
+
const o = l((t.progress - n * u) / (1 - n));
|
|
23
|
+
return t.lerpValue(i, s, d(o));
|
|
24
24
|
}
|
|
25
25
|
});
|
|
26
26
|
}
|
|
27
|
-
function
|
|
28
|
-
const e =
|
|
29
|
-
return (
|
|
30
|
-
if (
|
|
31
|
-
const t =
|
|
32
|
-
if (t === null || t.length < 2) return e(
|
|
27
|
+
function y() {
|
|
28
|
+
const e = I();
|
|
29
|
+
return (n) => {
|
|
30
|
+
if (n.stacking !== "off") return e(n);
|
|
31
|
+
const t = n.primaryPath();
|
|
32
|
+
if (t === null || t.length < 2) return e(n);
|
|
33
33
|
let r = 0;
|
|
34
|
-
const
|
|
35
|
-
for (let
|
|
36
|
-
const
|
|
37
|
-
|
|
34
|
+
const s = [];
|
|
35
|
+
for (let o = 1; o < t.length; o++) {
|
|
36
|
+
const a = Math.hypot(t[o].x - t[o - 1].x, t[o].y - t[o - 1].y);
|
|
37
|
+
s.push(a), r += a;
|
|
38
38
|
}
|
|
39
|
-
if (r <= 0) return e(
|
|
40
|
-
let
|
|
41
|
-
for (let
|
|
42
|
-
const
|
|
43
|
-
if (
|
|
44
|
-
|
|
39
|
+
if (r <= 0) return e(n);
|
|
40
|
+
let u = n.progress * r;
|
|
41
|
+
for (let o = 1; o < t.length; o++) {
|
|
42
|
+
const a = s[o - 1];
|
|
43
|
+
if (u > a) {
|
|
44
|
+
u -= a;
|
|
45
45
|
continue;
|
|
46
46
|
}
|
|
47
|
-
const
|
|
47
|
+
const p = a > 0 ? u / a : 1, c = t[o - 1], h = t[o], m = c.x + (h.x - c.x) * p, x = c.time + (h.time - c.time) * p;
|
|
48
48
|
return { clip: { toX: m }, heads: [{ x: m, time: x }] };
|
|
49
49
|
}
|
|
50
|
-
const
|
|
51
|
-
return { clip: { toX:
|
|
50
|
+
const i = t[t.length - 1];
|
|
51
|
+
return { clip: { toX: i.x }, heads: [{ x: i.x, time: i.time }] };
|
|
52
52
|
};
|
|
53
53
|
}
|
|
54
|
-
function
|
|
55
|
-
const
|
|
54
|
+
function T(e = {}) {
|
|
55
|
+
const n = l(e.ghostAlpha ?? 0.18);
|
|
56
56
|
return (t) => {
|
|
57
57
|
const r = g(t);
|
|
58
|
-
return { clip: { toX: r.x }, heads: [r], ghostAlpha:
|
|
58
|
+
return { clip: { toX: r.x }, heads: [r], ghostAlpha: n };
|
|
59
59
|
};
|
|
60
60
|
}
|
|
61
61
|
function b() {
|
|
@@ -63,9 +63,9 @@ function b() {
|
|
|
63
63
|
clip: { toX: f(e.progress) * e.width }
|
|
64
64
|
});
|
|
65
65
|
}
|
|
66
|
-
function
|
|
66
|
+
function w() {
|
|
67
67
|
return (e) => {
|
|
68
|
-
const
|
|
68
|
+
const n = f(e.progress), t = e.width / 2, r = t * n;
|
|
69
69
|
return {
|
|
70
70
|
clip: { fromX: t - r, toX: t + r },
|
|
71
71
|
heads: [
|
|
@@ -75,11 +75,21 @@ function k() {
|
|
|
75
75
|
};
|
|
76
76
|
};
|
|
77
77
|
}
|
|
78
|
+
function M(e, n) {
|
|
79
|
+
const t = n.getTransform();
|
|
80
|
+
let r = 0, s = 0;
|
|
81
|
+
for (const i of e)
|
|
82
|
+
n.isPlottable(i.value) && (r += t === null ? i.value : t.forward(i.value), s++);
|
|
83
|
+
if (s === 0) return null;
|
|
84
|
+
const u = r / s;
|
|
85
|
+
return t === null ? u : t.inverse(u);
|
|
86
|
+
}
|
|
78
87
|
export {
|
|
79
88
|
b as backfillSweepIntro,
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
89
|
+
w as centerOutIntro,
|
|
90
|
+
y as plotterIntro,
|
|
91
|
+
M as scaleMean,
|
|
92
|
+
I as sweepIntro,
|
|
93
|
+
T as traceIntro,
|
|
94
|
+
v as unfoldIntro
|
|
85
95
|
};
|