@wick-charts/vue 0.6.3 → 0.7.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 +6 -6
- package/dist/BandSeries.vue.js +52 -0
- package/dist/BandSeries.vue2.js +4 -0
- package/dist/BarSeries.vue.js +15 -13
- package/dist/CandlestickSeries.vue.js +31 -29
- package/dist/ChartContainer.vue.js +75 -68
- package/dist/LineSeries.vue.js +19 -17
- package/dist/composables.js +46 -36
- package/dist/core/dist/animation/config.js +92 -75
- package/dist/core/dist/animation/viewport-engine.js +155 -96
- package/dist/core/dist/axis/dom-labels.js +56 -51
- 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/scale-guards.js +23 -5
- package/dist/core/dist/chart/x-guards.js +37 -0
- package/dist/core/dist/chart.js +1286 -842
- package/dist/core/dist/data/decimation.js +58 -39
- package/dist/core/dist/data/sync.js +37 -31
- package/dist/core/dist/navigator/controller.js +41 -41
- package/dist/core/dist/perf/perf-hud.js +3 -3
- package/dist/core/dist/scales/tick-tracker.js +2 -2
- package/dist/core/dist/scales/x-scale.js +167 -53
- package/dist/core/dist/scales/y-scale.js +36 -34
- package/dist/core/dist/series/band.js +723 -0
- package/dist/core/dist/series/bar.js +297 -291
- package/dist/core/dist/series/base-multi-layer.js +283 -237
- package/dist/core/dist/series/candlestick.js +32 -31
- package/dist/core/dist/series/heatmap.js +5 -5
- package/dist/core/dist/series/line-intro.js +47 -37
- package/dist/core/dist/series/line.js +489 -448
- 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/snapshots.js +59 -46
- package/dist/core/dist/utils/point.js +10 -0
- package/dist/index.d.ts +552 -129
- package/dist/index.js +195 -191
- package/dist/ui/Crosshair.vue.js +51 -27
- package/dist/ui/InfoBar.vue.js +98 -79
- package/dist/ui/Marker.vue.js +14 -11
- package/dist/ui/Navigator.vue.js +23 -23
- package/dist/ui/ReferenceLine.vue.js +19 -16
- package/dist/ui/Tooltip.vue.js +116 -84
- package/dist/ui/XAxis.vue.js +48 -0
- package/dist/ui/XAxis.vue2.js +4 -0
- package/dist/ui/YAxis.vue.js +44 -28
- package/dist/ui/YLabel.vue.js +82 -85
- package/package.json +2 -2
- package/src/BandSeries.vue +92 -0
- package/src/BarSeries.vue +13 -6
- package/src/CandlestickSeries.vue +9 -5
- package/src/ChartContainer.vue +20 -0
- package/src/LineSeries.vue +13 -6
- package/src/composables.ts +23 -4
- package/src/index.ts +16 -1
- package/src/ui/Crosshair.vue +41 -1
- package/src/ui/InfoBar.vue +22 -2
- package/src/ui/Marker.vue +5 -1
- package/src/ui/Navigator.vue +2 -1
- package/src/ui/ReferenceLine.vue +5 -1
- package/src/ui/Tooltip.vue +43 -6
- package/src/ui/{TimeAxis.vue → XAxis.vue} +18 -5
- package/src/ui/YAxis.vue +66 -12
- package/src/ui/YLabel.vue +37 -18
- package/dist/ui/TimeAxis.vue.js +0 -44
- package/dist/ui/TimeAxis.vue2.js +0 -4
|
@@ -1,32 +1,39 @@
|
|
|
1
|
-
import { isTimeSeriesRenderer as
|
|
2
|
-
|
|
3
|
-
function
|
|
4
|
-
|
|
1
|
+
import { isTimeSeriesRenderer as d } from "../series/types.js";
|
|
2
|
+
import { isBandPoint as g, pointValue as m } from "../utils/point.js";
|
|
3
|
+
function o(n) {
|
|
4
|
+
return g(n) ? null : m(n);
|
|
5
|
+
}
|
|
6
|
+
function L(n, i, u) {
|
|
7
|
+
const t = i.find((l) => l.id === n);
|
|
5
8
|
if (!t) return null;
|
|
6
|
-
const
|
|
7
|
-
if (!
|
|
8
|
-
const
|
|
9
|
-
if (!
|
|
10
|
-
const { from:
|
|
11
|
-
if (
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
9
|
+
const r = t.renderer;
|
|
10
|
+
if (!d(r)) return null;
|
|
11
|
+
const e = r.getLastDataPoint();
|
|
12
|
+
if (!e) return null;
|
|
13
|
+
const { from: a, to: c } = u;
|
|
14
|
+
if (e.time >= a && e.time <= c) {
|
|
15
|
+
const l = o(e);
|
|
16
|
+
return l === null ? null : { value: l, isLive: !0 };
|
|
17
|
+
}
|
|
18
|
+
const s = r.getVisibleDataPoints(a, c);
|
|
19
|
+
if (s.length === 0) return null;
|
|
20
|
+
const f = o(s[s.length - 1]);
|
|
21
|
+
return f === null ? null : { value: f, isLive: !1 };
|
|
15
22
|
}
|
|
16
|
-
function
|
|
17
|
-
const t =
|
|
18
|
-
return t ? t.renderer.getStackedLastValue?.() ||
|
|
23
|
+
function p(n, i, u) {
|
|
24
|
+
const t = i.find((e) => e.id === n);
|
|
25
|
+
return t ? t.renderer.getStackedLastValue?.() || L(n, i, u) : null;
|
|
19
26
|
}
|
|
20
|
-
function
|
|
21
|
-
const
|
|
22
|
-
if (!
|
|
23
|
-
const t =
|
|
24
|
-
if (!
|
|
25
|
-
const
|
|
26
|
-
return
|
|
27
|
+
function V(n, i) {
|
|
28
|
+
const u = i.find((e) => e.id === n);
|
|
29
|
+
if (!u) return null;
|
|
30
|
+
const t = u.renderer;
|
|
31
|
+
if (!d(t)) return null;
|
|
32
|
+
const r = t.getSecondLastDataPoint();
|
|
33
|
+
return r ? o(r) : null;
|
|
27
34
|
}
|
|
28
35
|
export {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
36
|
+
L as getLastValue,
|
|
37
|
+
V as getPreviousClose,
|
|
38
|
+
p as getStackedLastValue
|
|
32
39
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function
|
|
1
|
+
function c(a) {
|
|
2
2
|
if (!(a.stacking !== "percent" || a.isPlottable(0)))
|
|
3
3
|
throw new Error(
|
|
4
4
|
`[wick-charts] Series '${a.seriesId}' uses stacking: 'percent', which this Y scale can't show — a 0–100% axis starts at 0, and the scale has no position for 0. Use a linear axis, or stacking: 'normal' / 'off'.`
|
|
@@ -6,11 +6,11 @@ function o(a) {
|
|
|
6
6
|
}
|
|
7
7
|
function i(a) {
|
|
8
8
|
if (process.env.NODE_ENV === "production") return;
|
|
9
|
-
const { y: n, isPlottable: t } = a;
|
|
9
|
+
const { y: n, isPlottable: o, path: t = "axis.y" } = a;
|
|
10
10
|
for (const e of ["min", "max"]) {
|
|
11
11
|
const s = n?.[e];
|
|
12
|
-
typeof s != "number" ||
|
|
13
|
-
`[wick-charts]
|
|
12
|
+
typeof s != "number" || o(s) || console.warn(
|
|
13
|
+
`[wick-charts] ${t}.${e} is ${s}, which the Y scale can't place — falling back to 'auto'. Use a bound inside the scale's domain.`
|
|
14
14
|
);
|
|
15
15
|
}
|
|
16
16
|
}
|
|
@@ -19,8 +19,26 @@ function r(a) {
|
|
|
19
19
|
`[wick-charts] Series '${a.seriesId}' has values in view the Y scale can't place (e.g. ${a.value}; a log axis has no position for values ≤ 0). They are skipped — gaps in a line, no bar or candle. Filter or offset the data, or use a linear axis.`
|
|
20
20
|
);
|
|
21
21
|
}
|
|
22
|
+
function l(a) {
|
|
23
|
+
process.env.NODE_ENV !== "production" && console.warn(
|
|
24
|
+
`[wick-charts] Series '${a.seriesId}' uses scale '${a.scaleId}', which \`scales\` doesn't define — it maps through the default Y scale.`
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
function h(a) {
|
|
28
|
+
process.env.NODE_ENV !== "production" && console.warn(
|
|
29
|
+
`[wick-charts] Scale '${a.scaleId}' asks for the ${a.side} axis column, which another Y axis already holds — it renders as an overlay scale with no column. One axis column fits on each side.`
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
function u(a) {
|
|
33
|
+
process.env.NODE_ENV !== "production" && console.warn(
|
|
34
|
+
`[wick-charts] Series '${a.seriesId}' uses stacking: 'percent' on a Y scale that can't place 0 — a 0–100% axis starts at 0. Put it on a linear scale, or use stacking: 'normal' / 'off'.`
|
|
35
|
+
);
|
|
36
|
+
}
|
|
22
37
|
export {
|
|
23
|
-
|
|
38
|
+
c as assertStackingFitsScale,
|
|
39
|
+
h as warnScaleSideTaken,
|
|
40
|
+
u as warnStackingOffScale,
|
|
41
|
+
l as warnUnknownScale,
|
|
24
42
|
i as warnUnplottableBounds,
|
|
25
43
|
r as warnUnplottableValues
|
|
26
44
|
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
function a(e) {
|
|
2
|
+
const { seriesType: s, axisType: t, supported: i } = e;
|
|
3
|
+
if (i.includes(t)) return;
|
|
4
|
+
const n = i.map((r) => `'${r}'`).join(", ");
|
|
5
|
+
throw new Error(
|
|
6
|
+
`[wick-charts] A '${s}' series can't plot on a '${t}' X axis — it supports ${n}. Set axis.x.type to a supported type, or declare \`xTypes\` on a custom series definition.`
|
|
7
|
+
);
|
|
8
|
+
}
|
|
9
|
+
function o(e) {
|
|
10
|
+
if (process.env.NODE_ENV === "production") return;
|
|
11
|
+
const s = e.axisType === "category" ? "a string `x` (the category name)" : "a number `x`";
|
|
12
|
+
console.warn(
|
|
13
|
+
`[wick-charts] Series '${e.seriesId}' has a point with x = ${String(e.x)}, which doesn't fit the '${e.axisType}' X axis — it needs ${s}. Such points are skipped.`
|
|
14
|
+
);
|
|
15
|
+
}
|
|
16
|
+
function c(e) {
|
|
17
|
+
process.env.NODE_ENV !== "production" && console.warn(
|
|
18
|
+
`[wick-charts] Series '${e.seriesId}' mixes \`x\` and \`time\` keys. On a numeric or category X axis key every point by \`x\`.`
|
|
19
|
+
);
|
|
20
|
+
}
|
|
21
|
+
function p(e) {
|
|
22
|
+
process.env.NODE_ENV !== "production" && console.warn(
|
|
23
|
+
`[wick-charts] ${e.feature} works on a time X axis only — it is disabled on this '${e.axisType}' axis.`
|
|
24
|
+
);
|
|
25
|
+
}
|
|
26
|
+
function x(e) {
|
|
27
|
+
process.env.NODE_ENV !== "production" && console.warn(
|
|
28
|
+
`[wick-charts] axis.x.type changed from '${e.from}' to '${e.to}' after the chart was created — the change is ignored. Remount the chart (e.g. a React \`key\`) to switch the X axis type.`
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
export {
|
|
32
|
+
a as assertSeriesFitsXAxis,
|
|
33
|
+
p as warnTimeOnlyFeature,
|
|
34
|
+
o as warnXMisfit,
|
|
35
|
+
c as warnXTimeMixed,
|
|
36
|
+
x as warnXTypeChange
|
|
37
|
+
};
|