@wick-charts/vue 0.5.1 → 0.6.1
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 +45 -6
- package/dist/BarSeries.vue.js +26 -20
- package/dist/CandlestickSeries.vue.js +30 -24
- package/dist/ChartContainer.vue.js +125 -72
- package/dist/HeatmapSeries.vue.js +40 -0
- package/dist/HeatmapSeries.vue2.js +4 -0
- package/dist/LineSeries.vue.js +26 -20
- package/dist/PieSeries.vue.js +24 -18
- package/dist/core/dist/animation/animator.js +21 -21
- package/dist/core/dist/animation/config.js +114 -87
- package/dist/core/dist/animation/easing.js +3 -1
- package/dist/core/dist/animation/intro-wave.js +68 -0
- package/dist/core/dist/axis/dom-labels.js +13 -14
- package/dist/core/dist/chart/badge-animator.js +56 -0
- package/dist/core/dist/chart/edge-indicators.js +28 -13
- package/dist/core/dist/chart/last-value.js +18 -17
- package/dist/core/dist/chart/options.js +27 -16
- package/dist/core/dist/chart/y-target.js +13 -12
- package/dist/core/dist/chart.js +868 -441
- package/dist/core/dist/components/annotation-chip.js +28 -0
- package/dist/core/dist/components/crosshair.js +8 -6
- package/dist/core/dist/components/edge-indicator.js +58 -26
- package/dist/core/dist/components/loading-indicator.js +46 -0
- package/dist/core/dist/components/marker.js +49 -31
- package/dist/core/dist/components/reference-line.js +27 -36
- package/dist/core/dist/components/time-region.js +30 -28
- package/dist/core/dist/data/store.js +38 -19
- package/dist/core/dist/data/sync.js +60 -38
- package/dist/core/dist/heatmap-tooltip.js +16 -0
- package/dist/core/dist/interactions/handler.js +86 -46
- package/dist/core/dist/perf/perf-hud.js +5 -5
- package/dist/core/dist/scales/x-scale.js +85 -37
- package/dist/core/dist/scales/y-scale.js +38 -27
- package/dist/core/dist/series/bar-intro.js +18 -0
- package/dist/core/dist/series/bar.js +337 -205
- package/dist/core/dist/series/base-multi-layer.js +224 -96
- package/dist/core/dist/series/candlestick-intro.js +57 -0
- package/dist/core/dist/series/candlestick.js +454 -276
- package/dist/core/dist/series/heatmap.js +387 -0
- package/dist/core/dist/series/line-intro.js +85 -0
- package/dist/core/dist/series/line.js +590 -282
- package/dist/core/dist/series/painters/builtins.js +2 -2
- package/dist/core/dist/series/pie.js +396 -259
- package/dist/core/dist/series/register-builtins.js +8 -7
- package/dist/core/dist/series/types.js +6 -0
- package/dist/core/dist/series/wave-intro.js +26 -0
- package/dist/core/dist/theme/create.js +69 -63
- package/dist/core/dist/theme/themes/mint-breeze.js +2 -2
- package/dist/core/dist/theme/themes/sand-dune.js +2 -2
- package/dist/core/dist/utils/color.js +109 -34
- package/dist/core/dist/utils/deep-equal.js +18 -0
- package/dist/core/dist/utils/time.js +25 -19
- package/dist/index.d.ts +1494 -122
- package/dist/index.js +177 -130
- package/dist/ui/Crosshair.vue.js +20 -21
- package/dist/ui/HeatmapTooltip.vue.js +96 -0
- package/dist/ui/HeatmapTooltip.vue2.js +4 -0
- package/dist/ui/InfoBar.vue.js +46 -47
- package/dist/ui/Legend.vue.js +80 -79
- package/dist/ui/PieLegend.vue.js +5 -5
- package/dist/ui/PieTooltip.vue.js +77 -67
- package/dist/ui/Tooltip.vue.js +60 -60
- package/dist/ui/YAxis.vue.js +2 -2
- package/dist/ui/YLabel.vue.js +94 -61
- package/package.json +2 -2
- package/src/BarSeries.vue +23 -7
- package/src/CandlestickSeries.vue +23 -7
- package/src/ChartContainer.vue +250 -13
- package/src/HeatmapSeries.vue +69 -0
- package/src/LineSeries.vue +23 -7
- package/src/PieSeries.vue +22 -6
- package/src/index.ts +84 -3
- package/src/ui/Crosshair.vue +1 -2
- package/src/ui/HeatmapTooltip.vue +144 -0
- package/src/ui/InfoBar.vue +1 -2
- package/src/ui/Legend.vue +13 -0
- package/src/ui/Marker.vue +1 -1
- package/src/ui/PieTooltip.vue +10 -0
- package/src/ui/ReferenceLine.vue +2 -2
- package/src/ui/TimeRegion.vue +2 -2
- package/src/ui/Tooltip.vue +2 -2
- package/src/ui/YLabel.vue +123 -8
|
@@ -1,31 +1,32 @@
|
|
|
1
|
+
import { isTimeSeriesRenderer as c } from "../series/types.js";
|
|
1
2
|
const a = (e) => "close" in e ? e.close : e.value;
|
|
2
|
-
function
|
|
3
|
-
const t =
|
|
3
|
+
function d(e, s, i) {
|
|
4
|
+
const t = s.find((f) => f.id === e);
|
|
4
5
|
if (!t) return null;
|
|
5
6
|
const n = t.renderer;
|
|
6
|
-
if (n
|
|
7
|
+
if (!c(n)) return null;
|
|
7
8
|
const r = n.getLastDataPoint();
|
|
8
9
|
if (!r) return null;
|
|
9
|
-
const { from: u, to: o } =
|
|
10
|
+
const { from: u, to: o } = i;
|
|
10
11
|
if (r.time >= u && r.time <= o)
|
|
11
12
|
return { value: a(r), isLive: !0 };
|
|
12
|
-
const
|
|
13
|
-
return
|
|
13
|
+
const l = n.getVisibleDataPoints(u, o);
|
|
14
|
+
return l.length === 0 ? null : { value: a(l[l.length - 1]), isLive: !1 };
|
|
14
15
|
}
|
|
15
|
-
function
|
|
16
|
-
const t =
|
|
17
|
-
return t ? t.renderer.getStackedLastValue?.() ||
|
|
16
|
+
function v(e, s, i) {
|
|
17
|
+
const t = s.find((r) => r.id === e);
|
|
18
|
+
return t ? t.renderer.getStackedLastValue?.() || d(e, s, i) : null;
|
|
18
19
|
}
|
|
19
|
-
function
|
|
20
|
-
const
|
|
21
|
-
if (!
|
|
22
|
-
const t =
|
|
23
|
-
if (t
|
|
20
|
+
function L(e, s) {
|
|
21
|
+
const i = s.find((r) => r.id === e);
|
|
22
|
+
if (!i) return null;
|
|
23
|
+
const t = i.renderer;
|
|
24
|
+
if (!c(t)) return null;
|
|
24
25
|
const n = t.getSecondLastDataPoint();
|
|
25
26
|
return n ? "close" in n ? n.close : n.value : null;
|
|
26
27
|
}
|
|
27
28
|
export {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
d as getLastValue,
|
|
30
|
+
L as getPreviousClose,
|
|
31
|
+
v as getStackedLastValue
|
|
31
32
|
};
|
|
@@ -1,5 +1,15 @@
|
|
|
1
|
-
import { DEFAULT_MAX_VISIBLE_BARS as
|
|
2
|
-
function
|
|
1
|
+
import { DEFAULT_MAX_VISIBLE_BARS as i, MIN_VISIBLE_BARS as r } from "./pan-zoom-math.js";
|
|
2
|
+
function n(t) {
|
|
3
|
+
return t === void 0 || !Number.isFinite(t) || t <= 0 ? 0 : t;
|
|
4
|
+
}
|
|
5
|
+
function a(t) {
|
|
6
|
+
return {
|
|
7
|
+
top: n(t?.top),
|
|
8
|
+
right: t?.right === void 0 ? null : n(t.right),
|
|
9
|
+
left: n(t?.left)
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
function l(t) {
|
|
3
13
|
if (!t) return { monitor: null, ownsMonitor: !1, hud: null };
|
|
4
14
|
if (typeof t != "object" || !("monitor" in t || "recordFrame" in t))
|
|
5
15
|
throw new Error(
|
|
@@ -7,29 +17,30 @@ function s(t) {
|
|
|
7
17
|
);
|
|
8
18
|
return "recordFrame" in t ? { monitor: t, ownsMonitor: !1, hud: null } : { monitor: t.monitor, ownsMonitor: t.ownsMonitor ?? !1, hud: t.hud ?? null };
|
|
9
19
|
}
|
|
10
|
-
const
|
|
20
|
+
const e = {
|
|
11
21
|
top: 20,
|
|
12
22
|
bottom: 20,
|
|
13
23
|
right: { intervals: 3 },
|
|
14
24
|
left: { intervals: 0 }
|
|
15
25
|
};
|
|
16
|
-
function
|
|
26
|
+
function f(t) {
|
|
17
27
|
return {
|
|
18
|
-
top: t?.top ??
|
|
19
|
-
bottom: t?.bottom ??
|
|
20
|
-
right: t?.right ??
|
|
21
|
-
left: t?.left ??
|
|
28
|
+
top: t?.top ?? e.top,
|
|
29
|
+
bottom: t?.bottom ?? e.bottom,
|
|
30
|
+
right: t?.right ?? e.right,
|
|
31
|
+
left: t?.left ?? e.left
|
|
22
32
|
};
|
|
23
33
|
}
|
|
24
|
-
function
|
|
25
|
-
return typeof t == "number" && typeof
|
|
34
|
+
function u(t, o) {
|
|
35
|
+
return typeof t == "number" && typeof o == "number" ? t === o : typeof t == "object" && typeof o == "object" ? t.intervals === o.intervals : !1;
|
|
26
36
|
}
|
|
27
|
-
function
|
|
28
|
-
return t === void 0 ?
|
|
37
|
+
function m(t) {
|
|
38
|
+
return t === void 0 ? i : Number.isFinite(t) ? Math.max(r, Math.floor(t)) : i;
|
|
29
39
|
}
|
|
30
40
|
export {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
41
|
+
u as isSameHorizontalPadding,
|
|
42
|
+
a as resolveFade,
|
|
43
|
+
m as resolveMaxVisibleBars,
|
|
44
|
+
f as resolvePadding,
|
|
45
|
+
l as resolvePerfOptions
|
|
35
46
|
};
|
|
@@ -1,24 +1,25 @@
|
|
|
1
|
-
|
|
1
|
+
import { isTimeSeriesRenderer as m } from "../series/types.js";
|
|
2
|
+
function c(e, t, i) {
|
|
2
3
|
let o = 1 / 0, a = -1 / 0;
|
|
3
|
-
for (const n of
|
|
4
|
-
if (!n.visible || n.renderer
|
|
5
|
-
const
|
|
6
|
-
|
|
4
|
+
for (const n of t) {
|
|
5
|
+
if (!n.visible || !m(n.renderer)) continue;
|
|
6
|
+
const r = n.renderer.getValueRange(e.from, e.to);
|
|
7
|
+
r && (r.max > a && (a = r.max), r.min < o && (o = r.min), i?.push(r.min, r.max));
|
|
7
8
|
}
|
|
8
9
|
return o === 1 / 0 || a === -1 / 0 ? null : { min: o, max: a };
|
|
9
10
|
}
|
|
10
|
-
function
|
|
11
|
-
if (e === void 0 || e === "auto") return
|
|
11
|
+
function p(e, t, i, o, a) {
|
|
12
|
+
if (e === void 0 || e === "auto") return t;
|
|
12
13
|
if (typeof e == "number") return e;
|
|
13
14
|
if (typeof e == "function") return e(o);
|
|
14
15
|
const n = String(e).match(/^([+-]?)\s*(\d+(?:\.\d+)?)\s*%$/);
|
|
15
16
|
if (n) {
|
|
16
|
-
const
|
|
17
|
-
return
|
|
17
|
+
const r = n[1] === "-" ? -1 : 1, s = parseFloat(n[2]) / 100, u = Math.abs(i - t) || Math.abs(t) || 1;
|
|
18
|
+
return t + r * s * u * (a === "max" ? 1 : -1);
|
|
18
19
|
}
|
|
19
|
-
return
|
|
20
|
+
return t;
|
|
20
21
|
}
|
|
21
22
|
export {
|
|
22
|
-
|
|
23
|
-
|
|
23
|
+
c as computeTargetYRange,
|
|
24
|
+
p as resolveBound
|
|
24
25
|
};
|