@wick-charts/vue 0.5.0 → 0.5.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/dist/ChartContainer.vue.js +11 -11
- package/dist/core/dist/chart.js +569 -514
- package/dist/core/dist/perf/perf-hud.js +7 -7
- package/dist/index.d.ts +7 -0
- package/package.json +2 -2
|
@@ -2,7 +2,7 @@ import { ChartInstance as R } from "../chart.js";
|
|
|
2
2
|
import { LineSeriesDef as E } from "../series/line.js";
|
|
3
3
|
import { PerfMonitor as g } from "./perf-monitor.js";
|
|
4
4
|
import { createTheme as T } from "../theme/create.js";
|
|
5
|
-
function
|
|
5
|
+
function N(i) {
|
|
6
6
|
const e = i instanceof g;
|
|
7
7
|
return {
|
|
8
8
|
monitor: e ? i : new g(i),
|
|
@@ -10,14 +10,14 @@ function J(i) {
|
|
|
10
10
|
ownsMonitor: !e
|
|
11
11
|
};
|
|
12
12
|
}
|
|
13
|
-
const P = 100, z = 600, f = 250, F = 1e3 / 60, H = 1e3 / 120, m = 60, b = 4,
|
|
13
|
+
const P = 100, z = 600, f = 250, F = 1e3 / 60, H = 1e3 / 120, m = 60, b = 4, O = 34, S = 64, j = 24;
|
|
14
14
|
function I(i) {
|
|
15
15
|
let e = 0;
|
|
16
16
|
for (const t of i)
|
|
17
17
|
t > e && (e = t);
|
|
18
18
|
return Math.max(10, Math.ceil(e / 10) * 10);
|
|
19
19
|
}
|
|
20
|
-
function
|
|
20
|
+
function L(i) {
|
|
21
21
|
return -I(i) / 12;
|
|
22
22
|
}
|
|
23
23
|
const B = "#9aa6b6", c = "#5d6877", C = "#e8eef7", x = "#cdd6e2", y = "#3fd68f", V = "#f5c451", $ = "#f4756a", Y = "#5d6877", X = {
|
|
@@ -233,7 +233,7 @@ class D {
|
|
|
233
233
|
}), this.element.insertBefore(this.sparkHost, this.element.firstChild)) : (Object.assign(this.sparkHost.style, {
|
|
234
234
|
position: "relative",
|
|
235
235
|
inset: "auto",
|
|
236
|
-
height: `${
|
|
236
|
+
height: `${O}px`,
|
|
237
237
|
marginTop: "7px",
|
|
238
238
|
borderRadius: "4px",
|
|
239
239
|
opacity: "1",
|
|
@@ -271,7 +271,7 @@ class D {
|
|
|
271
271
|
const t = performance.now(), n = new R(e, {
|
|
272
272
|
theme: T({ background: "#10141c" }).theme,
|
|
273
273
|
axis: {
|
|
274
|
-
y: { visible: !1, width: 0, min:
|
|
274
|
+
y: { visible: !1, width: 0, min: L, max: I },
|
|
275
275
|
x: { visible: !1, height: 0 }
|
|
276
276
|
},
|
|
277
277
|
// Bottom padding keeps the zero baseline clearly on canvas — at 0 the
|
|
@@ -308,7 +308,7 @@ class D {
|
|
|
308
308
|
}
|
|
309
309
|
/** Keeps the plateau below the FPS number (mini) or the Y tick (strip). */
|
|
310
310
|
sparkPaddingTop() {
|
|
311
|
-
return this.mode === "mini" ?
|
|
311
|
+
return this.mode === "mini" ? j : 12;
|
|
312
312
|
}
|
|
313
313
|
/** Append one FPS sample to the sparkline chart and roll its window. */
|
|
314
314
|
appendSpark(e) {
|
|
@@ -449,5 +449,5 @@ class D {
|
|
|
449
449
|
}
|
|
450
450
|
export {
|
|
451
451
|
D as PerfHud,
|
|
452
|
-
|
|
452
|
+
N as perfHud
|
|
453
453
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -1615,6 +1615,13 @@ export declare class ChartInstance extends EventEmitter<ChartEvents> implements
|
|
|
1615
1615
|
* current crosshair is a no-op (no emit). Combined with the y-preservation
|
|
1616
1616
|
* above, this lets N charts broadcast their hover to each other without
|
|
1617
1617
|
* a feedback-loop guard.
|
|
1618
|
+
*
|
|
1619
|
+
* The echo protection assumes the broadcast is **synchronous** (call
|
|
1620
|
+
* `setCrosshair` directly from the `crosshairMove` listener). An echo
|
|
1621
|
+
* routed through an async hop — a state store, a React render — can
|
|
1622
|
+
* arrive with a stale `time` while the origin chart streams, miss the
|
|
1623
|
+
* idempotency check, and flip that chart to time-anchored until the next
|
|
1624
|
+
* real pointer move (see {@link #syncCrosshairToViewport}).
|
|
1618
1625
|
*/
|
|
1619
1626
|
setCrosshair(pos: {
|
|
1620
1627
|
time: number;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wick-charts/vue",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.1",
|
|
4
4
|
"description": "High-performance canvas timeseries charts for Vue — candlestick, line, bar, pie. Tree-shakeable, zero runtime deps.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"vue": ">=3.3.0"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
|
-
"@wick-charts/core": "^0.5.
|
|
48
|
+
"@wick-charts/core": "^0.5.1"
|
|
49
49
|
},
|
|
50
50
|
"scripts": {
|
|
51
51
|
"build": "vite build"
|