@lilt-ui/charts 0.12.2 → 0.13.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/CHANGELOG.md +288 -270
- package/README.md +21 -59
- package/dist/cards/arc-bridges-card.d.ts +17 -0
- package/dist/cards/area-chart-card.d.ts +1 -10
- package/dist/cards/block-city-card.d.ts +21 -0
- package/dist/cards/calendar-heatmap-card.d.ts +31 -1
- package/dist/cards/cartesian-card.d.ts +9 -27
- package/dist/cards/chart-card.d.ts +1 -12
- package/dist/cards/chord-loom-card.d.ts +17 -0
- package/dist/cards/circle-archipelago-card.d.ts +9 -0
- package/dist/cards/cluster-constellation-card.d.ts +16 -0
- package/dist/cards/comparison-forms.d.ts +30 -0
- package/dist/cards/composition-forms.d.ts +10 -0
- package/dist/cards/contour-islands-card.d.ts +25 -0
- package/dist/cards/density-contours.d.ts +3 -0
- package/dist/cards/distribution-forms.d.ts +37 -0
- package/dist/cards/event-helix-card.d.ts +26 -0
- package/dist/cards/helix-ribbons-card.d.ts +14 -0
- package/dist/cards/hex-city-card.d.ts +25 -0
- package/dist/cards/hierarchy-layouts.d.ts +21 -0
- package/dist/cards/horizon-folds-card.d.ts +10 -0
- package/dist/cards/horizontal-bar-chart-card.d.ts +1 -1
- package/dist/cards/intersection-towers-card.d.ts +9 -0
- package/dist/cards/line-chart-card.d.ts +4 -11
- package/dist/cards/link-readings.d.ts +26 -0
- package/dist/cards/marimekko-blocks-card.d.ts +10 -0
- package/dist/cards/observations-card.d.ts +45 -2
- package/dist/cards/parallel-ribbons-card.d.ts +27 -0
- package/dist/cards/prism-grid.d.ts +58 -0
- package/dist/cards/prism.d.ts +42 -0
- package/dist/cards/progress-forms.d.ts +21 -0
- package/dist/cards/rank-ribbons-card.d.ts +22 -0
- package/dist/cards/ridgeline-card.d.ts +24 -0
- package/dist/cards/scatter-chart-card.d.ts +19 -1
- package/dist/cards/sculpted-geometry.d.ts +18 -0
- package/dist/cards/skyline-card.d.ts +12 -0
- package/dist/cards/spatial-composition-layouts.d.ts +14 -0
- package/dist/cards/spatial-geometry.d.ts +34 -0
- package/dist/cards/spatial-hierarchy.d.ts +10 -0
- package/dist/cards/spatial-point-layouts.d.ts +16 -0
- package/dist/cards/spatial-series-layouts.d.ts +12 -0
- package/dist/cards/spiral-year-card.d.ts +17 -0
- package/dist/cards/sunburst-terraces-card.d.ts +10 -0
- package/dist/cards/ternary-prism-card.d.ts +13 -0
- package/dist/cards/terrain-card.d.ts +21 -0
- package/dist/cards/treemap-chart-card.d.ts +3 -1
- package/dist/cards/trend-forms.d.ts +11 -0
- package/dist/cards/voxel-cloud-card.d.ts +16 -0
- package/dist/cards/voxel-waffle-card.d.ts +18 -0
- package/dist/cards/wind-rose-card.d.ts +11 -0
- package/dist/engine/domains.d.ts +0 -1
- package/dist/finance.js +310 -311
- package/dist/index.d.ts +39 -4
- package/dist/index.js +8919 -2948
- package/dist/{skeleton-block-DIgcA9t6.js → skeleton-block-BPoUJvcR.js} +3596 -2971
- package/dist/styles.css +1 -1
- package/package.json +79 -85
- package/dist/report-context-CIUa6iiD.js +0 -1101
- package/dist/watch/board/board-state.d.ts +0 -72
- package/dist/watch/board/board-toast.d.ts +0 -19
- package/dist/watch/board/chart-board.d.ts +0 -93
- package/dist/watch/board/report-context.d.ts +0 -3
- package/dist/watch/engine/describe.d.ts +0 -9
- package/dist/watch/engine/explain.d.ts +0 -48
- package/dist/watch/engine/normal.d.ts +0 -114
- package/dist/watch/engine/robust.d.ts +0 -7
- package/dist/watch/engine/rules.d.ts +0 -22
- package/dist/watch/engine/status.d.ts +0 -39
- package/dist/watch/index.d.ts +0 -14
- package/dist/watch/normal-layer.d.ts +0 -18
- package/dist/watch.d.ts +0 -2
- package/dist/watch.js +0 -636
package/dist/finance.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import { C as A, d as j, g as ee, h as M, p as N, u as P } from "./report-context-CIUa6iiD.js";
|
|
2
|
+
import { A as e, B as t, D as n, F as r, J as i, K as a, M as o, N as s, Nt as c, O as l, P as u, S as d, W as f, Y as p, _ as m, a as h, b as g, bt as _, d as v, dt as y, f as b, ft as x, g as S, gt as C, i as w, it as T, j as E, k as D, lt as O, m as k, n as A, q as j, st as ee, t as M, ut as N, wt as P } from "./skeleton-block-BPoUJvcR.js";
|
|
4
3
|
import { useEffect as F, useMemo as I, useRef as L, useState as R } from "react";
|
|
5
4
|
import { Fragment as z, jsx as B, jsxs as V } from "react/jsx-runtime";
|
|
6
5
|
import { min as H } from "d3-array";
|
|
@@ -28,42 +27,42 @@ function te(e, t, n) {
|
|
|
28
27
|
}
|
|
29
28
|
}
|
|
30
29
|
function ne(e, t, n, r, i = !1) {
|
|
31
|
-
let a = Math.max(1, n.columnWidth),
|
|
30
|
+
let a = Math.max(1, n.columnWidth), o = a / 2, s = G(e), c = G(n.y(t.high)), l = G(n.y(t.low));
|
|
32
31
|
if (r === "ohlc") {
|
|
33
|
-
let r = G(n.y(t.open)), i = G(n.y(t.close)), a = G(Math.max(2,
|
|
32
|
+
let r = G(n.y(t.open)), i = G(n.y(t.close)), a = G(Math.max(2, o));
|
|
34
33
|
return {
|
|
35
34
|
body: null,
|
|
36
35
|
hollow: null,
|
|
37
|
-
stroke: `M${
|
|
36
|
+
stroke: `M${s},${c}V${l}M${G(e - a)},${r}H${s}M${s},${i}H${G(e + a)}`,
|
|
38
37
|
side: null,
|
|
39
38
|
top: null
|
|
40
39
|
};
|
|
41
40
|
}
|
|
42
|
-
let
|
|
43
|
-
if (
|
|
44
|
-
let e = (
|
|
45
|
-
|
|
41
|
+
let u = n.y(Math.max(t.open, t.close)), d = n.y(Math.min(t.open, t.close));
|
|
42
|
+
if (d - u < 1) {
|
|
43
|
+
let e = (u + d) / 2;
|
|
44
|
+
u = e - .5, d = e + .5;
|
|
46
45
|
}
|
|
47
|
-
let p = r === "hollow" && t.up && a >= 3, m = p ? .5 : 0, h = i ?
|
|
46
|
+
let p = r === "hollow" && t.up && a >= 3, m = p ? .5 : 0, h = i ? _(e, u, a, d - u) : null, g = h ? e - h.frontWidth / 2 : e - o, v = f(g + m, u + m, Math.max(1, (h ? h.frontWidth : a) - m * 2), Math.max(1, d - u - m * 2), !h && a >= 6 ? 1.5 : 0), y = (c < u ? `M${s},${c}V${G(u)}` : "") + (l > d ? `M${s},${G(d)}V${l}` : "");
|
|
48
47
|
return {
|
|
49
|
-
body: p ? null :
|
|
50
|
-
hollow: p ?
|
|
51
|
-
stroke:
|
|
48
|
+
body: p ? null : v,
|
|
49
|
+
hollow: p ? v : null,
|
|
50
|
+
stroke: y,
|
|
52
51
|
side: h?.side ?? null,
|
|
53
52
|
top: h?.top ?? null
|
|
54
53
|
};
|
|
55
54
|
}
|
|
56
|
-
function re(e, n,
|
|
57
|
-
let
|
|
58
|
-
for (let { row:
|
|
59
|
-
let e = K(
|
|
55
|
+
function re(e, n, i, a, o, s, c = !1) {
|
|
56
|
+
let l = new r(), u = new r(), d = new r(), f = new r(), p = new r();
|
|
57
|
+
for (let { row: r, cx: m } of t(e, a)) {
|
|
58
|
+
let e = K(r, n, i);
|
|
60
59
|
if (!e) continue;
|
|
61
|
-
let t =
|
|
62
|
-
h.side && f.add(t, h.side), h.top && p.add(t, h.top), h.body &&
|
|
60
|
+
let t = s(r, e), h = ne(m, e, a, o, c);
|
|
61
|
+
h.side && f.add(t, h.side), h.top && p.add(t, h.top), h.body && l.add(t, h.body), h.hollow && u.add(t, h.hollow), h.stroke && d.add(t, h.stroke);
|
|
63
62
|
}
|
|
64
63
|
return {
|
|
65
|
-
bodies:
|
|
66
|
-
hollow:
|
|
64
|
+
bodies: l.entries(),
|
|
65
|
+
hollow: u.entries(),
|
|
67
66
|
strokes: d.entries(),
|
|
68
67
|
sides: f.entries(),
|
|
69
68
|
tops: p.entries()
|
|
@@ -72,7 +71,7 @@ function re(e, n, r, i, a, o, s = !1) {
|
|
|
72
71
|
//#endregion
|
|
73
72
|
//#region src/finance/candles.tsx
|
|
74
73
|
function q(e, t, n) {
|
|
75
|
-
return
|
|
74
|
+
return p(e, t, n.up ? U : W);
|
|
76
75
|
}
|
|
77
76
|
function ie({ paths: e, display: t }) {
|
|
78
77
|
let n = t === "ohlc" ? 1.5 : 1;
|
|
@@ -86,11 +85,11 @@ function ie({ paths: e, display: t }) {
|
|
|
86
85
|
}, `stroke-${e}`)),
|
|
87
86
|
e.sides.map(({ color: e, d: t }) => /* @__PURE__ */ B("path", {
|
|
88
87
|
d: t,
|
|
89
|
-
style: { fill:
|
|
88
|
+
style: { fill: C(e).side }
|
|
90
89
|
}, `side-${e}`)),
|
|
91
90
|
e.tops.map(({ color: e, d: t }) => /* @__PURE__ */ B("path", {
|
|
92
91
|
d: t,
|
|
93
|
-
style: { fill:
|
|
92
|
+
style: { fill: C(e).top }
|
|
94
93
|
}, `top-${e}`)),
|
|
95
94
|
e.bodies.map(({ color: e, d: t }) => /* @__PURE__ */ B("path", {
|
|
96
95
|
d: t,
|
|
@@ -106,43 +105,43 @@ function ie({ paths: e, display: t }) {
|
|
|
106
105
|
}, `hollow-${e}`))
|
|
107
106
|
] });
|
|
108
107
|
}
|
|
109
|
-
var ae =
|
|
110
|
-
let
|
|
108
|
+
var ae = i(function({ series: e, open: t, high: n, low: r, display: i = "candle", depth: a = !1, className: o }) {
|
|
109
|
+
let s = u("Candles", e, [
|
|
110
|
+
t,
|
|
111
111
|
n,
|
|
112
|
-
r
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
low: i
|
|
112
|
+
r
|
|
113
|
+
], "column"), { snapshot: c, descriptor: l, scales: d } = s, f = I(() => {
|
|
114
|
+
let o = {
|
|
115
|
+
open: t,
|
|
116
|
+
high: n,
|
|
117
|
+
low: r
|
|
119
118
|
};
|
|
120
|
-
return te(
|
|
119
|
+
return te(c.data.rows, e, o), re(c.data.rows, e, o, d, i, (e, t) => q(l, e, t), a);
|
|
121
120
|
}, [
|
|
122
|
-
|
|
121
|
+
c,
|
|
122
|
+
e,
|
|
123
123
|
t,
|
|
124
124
|
n,
|
|
125
125
|
r,
|
|
126
|
-
i,
|
|
127
126
|
d,
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
127
|
+
i,
|
|
128
|
+
l,
|
|
129
|
+
a
|
|
131
130
|
]);
|
|
132
131
|
return /* @__PURE__ */ V("g", {
|
|
133
132
|
"aria-hidden": "true",
|
|
134
|
-
className: ["lilt-chart__candles",
|
|
135
|
-
"data-series":
|
|
136
|
-
"data-display":
|
|
137
|
-
clipPath:
|
|
138
|
-
mask:
|
|
133
|
+
className: ["lilt-chart__candles", o].filter(Boolean).join(" "),
|
|
134
|
+
"data-series": e,
|
|
135
|
+
"data-display": i,
|
|
136
|
+
clipPath: a ? `url(#${s.depthClip.id})` : s.clipPath,
|
|
137
|
+
mask: s.mask,
|
|
139
138
|
style: {
|
|
140
|
-
opacity:
|
|
141
|
-
transition:
|
|
139
|
+
opacity: s.opacity,
|
|
140
|
+
transition: s.reducedMotion ? void 0 : "opacity 160ms ease-out"
|
|
142
141
|
},
|
|
143
|
-
children: [
|
|
142
|
+
children: [a ? /* @__PURE__ */ B(x, { clip: s.depthClip }) : null, /* @__PURE__ */ B(ie, {
|
|
144
143
|
paths: f,
|
|
145
|
-
display:
|
|
144
|
+
display: i
|
|
146
145
|
})]
|
|
147
146
|
});
|
|
148
147
|
}, {
|
|
@@ -157,7 +156,7 @@ var ae = c(function({ series: t, open: n, high: r, low: i, display: a = "candle"
|
|
|
157
156
|
open: n + (r - n) * .28,
|
|
158
157
|
close: r - (r - n) * .23,
|
|
159
158
|
up: !0
|
|
160
|
-
}, i, e.display ?? "candle", e.depth), c =
|
|
159
|
+
}, i, e.display ?? "candle", e.depth), c = C(o);
|
|
161
160
|
return /* @__PURE__ */ V(z, { children: [
|
|
162
161
|
s.stroke ? /* @__PURE__ */ B("path", {
|
|
163
162
|
d: s.stroke,
|
|
@@ -195,14 +194,14 @@ var ae = c(function({ series: t, open: n, high: r, low: i, display: a = "candle"
|
|
|
195
194
|
let r = K(t, e.series, e);
|
|
196
195
|
return r ? q(n, t, r) : void 0;
|
|
197
196
|
},
|
|
198
|
-
highlight: (e, { row: t, snapshot:
|
|
199
|
-
let
|
|
200
|
-
if (!
|
|
201
|
-
let
|
|
197
|
+
highlight: (e, { row: t, snapshot: n, descriptor: r }) => {
|
|
198
|
+
let i = K(t, e.series, e);
|
|
199
|
+
if (!i) return null;
|
|
200
|
+
let a = e.display ?? "candle", o = s(n, e.series), c = ne(o.x(t.x), i, o, a, e.depth), l = q(r, t, i);
|
|
202
201
|
return /* @__PURE__ */ B("g", {
|
|
203
202
|
className: "lilt-chart__candle-highlight",
|
|
204
203
|
children: /* @__PURE__ */ B(ie, {
|
|
205
|
-
display:
|
|
204
|
+
display: a,
|
|
206
205
|
paths: {
|
|
207
206
|
bodies: c.body ? [{
|
|
208
207
|
color: l,
|
|
@@ -231,43 +230,43 @@ var ae = c(function({ series: t, open: n, high: r, low: i, display: a = "candle"
|
|
|
231
230
|
});
|
|
232
231
|
//#endregion
|
|
233
232
|
//#region src/finance/cards/pane.tsx
|
|
234
|
-
function J({ context: e, label: t, caption:
|
|
235
|
-
let [
|
|
233
|
+
function J({ context: e, label: t, caption: r, readout: i, series: a, height: o, y: s, bars: l, xAxis: u = !1, children: d }) {
|
|
234
|
+
let [f, p] = R(null), m = f ?? e.data.at(-1) ?? null;
|
|
236
235
|
return /* @__PURE__ */ V("div", {
|
|
237
236
|
className: "lilt-card__pane",
|
|
238
|
-
children: [
|
|
237
|
+
children: [r ? /* @__PURE__ */ V("span", {
|
|
239
238
|
className: "lilt-card__pane-caption",
|
|
240
239
|
"aria-hidden": "true",
|
|
241
240
|
children: [/* @__PURE__ */ B("span", {
|
|
242
241
|
className: "lilt-card__pane-name",
|
|
243
|
-
children:
|
|
244
|
-
}),
|
|
245
|
-
}) : null, /* @__PURE__ */ B(
|
|
242
|
+
children: r
|
|
243
|
+
}), i && m && !e.loading ? i(m) : null]
|
|
244
|
+
}) : null, /* @__PURE__ */ B(c, {
|
|
246
245
|
className: "lilt-card__chart",
|
|
247
246
|
"aria-label": t,
|
|
248
247
|
data: e.data,
|
|
249
248
|
x: e.x,
|
|
250
249
|
y: s,
|
|
251
|
-
series:
|
|
250
|
+
series: a,
|
|
252
251
|
controller: e.controller,
|
|
253
|
-
onSelectionChange:
|
|
252
|
+
onSelectionChange: i ? (e) => p(e?.row ?? null) : void 0,
|
|
254
253
|
motion: e.motion,
|
|
255
254
|
status: e.loading ? "loading" : "ready",
|
|
256
255
|
loadingStyle: e.loadingStyle,
|
|
257
|
-
children: /* @__PURE__ */ V(
|
|
256
|
+
children: /* @__PURE__ */ V(j, {
|
|
258
257
|
height: o,
|
|
259
258
|
margins: {
|
|
260
259
|
...e.margins,
|
|
261
260
|
top: 6,
|
|
262
|
-
bottom:
|
|
261
|
+
bottom: u ? 28 : 4
|
|
263
262
|
},
|
|
264
263
|
axis: e.axis,
|
|
265
264
|
pill: e.hoverStyle,
|
|
266
265
|
axisInset: e.axisInset,
|
|
267
|
-
slots: e.slots || !!
|
|
268
|
-
bars:
|
|
266
|
+
slots: e.slots || !!l,
|
|
267
|
+
bars: l,
|
|
269
268
|
background: "none",
|
|
270
|
-
children: [
|
|
269
|
+
children: [d, u ? /* @__PURE__ */ B(n, { labels: "fit" }) : null]
|
|
271
270
|
})
|
|
272
271
|
})]
|
|
273
272
|
});
|
|
@@ -292,71 +291,71 @@ var se = {
|
|
|
292
291
|
minimumFractionDigits: 2,
|
|
293
292
|
maximumFractionDigits: 2
|
|
294
293
|
};
|
|
295
|
-
function ce({ open:
|
|
296
|
-
let
|
|
297
|
-
...
|
|
298
|
-
delta:
|
|
294
|
+
function ce({ open: t, high: n, low: r, close: i, volume: o, display: s = "candle", depth: c = !1, scale: l = "linear", label: u = "Price", live: d = !1, data: f, ranges: p, delta: m, valueFormat: h = se, locale: g = "en-US", volumeHeight: _ = 64, ...v }) {
|
|
295
|
+
let y = I(() => w(g, h).full, [g, JSON.stringify(h)]), b = I(() => w(g).compact, [g]), x = I(() => p?.map((e) => ({
|
|
296
|
+
...e,
|
|
297
|
+
delta: e.delta ?? X(e.data, t, i)
|
|
299
298
|
})), [
|
|
300
|
-
|
|
301
|
-
|
|
299
|
+
p,
|
|
300
|
+
t,
|
|
302
301
|
i
|
|
303
|
-
]),
|
|
302
|
+
]), S = (X(f ?? p?.[0]?.data ?? [], t, i) ?? 0) >= 0, C = (e) => (Y(e, i) ?? 0) >= (Y(e, t) ?? 0), T = s === "area", D = {
|
|
304
303
|
open: {
|
|
305
304
|
label: "Open",
|
|
306
|
-
accessor: (
|
|
305
|
+
accessor: (e) => Y(e, t)
|
|
307
306
|
},
|
|
308
307
|
high: {
|
|
309
308
|
label: "High",
|
|
310
|
-
accessor: (e) => Y(e,
|
|
309
|
+
accessor: (e) => Y(e, n)
|
|
311
310
|
},
|
|
312
311
|
low: {
|
|
313
312
|
label: "Low",
|
|
314
|
-
accessor: (e) => Y(e,
|
|
313
|
+
accessor: (e) => Y(e, r)
|
|
315
314
|
}
|
|
316
315
|
};
|
|
317
|
-
return /* @__PURE__ */ B(
|
|
316
|
+
return /* @__PURE__ */ B(A, {
|
|
318
317
|
...v,
|
|
319
|
-
depth:
|
|
320
|
-
data:
|
|
321
|
-
ranges:
|
|
322
|
-
delta:
|
|
323
|
-
valueFormat:
|
|
318
|
+
depth: c,
|
|
319
|
+
data: f,
|
|
320
|
+
ranges: x,
|
|
321
|
+
delta: m ?? (f ? X(f, t, i) : void 0),
|
|
322
|
+
valueFormat: h,
|
|
324
323
|
locale: g,
|
|
325
324
|
aggregate: "last",
|
|
326
325
|
tiles: !1,
|
|
327
|
-
live:
|
|
326
|
+
live: d,
|
|
328
327
|
series: [{
|
|
329
328
|
key: i,
|
|
330
|
-
label:
|
|
331
|
-
color:
|
|
329
|
+
label: u,
|
|
330
|
+
color: T ? S ? U : W : void 0
|
|
332
331
|
}],
|
|
333
332
|
shape: {
|
|
334
333
|
kind: "marks",
|
|
335
|
-
id: `candles:${
|
|
334
|
+
id: `candles:${s}:${c}:${l}:${t}:${n}:${r}:${!!o}`,
|
|
336
335
|
includeZero: !1,
|
|
337
|
-
scale:
|
|
336
|
+
scale: l,
|
|
338
337
|
slots: !0,
|
|
339
|
-
xAxis: !
|
|
340
|
-
series: () =>
|
|
341
|
-
fields:
|
|
338
|
+
xAxis: !o,
|
|
339
|
+
series: () => T ? {
|
|
340
|
+
fields: D,
|
|
342
341
|
area: { treatment: "fade" },
|
|
343
342
|
curve: "linear"
|
|
344
343
|
} : {
|
|
345
|
-
fields:
|
|
344
|
+
fields: D,
|
|
346
345
|
line: { showInspectionPoint: !1 }
|
|
347
346
|
},
|
|
348
|
-
describe: oe(
|
|
349
|
-
draw: (e) => e.map((e) =>
|
|
347
|
+
describe: oe(y),
|
|
348
|
+
draw: (e) => e.map((e) => T ? [/* @__PURE__ */ B(a, { series: e }, `area-${e}`), /* @__PURE__ */ B(E, { series: e }, `line-${e}`)] : /* @__PURE__ */ B(ae, {
|
|
350
349
|
series: e,
|
|
351
350
|
open: "open",
|
|
352
351
|
high: "high",
|
|
353
352
|
low: "low",
|
|
354
|
-
display:
|
|
355
|
-
depth:
|
|
353
|
+
display: s,
|
|
354
|
+
depth: c
|
|
356
355
|
}, e))
|
|
357
356
|
},
|
|
358
|
-
panes:
|
|
359
|
-
context:
|
|
357
|
+
panes: o ? (t) => /* @__PURE__ */ B(J, {
|
|
358
|
+
context: t,
|
|
360
359
|
label: `${v.title} volume`,
|
|
361
360
|
caption: "Volume",
|
|
362
361
|
height: _,
|
|
@@ -364,18 +363,18 @@ function ce({ open: e, high: t, low: n, close: i, volume: a, display: o = "candl
|
|
|
364
363
|
y: {
|
|
365
364
|
includeZero: !0,
|
|
366
365
|
ticks: 2,
|
|
367
|
-
format:
|
|
366
|
+
format: b
|
|
368
367
|
},
|
|
369
368
|
bars: { series: ["volume"] },
|
|
370
369
|
series: [{
|
|
371
370
|
id: "volume",
|
|
372
371
|
label: "Volume",
|
|
373
|
-
accessor: (e) => Y(e,
|
|
374
|
-
formatValue:
|
|
375
|
-
colorAt: (e) =>
|
|
372
|
+
accessor: (e) => Y(e, o),
|
|
373
|
+
formatValue: b,
|
|
374
|
+
colorAt: (e) => C(e) ? "color-mix(in srgb, var(--lilt-candle-up) 42%, transparent)" : "color-mix(in srgb, var(--lilt-candle-down) 42%, transparent)",
|
|
376
375
|
bar: { radius: 1 }
|
|
377
376
|
}],
|
|
378
|
-
children: /* @__PURE__ */ B(
|
|
377
|
+
children: /* @__PURE__ */ B(e, { series: "volume" })
|
|
379
378
|
}) : void 0
|
|
380
379
|
});
|
|
381
380
|
}
|
|
@@ -562,57 +561,57 @@ var xe = {
|
|
|
562
561
|
"var(--lilt-series-3)",
|
|
563
562
|
"var(--lilt-series-5)"
|
|
564
563
|
];
|
|
565
|
-
function Ce({ close:
|
|
566
|
-
let
|
|
567
|
-
if (
|
|
568
|
-
let
|
|
569
|
-
if (
|
|
570
|
-
let j = I(() =>
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
]), ee = I(() =>
|
|
576
|
-
...
|
|
577
|
-
data: be(
|
|
578
|
-
delta:
|
|
564
|
+
function Ce({ close: t, open: n, high: r, low: i, volume: a, display: s, overlays: c = [], panes: l = ["rsi", "macd"], label: u = "Price", scale: f = "linear", live: p = !1, data: m, ranges: h, delta: _, valueFormat: v = xe, locale: y = "en-US", paneHeight: b = 72, ...x }) {
|
|
565
|
+
let S = !!(n && r && i), C = s ?? (S ? "candle" : "line");
|
|
566
|
+
if (C !== "line" && !S) throw Error("Lilt IndicatorChartCard candles need open, high and low fields.");
|
|
567
|
+
let T = JSON.stringify(c), D = JSON.stringify(l), O = I(() => ve(c), [T]), k = I(() => ye(l), [D]);
|
|
568
|
+
if (k.some((e) => e.kind === "volume") && !a) throw Error("Lilt IndicatorChartCard needs a `volume` field for a volume pane.");
|
|
569
|
+
let j = I(() => m ? be(m, t, O, k) : void 0, [
|
|
570
|
+
m,
|
|
571
|
+
t,
|
|
572
|
+
O,
|
|
573
|
+
k
|
|
574
|
+
]), ee = I(() => h?.map((e) => ({
|
|
575
|
+
...e,
|
|
576
|
+
data: be(e.data, t, O, k),
|
|
577
|
+
delta: e.delta ?? (n ? X(e.data, n, t) : void 0)
|
|
579
578
|
})), [
|
|
580
|
-
|
|
581
|
-
e,
|
|
579
|
+
h,
|
|
582
580
|
t,
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
581
|
+
n,
|
|
582
|
+
O,
|
|
583
|
+
k
|
|
584
|
+
]), M = I(() => w(y, v).full, [y, JSON.stringify(v)]), N = I(() => w(y, { maximumFractionDigits: 2 }).full, [y]), P = I(() => w(y).compact, [y]), F = S ? {
|
|
586
585
|
open: {
|
|
587
586
|
label: "Open",
|
|
588
|
-
accessor: (e) => $(e,
|
|
587
|
+
accessor: (e) => $(e, n)
|
|
589
588
|
},
|
|
590
589
|
high: {
|
|
591
590
|
label: "High",
|
|
592
|
-
accessor: (e) => $(e,
|
|
591
|
+
accessor: (e) => $(e, r)
|
|
593
592
|
},
|
|
594
593
|
low: {
|
|
595
594
|
label: "Low",
|
|
596
|
-
accessor: (e) => $(e,
|
|
595
|
+
accessor: (e) => $(e, i)
|
|
597
596
|
}
|
|
598
|
-
} : void 0, L = new Map(
|
|
599
|
-
let
|
|
597
|
+
} : void 0, L = new Map(O.map((e) => [e.id, e])), R = m?.length ? $(m[0], t) : null, H = m?.length ? $(m.at(-1), t) : null, G = R === null || H === null || H >= R, K = k.at(-1)?.id, te = (r, i) => {
|
|
598
|
+
let o = r.id === K, s = (e) => (t) => $(t, e), c = (e, t, n) => {
|
|
600
599
|
let r = $(e, t);
|
|
601
600
|
return /* @__PURE__ */ V("span", {
|
|
602
601
|
className: "lilt-card__pane-value",
|
|
603
602
|
children: [n ? `${n} ` : "", r === null ? "—" : N(r)]
|
|
604
603
|
}, t);
|
|
605
604
|
};
|
|
606
|
-
if (
|
|
607
|
-
context:
|
|
608
|
-
label: `${
|
|
605
|
+
if (r.kind === "volume") return /* @__PURE__ */ B(J, {
|
|
606
|
+
context: i,
|
|
607
|
+
label: `${x.title} volume`,
|
|
609
608
|
caption: "Volume",
|
|
610
609
|
readout: (e) => /* @__PURE__ */ B("span", {
|
|
611
610
|
className: "lilt-card__pane-value",
|
|
612
|
-
children: $(e,
|
|
611
|
+
children: $(e, a) === null ? "—" : P($(e, a))
|
|
613
612
|
}),
|
|
614
|
-
height:
|
|
615
|
-
xAxis:
|
|
613
|
+
height: b,
|
|
614
|
+
xAxis: o,
|
|
616
615
|
y: {
|
|
617
616
|
includeZero: !0,
|
|
618
617
|
ticks: 2,
|
|
@@ -622,92 +621,92 @@ function Ce({ close: e, open: t, high: n, low: r, volume: i, display: a, overlay
|
|
|
622
621
|
series: [{
|
|
623
622
|
id: "volume",
|
|
624
623
|
label: "Volume",
|
|
625
|
-
accessor:
|
|
624
|
+
accessor: s(a),
|
|
626
625
|
formatValue: P,
|
|
627
|
-
colorAt: (
|
|
626
|
+
colorAt: (e) => ($(e, t) ?? 0) >= ($(e, n) ?? $(e, t) ?? 0) ? "color-mix(in srgb, var(--lilt-candle-up) 42%, transparent)" : "color-mix(in srgb, var(--lilt-candle-down) 42%, transparent)",
|
|
628
627
|
bar: { radius: 1 }
|
|
629
628
|
}],
|
|
630
|
-
children: /* @__PURE__ */ B(
|
|
631
|
-
},
|
|
632
|
-
if (
|
|
633
|
-
context:
|
|
634
|
-
label: `${
|
|
635
|
-
caption: `RSI ${
|
|
636
|
-
readout: (e) =>
|
|
637
|
-
height:
|
|
638
|
-
xAxis:
|
|
629
|
+
children: /* @__PURE__ */ B(e, { series: "volume" })
|
|
630
|
+
}, r.id);
|
|
631
|
+
if (r.kind === "rsi") return /* @__PURE__ */ V(J, {
|
|
632
|
+
context: i,
|
|
633
|
+
label: `${x.title} RSI ${r.period}`,
|
|
634
|
+
caption: `RSI ${r.period}`,
|
|
635
|
+
readout: (e) => c(e, r.id),
|
|
636
|
+
height: b,
|
|
637
|
+
xAxis: o,
|
|
639
638
|
y: {
|
|
640
639
|
domain: [0, 100],
|
|
641
640
|
ticks: 2,
|
|
642
641
|
format: (e) => String(Math.round(e))
|
|
643
642
|
},
|
|
644
643
|
series: [{
|
|
645
|
-
id:
|
|
646
|
-
label: `RSI ${
|
|
647
|
-
accessor:
|
|
644
|
+
id: r.id,
|
|
645
|
+
label: `RSI ${r.period}`,
|
|
646
|
+
accessor: s(r.id),
|
|
648
647
|
color: "var(--lilt-series-1)",
|
|
649
648
|
formatValue: N,
|
|
650
649
|
line: {
|
|
651
650
|
width: 1.5,
|
|
652
|
-
depth:
|
|
651
|
+
depth: x.depth
|
|
653
652
|
}
|
|
654
653
|
}],
|
|
655
654
|
children: [
|
|
656
|
-
/* @__PURE__ */ B(
|
|
655
|
+
/* @__PURE__ */ B(d, {
|
|
657
656
|
axis: "y",
|
|
658
657
|
from: 30,
|
|
659
658
|
to: 70,
|
|
660
659
|
color: "var(--lilt-series-1)"
|
|
661
660
|
}),
|
|
662
|
-
/* @__PURE__ */ B(
|
|
661
|
+
/* @__PURE__ */ B(g, {
|
|
663
662
|
value: 70,
|
|
664
663
|
color: "var(--lilt-muted)"
|
|
665
664
|
}),
|
|
666
|
-
/* @__PURE__ */ B(
|
|
665
|
+
/* @__PURE__ */ B(g, {
|
|
667
666
|
value: 30,
|
|
668
667
|
color: "var(--lilt-muted)"
|
|
669
668
|
}),
|
|
670
|
-
/* @__PURE__ */ B(
|
|
669
|
+
/* @__PURE__ */ B(E, { series: r.id })
|
|
671
670
|
]
|
|
672
|
-
},
|
|
673
|
-
let
|
|
671
|
+
}, r.id);
|
|
672
|
+
let l = `${r.id}Macd`, u = `${r.id}Signal`, f = `${r.id}Histogram`;
|
|
674
673
|
return /* @__PURE__ */ V(J, {
|
|
675
|
-
context:
|
|
676
|
-
label: `${
|
|
677
|
-
caption: `MACD ${
|
|
678
|
-
readout: (e) => [
|
|
679
|
-
height:
|
|
680
|
-
xAxis:
|
|
674
|
+
context: i,
|
|
675
|
+
label: `${x.title} MACD`,
|
|
676
|
+
caption: `MACD ${r.fast} · ${r.slow} · ${r.signal}`,
|
|
677
|
+
readout: (e) => [c(e, l), c(e, u, "Signal")],
|
|
678
|
+
height: b,
|
|
679
|
+
xAxis: o,
|
|
681
680
|
y: {
|
|
682
681
|
includeZero: !0,
|
|
683
682
|
ticks: 2,
|
|
684
683
|
format: N
|
|
685
684
|
},
|
|
686
|
-
bars: { series: [
|
|
685
|
+
bars: { series: [f] },
|
|
687
686
|
series: [
|
|
688
687
|
{
|
|
689
|
-
id:
|
|
688
|
+
id: f,
|
|
690
689
|
label: "Histogram",
|
|
691
|
-
accessor:
|
|
690
|
+
accessor: s(f),
|
|
692
691
|
formatValue: N,
|
|
693
|
-
colorAt: (e) => ($(e,
|
|
692
|
+
colorAt: (e) => ($(e, f) ?? 0) >= 0 ? "color-mix(in srgb, var(--lilt-candle-up) 55%, transparent)" : "color-mix(in srgb, var(--lilt-candle-down) 55%, transparent)",
|
|
694
693
|
bar: { radius: 1 }
|
|
695
694
|
},
|
|
696
695
|
{
|
|
697
|
-
id:
|
|
696
|
+
id: l,
|
|
698
697
|
label: "MACD",
|
|
699
|
-
accessor:
|
|
698
|
+
accessor: s(l),
|
|
700
699
|
color: "var(--lilt-series-4)",
|
|
701
700
|
formatValue: N,
|
|
702
701
|
line: {
|
|
703
702
|
width: 1.5,
|
|
704
|
-
depth:
|
|
703
|
+
depth: x.depth
|
|
705
704
|
}
|
|
706
705
|
},
|
|
707
706
|
{
|
|
708
|
-
id:
|
|
707
|
+
id: u,
|
|
709
708
|
label: "Signal",
|
|
710
|
-
accessor:
|
|
709
|
+
accessor: s(u),
|
|
711
710
|
color: "var(--lilt-series-3)",
|
|
712
711
|
formatValue: N,
|
|
713
712
|
line: {
|
|
@@ -717,40 +716,40 @@ function Ce({ close: e, open: t, high: n, low: r, volume: i, display: a, overlay
|
|
|
717
716
|
}
|
|
718
717
|
],
|
|
719
718
|
children: [
|
|
720
|
-
/* @__PURE__ */ B(
|
|
721
|
-
/* @__PURE__ */ B(
|
|
722
|
-
/* @__PURE__ */ B(
|
|
719
|
+
/* @__PURE__ */ B(e, { series: f }),
|
|
720
|
+
/* @__PURE__ */ B(E, { series: l }),
|
|
721
|
+
/* @__PURE__ */ B(E, { series: u })
|
|
723
722
|
]
|
|
724
|
-
},
|
|
723
|
+
}, r.id);
|
|
725
724
|
};
|
|
726
|
-
return /* @__PURE__ */ B(
|
|
727
|
-
...
|
|
725
|
+
return /* @__PURE__ */ B(A, {
|
|
726
|
+
...x,
|
|
728
727
|
data: j,
|
|
729
728
|
ranges: ee,
|
|
730
|
-
delta:
|
|
731
|
-
valueFormat:
|
|
732
|
-
locale:
|
|
729
|
+
delta: _ ?? (m && n ? X(m, n, t) : void 0),
|
|
730
|
+
valueFormat: v,
|
|
731
|
+
locale: y,
|
|
733
732
|
aggregate: "last",
|
|
734
|
-
headlineSeries:
|
|
735
|
-
pillSeries:
|
|
733
|
+
headlineSeries: t,
|
|
734
|
+
pillSeries: t,
|
|
736
735
|
tiles: !1,
|
|
737
|
-
live:
|
|
736
|
+
live: p,
|
|
738
737
|
series: [{
|
|
739
|
-
key:
|
|
740
|
-
label:
|
|
741
|
-
color:
|
|
742
|
-
}, ...
|
|
738
|
+
key: t,
|
|
739
|
+
label: u,
|
|
740
|
+
color: C === "line" ? G ? U : W : void 0
|
|
741
|
+
}, ...O.map((e, t) => ({
|
|
743
742
|
key: e.id,
|
|
744
743
|
label: e.label,
|
|
745
744
|
color: Se[t % Se.length]
|
|
746
745
|
}))],
|
|
747
746
|
shape: {
|
|
748
747
|
kind: "marks",
|
|
749
|
-
id: `indicator:${
|
|
748
|
+
id: `indicator:${C}:${f}:${n}:${r}:${i}:${T}:${D}`,
|
|
750
749
|
includeZero: !1,
|
|
751
|
-
scale:
|
|
750
|
+
scale: f,
|
|
752
751
|
slots: !0,
|
|
753
|
-
xAxis:
|
|
752
|
+
xAxis: k.length === 0,
|
|
754
753
|
series: (e) => {
|
|
755
754
|
let t = L.get(e);
|
|
756
755
|
return t ? {
|
|
@@ -758,7 +757,7 @@ function Ce({ close: e, open: t, high: n, low: r, volume: i, display: a, overlay
|
|
|
758
757
|
line: {
|
|
759
758
|
width: 1.5,
|
|
760
759
|
showInspectionPoint: !1,
|
|
761
|
-
depth:
|
|
760
|
+
depth: x.depth
|
|
762
761
|
},
|
|
763
762
|
...t.kind === "bollinger" ? { fields: {
|
|
764
763
|
upper: {
|
|
@@ -770,39 +769,39 @@ function Ce({ close: e, open: t, high: n, low: r, volume: i, display: a, overlay
|
|
|
770
769
|
accessor: (e) => $(e, `${t.id}Lower`)
|
|
771
770
|
}
|
|
772
771
|
} } : {}
|
|
773
|
-
} :
|
|
772
|
+
} : C === "line" ? {
|
|
774
773
|
fields: F,
|
|
775
774
|
curve: "linear",
|
|
776
775
|
line: {
|
|
777
776
|
width: 2,
|
|
778
|
-
depth:
|
|
777
|
+
depth: x.depth
|
|
779
778
|
}
|
|
780
779
|
} : { fields: F };
|
|
781
780
|
},
|
|
782
|
-
describe:
|
|
781
|
+
describe: S ? oe(M) : void 0,
|
|
783
782
|
draw: (e) => e.map((e) => {
|
|
784
783
|
let t = L.get(e);
|
|
785
|
-
return t ? t.kind === "bollinger" ? [/* @__PURE__ */ B(
|
|
784
|
+
return t ? t.kind === "bollinger" ? [/* @__PURE__ */ B(o, {
|
|
786
785
|
series: e,
|
|
787
786
|
lower: "lower",
|
|
788
787
|
upper: "upper"
|
|
789
|
-
}, `band-${e}`), /* @__PURE__ */ B(
|
|
788
|
+
}, `band-${e}`), /* @__PURE__ */ B(E, { series: e }, `line-${e}`)] : /* @__PURE__ */ B(E, { series: e }, e) : C === "line" ? /* @__PURE__ */ B(E, { series: e }, e) : /* @__PURE__ */ B(ae, {
|
|
790
789
|
series: e,
|
|
791
790
|
open: "open",
|
|
792
791
|
high: "high",
|
|
793
792
|
low: "low",
|
|
794
|
-
display:
|
|
795
|
-
depth:
|
|
793
|
+
display: C,
|
|
794
|
+
depth: x.depth
|
|
796
795
|
}, e);
|
|
797
796
|
})
|
|
798
797
|
},
|
|
799
|
-
panes:
|
|
798
|
+
panes: k.length ? (e) => /* @__PURE__ */ B(z, { children: k.map((t) => te(t, e)) }) : void 0
|
|
800
799
|
});
|
|
801
800
|
}
|
|
802
801
|
//#endregion
|
|
803
802
|
//#region src/finance/cards/depth-chart-card.tsx
|
|
804
803
|
function we({ price: e, label: t }) {
|
|
805
|
-
let { snapshot: n } =
|
|
804
|
+
let { snapshot: n } = P();
|
|
806
805
|
if (e < n.xDomain[0] || e > n.xDomain[1]) return null;
|
|
807
806
|
let r = n.xToPixel(e);
|
|
808
807
|
return /* @__PURE__ */ V("g", {
|
|
@@ -829,11 +828,11 @@ var Te = {
|
|
|
829
828
|
minimumFractionDigits: 2,
|
|
830
829
|
maximumFractionDigits: 2
|
|
831
830
|
};
|
|
832
|
-
function Ee({ title: e, header: t = !0, "aria-label":
|
|
833
|
-
let
|
|
831
|
+
function Ee({ title: e, header: t = !0, "aria-label": r = e || "Depth chart", bids: i, asks: o, valueFormat: s = Te, sizeFormat: u, locale: d = "en-US", height: f = 220, axis: p = "minimal", background: h = "dots", hoverStyle: g = "soft", surface: _, numberStyle: y, loading: x = !1, loadingStyle: C = "shimmer", empty: T = "dots", motion: O, className: A, style: ee, depth: M = !1 }) {
|
|
832
|
+
let N = I(() => _e(i, o), [i, o]), P = JSON.stringify(s), F = JSON.stringify(u ?? null), L = I(() => w(d, s), [d, P]), H = I(() => w(d, u), [d, F]), G = I(() => w(d, {
|
|
834
833
|
style: "percent",
|
|
835
834
|
maximumFractionDigits: 3
|
|
836
|
-
}).full, [
|
|
835
|
+
}).full, [d]), [K, te] = R(null), ne = I(() => [{
|
|
837
836
|
id: "bid",
|
|
838
837
|
label: "Bids",
|
|
839
838
|
accessor: (e) => e.bid,
|
|
@@ -842,7 +841,7 @@ function Ee({ title: e, header: t = !0, "aria-label": n = e || "Depth chart", bi
|
|
|
842
841
|
area: { treatment: "fade" },
|
|
843
842
|
line: {
|
|
844
843
|
width: 1.5,
|
|
845
|
-
depth:
|
|
844
|
+
depth: M
|
|
846
845
|
},
|
|
847
846
|
formatValue: H.full
|
|
848
847
|
}, {
|
|
@@ -854,47 +853,47 @@ function Ee({ title: e, header: t = !0, "aria-label": n = e || "Depth chart", bi
|
|
|
854
853
|
area: { treatment: "fade" },
|
|
855
854
|
line: {
|
|
856
855
|
width: 1.5,
|
|
857
|
-
depth:
|
|
856
|
+
depth: M
|
|
858
857
|
},
|
|
859
858
|
formatValue: H.full
|
|
860
|
-
}], [H,
|
|
861
|
-
return /* @__PURE__ */ V(
|
|
862
|
-
"aria-label":
|
|
863
|
-
surface:
|
|
864
|
-
numberStyle:
|
|
865
|
-
motion:
|
|
866
|
-
className: ["lilt-card--depth",
|
|
867
|
-
style:
|
|
868
|
-
children: [t ? /* @__PURE__ */ V(z, { children: [/* @__PURE__ */ V(
|
|
869
|
-
value:
|
|
859
|
+
}], [H, M]), re = N.spread !== null && N.mid ? `${L.full(N.spread)} (${G(N.spread / N.mid)})` : "—", q = K ? K.bid ?? K.ask : null;
|
|
860
|
+
return /* @__PURE__ */ V(v, {
|
|
861
|
+
"aria-label": r,
|
|
862
|
+
surface: _,
|
|
863
|
+
numberStyle: y,
|
|
864
|
+
motion: O,
|
|
865
|
+
className: ["lilt-card--depth", A].filter(Boolean).join(" "),
|
|
866
|
+
style: ee,
|
|
867
|
+
children: [t ? /* @__PURE__ */ V(z, { children: [/* @__PURE__ */ V(k, { children: [e ? /* @__PURE__ */ B(S, { children: e }) : null, /* @__PURE__ */ B(m, {
|
|
868
|
+
value: N.mid,
|
|
870
869
|
format: L.full,
|
|
871
|
-
loading:
|
|
872
|
-
motion:
|
|
873
|
-
children:
|
|
870
|
+
loading: x,
|
|
871
|
+
motion: O,
|
|
872
|
+
children: x ? null : K && q !== null ? /* @__PURE__ */ V(b, { children: [
|
|
874
873
|
H.full(q),
|
|
875
874
|
" ",
|
|
876
875
|
K.side === "bid" ? "bid" : "ask",
|
|
877
876
|
" depth at",
|
|
878
877
|
" ",
|
|
879
878
|
L.full(K.price)
|
|
880
|
-
] }) : /* @__PURE__ */ B(
|
|
879
|
+
] }) : /* @__PURE__ */ B(b, { children: "Mid price" })
|
|
881
880
|
})] }), /* @__PURE__ */ V("dl", {
|
|
882
881
|
className: "lilt-card__stats",
|
|
883
882
|
children: [
|
|
884
|
-
/* @__PURE__ */ V("div", { children: [/* @__PURE__ */ B("dt", { children: "Spread" }), /* @__PURE__ */ B("dd", { children:
|
|
883
|
+
/* @__PURE__ */ V("div", { children: [/* @__PURE__ */ B("dt", { children: "Spread" }), /* @__PURE__ */ B("dd", { children: x ? "—" : re })] }),
|
|
885
884
|
/* @__PURE__ */ V("div", {
|
|
886
885
|
"data-side": "bid",
|
|
887
|
-
children: [/* @__PURE__ */ B("dt", { children: "Bid depth" }), /* @__PURE__ */ B("dd", { children:
|
|
886
|
+
children: [/* @__PURE__ */ B("dt", { children: "Bid depth" }), /* @__PURE__ */ B("dd", { children: x ? "—" : H.compact(N.bidDepth) })]
|
|
888
887
|
}),
|
|
889
888
|
/* @__PURE__ */ V("div", {
|
|
890
889
|
"data-side": "ask",
|
|
891
|
-
children: [/* @__PURE__ */ B("dt", { children: "Ask depth" }), /* @__PURE__ */ B("dd", { children:
|
|
890
|
+
children: [/* @__PURE__ */ B("dt", { children: "Ask depth" }), /* @__PURE__ */ B("dd", { children: x ? "—" : H.compact(N.askDepth) })]
|
|
892
891
|
})
|
|
893
892
|
]
|
|
894
|
-
})] }) : null, /* @__PURE__ */ B(
|
|
893
|
+
})] }) : null, /* @__PURE__ */ B(c, {
|
|
895
894
|
className: "lilt-card__chart",
|
|
896
|
-
"aria-label": `${
|
|
897
|
-
data:
|
|
895
|
+
"aria-label": `${r} depth by price`,
|
|
896
|
+
data: N.levels,
|
|
898
897
|
x: {
|
|
899
898
|
type: "number",
|
|
900
899
|
accessor: (e) => e.price,
|
|
@@ -907,15 +906,15 @@ function Ee({ title: e, header: t = !0, "aria-label": n = e || "Depth chart", bi
|
|
|
907
906
|
},
|
|
908
907
|
series: ne,
|
|
909
908
|
onSelectionChange: (e) => te(e?.row ?? null),
|
|
910
|
-
motion:
|
|
911
|
-
status:
|
|
912
|
-
loadingStyle:
|
|
913
|
-
empty:
|
|
914
|
-
children: /* @__PURE__ */ V(
|
|
915
|
-
height:
|
|
916
|
-
axis:
|
|
917
|
-
background:
|
|
918
|
-
pill:
|
|
909
|
+
motion: O,
|
|
910
|
+
status: x ? "loading" : "ready",
|
|
911
|
+
loadingStyle: C,
|
|
912
|
+
empty: T,
|
|
913
|
+
children: /* @__PURE__ */ V(j, {
|
|
914
|
+
height: f,
|
|
915
|
+
axis: p,
|
|
916
|
+
background: h,
|
|
917
|
+
pill: g,
|
|
919
918
|
margins: {
|
|
920
919
|
top: 8,
|
|
921
920
|
right: 4,
|
|
@@ -923,17 +922,17 @@ function Ee({ title: e, header: t = !0, "aria-label": n = e || "Depth chart", bi
|
|
|
923
922
|
left: 4
|
|
924
923
|
},
|
|
925
924
|
children: [
|
|
926
|
-
/* @__PURE__ */ B(
|
|
927
|
-
/* @__PURE__ */ B(
|
|
928
|
-
/* @__PURE__ */ B(
|
|
929
|
-
/* @__PURE__ */ B(
|
|
930
|
-
/* @__PURE__ */ B(
|
|
931
|
-
|
|
932
|
-
price:
|
|
933
|
-
label: `Mid ${L.full(
|
|
925
|
+
/* @__PURE__ */ B(D, { pattern: "lines" }),
|
|
926
|
+
/* @__PURE__ */ B(a, { series: "bid" }),
|
|
927
|
+
/* @__PURE__ */ B(a, { series: "ask" }),
|
|
928
|
+
/* @__PURE__ */ B(E, { series: "bid" }),
|
|
929
|
+
/* @__PURE__ */ B(E, { series: "ask" }),
|
|
930
|
+
N.mid === null ? null : /* @__PURE__ */ B(we, {
|
|
931
|
+
price: N.mid,
|
|
932
|
+
label: `Mid ${L.full(N.mid)}`
|
|
934
933
|
}),
|
|
935
|
-
/* @__PURE__ */ B(
|
|
936
|
-
/* @__PURE__ */ B(
|
|
934
|
+
/* @__PURE__ */ B(n, { labels: "fit" }),
|
|
935
|
+
/* @__PURE__ */ B(l, {})
|
|
937
936
|
]
|
|
938
937
|
})
|
|
939
938
|
})]
|
|
@@ -950,7 +949,7 @@ function Oe(e, t, n) {
|
|
|
950
949
|
let r = e.at(-1), i = De(r, t), a = De(r, n);
|
|
951
950
|
return i !== null && a ? i / a - 1 : void 0;
|
|
952
951
|
}
|
|
953
|
-
function ke({ value: e, basis: t, label: n = "Value", drawdown:
|
|
952
|
+
function ke({ value: e, basis: t, label: n = "Value", drawdown: r = !0, drawdownHeight: i = 64, data: o, ranges: s, delta: c, locale: l = "en-US", ...u }) {
|
|
954
953
|
let d = o ?? s?.[0]?.data ?? [], f = I(() => s?.map((n) => ({
|
|
955
954
|
...n,
|
|
956
955
|
delta: n.delta ?? Oe(n.data, e, t)
|
|
@@ -958,7 +957,7 @@ function ke({ value: e, basis: t, label: n = "Value", drawdown: i = !0, drawdown
|
|
|
958
957
|
s,
|
|
959
958
|
e,
|
|
960
959
|
t
|
|
961
|
-
]), p = I(() =>
|
|
960
|
+
]), p = I(() => w(l, {
|
|
962
961
|
style: "percent",
|
|
963
962
|
minimumFractionDigits: 1,
|
|
964
963
|
maximumFractionDigits: 1
|
|
@@ -966,7 +965,7 @@ function ke({ value: e, basis: t, label: n = "Value", drawdown: i = !0, drawdown
|
|
|
966
965
|
let t = me(d.map((t) => De(t, e))).filter((e) => e !== null);
|
|
967
966
|
return H(t) ?? null;
|
|
968
967
|
}, [d, e]);
|
|
969
|
-
return /* @__PURE__ */ B(
|
|
968
|
+
return /* @__PURE__ */ B(A, {
|
|
970
969
|
...u,
|
|
971
970
|
data: o,
|
|
972
971
|
ranges: f,
|
|
@@ -987,9 +986,9 @@ function ke({ value: e, basis: t, label: n = "Value", drawdown: i = !0, drawdown
|
|
|
987
986
|
}] : []],
|
|
988
987
|
shape: {
|
|
989
988
|
kind: "marks",
|
|
990
|
-
id: `portfolio:${e}:${t}:${
|
|
989
|
+
id: `portfolio:${e}:${t}:${r}:${u.depth}`,
|
|
991
990
|
includeZero: !1,
|
|
992
|
-
xAxis: !
|
|
991
|
+
xAxis: !r,
|
|
993
992
|
series: (e) => e === t ? {
|
|
994
993
|
curve: "step-after",
|
|
995
994
|
color: "var(--lilt-muted)"
|
|
@@ -997,22 +996,22 @@ function ke({ value: e, basis: t, label: n = "Value", drawdown: i = !0, drawdown
|
|
|
997
996
|
area: { treatment: "fade" },
|
|
998
997
|
curve: "monotone"
|
|
999
998
|
},
|
|
1000
|
-
draw: (e) => e.map((e) => [/* @__PURE__ */ B(
|
|
999
|
+
draw: (e) => e.map((e) => [/* @__PURE__ */ B(a, { series: e }, `area-${e}`), /* @__PURE__ */ B(E, { series: e }, e)])
|
|
1001
1000
|
},
|
|
1002
|
-
panes:
|
|
1003
|
-
let n = me(t.data.map((t) => De(t, e))),
|
|
1001
|
+
panes: r ? (t) => {
|
|
1002
|
+
let n = me(t.data.map((t) => De(t, e))), r = new Map(t.data.map((e, t) => [e, n[t] ?? null]));
|
|
1004
1003
|
return /* @__PURE__ */ V(J, {
|
|
1005
1004
|
context: t,
|
|
1006
1005
|
label: `${u.title} drawdown`,
|
|
1007
1006
|
caption: "Drawdown",
|
|
1008
1007
|
readout: (e) => /* @__PURE__ */ V(z, { children: [/* @__PURE__ */ B("span", {
|
|
1009
1008
|
className: "lilt-card__pane-value",
|
|
1010
|
-
children:
|
|
1009
|
+
children: r.get(e) == null ? "—" : p(r.get(e))
|
|
1011
1010
|
}), m === null ? null : /* @__PURE__ */ V("span", {
|
|
1012
1011
|
className: "lilt-card__pane-value",
|
|
1013
1012
|
children: ["Max ", p(m)]
|
|
1014
1013
|
})] }),
|
|
1015
|
-
height:
|
|
1014
|
+
height: i,
|
|
1016
1015
|
xAxis: !0,
|
|
1017
1016
|
y: {
|
|
1018
1017
|
includeZero: !0,
|
|
@@ -1022,14 +1021,14 @@ function ke({ value: e, basis: t, label: n = "Value", drawdown: i = !0, drawdown
|
|
|
1022
1021
|
series: [{
|
|
1023
1022
|
id: "drawdown",
|
|
1024
1023
|
label: "Drawdown",
|
|
1025
|
-
accessor: (e) =>
|
|
1024
|
+
accessor: (e) => r.get(e) ?? null,
|
|
1026
1025
|
color: "var(--lilt-candle-down)",
|
|
1027
1026
|
formatValue: p,
|
|
1028
1027
|
area: { treatment: "fade" },
|
|
1029
1028
|
line: { width: 1.5 },
|
|
1030
1029
|
curve: "monotone"
|
|
1031
1030
|
}],
|
|
1032
|
-
children: [/* @__PURE__ */ B(
|
|
1031
|
+
children: [/* @__PURE__ */ B(a, { series: "drawdown" }), /* @__PURE__ */ B(E, { series: "drawdown" })]
|
|
1033
1032
|
});
|
|
1034
1033
|
} : void 0
|
|
1035
1034
|
});
|
|
@@ -1058,33 +1057,33 @@ var Ne = {
|
|
|
1058
1057
|
minimumFractionDigits: 2,
|
|
1059
1058
|
maximumFractionDigits: 2
|
|
1060
1059
|
};
|
|
1061
|
-
function Pe({ price: e, symbol: t, name: n, icon:
|
|
1062
|
-
let
|
|
1060
|
+
function Pe({ price: e, symbol: t, name: n, icon: r, display: i = "area", versus: o, data: s, ranges: c, delta: l, valueFormat: u = Ne, locale: d = "en-US", title: f, ...p }) {
|
|
1061
|
+
let m = !!o?.length, g = I(() => [e, ...(o ?? []).map((e) => e.key)], [e, o]), _ = I(() => s ? m ? Me(s, g) : s : void 0, [
|
|
1063
1062
|
s,
|
|
1064
|
-
|
|
1063
|
+
m,
|
|
1065
1064
|
g
|
|
1066
1065
|
]), v = I(() => c?.map((t) => {
|
|
1067
1066
|
let n = je(t.data, e);
|
|
1068
1067
|
return {
|
|
1069
1068
|
...t,
|
|
1070
|
-
data:
|
|
1069
|
+
data: m ? Me(t.data, g) : t.data,
|
|
1071
1070
|
delta: t.delta ?? (n && n.first ? n.last / n.first - 1 : void 0)
|
|
1072
1071
|
};
|
|
1073
1072
|
}), [
|
|
1074
1073
|
c,
|
|
1075
|
-
|
|
1074
|
+
m,
|
|
1076
1075
|
g,
|
|
1077
1076
|
e
|
|
1078
|
-
]),
|
|
1077
|
+
]), y = je(s ?? c?.[0]?.data ?? [], e), b = !y || y.last >= y.first, x = I(() => w(d, u).full, [d, JSON.stringify(u)]), S = I(() => w(d, {
|
|
1079
1078
|
style: "percent",
|
|
1080
1079
|
minimumFractionDigits: 1,
|
|
1081
1080
|
maximumFractionDigits: 1
|
|
1082
|
-
}).full, [d]),
|
|
1081
|
+
}).full, [d]), C = (e) => m ? `__rebased${e}` : e, T = /* @__PURE__ */ V("span", {
|
|
1083
1082
|
className: "lilt-card__ticker",
|
|
1084
1083
|
children: [
|
|
1085
|
-
|
|
1084
|
+
r ? /* @__PURE__ */ B("span", {
|
|
1086
1085
|
className: "lilt-card__ticker-icon",
|
|
1087
|
-
children:
|
|
1086
|
+
children: r
|
|
1088
1087
|
}) : null,
|
|
1089
1088
|
/* @__PURE__ */ B("span", {
|
|
1090
1089
|
className: "lilt-card__ticker-symbol",
|
|
@@ -1096,45 +1095,45 @@ function Pe({ price: e, symbol: t, name: n, icon: i, display: a = "area", versus
|
|
|
1096
1095
|
}) : null
|
|
1097
1096
|
]
|
|
1098
1097
|
});
|
|
1099
|
-
return /* @__PURE__ */ B(
|
|
1098
|
+
return /* @__PURE__ */ B(A, {
|
|
1100
1099
|
...p,
|
|
1101
1100
|
title: f,
|
|
1102
1101
|
"aria-label": p["aria-label"] ?? f ?? t ?? n ?? "Price chart",
|
|
1103
|
-
heading: f || t || n ||
|
|
1102
|
+
heading: f || t || n || r ? T : void 0,
|
|
1104
1103
|
data: _,
|
|
1105
1104
|
ranges: v,
|
|
1106
|
-
delta:
|
|
1107
|
-
valueFormat:
|
|
1105
|
+
delta: m ? void 0 : l ?? (s && y && y.first ? y.last / y.first - 1 : void 0),
|
|
1106
|
+
valueFormat: m ? {
|
|
1108
1107
|
style: "percent",
|
|
1109
1108
|
maximumFractionDigits: 1
|
|
1110
1109
|
} : u,
|
|
1111
|
-
formatValue:
|
|
1110
|
+
formatValue: m ? (e) => h(S)(e) : p.formatValue,
|
|
1112
1111
|
locale: d,
|
|
1113
1112
|
aggregate: "last",
|
|
1114
|
-
headlineSeries:
|
|
1115
|
-
pillSeries:
|
|
1116
|
-
tiles:
|
|
1117
|
-
restCaption:
|
|
1113
|
+
headlineSeries: C(e),
|
|
1114
|
+
pillSeries: m ? "nearest" : C(e),
|
|
1115
|
+
tiles: m,
|
|
1116
|
+
restCaption: m ? void 0 : (t) => {
|
|
1118
1117
|
let n = je(t, e);
|
|
1119
|
-
return n ?
|
|
1118
|
+
return n ? h(x)(n.last - n.first) : null;
|
|
1120
1119
|
},
|
|
1121
1120
|
series: [{
|
|
1122
|
-
key:
|
|
1121
|
+
key: C(e),
|
|
1123
1122
|
label: t ?? f,
|
|
1124
|
-
color:
|
|
1123
|
+
color: m ? void 0 : b ? U : W
|
|
1125
1124
|
}, ...(o ?? []).map((e) => ({
|
|
1126
1125
|
...e,
|
|
1127
|
-
key:
|
|
1126
|
+
key: C(e.key)
|
|
1128
1127
|
}))],
|
|
1129
1128
|
shape: {
|
|
1130
1129
|
kind: "marks",
|
|
1131
|
-
id: `price:${
|
|
1132
|
-
includeZero:
|
|
1133
|
-
series: () =>
|
|
1130
|
+
id: `price:${i}:${g.join()}:${m}`,
|
|
1131
|
+
includeZero: m,
|
|
1132
|
+
series: () => i === "area" && !m ? {
|
|
1134
1133
|
area: { treatment: "fade" },
|
|
1135
1134
|
curve: "monotone"
|
|
1136
1135
|
} : { curve: "monotone" },
|
|
1137
|
-
draw: (e) => e.map((e) =>
|
|
1136
|
+
draw: (e) => e.map((e) => i === "area" && !m ? [/* @__PURE__ */ B(a, { series: e }, `area-${e}`), /* @__PURE__ */ B(E, { series: e }, e)] : /* @__PURE__ */ B(E, { series: e }, e))
|
|
1138
1137
|
},
|
|
1139
1138
|
bleed: p.bleed ?? !0
|
|
1140
1139
|
});
|
|
@@ -1166,14 +1165,14 @@ function Ie(e, t) {
|
|
|
1166
1165
|
return () => window.clearTimeout(s);
|
|
1167
1166
|
}, [e, t]), r;
|
|
1168
1167
|
}
|
|
1169
|
-
function Le({ title: e, header: t = !0, "aria-label": n = e || "Order book", bids: r, asks:
|
|
1168
|
+
function Le({ title: e, header: t = !0, "aria-label": n = e || "Order book", bids: r, asks: i, levels: a = 8, depth: o = !1, valueFormat: s = {
|
|
1170
1169
|
minimumFractionDigits: 2,
|
|
1171
1170
|
maximumFractionDigits: 2
|
|
1172
|
-
}, sizeFormat:
|
|
1173
|
-
let
|
|
1171
|
+
}, sizeFormat: c, locale: l = "en-US", flash: u = !0, surface: d, loading: f = !1, loadingStyle: p = "shimmer", empty: m = "dots", motion: h, className: g, style: _ }) {
|
|
1172
|
+
let b = T(h ?? "auto"), x = y(f, p), S = N(f, b), C = JSON.stringify(s), E = JSON.stringify(c ?? null), D = I(() => w(l, s).full, [l, C]), k = I(() => w(l, c).compact, [l, E]), A = I(() => w(l, {
|
|
1174
1173
|
style: "percent",
|
|
1175
1174
|
maximumFractionDigits: 3
|
|
1176
|
-
}).full, [
|
|
1175
|
+
}).full, [l]), j = I(() => Fe(r, "bid", a), [r, a]), P = I(() => Fe(i, "ask", a), [i, a]), F = !f && P.length === 0 && j.length === 0, L = Ie(I(() => [...P, ...j], [P, j]), u && !b && !f), R = Math.max(1, P.at(-1)?.total ?? 0, j.at(-1)?.total ?? 0), H = j[0]?.price, U = P[0]?.price, W = H !== void 0 && U !== void 0 ? {
|
|
1177
1176
|
value: U - H,
|
|
1178
1177
|
mid: (U + H) / 2
|
|
1179
1178
|
} : null, G = (e) => /* @__PURE__ */ V("tr", {
|
|
@@ -1184,48 +1183,48 @@ function Le({ title: e, header: t = !0, "aria-label": n = e || "Order book", bid
|
|
|
1184
1183
|
children: [
|
|
1185
1184
|
/* @__PURE__ */ V("th", {
|
|
1186
1185
|
scope: "row",
|
|
1187
|
-
children: [
|
|
1186
|
+
children: [o ? /* @__PURE__ */ B("span", {
|
|
1188
1187
|
className: "lilt-order-book__bar",
|
|
1189
1188
|
"aria-hidden": "true"
|
|
1190
|
-
}) : null,
|
|
1189
|
+
}) : null, D(e.price)]
|
|
1191
1190
|
}),
|
|
1192
|
-
/* @__PURE__ */ B("td", { children:
|
|
1193
|
-
/* @__PURE__ */ B("td", { children:
|
|
1191
|
+
/* @__PURE__ */ B("td", { children: k(e.size) }),
|
|
1192
|
+
/* @__PURE__ */ B("td", { children: k(e.total) })
|
|
1194
1193
|
]
|
|
1195
|
-
}, `${e.side}:${e.price}`), K = (e) => Array.from({ length: Math.max(1, Math.min(50,
|
|
1194
|
+
}, `${e.side}:${e.price}`), K = (e) => Array.from({ length: Math.max(1, Math.min(50, a)) }, (t, n) => /* @__PURE__ */ V("tr", {
|
|
1196
1195
|
className: "lilt-order-book__placeholder",
|
|
1197
1196
|
"aria-hidden": "true",
|
|
1198
1197
|
children: [
|
|
1199
|
-
/* @__PURE__ */ B("td", { children: /* @__PURE__ */ B(
|
|
1198
|
+
/* @__PURE__ */ B("td", { children: /* @__PURE__ */ B(M, {
|
|
1200
1199
|
width: `${86 - n * 4}%`,
|
|
1201
1200
|
step: n
|
|
1202
1201
|
}) }),
|
|
1203
|
-
/* @__PURE__ */ B("td", { children: /* @__PURE__ */ B(
|
|
1202
|
+
/* @__PURE__ */ B("td", { children: /* @__PURE__ */ B(M, {
|
|
1204
1203
|
width: "60%",
|
|
1205
1204
|
step: n
|
|
1206
1205
|
}) }),
|
|
1207
|
-
/* @__PURE__ */ B("td", { children: /* @__PURE__ */ B(
|
|
1206
|
+
/* @__PURE__ */ B("td", { children: /* @__PURE__ */ B(M, {
|
|
1208
1207
|
width: "72%",
|
|
1209
1208
|
step: n
|
|
1210
1209
|
}) })
|
|
1211
1210
|
]
|
|
1212
1211
|
}, `${e}-${n}`));
|
|
1213
|
-
return /* @__PURE__ */ V(
|
|
1212
|
+
return /* @__PURE__ */ V(v, {
|
|
1214
1213
|
"aria-label": n,
|
|
1215
|
-
surface:
|
|
1216
|
-
motion:
|
|
1217
|
-
className: ["lilt-card--order-book",
|
|
1218
|
-
style:
|
|
1219
|
-
children: [/* @__PURE__ */ B(
|
|
1220
|
-
leaving:
|
|
1214
|
+
surface: d,
|
|
1215
|
+
motion: h,
|
|
1216
|
+
className: ["lilt-card--order-book", g].filter(Boolean).join(" "),
|
|
1217
|
+
style: _,
|
|
1218
|
+
children: [/* @__PURE__ */ B(O, {
|
|
1219
|
+
leaving: S,
|
|
1221
1220
|
origin: "center",
|
|
1222
1221
|
children: /* @__PURE__ */ V("table", {
|
|
1223
|
-
ref:
|
|
1224
|
-
className:
|
|
1225
|
-
"data-depth":
|
|
1226
|
-
"data-style":
|
|
1227
|
-
"data-reduced-motion":
|
|
1228
|
-
"aria-busy":
|
|
1222
|
+
ref: x,
|
|
1223
|
+
className: f ? "lilt-order-book lilt-skeleton" : "lilt-order-book",
|
|
1224
|
+
"data-depth": o || void 0,
|
|
1225
|
+
"data-style": f ? p : void 0,
|
|
1226
|
+
"data-reduced-motion": b || void 0,
|
|
1227
|
+
"aria-busy": f,
|
|
1229
1228
|
"aria-label": n,
|
|
1230
1229
|
children: [
|
|
1231
1230
|
t && e ? /* @__PURE__ */ B("caption", { children: e }) : null,
|
|
@@ -1246,7 +1245,7 @@ function Le({ title: e, header: t = !0, "aria-label": n = e || "Order book", bid
|
|
|
1246
1245
|
F ? null : /* @__PURE__ */ V(z, { children: [
|
|
1247
1246
|
/* @__PURE__ */ B("tbody", {
|
|
1248
1247
|
"aria-label": "Asks",
|
|
1249
|
-
children:
|
|
1248
|
+
children: f ? K("ask") : [...P].reverse().map(G)
|
|
1250
1249
|
}),
|
|
1251
1250
|
/* @__PURE__ */ B("tbody", {
|
|
1252
1251
|
"aria-label": "Spread",
|
|
@@ -1254,23 +1253,23 @@ function Le({ title: e, header: t = !0, "aria-label": n = e || "Order book", bid
|
|
|
1254
1253
|
className: "lilt-order-book__spread",
|
|
1255
1254
|
children: [/* @__PURE__ */ B("th", {
|
|
1256
1255
|
scope: "row",
|
|
1257
|
-
children:
|
|
1256
|
+
children: f ? "—" : W ? D(W.mid) : "—"
|
|
1258
1257
|
}), /* @__PURE__ */ B("td", {
|
|
1259
1258
|
colSpan: 2,
|
|
1260
|
-
children:
|
|
1259
|
+
children: f ? "Loading order book" : W ? `Spread ${D(W.value)} · ${A(W.value / W.mid)}` : "No spread"
|
|
1261
1260
|
})]
|
|
1262
1261
|
})
|
|
1263
1262
|
}),
|
|
1264
1263
|
/* @__PURE__ */ B("tbody", {
|
|
1265
1264
|
"aria-label": "Bids",
|
|
1266
|
-
children:
|
|
1265
|
+
children: f ? K("bid") : j.map(G)
|
|
1267
1266
|
})
|
|
1268
1267
|
] })
|
|
1269
1268
|
]
|
|
1270
1269
|
})
|
|
1271
|
-
}), F ? /* @__PURE__ */ B(
|
|
1270
|
+
}), F ? /* @__PURE__ */ B(ee, {
|
|
1272
1271
|
block: !0,
|
|
1273
|
-
state:
|
|
1272
|
+
state: m,
|
|
1274
1273
|
shape: "rows"
|
|
1275
1274
|
}) : null]
|
|
1276
1275
|
});
|