@graphysdk/theme-shiny 0.0.0-stage → 0.1.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/LICENSE.md +17 -0
- package/README.md +59 -2
- package/dist/card.d.ts +8 -0
- package/dist/frame.d.ts +9 -0
- package/dist/index.cjs +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.mjs +1131 -0
- package/dist/renderer/area.d.ts +9 -0
- package/dist/renderer/bar.d.ts +8 -0
- package/dist/renderer/finish.d.ts +67 -0
- package/dist/renderer/finishes/flat.d.ts +3 -0
- package/dist/renderer/line.d.ts +9 -0
- package/dist/renderer/material.d.ts +46 -0
- package/dist/renderer/paint.d.ts +21 -0
- package/dist/renderer/plugins.d.ts +10 -0
- package/dist/renderer/point.d.ts +9 -0
- package/dist/renderer/slice.d.ts +8 -0
- package/dist/renderer/tile.d.ts +7 -0
- package/dist/renderer/trace.d.ts +19 -0
- package/dist/renderer/utils/paths.d.ts +7 -0
- package/dist/renderer/utils/projections.d.ts +16 -0
- package/dist/shiny.d.ts +16 -0
- package/dist/styles.d.ts +78 -0
- package/fonts.css +2 -0
- package/licenses/PolyForm-Free-Trial-1.0.0.md +93 -0
- package/licenses/PolyForm-NonCommercial-1.0.0.md +131 -0
- package/licenses/PolyForm-Small-Business-1.0.0.md +121 -0
- package/package.json +79 -3
- package/src/fonts.css.d.ts +2 -0
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,1131 @@
|
|
|
1
|
+
import { GROUP_VARIABLES as Ot, buildPolarBarArcPath as Et, createAreaPathGenerators as Tt, createLinePathGenerator as Lt, createStableCellKeyGenerator as _t, createStableKeyGenerator as G, defineGeomRenderer as T, getAngleExtent as kt, getBarRectBounds as Pt, getPaintedTileRect as It, getRadiusExtent as pt, getStackRole as Ht, getX as M, getXMax as Ft, getXMin as Wt, getY as b, getYMax as ut, getYMin as Gt, polarToUnit as gt, prepareAreaObservations as Mt, prepareLineObservations as bt, readMainAxis as Z, style as s, toPaintColor as Bt, toStrokeDasharray as Nt, toViewBoxX as Dt, toViewBoxY as Yt, useGeomStyleReader as Y } from "@graphysdk/react";
|
|
2
|
+
import { useId as zt, useMemo as k } from "react";
|
|
3
|
+
import { Fragment as Vt, jsx as o, jsxs as m } from "react/jsx-runtime";
|
|
4
|
+
var Ut = 90, jt = 41, Zt = 0.12, Kt = 0.38, Xt = 0.4, Jt = 0.8, qt = 0.16, Qt = (t) => {
|
|
5
|
+
let e = t;
|
|
6
|
+
return () => {
|
|
7
|
+
e = e + 1831565813 | 0;
|
|
8
|
+
let r = Math.imul(e ^ e >>> 15, 1 | e);
|
|
9
|
+
return r = r + Math.imul(r ^ r >>> 7, 61 | r) ^ r, ((r ^ r >>> 14) >>> 0) / 4294967296;
|
|
10
|
+
};
|
|
11
|
+
}, te = ({ ground: t, star: e, bloom: r }) => {
|
|
12
|
+
const a = Qt(jt), i = Array.from({ length: Ut }, () => {
|
|
13
|
+
const l = a() * 100, c = a() * 100, p = Xt + a() ** 3 * Jt, h = Zt + a() * Kt;
|
|
14
|
+
return `<circle cx="${l.toFixed(2)}%" cy="${c.toFixed(2)}%" r="${p.toFixed(2)}" fill="${e}" fill-opacity="${h.toFixed(2)}"/>`;
|
|
15
|
+
}), n = r.length - 1, d = `<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%"><defs><radialGradient id="b" cx="1" cy="0" r="0.9">${r.map((l, c) => {
|
|
16
|
+
const p = c / n * 0.7, h = qt * (1 - c / r.length);
|
|
17
|
+
return `<stop offset="${p.toFixed(2)}" stop-color="${l}" stop-opacity="${h.toFixed(3)}"/>`;
|
|
18
|
+
}).join("")}<stop offset="1" stop-color="${t}" stop-opacity="0"/></radialGradient></defs><rect width="100%" height="100%" fill="${t}"/><rect width="100%" height="100%" fill="url(#b)"/>` + i.join("") + "</svg>";
|
|
19
|
+
return `data:image/svg+xml,${encodeURIComponent(d)}`;
|
|
20
|
+
};
|
|
21
|
+
var K = 0.32, H = 6, ee = 0.22, X = 0.08, re = 0.55, ae = 1.75, ne = 1.25, ie = 0.3, oe = 0.7, se = (t) => t.map((e, r) => `<stop offset="${(r / (t.length - 1)).toFixed(3)}" stop-color="${e}"/>`).join(""), F = (t, e, r) => `<rect x="${t}" y="${t}" rx="${Math.max(0, e - t)}" style="width:calc(100% - ${t * 2}px);height:calc(100% - ${t * 2}px)" fill="none" ${r}/>`, de = (t, { foil: e, shade: r, light: a }) => {
|
|
22
|
+
const n = H / 2, d = `<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%"><defs><linearGradient id="foil" x1="0" y1="0" x2="${K}" y2="${K}" spreadMethod="reflect">${se(e)}</linearGradient><linearGradient id="streak" x1="0" y1="1" x2="${X}" y2="${1 - X}" spreadMethod="repeat"><stop offset="0" stop-color="${a}" stop-opacity="0"/><stop offset="0.12" stop-color="${a}" stop-opacity="${re}"/><stop offset="0.24" stop-color="${a}" stop-opacity="0"/><stop offset="1" stop-color="${a}" stop-opacity="0"/></linearGradient><pattern id="plate" width="${H}" height="${H}" patternUnits="userSpaceOnUse"><path d="M${n},0 L${H},${n} L${n},${H} L0,${n} Z" fill="${a}" fill-opacity="${ee}"/></pattern><linearGradient id="catch" x1="0" y1="0" x2="1" y2="1"><stop offset="0" stop-color="${a}" stop-opacity="0.95"/><stop offset="${ie}" stop-color="${a}" stop-opacity="0"/></linearGradient></defs>` + F(4.5, t, 'stroke="url(#foil)" stroke-width="9"') + F(4.5, t, 'stroke="url(#plate)" stroke-width="9"') + F(4.5, t, 'stroke="url(#streak)" stroke-width="9"') + F(ae, t, `stroke="url(#catch)" stroke-width="${ne}"`) + F(9.5, t, `stroke="${r}" stroke-opacity="${oe}" stroke-width="1"`) + "</svg>";
|
|
23
|
+
return `data:image/svg+xml,${encodeURIComponent(d)}`;
|
|
24
|
+
}, A = {
|
|
25
|
+
pulse: "#E94FF3",
|
|
26
|
+
nebula: "#EC9BFF",
|
|
27
|
+
starlight: "#FFFBFF",
|
|
28
|
+
sirius: "#9AF2FF",
|
|
29
|
+
lagoon: "#9F98FF",
|
|
30
|
+
void: "#0C0B0F",
|
|
31
|
+
obsidian: "#1A1721"
|
|
32
|
+
}, L = [
|
|
33
|
+
"#B9A2FF",
|
|
34
|
+
"#FF9DE4",
|
|
35
|
+
"#8DEEFF",
|
|
36
|
+
"#9FFCCD",
|
|
37
|
+
"#C6ADFF"
|
|
38
|
+
], w = {
|
|
39
|
+
ground: A.obsidian,
|
|
40
|
+
window: "#121017",
|
|
41
|
+
text: A.starlight,
|
|
42
|
+
secondary: "#B3ABC4",
|
|
43
|
+
edge: "rgba(255, 251, 255, 0.12)",
|
|
44
|
+
grid: "rgba(236, 155, 255, 0.11)",
|
|
45
|
+
baseline: "rgba(255, 251, 255, 0.32)",
|
|
46
|
+
star: A.starlight,
|
|
47
|
+
accent: A.pulse,
|
|
48
|
+
accentEdge: "rgba(233, 79, 243, 0.6)"
|
|
49
|
+
};
|
|
50
|
+
var le = "'Inter Tight', 'Inter', ui-sans-serif, system-ui, sans-serif", ft = "'JetBrains Mono', 'IBM Plex Mono', ui-monospace, monospace", ce = "#A8F5C9", he = [
|
|
51
|
+
A.pulse,
|
|
52
|
+
A.sirius,
|
|
53
|
+
A.lagoon,
|
|
54
|
+
A.nebula,
|
|
55
|
+
ce,
|
|
56
|
+
A.starlight
|
|
57
|
+
], pe = [
|
|
58
|
+
"#33205C",
|
|
59
|
+
"#8C3FD2",
|
|
60
|
+
A.pulse,
|
|
61
|
+
"#FFD9FB"
|
|
62
|
+
], ue = 0.88, ge = 0.4, J = { fontFamily: le }, y = { fontFamily: ft }, fe = {
|
|
63
|
+
gradient: "linear",
|
|
64
|
+
angle: 135,
|
|
65
|
+
stops: L.map((t, e) => ({
|
|
66
|
+
offset: e / (L.length - 1),
|
|
67
|
+
color: t
|
|
68
|
+
}))
|
|
69
|
+
}, ve = {
|
|
70
|
+
card: te({
|
|
71
|
+
ground: w.ground,
|
|
72
|
+
star: w.star,
|
|
73
|
+
bloom: L
|
|
74
|
+
}),
|
|
75
|
+
ground: w.ground,
|
|
76
|
+
edge: w.edge,
|
|
77
|
+
text: w.text,
|
|
78
|
+
secondary: w.secondary,
|
|
79
|
+
grid: w.grid,
|
|
80
|
+
baseline: w.baseline,
|
|
81
|
+
accent: w.accent,
|
|
82
|
+
accentEdge: w.accentEdge,
|
|
83
|
+
window: w.window,
|
|
84
|
+
windowGlow: "rgba(233, 79, 243, 0.18)",
|
|
85
|
+
hoverGuideFill: "rgba(236, 155, 255, 0.07)",
|
|
86
|
+
tooltipPrimaryRow: "rgba(233, 79, 243, 0.12)",
|
|
87
|
+
washAlpha: 0.16
|
|
88
|
+
}, me = (t, e) => {
|
|
89
|
+
const r = { textColor: t.text }, a = { textColor: t.secondary }, i = {
|
|
90
|
+
offsetX: 0,
|
|
91
|
+
offsetY: 8,
|
|
92
|
+
blur: 24,
|
|
93
|
+
color: t.windowGlow
|
|
94
|
+
}, n = {
|
|
95
|
+
...r,
|
|
96
|
+
...y,
|
|
97
|
+
fontWeight: 500,
|
|
98
|
+
fontSize: 12,
|
|
99
|
+
fill: t.window,
|
|
100
|
+
stroke: t.accentEdge,
|
|
101
|
+
strokeWidth: 1,
|
|
102
|
+
cornerRadius: 8,
|
|
103
|
+
shadow: i
|
|
104
|
+
};
|
|
105
|
+
return {
|
|
106
|
+
tokens: {
|
|
107
|
+
graphBackground: t.ground,
|
|
108
|
+
graphBorder: t.edge,
|
|
109
|
+
geom: A.pulse,
|
|
110
|
+
geomBorder: t.secondary,
|
|
111
|
+
textPrimary: t.text,
|
|
112
|
+
textSecondary: t.secondary,
|
|
113
|
+
ruleLine: t.accent,
|
|
114
|
+
gridLine: t.grid,
|
|
115
|
+
hoverAffordance: t.text,
|
|
116
|
+
hoverGuideFill: t.hoverGuideFill,
|
|
117
|
+
hoverGuideLine: t.accentEdge,
|
|
118
|
+
tooltipBackground: t.window,
|
|
119
|
+
tooltipBorder: t.accentEdge,
|
|
120
|
+
tooltipPrimaryRow: t.tooltipPrimaryRow,
|
|
121
|
+
annotationShape: A.nebula,
|
|
122
|
+
annotationArrow: t.accent,
|
|
123
|
+
differenceLabelBackground: t.window
|
|
124
|
+
},
|
|
125
|
+
defaults: [
|
|
126
|
+
s.graph({
|
|
127
|
+
fill: {
|
|
128
|
+
image: t.card,
|
|
129
|
+
fit: "stretch",
|
|
130
|
+
fallback: t.ground
|
|
131
|
+
},
|
|
132
|
+
stroke: t.edge,
|
|
133
|
+
strokeWidth: 1,
|
|
134
|
+
cornerRadius: 20,
|
|
135
|
+
fontFamily: ft,
|
|
136
|
+
padding: 28
|
|
137
|
+
}),
|
|
138
|
+
s.geom({ shadow: "none" }),
|
|
139
|
+
s.geom({ shadow: "none" }, { state: "hovered" }),
|
|
140
|
+
s.geom.bar({
|
|
141
|
+
strokeWidth: 0,
|
|
142
|
+
cornerRadius: "none"
|
|
143
|
+
}),
|
|
144
|
+
s.geom.line({
|
|
145
|
+
strokeWidth: e.lineWidth,
|
|
146
|
+
dashArray: [],
|
|
147
|
+
lineCap: "round",
|
|
148
|
+
lineJoin: "round"
|
|
149
|
+
}),
|
|
150
|
+
s.geom.area({
|
|
151
|
+
fillAlpha: ue,
|
|
152
|
+
strokeWidth: 0,
|
|
153
|
+
dashArray: [],
|
|
154
|
+
lineJoin: "round"
|
|
155
|
+
}),
|
|
156
|
+
s.geom.point({
|
|
157
|
+
size: e.pointSize,
|
|
158
|
+
strokeWidth: 0
|
|
159
|
+
}),
|
|
160
|
+
s.geom.tile({
|
|
161
|
+
cornerRadius: 3,
|
|
162
|
+
strokeWidth: 0
|
|
163
|
+
}),
|
|
164
|
+
s.geom.rule({
|
|
165
|
+
stroke: t.accent,
|
|
166
|
+
strokeWidth: 1.5,
|
|
167
|
+
dashArray: [5, 4]
|
|
168
|
+
}),
|
|
169
|
+
s.geom.rule.label({
|
|
170
|
+
...y,
|
|
171
|
+
fontWeight: 600,
|
|
172
|
+
fontSize: 11.5,
|
|
173
|
+
textTransform: "uppercase"
|
|
174
|
+
}),
|
|
175
|
+
s.gridLine({ dashArray: [] }),
|
|
176
|
+
s.gridLine.x({ strokeWidth: 0 }),
|
|
177
|
+
s.gridLine.y({ strokeWidth: 1 }),
|
|
178
|
+
s.panelBorder({ strokeWidth: 0 }),
|
|
179
|
+
s.panelBorder.bottom({
|
|
180
|
+
stroke: t.baseline,
|
|
181
|
+
strokeWidth: 1,
|
|
182
|
+
dashArray: []
|
|
183
|
+
}),
|
|
184
|
+
s.tickLine({ strokeWidth: 0 }),
|
|
185
|
+
s.tickLabel({
|
|
186
|
+
...a,
|
|
187
|
+
...y,
|
|
188
|
+
fontWeight: 400,
|
|
189
|
+
fontSize: 11.5,
|
|
190
|
+
lineHeight: 1
|
|
191
|
+
}),
|
|
192
|
+
s.axisLabel({
|
|
193
|
+
...y,
|
|
194
|
+
textColor: t.accent,
|
|
195
|
+
fontWeight: 600,
|
|
196
|
+
fontSize: 11,
|
|
197
|
+
lineHeight: 1,
|
|
198
|
+
letterSpacing: 0.6,
|
|
199
|
+
textTransform: "uppercase"
|
|
200
|
+
}),
|
|
201
|
+
s.heading({
|
|
202
|
+
...r,
|
|
203
|
+
...J
|
|
204
|
+
}),
|
|
205
|
+
s.heading.h1({
|
|
206
|
+
fontWeight: 800,
|
|
207
|
+
fontSize: 25,
|
|
208
|
+
lineHeight: 1.1,
|
|
209
|
+
letterSpacing: -0.5
|
|
210
|
+
}),
|
|
211
|
+
s.heading.h2({
|
|
212
|
+
...a,
|
|
213
|
+
fontWeight: 500,
|
|
214
|
+
fontSize: 14.5,
|
|
215
|
+
lineHeight: 1.3
|
|
216
|
+
}),
|
|
217
|
+
s.header({ margin: { bottom: 18 } }),
|
|
218
|
+
s.caption({
|
|
219
|
+
...a,
|
|
220
|
+
...y,
|
|
221
|
+
fontWeight: 400,
|
|
222
|
+
fontSize: 11.5
|
|
223
|
+
}),
|
|
224
|
+
s.source({
|
|
225
|
+
...a,
|
|
226
|
+
...y,
|
|
227
|
+
fontWeight: 400,
|
|
228
|
+
fontSize: 11.5
|
|
229
|
+
}),
|
|
230
|
+
s.source.link({
|
|
231
|
+
...a,
|
|
232
|
+
...y,
|
|
233
|
+
fontWeight: 400,
|
|
234
|
+
fontSize: 11.5
|
|
235
|
+
}),
|
|
236
|
+
s.dataLabel({
|
|
237
|
+
...r,
|
|
238
|
+
...y,
|
|
239
|
+
fontWeight: 600,
|
|
240
|
+
fontSize: 11.5,
|
|
241
|
+
fill: "transparent"
|
|
242
|
+
}),
|
|
243
|
+
s.legendItem({
|
|
244
|
+
...r,
|
|
245
|
+
...y,
|
|
246
|
+
fontWeight: 500,
|
|
247
|
+
fontSize: 12,
|
|
248
|
+
fill: "transparent",
|
|
249
|
+
stroke: "transparent"
|
|
250
|
+
}),
|
|
251
|
+
s.directLabel({
|
|
252
|
+
...y,
|
|
253
|
+
fontWeight: 600,
|
|
254
|
+
fontSize: 12
|
|
255
|
+
}),
|
|
256
|
+
s.headlineItem.number({
|
|
257
|
+
...J,
|
|
258
|
+
fontWeight: 800,
|
|
259
|
+
fontSize: 32,
|
|
260
|
+
lineHeight: 1.1
|
|
261
|
+
}),
|
|
262
|
+
s.tooltip({
|
|
263
|
+
fill: t.window,
|
|
264
|
+
strokeWidth: 1,
|
|
265
|
+
cornerRadius: 10,
|
|
266
|
+
paddingInline: 12,
|
|
267
|
+
paddingBlock: 9,
|
|
268
|
+
shadow: i
|
|
269
|
+
}),
|
|
270
|
+
s.tooltip.heading({
|
|
271
|
+
...y,
|
|
272
|
+
textColor: t.accent,
|
|
273
|
+
fontWeight: 600,
|
|
274
|
+
fontSize: 12,
|
|
275
|
+
lineHeight: 1.3,
|
|
276
|
+
textTransform: "uppercase"
|
|
277
|
+
}),
|
|
278
|
+
s.tooltip.label({
|
|
279
|
+
...a,
|
|
280
|
+
...y,
|
|
281
|
+
fontWeight: 400,
|
|
282
|
+
fontSize: 12,
|
|
283
|
+
lineHeight: 1.4
|
|
284
|
+
}),
|
|
285
|
+
s.tooltip.value({
|
|
286
|
+
...r,
|
|
287
|
+
...y,
|
|
288
|
+
fontWeight: 600,
|
|
289
|
+
fontSize: 12,
|
|
290
|
+
lineHeight: 1.4
|
|
291
|
+
}),
|
|
292
|
+
s.legend.popover({
|
|
293
|
+
cornerRadius: 10,
|
|
294
|
+
shadow: i
|
|
295
|
+
}),
|
|
296
|
+
s.annotation.text({
|
|
297
|
+
...n,
|
|
298
|
+
paddingInline: 11,
|
|
299
|
+
paddingBlock: 7,
|
|
300
|
+
lineHeight: 1.4
|
|
301
|
+
}),
|
|
302
|
+
s.annotation.pinnedNumber({
|
|
303
|
+
fill: t.accent,
|
|
304
|
+
stroke: t.ground,
|
|
305
|
+
shadow: "none"
|
|
306
|
+
}),
|
|
307
|
+
s.annotation.pinnedNumber.label({
|
|
308
|
+
...n,
|
|
309
|
+
fontWeight: 600
|
|
310
|
+
}),
|
|
311
|
+
s.annotation.comment({
|
|
312
|
+
fill: t.accent,
|
|
313
|
+
stroke: t.ground,
|
|
314
|
+
shadow: "none"
|
|
315
|
+
}),
|
|
316
|
+
s.annotation.comment.label({ ...n }),
|
|
317
|
+
s.annotation.differenceArrow({
|
|
318
|
+
stroke: t.accent,
|
|
319
|
+
strokeWidth: 1.5
|
|
320
|
+
}),
|
|
321
|
+
s.annotation.differenceArrow.label({
|
|
322
|
+
...n,
|
|
323
|
+
textColor: t.accent,
|
|
324
|
+
fontWeight: 700
|
|
325
|
+
}),
|
|
326
|
+
s.annotation.arrow({
|
|
327
|
+
stroke: t.accent,
|
|
328
|
+
strokeWidth: 1.5,
|
|
329
|
+
dashArray: []
|
|
330
|
+
}),
|
|
331
|
+
s.annotation.shape({
|
|
332
|
+
fill: fe,
|
|
333
|
+
fillAlpha: t.washAlpha,
|
|
334
|
+
stroke: "transparent",
|
|
335
|
+
strokeWidth: 0
|
|
336
|
+
}),
|
|
337
|
+
s.geom.area({ fillAlpha: ge }, { coord: "polar" }),
|
|
338
|
+
s.panelBorder.bottom({ strokeWidth: 0 }, { coord: "polar" }),
|
|
339
|
+
s.tickLabel({
|
|
340
|
+
...r,
|
|
341
|
+
fontWeight: 600,
|
|
342
|
+
textOutlineColor: t.ground,
|
|
343
|
+
textOutlineWidth: 3
|
|
344
|
+
}, { coord: "polar" })
|
|
345
|
+
]
|
|
346
|
+
};
|
|
347
|
+
}, Ae = 28, q = me(ve, {
|
|
348
|
+
lineWidth: 3,
|
|
349
|
+
pointSize: 14
|
|
350
|
+
}), $e = {
|
|
351
|
+
...q,
|
|
352
|
+
defaults: [...q.defaults ?? [], s.graph({
|
|
353
|
+
strokeWidth: 0,
|
|
354
|
+
padding: 9 + Ae,
|
|
355
|
+
overlay: {
|
|
356
|
+
image: de(20, {
|
|
357
|
+
foil: L,
|
|
358
|
+
shade: A.void,
|
|
359
|
+
light: A.starlight
|
|
360
|
+
}),
|
|
361
|
+
fit: "stretch",
|
|
362
|
+
fallback: "transparent"
|
|
363
|
+
}
|
|
364
|
+
})]
|
|
365
|
+
}, ye = 2.6, Re = 28, we = 0.6, Ce = 0.4, Q = 0.42, xe = 0.62, Se = 0.95, Oe = 0.42, Ee = 0.45, x = A.starlight, tt = A.void, S = (t) => `${t}-${zt().replace(/[^a-zA-Z0-9]/gu, "")}`, O = (t) => ({
|
|
366
|
+
foil: `${t}-foil`,
|
|
367
|
+
rimLight: `${t}-rim-light`,
|
|
368
|
+
rimShade: `${t}-rim-shade`,
|
|
369
|
+
gloss: `${t}-gloss`,
|
|
370
|
+
catchlight: `${t}-catchlight`,
|
|
371
|
+
reflection: `${t}-reflection`
|
|
372
|
+
}), E = ({ ids: t, panel: e }) => {
|
|
373
|
+
const r = Re * Math.PI / 180, a = Math.hypot(e.width, e.height) / ye, i = L.length - 1;
|
|
374
|
+
return /* @__PURE__ */ m(Vt, { children: [
|
|
375
|
+
/* @__PURE__ */ o("linearGradient", {
|
|
376
|
+
id: t.foil,
|
|
377
|
+
gradientUnits: "userSpaceOnUse",
|
|
378
|
+
spreadMethod: "reflect",
|
|
379
|
+
x1: 0,
|
|
380
|
+
y1: 0,
|
|
381
|
+
x2: Math.cos(r) * a,
|
|
382
|
+
y2: Math.sin(r) * a,
|
|
383
|
+
children: L.map((n, d) => /* @__PURE__ */ o("stop", {
|
|
384
|
+
offset: d / i,
|
|
385
|
+
stopColor: n
|
|
386
|
+
}, n))
|
|
387
|
+
}),
|
|
388
|
+
/* @__PURE__ */ m("linearGradient", {
|
|
389
|
+
id: t.rimLight,
|
|
390
|
+
x1: 0,
|
|
391
|
+
y1: 0,
|
|
392
|
+
x2: 1,
|
|
393
|
+
y2: 1,
|
|
394
|
+
children: [/* @__PURE__ */ o("stop", {
|
|
395
|
+
offset: 0,
|
|
396
|
+
stopColor: x,
|
|
397
|
+
stopOpacity: we
|
|
398
|
+
}), /* @__PURE__ */ o("stop", {
|
|
399
|
+
offset: 0.45,
|
|
400
|
+
stopColor: x,
|
|
401
|
+
stopOpacity: 0
|
|
402
|
+
})]
|
|
403
|
+
}),
|
|
404
|
+
/* @__PURE__ */ m("linearGradient", {
|
|
405
|
+
id: t.rimShade,
|
|
406
|
+
x1: 0,
|
|
407
|
+
y1: 0,
|
|
408
|
+
x2: 1,
|
|
409
|
+
y2: 1,
|
|
410
|
+
children: [/* @__PURE__ */ o("stop", {
|
|
411
|
+
offset: 0.5,
|
|
412
|
+
stopColor: tt,
|
|
413
|
+
stopOpacity: 0
|
|
414
|
+
}), /* @__PURE__ */ o("stop", {
|
|
415
|
+
offset: 1,
|
|
416
|
+
stopColor: tt,
|
|
417
|
+
stopOpacity: Ce
|
|
418
|
+
})]
|
|
419
|
+
}),
|
|
420
|
+
/* @__PURE__ */ m("radialGradient", {
|
|
421
|
+
id: t.gloss,
|
|
422
|
+
cx: 0.22,
|
|
423
|
+
cy: 0.12,
|
|
424
|
+
r: xe,
|
|
425
|
+
children: [
|
|
426
|
+
/* @__PURE__ */ o("stop", {
|
|
427
|
+
offset: 0,
|
|
428
|
+
stopColor: x,
|
|
429
|
+
stopOpacity: Q
|
|
430
|
+
}),
|
|
431
|
+
/* @__PURE__ */ o("stop", {
|
|
432
|
+
offset: 0.6,
|
|
433
|
+
stopColor: x,
|
|
434
|
+
stopOpacity: Q / 5
|
|
435
|
+
}),
|
|
436
|
+
/* @__PURE__ */ o("stop", {
|
|
437
|
+
offset: 1,
|
|
438
|
+
stopColor: x,
|
|
439
|
+
stopOpacity: 0
|
|
440
|
+
})
|
|
441
|
+
]
|
|
442
|
+
}),
|
|
443
|
+
/* @__PURE__ */ m("linearGradient", {
|
|
444
|
+
id: t.catchlight,
|
|
445
|
+
x1: 0,
|
|
446
|
+
y1: 0,
|
|
447
|
+
x2: 1,
|
|
448
|
+
y2: 1,
|
|
449
|
+
children: [/* @__PURE__ */ o("stop", {
|
|
450
|
+
offset: 0,
|
|
451
|
+
stopColor: x,
|
|
452
|
+
stopOpacity: Se
|
|
453
|
+
}), /* @__PURE__ */ o("stop", {
|
|
454
|
+
offset: Oe,
|
|
455
|
+
stopColor: x,
|
|
456
|
+
stopOpacity: 0
|
|
457
|
+
})]
|
|
458
|
+
}),
|
|
459
|
+
/* @__PURE__ */ m("linearGradient", {
|
|
460
|
+
id: t.reflection,
|
|
461
|
+
x1: 0,
|
|
462
|
+
y1: 0,
|
|
463
|
+
x2: 1,
|
|
464
|
+
y2: 1,
|
|
465
|
+
children: [/* @__PURE__ */ o("stop", {
|
|
466
|
+
offset: 0.6,
|
|
467
|
+
stopColor: x,
|
|
468
|
+
stopOpacity: 0
|
|
469
|
+
}), /* @__PURE__ */ o("stop", {
|
|
470
|
+
offset: 1,
|
|
471
|
+
stopColor: x,
|
|
472
|
+
stopOpacity: Ee
|
|
473
|
+
})]
|
|
474
|
+
})
|
|
475
|
+
] });
|
|
476
|
+
}, vt = ({ x: t, y: e, width: r, height: a }, i) => {
|
|
477
|
+
const n = Math.max(0, Math.min(i, r / 2, a / 2));
|
|
478
|
+
if (n === 0) return `M${t},${e} H${t + r} V${e + a} H${t} Z`;
|
|
479
|
+
const d = (l, c) => `A${n},${n} 0 0 1 ${l},${c}`;
|
|
480
|
+
return [
|
|
481
|
+
`M${t + n},${e}`,
|
|
482
|
+
`H${t + r - n}`,
|
|
483
|
+
d(t + r, e + n),
|
|
484
|
+
`V${e + a - n}`,
|
|
485
|
+
d(t + r - n, e + a),
|
|
486
|
+
`H${t + n}`,
|
|
487
|
+
d(t, e + a - n),
|
|
488
|
+
`V${e + n}`,
|
|
489
|
+
d(t + n, e),
|
|
490
|
+
"Z"
|
|
491
|
+
].join(" ");
|
|
492
|
+
}, _ = (t, e, r) => `M${t - r},${e} A${r},${r} 0 1 0 ${t + r},${e} A${r},${r} 0 1 0 ${t - r},${e} Z`, Te = 2, Le = 2.5, _e = 0.35, ke = 1.5, Pe = 0.9, Ie = ({ id: t, path: e, paint: r, state: a }) => /* @__PURE__ */ m("g", {
|
|
493
|
+
opacity: r.opacity,
|
|
494
|
+
children: [
|
|
495
|
+
/* @__PURE__ */ o("defs", { children: /* @__PURE__ */ o("clipPath", {
|
|
496
|
+
id: t,
|
|
497
|
+
children: /* @__PURE__ */ o("path", { d: e })
|
|
498
|
+
}) }),
|
|
499
|
+
/* @__PURE__ */ o("path", {
|
|
500
|
+
d: e,
|
|
501
|
+
fill: r.color,
|
|
502
|
+
fillOpacity: r.fillOpacity
|
|
503
|
+
}),
|
|
504
|
+
/* @__PURE__ */ m("g", {
|
|
505
|
+
fill: "none",
|
|
506
|
+
clipPath: `url(#${t})`,
|
|
507
|
+
strokeLinejoin: "round",
|
|
508
|
+
children: [/* @__PURE__ */ o("path", {
|
|
509
|
+
d: e,
|
|
510
|
+
stroke: w.ground,
|
|
511
|
+
strokeWidth: Te
|
|
512
|
+
}), a === "hovered" && /* @__PURE__ */ o("path", {
|
|
513
|
+
d: e,
|
|
514
|
+
stroke: x,
|
|
515
|
+
strokeOpacity: Pe,
|
|
516
|
+
strokeWidth: ke * 2
|
|
517
|
+
})]
|
|
518
|
+
})
|
|
519
|
+
]
|
|
520
|
+
}), He = ({ path: t, paint: e, glowId: r }) => /* @__PURE__ */ m("g", {
|
|
521
|
+
opacity: e.opacity,
|
|
522
|
+
fill: "none",
|
|
523
|
+
strokeLinecap: "round",
|
|
524
|
+
strokeLinejoin: "round",
|
|
525
|
+
strokeDasharray: e.dashArray,
|
|
526
|
+
children: [/* @__PURE__ */ o("path", {
|
|
527
|
+
d: t,
|
|
528
|
+
stroke: e.color,
|
|
529
|
+
strokeOpacity: _e,
|
|
530
|
+
strokeWidth: e.width * Le,
|
|
531
|
+
filter: `url(#${r})`
|
|
532
|
+
}), /* @__PURE__ */ o("path", {
|
|
533
|
+
d: t,
|
|
534
|
+
stroke: e.color,
|
|
535
|
+
strokeWidth: e.width
|
|
536
|
+
})]
|
|
537
|
+
}), Fe = {
|
|
538
|
+
Cell: Ie,
|
|
539
|
+
Tube: He,
|
|
540
|
+
rims: {
|
|
541
|
+
bar: () => 0,
|
|
542
|
+
barCorner: () => 3,
|
|
543
|
+
tile: () => 0,
|
|
544
|
+
tileCorner: 3,
|
|
545
|
+
tileGap: 0,
|
|
546
|
+
bead: () => 0,
|
|
547
|
+
ringSlice: () => 0,
|
|
548
|
+
petal: () => 0,
|
|
549
|
+
areaSide: 0,
|
|
550
|
+
areaValue: 0
|
|
551
|
+
},
|
|
552
|
+
pin: {
|
|
553
|
+
hasBezel: !1,
|
|
554
|
+
hasGlow: !1,
|
|
555
|
+
hole: null
|
|
556
|
+
}
|
|
557
|
+
}, We = /[a-df-zA-DF-Z]|[-+]?(?:\d+\.?\d*|\.\d+)(?:[eE][-+]?\d+)?/gu, Ge = /^[a-zA-Z]$/u, Me = (t, e) => t === "H" ? "x" : t === "V" ? "y" : e % 2 === 0 ? "x" : "y", D = (t, e) => {
|
|
558
|
+
let r = "", a = 0;
|
|
559
|
+
return (t.match(We) ?? []).map((i) => {
|
|
560
|
+
if (Ge.test(i))
|
|
561
|
+
return r = i.toUpperCase(), a = 0, i;
|
|
562
|
+
const n = Me(r, a);
|
|
563
|
+
return a += 1, String(Number(i) * (n === "x" ? e.width : e.height));
|
|
564
|
+
}).join(" ");
|
|
565
|
+
}, z = (t, e) => {
|
|
566
|
+
const r = M(t), a = b(t) ?? ut(t);
|
|
567
|
+
return r === null || a === null ? null : {
|
|
568
|
+
x: Dt(r) * e.width,
|
|
569
|
+
y: Yt(a) * e.height
|
|
570
|
+
};
|
|
571
|
+
}, B = (t, e) => {
|
|
572
|
+
const r = M(t), a = b(t) ?? pt(t).outerRadius;
|
|
573
|
+
if (r === null || a === null) return null;
|
|
574
|
+
const i = gt(r, a), n = Math.min(e.width, e.height) / 2;
|
|
575
|
+
return {
|
|
576
|
+
x: e.width / 2 + i.x * n,
|
|
577
|
+
y: e.height / 2 - i.y * n
|
|
578
|
+
};
|
|
579
|
+
}, be = (t) => `${t.map((e, r) => `${r === 0 ? "M" : "L"}${e.x},${e.y}`).join(" ")} Z`, P = (t) => {
|
|
580
|
+
const e = Y(t);
|
|
581
|
+
return (r, a) => ({
|
|
582
|
+
color: Bt(e.get("fill", r, a)),
|
|
583
|
+
opacity: e.get("alpha", r, a),
|
|
584
|
+
fillOpacity: e.get("fillAlpha", r, a),
|
|
585
|
+
edge: e.get("stroke", r, a),
|
|
586
|
+
edgeWidth: e.get("strokeWidth", r, a)
|
|
587
|
+
});
|
|
588
|
+
}, mt = (t) => {
|
|
589
|
+
const e = Y(t);
|
|
590
|
+
return (r, a) => {
|
|
591
|
+
const i = e.get("strokeWidth", r, a);
|
|
592
|
+
return {
|
|
593
|
+
color: e.get("stroke", r, a),
|
|
594
|
+
opacity: e.get("alpha", r, a) * e.get("strokeAlpha", r, a),
|
|
595
|
+
width: i,
|
|
596
|
+
dashArray: Nt(e.get("dashArray", r, a), i)
|
|
597
|
+
};
|
|
598
|
+
};
|
|
599
|
+
}, W = (t, e) => {
|
|
600
|
+
const r = G(t.data, t.mapping, t.id), a = [];
|
|
601
|
+
return t.data.groupBy(Ot.group).forEach((i) => {
|
|
602
|
+
const n = [...i], [d] = n, l = e(n);
|
|
603
|
+
d === void 0 || l === null || a.push({
|
|
604
|
+
key: r(d),
|
|
605
|
+
observation: d,
|
|
606
|
+
path: l
|
|
607
|
+
});
|
|
608
|
+
}), a;
|
|
609
|
+
}, Be = (t, e) => t.flatMap((r) => {
|
|
610
|
+
const a = M(r), i = B(r, e);
|
|
611
|
+
return a === null || i === null ? [] : [{
|
|
612
|
+
angle: a,
|
|
613
|
+
point: i
|
|
614
|
+
}];
|
|
615
|
+
}).sort((r, a) => r.angle - a.angle).map(({ point: r }) => r), At = (t, e) => {
|
|
616
|
+
const r = Be(t, e);
|
|
617
|
+
return r.length === 0 ? null : be(r);
|
|
618
|
+
}, et = 14, $t = ({ finish: t, layer: e, coordSystem: r, panel: a }) => {
|
|
619
|
+
const i = P(e), n = S("shiny-area"), d = k(() => {
|
|
620
|
+
if (r === void 0) return W(e, (u) => At(u, a)).map((u) => ({
|
|
621
|
+
...u,
|
|
622
|
+
fill: u.path,
|
|
623
|
+
edge: u.path
|
|
624
|
+
}));
|
|
625
|
+
const { areaGenerator: h, lineGenerator: g } = Tt(r, e.params), v = /* @__PURE__ */ new Map();
|
|
626
|
+
return W(e, (u) => {
|
|
627
|
+
const f = Mt(u, e.params.missingValues), C = h(f), $ = g(f);
|
|
628
|
+
if (!C) return null;
|
|
629
|
+
const R = D(C, a);
|
|
630
|
+
return $ && v.set(R, D($, a)), R;
|
|
631
|
+
}).map((u) => ({
|
|
632
|
+
...u,
|
|
633
|
+
fill: u.path,
|
|
634
|
+
edge: v.get(u.path) ?? ""
|
|
635
|
+
}));
|
|
636
|
+
}, [
|
|
637
|
+
e,
|
|
638
|
+
r,
|
|
639
|
+
a
|
|
640
|
+
]);
|
|
641
|
+
if (a.width <= 0 || a.height <= 0) return null;
|
|
642
|
+
const l = O(n), { Cell: c, rims: p } = t;
|
|
643
|
+
return /* @__PURE__ */ m("g", {
|
|
644
|
+
"data-geom": "area",
|
|
645
|
+
children: [/* @__PURE__ */ o("defs", { children: /* @__PURE__ */ o(E, {
|
|
646
|
+
ids: l,
|
|
647
|
+
panel: a
|
|
648
|
+
}) }), d.map(({ key: h, observation: g, fill: v, edge: u }, f) => /* @__PURE__ */ o(c, {
|
|
649
|
+
id: `${n}-${f}`,
|
|
650
|
+
ids: l,
|
|
651
|
+
path: v,
|
|
652
|
+
rimWidth: p.areaSide,
|
|
653
|
+
cap: u === "" ? void 0 : u,
|
|
654
|
+
capWidth: p.areaValue,
|
|
655
|
+
paint: i(g)
|
|
656
|
+
}, h))]
|
|
657
|
+
});
|
|
658
|
+
}, yt = ({ finish: t, layer: e, observation: r, panel: a, project: i }) => {
|
|
659
|
+
const n = P(e)(r, "hovered"), d = S("shiny-area-reading"), l = i(r, a);
|
|
660
|
+
if (l === null) return null;
|
|
661
|
+
const c = O(d), { Cell: p, rims: h } = t;
|
|
662
|
+
return /* @__PURE__ */ m("g", {
|
|
663
|
+
"data-geom": "area",
|
|
664
|
+
children: [/* @__PURE__ */ o("defs", { children: /* @__PURE__ */ o(E, {
|
|
665
|
+
ids: c,
|
|
666
|
+
panel: a
|
|
667
|
+
}) }), /* @__PURE__ */ o(p, {
|
|
668
|
+
id: `${d}-point`,
|
|
669
|
+
ids: c,
|
|
670
|
+
path: _(l.x, l.y, et / 2),
|
|
671
|
+
rimWidth: h.bead(et),
|
|
672
|
+
paint: {
|
|
673
|
+
...n,
|
|
674
|
+
fillOpacity: 1
|
|
675
|
+
},
|
|
676
|
+
state: "hovered"
|
|
677
|
+
})]
|
|
678
|
+
});
|
|
679
|
+
}, Ne = (t) => T("area", {
|
|
680
|
+
coord: "cartesian",
|
|
681
|
+
guideMode: "crosshair",
|
|
682
|
+
swatchShape: "area",
|
|
683
|
+
render: ({ layer: e, coordSystem: r, panelRect: a }) => r.type !== "cartesian" ? null : /* @__PURE__ */ o($t, {
|
|
684
|
+
finish: t,
|
|
685
|
+
layer: e,
|
|
686
|
+
coordSystem: r,
|
|
687
|
+
panel: a
|
|
688
|
+
}),
|
|
689
|
+
renderHover: ({ layer: e, primary: r, panelRect: a }) => /* @__PURE__ */ o(yt, {
|
|
690
|
+
finish: t,
|
|
691
|
+
layer: e,
|
|
692
|
+
observation: r.observation,
|
|
693
|
+
panel: a,
|
|
694
|
+
project: z
|
|
695
|
+
}),
|
|
696
|
+
renderHoverCompanions: () => null
|
|
697
|
+
}), De = (t) => T("area", {
|
|
698
|
+
coord: "polar",
|
|
699
|
+
guideMode: "crosshair",
|
|
700
|
+
swatchShape: "area",
|
|
701
|
+
render: ({ layer: e, panelRect: r }) => /* @__PURE__ */ o($t, {
|
|
702
|
+
finish: t,
|
|
703
|
+
layer: e,
|
|
704
|
+
panel: r
|
|
705
|
+
}),
|
|
706
|
+
renderHover: ({ layer: e, primary: r, panelRect: a }) => /* @__PURE__ */ o(yt, {
|
|
707
|
+
finish: t,
|
|
708
|
+
layer: e,
|
|
709
|
+
observation: r.observation,
|
|
710
|
+
panel: a,
|
|
711
|
+
project: B
|
|
712
|
+
}),
|
|
713
|
+
renderHoverCompanions: () => null
|
|
714
|
+
}), Ye = (t, e) => e === "x" ? (ut(t) ?? b(t) ?? 0) >= (Gt(t) ?? 0) ? "top" : "bottom" : (Ft(t) ?? 0) >= (Wt(t) ?? 0) ? "right" : "left", ze = ({ x: t, y: e, width: r, height: a }, i) => i === "top" ? `M${t},${e} H${t + r}` : i === "bottom" ? `M${t},${e + a} H${t + r}` : i === "left" ? `M${t},${e} V${e + a}` : `M${t + r},${e} V${e + a}`, Ve = (t, e, r) => {
|
|
715
|
+
const a = Pt(e, t);
|
|
716
|
+
return !a || a.width <= 0 || a.height <= 0 ? null : {
|
|
717
|
+
x: a.x * r.width,
|
|
718
|
+
y: a.y * r.height,
|
|
719
|
+
width: a.width * r.width,
|
|
720
|
+
height: a.height * r.height
|
|
721
|
+
};
|
|
722
|
+
}, rt = ({ finish: t, layer: e, observations: r, mainAxis: a, panel: i, state: n }) => {
|
|
723
|
+
const d = P(e), l = S("shiny-bar"), c = k(() => G(e.data, e.mapping, e.id), [
|
|
724
|
+
e.data,
|
|
725
|
+
e.mapping,
|
|
726
|
+
e.id
|
|
727
|
+
]);
|
|
728
|
+
if (i.width <= 0 || i.height <= 0) return null;
|
|
729
|
+
const p = O(l), { Cell: h, rims: g } = t;
|
|
730
|
+
return /* @__PURE__ */ m("g", {
|
|
731
|
+
"data-geom": "bar",
|
|
732
|
+
children: [/* @__PURE__ */ o("defs", { children: /* @__PURE__ */ o(E, {
|
|
733
|
+
ids: p,
|
|
734
|
+
panel: i
|
|
735
|
+
}) }), Array.from(r, (v, u) => {
|
|
736
|
+
const f = Ve(v, a, i);
|
|
737
|
+
if (f === null) return null;
|
|
738
|
+
const C = a === "x" ? f.width : f.height, $ = Ht(v), R = $ === "solo" || $ === "ceiling";
|
|
739
|
+
return /* @__PURE__ */ o(h, {
|
|
740
|
+
id: `${l}-${u}`,
|
|
741
|
+
ids: p,
|
|
742
|
+
path: vt(f, g.barCorner(C)),
|
|
743
|
+
rimWidth: g.bar(C),
|
|
744
|
+
valueEnd: R ? ze(f, Ye(v, a)) : void 0,
|
|
745
|
+
paint: d(v, n),
|
|
746
|
+
state: n
|
|
747
|
+
}, c(v));
|
|
748
|
+
})]
|
|
749
|
+
});
|
|
750
|
+
}, Ue = (t) => T("bar", {
|
|
751
|
+
coord: "cartesian",
|
|
752
|
+
guideMode: "band",
|
|
753
|
+
swatchShape: "square",
|
|
754
|
+
render: ({ layer: e, coordSystem: r, panelRect: a }) => /* @__PURE__ */ o(rt, {
|
|
755
|
+
finish: t,
|
|
756
|
+
layer: e,
|
|
757
|
+
observations: e.data,
|
|
758
|
+
mainAxis: Z(r),
|
|
759
|
+
panel: a
|
|
760
|
+
}),
|
|
761
|
+
renderHover: ({ layer: e, coordSystem: r, primary: a, panelRect: i }) => /* @__PURE__ */ o(rt, {
|
|
762
|
+
finish: t,
|
|
763
|
+
layer: e,
|
|
764
|
+
observations: [a.observation],
|
|
765
|
+
mainAxis: Z(r),
|
|
766
|
+
panel: i,
|
|
767
|
+
state: "hovered"
|
|
768
|
+
}),
|
|
769
|
+
renderHoverCompanions: () => null
|
|
770
|
+
}), je = 4, Ze = 4, Ke = ({ finish: t, layer: e, panel: r, coord: a }) => {
|
|
771
|
+
const i = mt(e), n = S("shiny-line"), d = k(() => {
|
|
772
|
+
if (a === "polar") return W(e, (g) => At(g, r));
|
|
773
|
+
const h = Lt(e.params);
|
|
774
|
+
return W(e, (g) => {
|
|
775
|
+
const v = h(bt(g, e.params.missingValues));
|
|
776
|
+
return v ? D(v, r) : null;
|
|
777
|
+
});
|
|
778
|
+
}, [
|
|
779
|
+
e,
|
|
780
|
+
r,
|
|
781
|
+
a
|
|
782
|
+
]);
|
|
783
|
+
if (r.width <= 0 || r.height <= 0) return null;
|
|
784
|
+
const l = O(n), c = `${n}-glow`, { Tube: p } = t;
|
|
785
|
+
return /* @__PURE__ */ m("g", {
|
|
786
|
+
"data-geom": "line",
|
|
787
|
+
children: [/* @__PURE__ */ m("defs", { children: [/* @__PURE__ */ o(E, {
|
|
788
|
+
ids: l,
|
|
789
|
+
panel: r
|
|
790
|
+
}), /* @__PURE__ */ o("filter", {
|
|
791
|
+
id: c,
|
|
792
|
+
x: "-20%",
|
|
793
|
+
y: "-20%",
|
|
794
|
+
width: "140%",
|
|
795
|
+
height: "140%",
|
|
796
|
+
children: /* @__PURE__ */ o("feGaussianBlur", { stdDeviation: je })
|
|
797
|
+
})] }), d.map(({ key: h, path: g, observation: v }, u) => /* @__PURE__ */ o(p, {
|
|
798
|
+
id: `${n}-${u}`,
|
|
799
|
+
ids: l,
|
|
800
|
+
path: g,
|
|
801
|
+
paint: i(v),
|
|
802
|
+
panel: r,
|
|
803
|
+
glowId: c
|
|
804
|
+
}, h))]
|
|
805
|
+
});
|
|
806
|
+
}, Xe = ({ finish: t, layer: e, observation: r, panel: a, project: i }) => {
|
|
807
|
+
const n = mt(e)(r, "hovered"), d = S("shiny-line-reading"), l = i(r, a);
|
|
808
|
+
if (l === null) return null;
|
|
809
|
+
const c = O(d), p = n.width * Ze, { Cell: h, rims: g } = t;
|
|
810
|
+
return /* @__PURE__ */ m("g", {
|
|
811
|
+
"data-geom": "line",
|
|
812
|
+
children: [/* @__PURE__ */ o("defs", { children: /* @__PURE__ */ o(E, {
|
|
813
|
+
ids: c,
|
|
814
|
+
panel: a
|
|
815
|
+
}) }), /* @__PURE__ */ o(h, {
|
|
816
|
+
id: `${d}-point`,
|
|
817
|
+
ids: c,
|
|
818
|
+
path: _(l.x, l.y, p / 2),
|
|
819
|
+
rimWidth: g.bead(p),
|
|
820
|
+
paint: {
|
|
821
|
+
color: n.color,
|
|
822
|
+
opacity: n.opacity,
|
|
823
|
+
fillOpacity: 1,
|
|
824
|
+
edge: n.color,
|
|
825
|
+
edgeWidth: 0
|
|
826
|
+
},
|
|
827
|
+
state: "hovered"
|
|
828
|
+
})]
|
|
829
|
+
});
|
|
830
|
+
}, Rt = (t, e, r) => T("line", {
|
|
831
|
+
coord: e,
|
|
832
|
+
guideMode: "crosshair",
|
|
833
|
+
swatchShape: "line",
|
|
834
|
+
render: ({ layer: a, panelRect: i }) => /* @__PURE__ */ o(Ke, {
|
|
835
|
+
finish: t,
|
|
836
|
+
layer: a,
|
|
837
|
+
panel: i,
|
|
838
|
+
coord: e
|
|
839
|
+
}),
|
|
840
|
+
renderHover: ({ layer: a, primary: i, panelRect: n }) => /* @__PURE__ */ o(Xe, {
|
|
841
|
+
finish: t,
|
|
842
|
+
layer: a,
|
|
843
|
+
observation: i.observation,
|
|
844
|
+
panel: n,
|
|
845
|
+
project: r
|
|
846
|
+
}),
|
|
847
|
+
renderHoverCompanions: () => null,
|
|
848
|
+
getOverlayAnchor: ({ observation: a }) => {
|
|
849
|
+
const i = M(a), n = b(a);
|
|
850
|
+
return i === null || n === null ? null : {
|
|
851
|
+
x: i,
|
|
852
|
+
y: n
|
|
853
|
+
};
|
|
854
|
+
}
|
|
855
|
+
}), Je = (t) => Rt(t, "cartesian", z), qe = (t) => Rt(t, "polar", B), Qe = 4, at = ({ finish: t, layer: e, observations: r, panel: a, project: i, state: n }) => {
|
|
856
|
+
const d = Y(e), l = P(e), c = S("shiny-point"), p = k(() => G(e.data, e.mapping, e.id), [
|
|
857
|
+
e.data,
|
|
858
|
+
e.mapping,
|
|
859
|
+
e.id
|
|
860
|
+
]);
|
|
861
|
+
if (a.width <= 0 || a.height <= 0) return null;
|
|
862
|
+
const h = O(c), g = n === "hovered" ? Qe : 0, { Cell: v, rims: u } = t;
|
|
863
|
+
return /* @__PURE__ */ m("g", {
|
|
864
|
+
"data-geom": "point",
|
|
865
|
+
children: [/* @__PURE__ */ o("defs", { children: /* @__PURE__ */ o(E, {
|
|
866
|
+
ids: h,
|
|
867
|
+
panel: a
|
|
868
|
+
}) }), Array.from(r, (f, C) => {
|
|
869
|
+
const $ = i(f, a);
|
|
870
|
+
if ($ === null) return null;
|
|
871
|
+
const R = (d.get("size", f, n) + g) / 2;
|
|
872
|
+
return R <= 0 ? null : /* @__PURE__ */ o(v, {
|
|
873
|
+
id: `${c}-${C}`,
|
|
874
|
+
ids: h,
|
|
875
|
+
path: _($.x, $.y, R),
|
|
876
|
+
rimWidth: u.bead(R * 2),
|
|
877
|
+
paint: l(f, n),
|
|
878
|
+
state: n
|
|
879
|
+
}, p(f));
|
|
880
|
+
})]
|
|
881
|
+
});
|
|
882
|
+
}, wt = (t, e, r) => T("point", {
|
|
883
|
+
coord: e,
|
|
884
|
+
swatchShape: "circle",
|
|
885
|
+
render: ({ layer: a, panelRect: i }) => /* @__PURE__ */ o(at, {
|
|
886
|
+
finish: t,
|
|
887
|
+
layer: a,
|
|
888
|
+
observations: a.data,
|
|
889
|
+
panel: i,
|
|
890
|
+
project: r
|
|
891
|
+
}),
|
|
892
|
+
renderHover: ({ layer: a, primary: i, panelRect: n }) => /* @__PURE__ */ o(at, {
|
|
893
|
+
finish: t,
|
|
894
|
+
layer: a,
|
|
895
|
+
observations: [i.observation],
|
|
896
|
+
panel: n,
|
|
897
|
+
project: r,
|
|
898
|
+
state: "hovered"
|
|
899
|
+
}),
|
|
900
|
+
renderHoverCompanions: () => null
|
|
901
|
+
}), tr = (t) => wt(t, "cartesian", z), er = (t) => wt(t, "polar", B), rr = 3, nt = 1e-6, ar = 0.16, nr = 5, ir = 10, it = 120, or = 0.45, sr = 2.5, dr = 7, lr = 0.55, ot = [
|
|
902
|
+
A.pulse,
|
|
903
|
+
"#8E5CFF",
|
|
904
|
+
"#5A8CFF"
|
|
905
|
+
], st = 4, dt = (t, e) => [...t].flatMap((r) => {
|
|
906
|
+
const { startAngle: a, endAngle: i } = kt(r), { innerRadius: n, outerRadius: d } = pt(r);
|
|
907
|
+
return a === null || i === null || n === null || d === null ? [] : i <= a || d <= 0 ? [] : [{
|
|
908
|
+
key: `${e(r)}-${a}`,
|
|
909
|
+
observation: r,
|
|
910
|
+
startAngle: a,
|
|
911
|
+
endAngle: i,
|
|
912
|
+
innerRadius: n,
|
|
913
|
+
outerRadius: d
|
|
914
|
+
}];
|
|
915
|
+
}), cr = (t) => {
|
|
916
|
+
const [e] = t;
|
|
917
|
+
return e === void 0 ? !1 : t.every((r) => Math.abs(r.innerRadius - e.innerRadius) < nt && Math.abs(r.outerRadius - e.outerRadius) < nt);
|
|
918
|
+
}, lt = (t, e, r) => {
|
|
919
|
+
const a = gt(e, r);
|
|
920
|
+
return {
|
|
921
|
+
x: t.centre.x + a.x,
|
|
922
|
+
y: t.centre.y - a.y
|
|
923
|
+
};
|
|
924
|
+
}, hr = (t, e) => Et({
|
|
925
|
+
startAngle: t.startAngle,
|
|
926
|
+
endAngle: t.endAngle,
|
|
927
|
+
innerRadius: t.innerRadius,
|
|
928
|
+
outerRadius: t.outerRadius
|
|
929
|
+
}, {
|
|
930
|
+
centerX: e.centre.x,
|
|
931
|
+
centerY: e.centre.y,
|
|
932
|
+
radius: e.radius,
|
|
933
|
+
digits: rr
|
|
934
|
+
}), pr = ({ id: t, circle: e, outer: r, bezel: a }) => {
|
|
935
|
+
const i = Math.PI * 2 / it, n = Array.from({ length: it / 2 }, (d, l) => {
|
|
936
|
+
const c = l * 2 * i, p = c + i, h = lt(e, c, r + st), g = lt(e, p, r + st);
|
|
937
|
+
return `M${e.centre.x},${e.centre.y} L${h.x},${h.y} L${g.x},${g.y} Z`;
|
|
938
|
+
}).join(" ");
|
|
939
|
+
return /* @__PURE__ */ m("g", { children: [/* @__PURE__ */ o("defs", { children: /* @__PURE__ */ o("clipPath", {
|
|
940
|
+
id: t,
|
|
941
|
+
children: /* @__PURE__ */ o("path", {
|
|
942
|
+
d: `${_(e.centre.x, e.centre.y, r)} ${_(e.centre.x, e.centre.y, r - a)}`,
|
|
943
|
+
clipRule: "evenodd"
|
|
944
|
+
})
|
|
945
|
+
}) }), /* @__PURE__ */ o("path", {
|
|
946
|
+
d: n,
|
|
947
|
+
fill: x,
|
|
948
|
+
fillOpacity: or,
|
|
949
|
+
clipPath: `url(#${t})`
|
|
950
|
+
})] });
|
|
951
|
+
}, ur = ({ pin: t, id: e, circle: r, inner: a, outer: i, bezel: n }) => {
|
|
952
|
+
const d = r.radius;
|
|
953
|
+
return /* @__PURE__ */ m("g", { children: [
|
|
954
|
+
/* @__PURE__ */ m("defs", { children: [/* @__PURE__ */ o("linearGradient", {
|
|
955
|
+
id: `${e}-glow-colors`,
|
|
956
|
+
gradientUnits: "userSpaceOnUse",
|
|
957
|
+
x1: r.centre.x - d,
|
|
958
|
+
y1: r.centre.y - d,
|
|
959
|
+
x2: r.centre.x + d,
|
|
960
|
+
y2: r.centre.y + d,
|
|
961
|
+
children: ot.map((l, c) => /* @__PURE__ */ o("stop", {
|
|
962
|
+
offset: c / (ot.length - 1),
|
|
963
|
+
stopColor: l
|
|
964
|
+
}, l))
|
|
965
|
+
}), /* @__PURE__ */ o("filter", {
|
|
966
|
+
id: `${e}-glow`,
|
|
967
|
+
x: "-50%",
|
|
968
|
+
y: "-50%",
|
|
969
|
+
width: "200%",
|
|
970
|
+
height: "200%",
|
|
971
|
+
children: /* @__PURE__ */ o("feGaussianBlur", { stdDeviation: dr })
|
|
972
|
+
})] }),
|
|
973
|
+
t.hasGlow && /* @__PURE__ */ o("circle", {
|
|
974
|
+
cx: r.centre.x,
|
|
975
|
+
cy: r.centre.y,
|
|
976
|
+
r: i - n / 2,
|
|
977
|
+
fill: "none",
|
|
978
|
+
stroke: `url(#${e}-glow-colors)`,
|
|
979
|
+
strokeWidth: n * sr,
|
|
980
|
+
strokeOpacity: lr,
|
|
981
|
+
filter: `url(#${e}-glow)`
|
|
982
|
+
}),
|
|
983
|
+
a > 0 && t.hole !== null && /* @__PURE__ */ o("circle", {
|
|
984
|
+
cx: r.centre.x,
|
|
985
|
+
cy: r.centre.y,
|
|
986
|
+
r: a,
|
|
987
|
+
fill: t.hole
|
|
988
|
+
})
|
|
989
|
+
] });
|
|
990
|
+
}, ct = ({ finish: t, layer: e, observations: r, panel: a, isRadialBar: i, state: n }) => {
|
|
991
|
+
const d = P(e), l = S("shiny-slice"), c = k(() => G(e.data, e.mapping, e.id), [
|
|
992
|
+
e.data,
|
|
993
|
+
e.mapping,
|
|
994
|
+
e.id
|
|
995
|
+
]);
|
|
996
|
+
if (a.width <= 0 || a.height <= 0) return null;
|
|
997
|
+
const p = {
|
|
998
|
+
centre: {
|
|
999
|
+
x: a.width / 2,
|
|
1000
|
+
y: a.height / 2
|
|
1001
|
+
},
|
|
1002
|
+
radius: Math.min(a.width, a.height) / 2
|
|
1003
|
+
}, h = O(l), g = dt(r, c), v = n === void 0 ? g : dt(e.data, c), [u] = v, f = !i && u !== void 0 && cr(v), C = (u?.innerRadius ?? 0) * p.radius, $ = (u?.outerRadius ?? 0) * p.radius, R = Math.min(ir, Math.max(nr, ($ - C) * ar)), V = f && n === void 0, { Cell: Ct, rims: U, pin: N } = t, xt = f && N.hasBezel;
|
|
1004
|
+
return /* @__PURE__ */ m("g", {
|
|
1005
|
+
"data-geom": "bar",
|
|
1006
|
+
children: [
|
|
1007
|
+
/* @__PURE__ */ o("defs", { children: /* @__PURE__ */ o(E, {
|
|
1008
|
+
ids: h,
|
|
1009
|
+
panel: a
|
|
1010
|
+
}) }),
|
|
1011
|
+
V && /* @__PURE__ */ o(ur, {
|
|
1012
|
+
pin: N,
|
|
1013
|
+
id: `${l}-pin`,
|
|
1014
|
+
circle: p,
|
|
1015
|
+
inner: C,
|
|
1016
|
+
outer: $,
|
|
1017
|
+
bezel: R
|
|
1018
|
+
}),
|
|
1019
|
+
g.map((I, St) => {
|
|
1020
|
+
const j = hr(I, p);
|
|
1021
|
+
return j === void 0 ? null : /* @__PURE__ */ o(Ct, {
|
|
1022
|
+
id: `${l}-${St}`,
|
|
1023
|
+
ids: h,
|
|
1024
|
+
path: j,
|
|
1025
|
+
cap: xt ? _(p.centre.x, p.centre.y, $) : void 0,
|
|
1026
|
+
capWidth: R,
|
|
1027
|
+
rimWidth: f ? U.ringSlice($ - C) : U.petal((I.outerRadius - I.innerRadius) * p.radius),
|
|
1028
|
+
paint: d(I.observation, n),
|
|
1029
|
+
state: n
|
|
1030
|
+
}, I.key);
|
|
1031
|
+
}),
|
|
1032
|
+
V && N.hasBezel && /* @__PURE__ */ o(pr, {
|
|
1033
|
+
id: `${l}-rays`,
|
|
1034
|
+
circle: p,
|
|
1035
|
+
outer: $,
|
|
1036
|
+
bezel: R
|
|
1037
|
+
})
|
|
1038
|
+
]
|
|
1039
|
+
});
|
|
1040
|
+
}, gr = (t) => T("bar", {
|
|
1041
|
+
coord: "polar",
|
|
1042
|
+
guideMode: "band",
|
|
1043
|
+
swatchShape: "slice",
|
|
1044
|
+
render: ({ layer: e, coordSystem: r, panelRect: a }) => /* @__PURE__ */ o(ct, {
|
|
1045
|
+
finish: t,
|
|
1046
|
+
layer: e,
|
|
1047
|
+
observations: e.data,
|
|
1048
|
+
panel: a,
|
|
1049
|
+
isRadialBar: r.type === "polar" && r.bandAxis === "y"
|
|
1050
|
+
}),
|
|
1051
|
+
renderHover: ({ layer: e, coordSystem: r, primary: a, panelRect: i }) => /* @__PURE__ */ o(ct, {
|
|
1052
|
+
finish: t,
|
|
1053
|
+
layer: e,
|
|
1054
|
+
observations: [a.observation],
|
|
1055
|
+
panel: i,
|
|
1056
|
+
isRadialBar: r.type === "polar" && r.bandAxis === "y",
|
|
1057
|
+
state: "hovered"
|
|
1058
|
+
}),
|
|
1059
|
+
renderHoverCompanions: () => null
|
|
1060
|
+
}), ht = ({ finish: t, layer: e, observations: r, panel: a, state: i }) => {
|
|
1061
|
+
const n = P(e), d = S("shiny-tile"), l = k(() => _t(e.data, e.mapping, e.id), [
|
|
1062
|
+
e.data,
|
|
1063
|
+
e.mapping,
|
|
1064
|
+
e.id
|
|
1065
|
+
]);
|
|
1066
|
+
if (a.width <= 0 || a.height <= 0) return null;
|
|
1067
|
+
const c = O(d), { Cell: p, rims: h } = t;
|
|
1068
|
+
return /* @__PURE__ */ m("g", {
|
|
1069
|
+
"data-geom": "tile",
|
|
1070
|
+
children: [/* @__PURE__ */ o("defs", { children: /* @__PURE__ */ o(E, {
|
|
1071
|
+
ids: c,
|
|
1072
|
+
panel: a
|
|
1073
|
+
}) }), Array.from(r, (g, v) => {
|
|
1074
|
+
const u = It(g);
|
|
1075
|
+
if (u === null) return null;
|
|
1076
|
+
const f = {
|
|
1077
|
+
x: u.x * a.width + h.tileGap / 2,
|
|
1078
|
+
y: u.y * a.height + h.tileGap / 2,
|
|
1079
|
+
width: u.width * a.width - h.tileGap,
|
|
1080
|
+
height: u.height * a.height - h.tileGap
|
|
1081
|
+
};
|
|
1082
|
+
return f.width <= 0 || f.height <= 0 ? null : /* @__PURE__ */ o(p, {
|
|
1083
|
+
id: `${d}-${v}`,
|
|
1084
|
+
ids: c,
|
|
1085
|
+
path: vt(f, h.tileCorner),
|
|
1086
|
+
rimWidth: h.tile(Math.min(f.width, f.height)),
|
|
1087
|
+
isEven: !0,
|
|
1088
|
+
paint: n(g, i),
|
|
1089
|
+
state: i
|
|
1090
|
+
}, l(g));
|
|
1091
|
+
})]
|
|
1092
|
+
});
|
|
1093
|
+
}, fr = (t) => T("tile", {
|
|
1094
|
+
coord: "cartesian",
|
|
1095
|
+
guideMode: null,
|
|
1096
|
+
swatchShape: "square",
|
|
1097
|
+
render: ({ layer: e, panelRect: r }) => /* @__PURE__ */ o(ht, {
|
|
1098
|
+
finish: t,
|
|
1099
|
+
layer: e,
|
|
1100
|
+
observations: e.data,
|
|
1101
|
+
panel: r
|
|
1102
|
+
}),
|
|
1103
|
+
renderHover: ({ layer: e, primary: r, panelRect: a }) => /* @__PURE__ */ o(ht, {
|
|
1104
|
+
finish: t,
|
|
1105
|
+
layer: e,
|
|
1106
|
+
observations: [r.observation],
|
|
1107
|
+
panel: a,
|
|
1108
|
+
state: "hovered"
|
|
1109
|
+
}),
|
|
1110
|
+
renderHoverCompanions: () => null
|
|
1111
|
+
}), vr = (t) => [
|
|
1112
|
+
Ue(t),
|
|
1113
|
+
gr(t),
|
|
1114
|
+
fr(t),
|
|
1115
|
+
Je(t),
|
|
1116
|
+
qe(t),
|
|
1117
|
+
Ne(t),
|
|
1118
|
+
De(t),
|
|
1119
|
+
tr(t),
|
|
1120
|
+
er(t)
|
|
1121
|
+
], mr = vr(Fe), Rr = {
|
|
1122
|
+
name: "shiny",
|
|
1123
|
+
styles: $e,
|
|
1124
|
+
palette: he,
|
|
1125
|
+
colormap: pe,
|
|
1126
|
+
colorScheme: "dark",
|
|
1127
|
+
plugins: mr
|
|
1128
|
+
};
|
|
1129
|
+
export {
|
|
1130
|
+
Rr as shiny
|
|
1131
|
+
};
|