@astrato-io/visualizations 0.8.0 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -5
- package/THIRD_PARTY_NOTICES.md +403 -325
- package/VISUALIZATION_DEFINITIONS.md +319 -32
- package/chunks/{Button-BrGKp9Nm.js → Button-CCF851ea.js} +10 -10
- package/chunks/CircularProgress-yupH6YWs.js +765 -0
- package/chunks/FieldTypeIcon-D_MzsdfY.js +22 -0
- package/chunks/LinearProgress-CyFjN4px.js +327 -0
- package/chunks/{MenuOption-ByRqhRdX.js → MenuOption-CQpT79AP.js} +1391 -1008
- package/chunks/Title-C-p4ZarD.js +1804 -0
- package/chunks/_createAggregator-BF4qG9XK.js +50 -0
- package/chunks/{app-filter-bar.compiler-TwVTeoj5.js → app-filter-bar.compiler-8fxCo2q7.js} +10 -10
- package/chunks/bar-layout-DStC-GNV.js +9 -0
- package/chunks/{bar.compiler-DuQg8EUb.js → bar.compiler-CQAu8KL8.js} +102 -84
- package/chunks/{builder-DEDvNq1k.js → builder-CScg1TOS.js} +156 -60
- package/chunks/color-rules-DYJL4fIW.js +15 -0
- package/chunks/color-settings-DJFoFTip.js +5 -0
- package/chunks/{coloring-CncX_JRX.js → coloring-9jU3s_-p.js} +41 -41
- package/chunks/contains-BK-sRXcB.js +21 -0
- package/chunks/createSimplePaletteValueFilter-C4hZpCdn.js +2005 -0
- package/chunks/defaults-cyNhn37t.js +3 -0
- package/chunks/{definitions-BPJQTx16.js → definitions-C4grxhye.js} +612 -400
- package/chunks/{escobar-DRhRMYRE.js → escobar-CjirINHP.js} +5354 -5473
- package/chunks/{extend-preset-CUFNpmPe.js → extend-preset-D-l9u_we.js} +974 -909
- package/chunks/{filter.compiler-w27dlv0C.js → filter.compiler-lji2Acgn.js} +7 -7
- package/chunks/{filtering-cc7WqWpg.js → filtering-C1zakrrX.js} +570 -390
- package/chunks/handlers-ZviIUC-j.js +15387 -0
- package/chunks/{icon-picker-styles-CoJmwTRi.js → icon-picker-styles-Bj80ZUBK.js} +11 -11
- package/chunks/isEqual-Ch9OEye3.js +16 -0
- package/chunks/isFocusVisible-CgMP0qkR.js +144 -0
- package/chunks/label-format-type-C46pzgx7.js +17 -0
- package/chunks/{line.compiler-Ct1WhN2p.js → line.compiler-De5fiKuR.js} +6 -6
- package/chunks/{logger-DpQtYQnX.js → logger-CKRjhSHQ.js} +77 -66
- package/chunks/map.compiler-CKzorLgK.js +345 -0
- package/chunks/{metadata-WABZrt7Y.js → metadata-Bb9pTXrq.js} +1 -1
- package/chunks/{number.compiler-D8TPly-4.js → number.compiler-CaTmJkmi.js} +4 -4
- package/chunks/operations-DZoY50VX.js +31297 -0
- package/chunks/{range-Bi-7zT0k.js → range-D1BTmFMp.js} +2 -2
- package/chunks/react-dom-Dgv2azN2.js +368 -0
- package/chunks/{render-wrappers-OEmtaM8g.js → render-wrappers-_P3xwu5A.js} +1 -1
- package/chunks/{requirements-Dvd8jqYF.js → requirements-NHNrR8Ie.js} +55 -53
- package/chunks/responsive.styles-FItb913l.js +93 -0
- package/chunks/shared-UitWpq1J.js +1331 -0
- package/chunks/standalone-B0U6c3su.js +3638 -0
- package/chunks/{standalone-we5D5MIn.js → standalone-BBu90BhK.js} +113 -113
- package/chunks/standalone-BEekPuA12.js +357 -0
- package/chunks/{standalone-BMTCb10X.js → standalone-BOzHA_d4.js} +41 -41
- package/chunks/standalone-BR2JuRIC.js +422 -0
- package/chunks/{standalone-BGkmozIb.js → standalone-BapqaniK.js} +619 -619
- package/chunks/standalone-Bnnr87pc.js +2009 -0
- package/chunks/standalone-BwJqDj2Z.js +396 -0
- package/chunks/{standalone-BDhPQtzQ.js → standalone-ByKKqT5L.js} +308 -300
- package/chunks/{standalone-vBnBS2YC.js → standalone-CRdDZYeM.js} +1788 -1004
- package/chunks/standalone-CRfDOO1x.js +287 -0
- package/chunks/{standalone-D5Q5ngsD.js → standalone-CVknVdUC.js} +30 -27
- package/chunks/standalone-CbPk8bKn.js +580 -0
- package/chunks/{standalone-CJvIXsQE.js → standalone-Ck63MZzj.js} +234 -232
- package/chunks/{standalone-CM5XcAN5.js → standalone-DCFY1MAV.js} +8075 -7729
- package/chunks/{standalone-DW6NT205.js → standalone-DZDGX3aa.js} +168 -168
- package/chunks/standalone-DhfgeJIk.js +1012 -0
- package/chunks/{standalone-DT0wKji7.js → standalone-DibjA73M.js} +2 -2
- package/chunks/{standalone-XuGksArp.js → standalone-DtBk_iUz.js} +9 -8
- package/chunks/standalone-DxBAyqAu.js +772 -0
- package/chunks/standalone-KMQPsNsq.js +2 -0
- package/chunks/standalone-MBLSvsrY.js +2 -0
- package/chunks/standalone-U0WJwFlG.js +354 -0
- package/chunks/{standalone-C8ZAEutO.js → standalone-swGs70tD.js} +49 -51
- package/chunks/standalone-wgFAVnnm.js +355 -0
- package/chunks/standalone-xGV0dqPV.js +689 -0
- package/chunks/{table.compiler-DMeeHxb6.js → table.compiler-OWSx5MOq.js} +7 -7
- package/chunks/{typeof-CJDtcySz.js → typeof-DCq3QgvY.js} +6 -1
- package/chunks/useFieldName-B8iCYyw1.js +7 -0
- package/chunks/{utils-vdmi_2PK.js → utils-3Igg6xmO.js} +7668 -12779
- package/chunks/{view-BuwQugKb.js → view-DdMLZySj.js} +2430 -2110
- package/chunks/{visualization-filters-Cc4KU-l-.js → visualization-filters-CzvFHE6M.js} +5205 -4438
- package/chunks/with-html-element-DOfkR3C1.js +16094 -0
- package/definitions.js +2 -2
- package/docs/operations/astrato-app-filter-bar.md +1 -1
- package/docs/operations/bar.md +303 -2
- package/docs/operations/combo.md +262 -1
- package/docs/operations/date-picker.md +1 -1
- package/docs/operations/distribution-gauge.md +1 -1
- package/docs/operations/dot.md +148 -1
- package/docs/operations/filter.md +1 -1
- package/docs/operations/gauge.md +1 -1
- package/docs/operations/heatMap.md +1 -1
- package/docs/operations/histogram.md +262 -1
- package/docs/operations/iframe.md +1 -1
- package/docs/operations/image.md +1 -1
- package/docs/operations/index.md +8 -8
- package/docs/operations/line.md +262 -1
- package/docs/operations/number.md +1 -1
- package/docs/operations/pie.md +1 -1
- package/docs/operations/radar.md +1 -1
- package/docs/operations/sankey.md +1 -1
- package/docs/operations/scatter.md +148 -1
- package/docs/operations/shape.md +1 -1
- package/docs/operations/simpleTextObject.md +1 -1
- package/docs/operations/slider.md +1 -1
- package/docs/operations/table.md +439 -157
- package/docs/operations/tree.md +1 -1
- package/docs/operations/treemap.md +1 -1
- package/docs/operations/waterfall.md +1 -1
- package/docs/operations/word-cloud.md +1 -1
- package/getters.js +2 -2
- package/index.js +523 -469
- package/metadata.js +2 -2
- package/operations.js +5 -5
- package/package.json +74 -68
- package/src/definitions/index.d.ts +1 -1
- package/src/definitions/model/definitions/available-fields.d.ts +2 -2
- package/src/definitions/model/definitions/compilers/compile.d.ts +1 -0
- package/src/definitions/model/definitions/data-item-resolution.d.ts +3 -3
- package/src/definitions/model/definitions/descriptors/descriptor-metadata.d.ts +535 -349
- package/src/definitions/model/definitions/index.d.ts +2 -1
- package/src/definitions/model/definitions/schema-registry.d.ts +406 -101
- package/src/definitions/model/definitions/schemas/bar.schema.d.ts +10 -8
- package/src/definitions/model/definitions/schemas/common.schema.d.ts +33 -32
- package/src/definitions/model/definitions/schemas/index.d.ts +1 -0
- package/src/definitions/model/definitions/schemas/line.schema.d.ts +10 -10
- package/src/definitions/model/definitions/schemas/map.schema.d.ts +590 -0
- package/src/definitions/model/definitions/schemas/number.schema.d.ts +4 -4
- package/src/definitions/model/definitions/schemas/object.schema.d.ts +38 -38
- package/src/definitions/model/definitions/schemas/table.schema.d.ts +61 -61
- package/src/definitions/model/definitions/types/compilation.types.d.ts +7 -2
- package/src/definitions/model/definitions/types/definition.types.d.ts +2 -2
- package/src/definitions/model/definitions/types/index.d.ts +1 -1
- package/src/index.d.ts +1 -1
- package/src/operations/index.d.ts +1 -1
- package/src/types.d.ts +45 -41
- package/src/visualization-catalog.d.ts +26 -26
- package/chunks/DefaultPropsProvider-BsfB7QTn.js +0 -257
- package/chunks/FieldTypeIcon-Drs6hSJF.js +0 -22
- package/chunks/LinearProgress-VtfFx2vJ.js +0 -253
- package/chunks/Title-CO5dP1ma.js +0 -1691
- package/chunks/ToggleButton-KOBAimC1.js +0 -112
- package/chunks/color-rules-CN7TcGrC.js +0 -6
- package/chunks/color-settings-3VRlf_Vw.js +0 -6
- package/chunks/colorManipulator-D8Pjy1pf.js +0 -45
- package/chunks/handlers-TOT-7INo.js +0 -12871
- package/chunks/isEqual-B8loyPsC.js +0 -12
- package/chunks/label-format-type-weq1XfcX.js +0 -8
- package/chunks/operations-Dh4v1Ovt.js +0 -26280
- package/chunks/responsive.styles-DSiOGD7u.js +0 -82
- package/chunks/shared-Bn4N5QcZ.js +0 -1218
- package/chunks/standalone-B55oyW6c.js +0 -689
- package/chunks/standalone-BXKRE_Se.js +0 -468
- package/chunks/standalone-Bes8srx1.js +0 -354
- package/chunks/standalone-BjZp0QMe.js +0 -2
- package/chunks/standalone-BlMIwpEe.js +0 -1877
- package/chunks/standalone-C8qAelL4.js +0 -2
- package/chunks/standalone-CLmGb7nn2.js +0 -355
- package/chunks/standalone-CXNP6-xD.js +0 -420
- package/chunks/standalone-DLlyRIE6.js +0 -287
- package/chunks/standalone-DMcI1afI.js +0 -396
- package/chunks/standalone-DN4S1MjT.js +0 -3874
- package/chunks/standalone-DYQIQH4c.js +0 -2095
- package/chunks/standalone-D__XCp-h.js +0 -1003
- package/chunks/standalone-XTgSsTAa.js +0 -354
- package/chunks/useFieldName-Cjn9KCVp.js +0 -7
- package/chunks/useSlotProps-DLbQp4lc.js +0 -166
- package/chunks/with-html-element-D0uY2zjI.js +0 -7328
|
@@ -0,0 +1,689 @@
|
|
|
1
|
+
import { o as e } from "./rolldown-runtime-DleVn1XH.js";
|
|
2
|
+
import { Da as t, Fo as n, Io as r, Ir as i, No as a, Pc as o, Pi as s, Qr as c, Ra as l, Ut as u, Xa as d, aa as f, hc as p, kc as m, ko as h, n as g, oa as _, oc as v, rr as y, so as b, vc as x } from "./visualization-filters-CzvFHE6M.js";
|
|
3
|
+
import { F as S, N as C, Ut as w, ci as T, f as E, jt as D, s as O, zr as k } from "./utils-3Igg6xmO.js";
|
|
4
|
+
import "./logger-CKRjhSHQ.js";
|
|
5
|
+
import { At as A, Dt as ee, Ft as j, Gt as M, Ht as N, I as P, It as F, J as I, Kt as L, L as te, Lt as ne, Mt as re, Nt as ie, Ot as ae, Q as oe, Rt as se, St as ce, U as le, Vt as R, W as ue, Xt as z, Y as B, _n as de, an as fe, bt as V, cn as H, dn as U, dt as pe, en as me, fn as W, i as he, in as ge, it as _e, mn as ve, n as ye, nt as be, on as xe, pn as Se, q as Ce, sn as we, st as Te, tt as Ee, un as De, vn as G, wt as Oe } from "./escobar-CjirINHP.js";
|
|
6
|
+
import { t as ke } from "./coloring-9jU3s_-p.js";
|
|
7
|
+
import { t as Ae } from "./set-coloring-datafield-B3uIS1Pe.js";
|
|
8
|
+
var je = /* @__PURE__ */ e(T()), Me = (e, t, r, i, a, o, s, u) => {
|
|
9
|
+
let d = [], f = [], p = e.measures.filter((e) => c(e)), m = {
|
|
10
|
+
...t.axis.measure,
|
|
11
|
+
...t.fonts
|
|
12
|
+
}, h = [];
|
|
13
|
+
if (u) {
|
|
14
|
+
let e = N(G.Text, u);
|
|
15
|
+
h.push(e);
|
|
16
|
+
}
|
|
17
|
+
let g = p.filter((e) => e.role === l.SCATTER_HORIZONTAL), _ = p.filter((e) => e.role === l.SCATTER_VERTICAL), v = e.measures.filter((e) => e.role === l.SCATTER_HORIZONTAL), b = e.measures.filter((e) => e.role === l.SCATTER_VERTICAL), x = g[0], S = _[0], C = {};
|
|
18
|
+
if (x) {
|
|
19
|
+
let t = n.Bottom, r = e.axes?.primaryMeasure || C;
|
|
20
|
+
if (d.push(M(H.XAxisScale, r, m, t, x.formatter)), e.axes?.primaryMeasure?.showAxisName) {
|
|
21
|
+
let n = y(v, e.enableAlternate, o?.isPrintMode);
|
|
22
|
+
f.push(L(g, n, t, m, r.colors?.title, r.axisTitle, r.titleFontSize));
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
if (S) {
|
|
26
|
+
let t = n.Left, r = e.axes?.secondaryMeasure || C;
|
|
27
|
+
if (d.push(M(H.YAxisScale, r, m, t, S.formatter)), e.axes?.secondaryMeasure?.showAxisName) {
|
|
28
|
+
let n = y(b, e.enableAlternate, o?.isPrintMode);
|
|
29
|
+
f.push(L(_, n, t, m, r.colors?.title, r.axisTitle, r.titleFontSize));
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
return {
|
|
33
|
+
...r,
|
|
34
|
+
components: [
|
|
35
|
+
...r.components,
|
|
36
|
+
...d,
|
|
37
|
+
...f
|
|
38
|
+
],
|
|
39
|
+
interactions: [...r.interactions ?? [], ...h]
|
|
40
|
+
};
|
|
41
|
+
}, Ne = (e, t) => {
|
|
42
|
+
let n = e.dimensions.filter((e) => c(e)), r = e.measures.filter((e) => c(e)), i = n.filter((e) => e.role === d.SCATTER_DIMENSION), a = r.filter((e) => e.role === l.SCATTER_SIZE), s = i[0], u = a[0], { coloring: f } = e || {};
|
|
43
|
+
switch (f?.type) {
|
|
44
|
+
case x.Categorical: return ae(e, t);
|
|
45
|
+
case x.Gradient: return A(e, u);
|
|
46
|
+
case x.Single: return o(s.dataItem);
|
|
47
|
+
default: return null;
|
|
48
|
+
}
|
|
49
|
+
}, Pe = (e, t, n, r, i, a, p) => {
|
|
50
|
+
let m = e.dimensions.filter((e) => c(e)), h = e.measures.filter((e) => c(e)), _ = m.filter((e) => e.role === d.SCATTER_DIMENSION), v = h.filter((e) => e.role === l.SCATTER_HORIZONTAL), y = h.filter((e) => e.role === l.SCATTER_VERTICAL), b = h.filter((e) => e.role === l.SCATTER_SIZE), S = _[0], C = v[0], T = y[0], E = b[0], D = {}, { coloring: O } = e || {}, k = m.length < 2 && e.scatterSettings?.spatialHeatmap?.show, A = k && !O?.fieldId ? null : Ne(e, p);
|
|
51
|
+
switch (O?.type) {
|
|
52
|
+
case x.Categorical:
|
|
53
|
+
D = ee(Ae(e, A), t, D, void 0, p);
|
|
54
|
+
break;
|
|
55
|
+
case x.Gradient:
|
|
56
|
+
D = ee(Ae(e, A), t, D, void 0, p);
|
|
57
|
+
break;
|
|
58
|
+
case x.Single: {
|
|
59
|
+
let n = o(S.dataItem);
|
|
60
|
+
D[x.Single] = {
|
|
61
|
+
data: { extract: { field: n } },
|
|
62
|
+
range: [e?.coloring?.color ?? t.colors.brandColors[0]],
|
|
63
|
+
type: W.CategoricalColor,
|
|
64
|
+
label: (e) => S?.formatter?.format ? w(S.formatter, e.datum.value) : e.datum.label
|
|
65
|
+
};
|
|
66
|
+
break;
|
|
67
|
+
}
|
|
68
|
+
default: break;
|
|
69
|
+
}
|
|
70
|
+
if (k) {
|
|
71
|
+
D[H.Density] = {
|
|
72
|
+
data: A ? { field: A } : void 0,
|
|
73
|
+
min: 0,
|
|
74
|
+
max: (t) => (t.data?.fields?.[0] ? t.data.fields[0].max() : 1) * (u(e.scatterSettings?.spatialHeatmap?.maxDensity ?? s.heatmapMaxDensity) ?? 0),
|
|
75
|
+
nice: !0
|
|
76
|
+
}, D[H.DensityInverted] = {
|
|
77
|
+
...D[H.Density],
|
|
78
|
+
invert: !0
|
|
79
|
+
};
|
|
80
|
+
let r = [...g(O?.type ?? x.Gradient, t), ...O?.customGradient ? [O.customGradient] : []].find((e) => e.id === (O?.palette ?? t.colors.defaultGradient ?? f.id))?.colors;
|
|
81
|
+
D[H.DensityGradient] = {
|
|
82
|
+
...D[H.Density],
|
|
83
|
+
range: r ?? f.colors,
|
|
84
|
+
type: W.SequentialColor
|
|
85
|
+
}, A && V(n, 0, { density: { field: A } });
|
|
86
|
+
} else A && V(n, 0, { color: { field: A } });
|
|
87
|
+
let j = o(C?.dataItem), M = o(T?.dataItem), N = o(E?.dataItem), P = Ce(e?.axes?.primaryMeasure?.axisRange, !0), F = B(P);
|
|
88
|
+
D[H.XAxisScale] = {
|
|
89
|
+
type: W.Linear,
|
|
90
|
+
data: { field: j },
|
|
91
|
+
invert: I(!1, e?.axes?.primaryMeasure),
|
|
92
|
+
nice: !F && ve.scale.nice,
|
|
93
|
+
expandMax: .06,
|
|
94
|
+
...P
|
|
95
|
+
};
|
|
96
|
+
let L = Ce(e?.axes?.secondaryMeasure?.axisRange, !0), te = B(L);
|
|
97
|
+
return D[H.YAxisScale] = {
|
|
98
|
+
type: W.Linear,
|
|
99
|
+
data: { fields: [M] },
|
|
100
|
+
invert: I(!0, e?.axes?.secondaryMeasure),
|
|
101
|
+
nice: !te && ve.scale.nice,
|
|
102
|
+
expandMax: .06,
|
|
103
|
+
...L
|
|
104
|
+
}, E && (D[N] = {
|
|
105
|
+
type: W.Linear,
|
|
106
|
+
data: { field: N }
|
|
107
|
+
}), {
|
|
108
|
+
...n,
|
|
109
|
+
scales: D
|
|
110
|
+
};
|
|
111
|
+
}, K = "spatial-heatmap", Fe = "shape", q = (e) => {
|
|
112
|
+
let t = e.scatterSettings?.shape ?? h.Circle;
|
|
113
|
+
return `${G.Point}-${t}`;
|
|
114
|
+
}, Ie = (e, t, n, r, i, a) => {
|
|
115
|
+
let s = e.dimensions.filter((e) => c(e)), u = e.measures.filter((e) => c(e)), f = te((e.supportingMeasures ?? []).filter((e) => c(e))), p = s.filter((e) => e.role === d.SCATTER_IMAGE), m = u.filter((e) => e.role === l.SCATTER_HORIZONTAL), h = u.filter((e) => e.role === l.SCATTER_VERTICAL), g = u.filter((e) => e.role === l.SCATTER_SIZE), _ = p[0], v = m[0], y = h[0], b = g[0], x = o(v?.dataItem), S = o(y?.dataItem);
|
|
116
|
+
V(n, 0, {
|
|
117
|
+
x: { field: x },
|
|
118
|
+
y: { field: S },
|
|
119
|
+
[x]: { field: x },
|
|
120
|
+
[S]: { field: S },
|
|
121
|
+
...f
|
|
122
|
+
});
|
|
123
|
+
let C = e.scatterSettings?.pointSize ?? .1, w = {};
|
|
124
|
+
if (b) {
|
|
125
|
+
let t = o(b.dataItem);
|
|
126
|
+
w = { field: t }, C = (t) => {
|
|
127
|
+
let n = e.scatterSettings?.pointSize ?? 0, r = e.scatterSettings?.maxPointSize ?? Math.max(n, 1);
|
|
128
|
+
return t.resources.scale(o(b.dataItem))(t.datum.size.value) * (r - n) + n;
|
|
129
|
+
}, V(n, 0, {
|
|
130
|
+
size: w,
|
|
131
|
+
[t]: { field: t }
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
let T;
|
|
135
|
+
return _ ? (V(n, 0, { imageUrl: { field: o(_.dataItem) } }), T = [Le(e, t, C, a, !0, i), ze(e, C, a)]) : T = e.scatterSettings?.spatialHeatmap?.show ? [Re(e, t, n, C, a, i)] : [Le(e, t, C, a, !1, i)], {
|
|
136
|
+
...n,
|
|
137
|
+
components: [...n.components, ...T]
|
|
138
|
+
};
|
|
139
|
+
}, Le = (e, t, n, r, i, a) => {
|
|
140
|
+
let o = new ke(e, t, a?.[0]?.itemsNotAffectedByFiltering), s = e.scatterSettings?.shape ?? h.Circle, c = e.scatterSettings?.stroke;
|
|
141
|
+
return {
|
|
142
|
+
type: G.Point,
|
|
143
|
+
layout: { displayOrder: R.VisualizationElement },
|
|
144
|
+
key: q(e),
|
|
145
|
+
data: { collection: H.Collection },
|
|
146
|
+
animations: {
|
|
147
|
+
enabled: !i,
|
|
148
|
+
presetId: "scatter-chart"
|
|
149
|
+
},
|
|
150
|
+
settings: {
|
|
151
|
+
x: {
|
|
152
|
+
scale: H.XAxisScale,
|
|
153
|
+
ref: "x"
|
|
154
|
+
},
|
|
155
|
+
y: {
|
|
156
|
+
scale: H.YAxisScale,
|
|
157
|
+
ref: "y"
|
|
158
|
+
},
|
|
159
|
+
opacity: i ? 0 : .8,
|
|
160
|
+
stroke: c?.color ?? void 0,
|
|
161
|
+
strokeWidth: c?.enabled ? c.width : 0,
|
|
162
|
+
shape: s,
|
|
163
|
+
size: n,
|
|
164
|
+
fill: i ? "transparent" : o.getColorDefinition({
|
|
165
|
+
overwriteSources: [o.MAIN_FIELD, "color"],
|
|
166
|
+
ref: "color"
|
|
167
|
+
}),
|
|
168
|
+
tag: Fe
|
|
169
|
+
},
|
|
170
|
+
brush: i ? null : z([""], r, { valuePickerMode: r?.valuePickerMode })
|
|
171
|
+
};
|
|
172
|
+
}, Re = (e, t, n, r, i, a) => {
|
|
173
|
+
let o = n.scales[H.Density]?.data, s = a?.[0]?.items?.length, c = n.collections?.[0]?.data?.extract?.[0]?.props?.density?.field && o?.field ? {
|
|
174
|
+
scale: H.Density,
|
|
175
|
+
ref: "density"
|
|
176
|
+
} : {
|
|
177
|
+
scale: H.Density,
|
|
178
|
+
fn: ({ scale: e }) => {
|
|
179
|
+
let t = e?.(1);
|
|
180
|
+
return typeof t == "number" ? t : 1;
|
|
181
|
+
}
|
|
182
|
+
};
|
|
183
|
+
return {
|
|
184
|
+
type: G.Heatmap,
|
|
185
|
+
layout: { displayOrder: R.VisualizationElement },
|
|
186
|
+
key: "spatial-heatmap",
|
|
187
|
+
animations: s !== void 0 && s < 1e3 ? { enabled: !0 } : void 0,
|
|
188
|
+
data: { collection: H.Collection },
|
|
189
|
+
settings: {
|
|
190
|
+
point: {
|
|
191
|
+
x: {
|
|
192
|
+
scale: H.XAxisScale,
|
|
193
|
+
ref: "x"
|
|
194
|
+
},
|
|
195
|
+
y: {
|
|
196
|
+
scale: H.YAxisScale,
|
|
197
|
+
ref: "y"
|
|
198
|
+
},
|
|
199
|
+
size: r,
|
|
200
|
+
density: c
|
|
201
|
+
},
|
|
202
|
+
gradient: H.DensityGradient,
|
|
203
|
+
blur: e.scatterSettings?.spatialHeatmap?.blur,
|
|
204
|
+
minOpacity: 1e-4
|
|
205
|
+
},
|
|
206
|
+
brush: i?.disable?.brushing ? void 0 : { consume: [{
|
|
207
|
+
context: U.Selection,
|
|
208
|
+
data: [""],
|
|
209
|
+
mode: de.And,
|
|
210
|
+
style: { inactive: { opacity: .1 } }
|
|
211
|
+
}] }
|
|
212
|
+
};
|
|
213
|
+
}, ze = (e, t, n) => ({
|
|
214
|
+
type: G.DomPoint,
|
|
215
|
+
layout: { displayOrder: R.VisualizationElement },
|
|
216
|
+
key: G.DomPoint,
|
|
217
|
+
data: { collection: H.Collection },
|
|
218
|
+
settings: {
|
|
219
|
+
x: {
|
|
220
|
+
scale: H.XAxisScale,
|
|
221
|
+
ref: "x"
|
|
222
|
+
},
|
|
223
|
+
y: {
|
|
224
|
+
scale: H.YAxisScale,
|
|
225
|
+
ref: "y"
|
|
226
|
+
},
|
|
227
|
+
opacity: .8,
|
|
228
|
+
size: t,
|
|
229
|
+
url: { ref: "imageUrl" },
|
|
230
|
+
renderCallback: (...e) => {
|
|
231
|
+
e.length === 0 && n?.onRenderDone?.();
|
|
232
|
+
},
|
|
233
|
+
borderWidth: e.scatterSettings?.borderWidth,
|
|
234
|
+
borderColor: e.scatterSettings?.borderColor ?? void 0
|
|
235
|
+
},
|
|
236
|
+
brush: z([""], n, { valuePickerMode: n?.valuePickerMode })
|
|
237
|
+
}), Be = (e, t, n) => {
|
|
238
|
+
let { measures: r, grid: i = [] } = e, a = i.filter((e) => e.enabled).map((e) => {
|
|
239
|
+
let n = m(r[0].dataItem, e.dataItem);
|
|
240
|
+
return Oe(e, n ? "x" : "y", n ? H.XAxisScale : H.YAxisScale, t);
|
|
241
|
+
}).filter((e) => !!e);
|
|
242
|
+
return {
|
|
243
|
+
...n,
|
|
244
|
+
components: [...n.components, ...a]
|
|
245
|
+
};
|
|
246
|
+
}, Ve = (e, t, n) => {
|
|
247
|
+
let r = [], i = [];
|
|
248
|
+
if (!e.refLines?.x && !e.refLines?.y) return n;
|
|
249
|
+
if (e.refLines.x) {
|
|
250
|
+
let n = e.refLines.x.map((e) => pe(e, H.XAxisScale, t));
|
|
251
|
+
r.push(...n);
|
|
252
|
+
}
|
|
253
|
+
if (e.refLines.y) {
|
|
254
|
+
let n = e.refLines.y.map((e) => pe(e, H.YAxisScale, t));
|
|
255
|
+
i.push(...n);
|
|
256
|
+
}
|
|
257
|
+
let a = {
|
|
258
|
+
type: G.RefLine,
|
|
259
|
+
layout: { displayOrder: R.RefLine },
|
|
260
|
+
lines: {
|
|
261
|
+
x: r,
|
|
262
|
+
y: i
|
|
263
|
+
}
|
|
264
|
+
};
|
|
265
|
+
return {
|
|
266
|
+
...n,
|
|
267
|
+
components: [...n.components, a]
|
|
268
|
+
};
|
|
269
|
+
}, He = "scatter-reference-areas", J = "scatter-reference-area", Ue = i("scatter-reference-areas-stage", "#6B7280"), Y = (e) => {
|
|
270
|
+
if (e == null) return null;
|
|
271
|
+
let t = u(e);
|
|
272
|
+
if (t === null) return null;
|
|
273
|
+
let n = typeof t == "number" ? t : Number(t);
|
|
274
|
+
return Number.isNaN(n) ? null : n;
|
|
275
|
+
}, We = (e) => {
|
|
276
|
+
if (e == null) return;
|
|
277
|
+
let t = u(e);
|
|
278
|
+
if (t === null || typeof t != "string") return;
|
|
279
|
+
let n = t.trim();
|
|
280
|
+
return n.length > 0 ? n : void 0;
|
|
281
|
+
}, Ge = (e, t) => {
|
|
282
|
+
if (e.enabled === !1) return;
|
|
283
|
+
let n = Y(e.xMin), r = Y(e.xMax), i = Y(e.yMin), a = Y(e.yMax);
|
|
284
|
+
if (n === null || r === null || i === null || a === null) {
|
|
285
|
+
Ue.warn("Skipping reference area due to incomplete bounds", {
|
|
286
|
+
id: e.id,
|
|
287
|
+
index: t
|
|
288
|
+
});
|
|
289
|
+
return;
|
|
290
|
+
}
|
|
291
|
+
let o = We(e.label), c = e.fillColor ?? s.referenceArea.fillColor, l = e.border?.enabled ?? s.referenceArea.border?.enabled ?? !1, u = l ? e.border?.color ?? s.referenceArea.border?.color ?? void 0 : void 0, d = l ? e.border?.width ?? s.referenceArea.border?.width ?? 1 : void 0, [f, p] = n <= r ? [n, r] : [r, n], [m, h] = i <= a ? [i, a] : [a, i], g = e.labelMode ?? s.referenceArea.labelMode, _ = e.labelPlacement ?? s.referenceArea.labelPlacement, v = e.labelColor ?? s.referenceArea.labelColor, y = e.labelFontSize ?? s.referenceArea.labelFontSize;
|
|
292
|
+
return {
|
|
293
|
+
id: e.id,
|
|
294
|
+
label: o,
|
|
295
|
+
labelMode: g,
|
|
296
|
+
labelPlacement: _,
|
|
297
|
+
labelColor: v,
|
|
298
|
+
labelFontSize: y,
|
|
299
|
+
xMin: f,
|
|
300
|
+
xMax: p,
|
|
301
|
+
yMin: m,
|
|
302
|
+
yMax: h,
|
|
303
|
+
fillColor: c,
|
|
304
|
+
borderColor: u,
|
|
305
|
+
borderWidth: d
|
|
306
|
+
};
|
|
307
|
+
}, Ke = (e) => {
|
|
308
|
+
let t = {
|
|
309
|
+
id: { value: e.id },
|
|
310
|
+
labelMode: { value: e.labelMode },
|
|
311
|
+
labelPlacement: { value: e.labelPlacement },
|
|
312
|
+
labelColor: { value: e.labelColor },
|
|
313
|
+
labelFontSize: { value: e.labelFontSize },
|
|
314
|
+
start: { value: e.yMin },
|
|
315
|
+
end: { value: e.yMax },
|
|
316
|
+
binStart: { value: e.xMin },
|
|
317
|
+
binEnd: { value: e.xMax },
|
|
318
|
+
xMin: { value: e.xMin },
|
|
319
|
+
xMax: { value: e.xMax },
|
|
320
|
+
yMin: { value: e.yMin },
|
|
321
|
+
yMax: { value: e.yMax },
|
|
322
|
+
fillColor: { value: e.fillColor }
|
|
323
|
+
};
|
|
324
|
+
return e.label && (t.label = { value: e.label }), e.borderColor && (t.borderColor = { value: e.borderColor }), typeof e.borderWidth == "number" && (t.borderWidth = { value: e.borderWidth }), t;
|
|
325
|
+
}, qe = (e) => {
|
|
326
|
+
switch (e) {
|
|
327
|
+
case a.TopLeft: return {
|
|
328
|
+
align: 0,
|
|
329
|
+
justify: 0
|
|
330
|
+
};
|
|
331
|
+
case a.Top: return {
|
|
332
|
+
align: .5,
|
|
333
|
+
justify: 0
|
|
334
|
+
};
|
|
335
|
+
case a.TopRight: return {
|
|
336
|
+
align: 1,
|
|
337
|
+
justify: 0
|
|
338
|
+
};
|
|
339
|
+
case a.Left: return {
|
|
340
|
+
align: 0,
|
|
341
|
+
justify: .5
|
|
342
|
+
};
|
|
343
|
+
case a.Right: return {
|
|
344
|
+
align: 1,
|
|
345
|
+
justify: .5
|
|
346
|
+
};
|
|
347
|
+
case a.BottomLeft: return {
|
|
348
|
+
align: 0,
|
|
349
|
+
justify: 1
|
|
350
|
+
};
|
|
351
|
+
case a.Bottom: return {
|
|
352
|
+
align: .5,
|
|
353
|
+
justify: 1
|
|
354
|
+
};
|
|
355
|
+
case a.BottomRight: return {
|
|
356
|
+
align: 1,
|
|
357
|
+
justify: 1
|
|
358
|
+
};
|
|
359
|
+
case a.Center:
|
|
360
|
+
default: return {
|
|
361
|
+
align: .5,
|
|
362
|
+
justify: .5
|
|
363
|
+
};
|
|
364
|
+
}
|
|
365
|
+
}, Je = (e, t, n) => {
|
|
366
|
+
if (e.labelMode !== b.Fixed || !e.label) return null;
|
|
367
|
+
let { align: r, justify: i } = qe(e.labelPlacement), a = s.referenceArea.labelColor, o = s.referenceArea.labelFontSize, c = e.labelColor ?? a, l = e.labelFontSize ?? o;
|
|
368
|
+
return {
|
|
369
|
+
type: G.Labels,
|
|
370
|
+
key: `${J}-${e.id}-label`,
|
|
371
|
+
layout: { displayOrder: t },
|
|
372
|
+
settings: { sources: [{
|
|
373
|
+
component: `${J}-${e.id}`,
|
|
374
|
+
selector: De.Rect,
|
|
375
|
+
strategy: {
|
|
376
|
+
type: "rows",
|
|
377
|
+
settings: {
|
|
378
|
+
align: r,
|
|
379
|
+
justify: i,
|
|
380
|
+
fontSize: l,
|
|
381
|
+
fontFamily: n.fonts?.general?.fontFamily,
|
|
382
|
+
padding: 2,
|
|
383
|
+
labels: [{
|
|
384
|
+
label: () => e.label ?? "",
|
|
385
|
+
fill: c
|
|
386
|
+
}]
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
}] },
|
|
390
|
+
animations: { enabled: !1 },
|
|
391
|
+
brush: null
|
|
392
|
+
};
|
|
393
|
+
}, Ye = (e, t, n) => {
|
|
394
|
+
let i = {
|
|
395
|
+
orientation: r.Vertical,
|
|
396
|
+
major: {
|
|
397
|
+
scale: H.XAxisScale,
|
|
398
|
+
ref: "binEnd",
|
|
399
|
+
binStart: { ref: "binStart" },
|
|
400
|
+
binEnd: { ref: "binEnd" }
|
|
401
|
+
},
|
|
402
|
+
minor: {
|
|
403
|
+
scale: H.YAxisScale,
|
|
404
|
+
ref: "end"
|
|
405
|
+
},
|
|
406
|
+
minor0: {
|
|
407
|
+
scale: H.YAxisScale,
|
|
408
|
+
ref: "start"
|
|
409
|
+
},
|
|
410
|
+
box: {
|
|
411
|
+
fill: e.fillColor ?? s.referenceArea.fillColor,
|
|
412
|
+
opacity: 1,
|
|
413
|
+
stroke: e.borderColor ?? "transparent",
|
|
414
|
+
strokeWidth: e.borderWidth ?? 0,
|
|
415
|
+
ignoreOutOfBounds: !0
|
|
416
|
+
}
|
|
417
|
+
};
|
|
418
|
+
return {
|
|
419
|
+
type: G.Box,
|
|
420
|
+
key: `${J}-${e.id}`,
|
|
421
|
+
layout: { displayOrder: t },
|
|
422
|
+
data: {
|
|
423
|
+
collection: He,
|
|
424
|
+
filter: (e, t) => t === n
|
|
425
|
+
},
|
|
426
|
+
settings: i,
|
|
427
|
+
animations: { enabled: !1 },
|
|
428
|
+
brush: null
|
|
429
|
+
};
|
|
430
|
+
}, Xe = (e, t, n) => {
|
|
431
|
+
let r = e.referenceAreas ?? [];
|
|
432
|
+
if (!r.length) return n;
|
|
433
|
+
let i = r.map(Ge).filter((e) => e !== void 0);
|
|
434
|
+
if (!i.length) return n;
|
|
435
|
+
let a = i.map(Ke), o = n.collections ? [...n.collections] : [];
|
|
436
|
+
o.push({
|
|
437
|
+
key: He,
|
|
438
|
+
data: {
|
|
439
|
+
items: a,
|
|
440
|
+
map: ({ value: e }) => e,
|
|
441
|
+
extract: []
|
|
442
|
+
}
|
|
443
|
+
});
|
|
444
|
+
let s = n.components ? [...n.components] : [], c = i.length;
|
|
445
|
+
return i.forEach((e, n) => {
|
|
446
|
+
let r = R.ReferenceArea + (c - n) * .001, i = Ye(e, r, n);
|
|
447
|
+
s.push(i);
|
|
448
|
+
let a = Je(e, r + 5e-4, t);
|
|
449
|
+
a && s.push(a);
|
|
450
|
+
}), {
|
|
451
|
+
...n,
|
|
452
|
+
collections: o,
|
|
453
|
+
components: s
|
|
454
|
+
};
|
|
455
|
+
}, Ze = (e, t, n) => {
|
|
456
|
+
let r = t.data.value, i = e.filter((e) => c(e)).filter((e) => e.role === d.SCATTER_DIMENSION)[0];
|
|
457
|
+
return i?.formatter && (r = n.formatter(i.formatter)(r)), `${r}`;
|
|
458
|
+
}, X = (e) => typeof e == "string" && e.startsWith("scatter-reference-area") && !e.endsWith("-label"), Z = (e) => {
|
|
459
|
+
let t = e.data?.labelMode;
|
|
460
|
+
if (typeof t == "string") return t;
|
|
461
|
+
if (t && typeof t == "object" && "value" in t) {
|
|
462
|
+
let e = t.value;
|
|
463
|
+
if (typeof e == "string") return e;
|
|
464
|
+
}
|
|
465
|
+
}, Q = (e) => {
|
|
466
|
+
let t = e.data?.label, n;
|
|
467
|
+
if (typeof t == "string") n = t;
|
|
468
|
+
else if (t && typeof t == "object" && t && "value" in t) {
|
|
469
|
+
let e = t.value;
|
|
470
|
+
n = typeof e == "string" ? e : void 0;
|
|
471
|
+
}
|
|
472
|
+
if (!n) return;
|
|
473
|
+
let r = n.trim();
|
|
474
|
+
return r.length > 0 ? r : void 0;
|
|
475
|
+
}, $ = (e) => ({
|
|
476
|
+
title: e,
|
|
477
|
+
props: []
|
|
478
|
+
}), Qe = (e, t, n) => {
|
|
479
|
+
let r = {
|
|
480
|
+
filter: (t) => {
|
|
481
|
+
let n = [
|
|
482
|
+
q(e),
|
|
483
|
+
le,
|
|
484
|
+
K
|
|
485
|
+
];
|
|
486
|
+
return t.filter((e) => e.key ? X(e.key) ? Z(e) !== b.Fixed && !!Q(e) : n.includes(e.key) : !1);
|
|
487
|
+
},
|
|
488
|
+
placement: {
|
|
489
|
+
type: "pointer",
|
|
490
|
+
area: "target"
|
|
491
|
+
}
|
|
492
|
+
};
|
|
493
|
+
if (n.components.find((e) => e.key === "spatial-heatmap")) {
|
|
494
|
+
let e = ({ node: e, resources: t }) => ({
|
|
495
|
+
title: e.data.label,
|
|
496
|
+
props: [
|
|
497
|
+
"x",
|
|
498
|
+
"y",
|
|
499
|
+
"size",
|
|
500
|
+
"density"
|
|
501
|
+
].flatMap((n) => {
|
|
502
|
+
let r = e.data[n], i = r?.source?.field;
|
|
503
|
+
return i ? [{
|
|
504
|
+
label: t.dataset("").field(i)?.title() ?? "",
|
|
505
|
+
value: r.label ?? ""
|
|
506
|
+
}] : [];
|
|
507
|
+
})
|
|
508
|
+
});
|
|
509
|
+
r.extract = (t) => {
|
|
510
|
+
if (X(t.node.key)) {
|
|
511
|
+
let e = Q(t.node), n = Z(t.node);
|
|
512
|
+
if (e && n !== b.Fixed) return $(e);
|
|
513
|
+
}
|
|
514
|
+
return e(t);
|
|
515
|
+
};
|
|
516
|
+
let t = _e();
|
|
517
|
+
r.content = ({ h: e, data: n }) => {
|
|
518
|
+
if (n.length > 8) {
|
|
519
|
+
let e = n.length;
|
|
520
|
+
n = n.slice(0, 5), n.push({
|
|
521
|
+
title: `+ ${e - n.length} more`,
|
|
522
|
+
props: []
|
|
523
|
+
});
|
|
524
|
+
}
|
|
525
|
+
return t({
|
|
526
|
+
h: e,
|
|
527
|
+
data: n
|
|
528
|
+
});
|
|
529
|
+
};
|
|
530
|
+
} else {
|
|
531
|
+
let n = be(e, t, Te, Ze);
|
|
532
|
+
r.extract = (e) => {
|
|
533
|
+
if (X(e.node.key)) {
|
|
534
|
+
let t = Q(e.node), n = Z(e.node);
|
|
535
|
+
if (t && n !== b.Fixed) return $(t);
|
|
536
|
+
}
|
|
537
|
+
return n(e);
|
|
538
|
+
};
|
|
539
|
+
}
|
|
540
|
+
return Ee(e, t, n, r, "tooltip", void 0, {
|
|
541
|
+
componentKeys: [q(e)],
|
|
542
|
+
yieldToComponentKeys: [le, K]
|
|
543
|
+
});
|
|
544
|
+
}, $e = (e, t, n) => {
|
|
545
|
+
let r = e?.measures[0], i = {
|
|
546
|
+
showAxisTooltip: e?.axes?.primaryMeasure?.showAxisTooltip,
|
|
547
|
+
formatter: r?.formatter,
|
|
548
|
+
scale: fe(e),
|
|
549
|
+
key: ie.Measure,
|
|
550
|
+
settings: { direction: j(e) }
|
|
551
|
+
}, a = e?.measures[1], [o, s] = se([i, {
|
|
552
|
+
showAxisTooltip: e?.axes?.secondaryMeasure?.showAxisTooltip,
|
|
553
|
+
formatter: a?.formatter,
|
|
554
|
+
scale: xe(e, a),
|
|
555
|
+
key: ie.MeasureSec,
|
|
556
|
+
settings: {
|
|
557
|
+
direction: ne(e),
|
|
558
|
+
labelDock: F(we(e), a?.secondaryAxis)
|
|
559
|
+
}
|
|
560
|
+
}]);
|
|
561
|
+
return {
|
|
562
|
+
...n,
|
|
563
|
+
components: [...n.components ?? [], ...o],
|
|
564
|
+
interactions: [...n.interactions ?? [], ...s]
|
|
565
|
+
};
|
|
566
|
+
}, et = (e, t, n) => oe(e, t, n), tt = (e) => {
|
|
567
|
+
try {
|
|
568
|
+
return !!e && me(e);
|
|
569
|
+
} catch {
|
|
570
|
+
return !1;
|
|
571
|
+
}
|
|
572
|
+
}, nt = (e, n, r, i, a, o) => {
|
|
573
|
+
if (o?.disable?.brushing || o?.disable?.brushingLasso) return r;
|
|
574
|
+
let s = tt(n?.colors?.sheetBackgroundColor) ? t.white : t.mainDarkNavy, c = e.scatterSettings?.lasso, l = c?.strokeColor ?? s, u = {
|
|
575
|
+
type: G.Lasso,
|
|
576
|
+
key: G.Lasso,
|
|
577
|
+
layout: { displayOrder: R.VisualizationElement + 1 },
|
|
578
|
+
settings: {
|
|
579
|
+
brush: { components: [{
|
|
580
|
+
key: q(e),
|
|
581
|
+
contexts: [U.Selection],
|
|
582
|
+
action: "toggle"
|
|
583
|
+
}, {
|
|
584
|
+
key: K,
|
|
585
|
+
contexts: [U.Selection],
|
|
586
|
+
action: "toggle"
|
|
587
|
+
}] },
|
|
588
|
+
lasso: {
|
|
589
|
+
strokeWidth: 2,
|
|
590
|
+
strokeDasharray: "4",
|
|
591
|
+
stroke: l
|
|
592
|
+
},
|
|
593
|
+
snapIndicator: { stroke: l },
|
|
594
|
+
startPoint: {
|
|
595
|
+
r: 3,
|
|
596
|
+
fill: c?.startPointColor ?? t.secondaryPurple,
|
|
597
|
+
stroke: l
|
|
598
|
+
}
|
|
599
|
+
}
|
|
600
|
+
}, d = {
|
|
601
|
+
type: "native",
|
|
602
|
+
key: `${G.Lasso}-interaction`,
|
|
603
|
+
events: {
|
|
604
|
+
mousedown(e) {
|
|
605
|
+
this.chart.component(G.Lasso).emit("lassoStart", { center: {
|
|
606
|
+
x: e.clientX,
|
|
607
|
+
y: e.clientY
|
|
608
|
+
} });
|
|
609
|
+
},
|
|
610
|
+
mousemove(e) {
|
|
611
|
+
this.chart.component(G.Lasso).emit("lassoMove", { center: {
|
|
612
|
+
x: e.clientX,
|
|
613
|
+
y: e.clientY
|
|
614
|
+
} });
|
|
615
|
+
},
|
|
616
|
+
mouseup(e) {
|
|
617
|
+
this.chart.component(G.Lasso).emit("lassoEnd", { center: {
|
|
618
|
+
x: e.clientX,
|
|
619
|
+
y: e.clientY
|
|
620
|
+
} });
|
|
621
|
+
}
|
|
622
|
+
}
|
|
623
|
+
};
|
|
624
|
+
return {
|
|
625
|
+
...r,
|
|
626
|
+
components: [...r.components, u],
|
|
627
|
+
interactions: [...r.interactions ?? [], d]
|
|
628
|
+
};
|
|
629
|
+
}, rt = (e, t, n, r, i, a) => {
|
|
630
|
+
let o = e.scatterSettings?.spatialHeatmap?.show && e.dimensions.length < 2;
|
|
631
|
+
if (!e.pointLabeling?.enabled || o) return n;
|
|
632
|
+
let s = e.pointLabeling, c = 4 + (e.scatterSettings?.stroke?.enabled ? e.scatterSettings.stroke.width / 2 : 0), l = ue({
|
|
633
|
+
targetComponentKeys: [q(e)],
|
|
634
|
+
targetSelector: `.${Fe}`,
|
|
635
|
+
offset: c,
|
|
636
|
+
fontSize: ge(e.pointLabeling?.fontSize)
|
|
637
|
+
}, s, a, t);
|
|
638
|
+
return l ? {
|
|
639
|
+
...n,
|
|
640
|
+
components: [...n.components, l]
|
|
641
|
+
} : n;
|
|
642
|
+
}, it = (...e) => {
|
|
643
|
+
let t = ce(...e), r = t.components.find((e) => e.type === Se.SequentialLegend), i = t.scales[H.Density];
|
|
644
|
+
if (r && i) {
|
|
645
|
+
r.settings.fill = H.DensityGradient;
|
|
646
|
+
let e = r.layout?.dock;
|
|
647
|
+
r.settings.major = e === n.Left || e === n.Right ? H.DensityInverted : H.Density;
|
|
648
|
+
}
|
|
649
|
+
return t;
|
|
650
|
+
}, at = class extends P {
|
|
651
|
+
constructor() {
|
|
652
|
+
super([
|
|
653
|
+
re,
|
|
654
|
+
Pe,
|
|
655
|
+
Be,
|
|
656
|
+
Xe,
|
|
657
|
+
Ie,
|
|
658
|
+
Me,
|
|
659
|
+
Ve,
|
|
660
|
+
it,
|
|
661
|
+
et,
|
|
662
|
+
rt,
|
|
663
|
+
Qe,
|
|
664
|
+
nt,
|
|
665
|
+
$e
|
|
666
|
+
]);
|
|
667
|
+
}
|
|
668
|
+
preCompile(e) {
|
|
669
|
+
let t = e.dimensions.filter((e) => c(e)), n = e.measures.filter((e) => c(e)), r = t.filter((e) => e.role === d.SCATTER_DIMENSION), i = n.filter((e) => e.role === l.SCATTER_HORIZONTAL), a = n.filter((e) => e.role === l.SCATTER_VERTICAL), o = r[0], s = i[0], u = a[0];
|
|
670
|
+
if (!o || !s || !u) throw Error("Scatter chart requires at least 1 scatter dimension, 1 horizontal measure, and 1 vertical measure.");
|
|
671
|
+
}
|
|
672
|
+
}, ot = k(), st = D(({ vSpec: e, vTheme: t, data: n, elementSize: r, vizProperties: i }) => {
|
|
673
|
+
let a = C(), [o] = (0, je.useState)(() => new at()), s = E(), { activeKey: c } = O(), l = S(), u = ye();
|
|
674
|
+
if (!e || !n || !r || !v(e)) return null;
|
|
675
|
+
let d = {
|
|
676
|
+
...i,
|
|
677
|
+
valuePickerMode: !!c
|
|
678
|
+
}, f = t || _, m = o.compile(e, f, n, r, {
|
|
679
|
+
...d,
|
|
680
|
+
onRenderDone: s
|
|
681
|
+
}, p.Scatter, a, l, u);
|
|
682
|
+
return m ? /* @__PURE__ */ (0, ot.jsx)(he, {
|
|
683
|
+
config: d,
|
|
684
|
+
definition: m,
|
|
685
|
+
size: r,
|
|
686
|
+
vSpec: e
|
|
687
|
+
}) : null;
|
|
688
|
+
});
|
|
689
|
+
export { st as ScatterChart };
|