@astrato-io/visualizations 0.6.4 → 0.6.5
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 +0 -0
- package/THIRD_PARTY_NOTICES.md +94 -4
- package/chunks/ClickAwayListener-BbeNMAvj.js +52 -0
- package/chunks/{LinearProgress-CUZ0D8_t.js → LinearProgress-B1FeWaen.js} +54 -54
- package/chunks/app-filter-bar.compiler-BGJ7HAbr.js +64 -0
- package/chunks/bar.compiler-CT0ZbQKc.js +374 -0
- package/chunks/{src-Cum_2NLV.js → builder-B6dWSIdD.js} +5779 -5635
- package/chunks/{coloring-C16AUZEi.js → coloring-B1XAfg6b.js} +234 -233
- package/chunks/{src-BC7cGcJ-.js → definitions-D3OVqmXl.js} +438 -360
- package/chunks/{escobar-BGqT1EsE.js → escobar-eDjtGpkC.js} +4645 -4619
- package/chunks/filter.compiler-DBsyRBJt.js +70 -0
- package/chunks/{filtering-Yq4DEa0t.js → filtering-tqjAyJH5.js} +432 -313
- package/chunks/{grouping-type-BX_9Ix5q.js → grouping-type-On4s9Thj.js} +1 -1
- package/chunks/handlers-VTBfIZYZ.js +13072 -0
- package/chunks/isEqual-BDxAhUo8.js +7514 -0
- package/chunks/line.compiler-CzdM5Ld0.js +198 -0
- package/chunks/{metadata-CPXdYoln.js → metadata-BGElBy5Z.js} +1 -1
- package/chunks/number.compiler-G-R7y16P.js +53 -0
- package/chunks/{src-C0LgoUWY.js → operations-CTNUX6Sy.js} +9576 -9432
- package/chunks/{range-DrzdfBX4.js → range-CiwTbMig.js} +2 -2
- package/chunks/{registry-CExpGJ1N.js → registry-CsQQzukD.js} +153 -153
- package/chunks/{requirements-DNhuShLS.js → requirements-DYjZCFyf.js} +1 -1
- package/chunks/{shared-CKDL4hx9.js → shared-CBvcC5YV.js} +460 -413
- package/chunks/{standalone-D5vnf-9y.js → standalone-0M4HlmDW2.js} +823 -822
- package/chunks/standalone-0ashe9w1.js +411 -0
- package/chunks/{standalone-C85u7U6I.js → standalone-B7jax8wa.js} +93 -94
- package/chunks/standalone-BK0VYU-l.js +463 -0
- package/chunks/{standalone-BDCwI6Hn.js → standalone-BMIbT1b2.js} +815 -815
- package/chunks/standalone-BZV5vOwA.js +6 -0
- package/chunks/standalone-BhDrWj4p.js +1980 -0
- package/chunks/{standalone-CNyNHKVx.js → standalone-BtSHCp2U2.js} +97 -98
- package/chunks/{standalone-CDQnr6qT.js → standalone-BvaKdky9.js} +95 -96
- package/chunks/standalone-BwtM31-f.js +2 -0
- package/chunks/{standalone-CY57qwZ-.js → standalone-C3gg736V.js} +153 -153
- package/chunks/{standalone-DFPva_ku.js → standalone-CC1VUjO32.js} +60 -60
- package/chunks/{standalone-CCNtaJ7s.js → standalone-C_rYnZ0N.js} +41 -41
- package/chunks/{standalone-CZynjFG7.js → standalone-CoLrAxRV.js} +3701 -3482
- package/chunks/{standalone-jiz0L2Dg.js → standalone-DC-aUgXC.js} +104 -104
- package/chunks/standalone-DCtRoTWg.js +675 -0
- package/chunks/standalone-DUDFTBqL.js +833 -0
- package/chunks/standalone-DhZkX9Td.js +2 -0
- package/chunks/{standalone-Dx3MLlrO.js → standalone-DtLElfuM.js} +141 -141
- package/chunks/{standalone-BmfMt74U.js → standalone-G9Q4Uczu.js} +192 -192
- package/chunks/{standalone-BH5NqDwp.js → standalone-JuLF-OoH.js} +390 -391
- package/chunks/standalone-_DeX21JJ.js +383 -0
- package/chunks/{standalone-lBm9hQ-q.js → standalone-gFhKZh8m.js} +34 -34
- package/chunks/standalone-tDNy-SFH.js +281 -0
- package/chunks/{standalone-rJ45Zfl1.js → standalone-v1oxfU20.js} +10 -10
- package/chunks/{standalone-BYm1UjLr.js → standalone-vzBY6q0I2.js} +18 -18
- package/chunks/table.compiler-tb914oj3.js +222 -0
- package/chunks/{ui-D1HQNIBy.js → ui-DQWtv2iM.js} +13485 -3973
- package/chunks/{useFieldName-oqQ3bvnO.js → useFieldName-BvdcoJRl.js} +1 -1
- package/chunks/{utils-Ba9T0TqC.js → utils-Bg7K-t6K.js} +7306 -6024
- package/chunks/{src-DvX5LU9T.js → view-Bn83C8d9.js} +2555 -4831
- package/definitions.js +3 -3
- package/docs/operations/astrato-app-filter-bar.md +17 -17
- package/docs/operations/bar.md +989 -1071
- package/docs/operations/combo.md +717 -738
- package/docs/operations/date-picker.md +25 -25
- package/docs/operations/distribution-gauge.md +471 -607
- package/docs/operations/dot.md +787 -879
- package/docs/operations/filter.md +139 -163
- package/docs/operations/gauge.md +491 -627
- package/docs/operations/heatMap.md +834 -916
- package/docs/operations/histogram.md +166 -180
- package/docs/operations/iframe.md +5 -5
- package/docs/operations/image.md +16 -16
- package/docs/operations/index.md +12 -12
- package/docs/operations/line.md +811 -888
- package/docs/operations/number.md +470 -536
- package/docs/operations/pie.md +825 -958
- package/docs/operations/radar.md +599 -679
- package/docs/operations/sankey.md +462 -584
- package/docs/operations/scatter.md +823 -929
- package/docs/operations/shape.md +34 -34
- package/docs/operations/simpleTextObject.md +18 -25
- package/docs/operations/slider.md +33 -43
- package/docs/operations/table.md +1160 -1150
- package/docs/operations/tree.md +354 -361
- package/docs/operations/treemap.md +545 -637
- package/docs/operations/waterfall.md +369 -379
- package/docs/operations/word-cloud.md +512 -583
- package/getters.js +3 -3
- package/index.js +51 -51
- package/metadata.js +3 -3
- package/operations.js +7 -7
- package/package.json +80 -86
- package/src/definitions/index.d.ts +2 -2
- package/src/definitions/{shared/lib → model/definitions}/available-fields.d.ts +0 -1
- package/src/definitions/{shared/lib/compilers/index.d.ts → model/definitions/compilers/compile.d.ts} +1 -1
- package/src/definitions/model/definitions/data-item-resolution.d.ts +19 -0
- package/src/definitions/model/definitions/descriptors/descriptor-metadata.d.ts +1341 -0
- package/src/definitions/model/definitions/descriptors/json-schema.d.ts +2 -0
- package/src/definitions/model/definitions/diagnostics.d.ts +5 -0
- package/src/definitions/model/definitions/field-suggestions.d.ts +2 -0
- package/src/definitions/model/definitions/index.d.ts +23 -0
- package/src/definitions/{shared/lib → model/definitions}/registry/compile.d.ts +1 -1
- package/src/definitions/model/definitions/registry/descriptor-registry.d.ts +3 -0
- package/src/definitions/model/definitions/schema-registry.d.ts +660 -0
- package/src/definitions/{shared/lib → model/definitions}/schemas/broad-chart.schema.d.ts +1 -1
- package/src/definitions/{shared/lib → model/definitions}/schemas/common.schema.d.ts +0 -1
- package/src/definitions/model/definitions/schemas/index.d.ts +9 -0
- package/src/definitions/{shared/lib → model/definitions}/schemas/object.schema.d.ts +6 -6
- package/src/definitions/{shared/lib → model/definitions}/types/definition.types.d.ts +1 -1
- package/src/definitions/model/definitions/types/index.d.ts +3 -0
- package/src/definitions/{shared/lib/registry → model/definitions}/validation.d.ts +1 -1
- package/chunks/Radio-Ciu-F4CU.js +0 -957
- package/chunks/ToggleButton-BCJc3Jlc.js +0 -153
- package/chunks/_baseFlatten-DPXPOrea.js +0 -7076
- package/chunks/app-filter-bar.compiler-j_CVoWTa.js +0 -55
- package/chunks/bar.compiler-oqaPzIut.js +0 -370
- package/chunks/data-item-resolution-1lvYB5ln.js +0 -53
- package/chunks/event-bus-KiSiCJrC.js +0 -2683
- package/chunks/filter.compiler-CuLtc_02.js +0 -60
- package/chunks/gauge-target-type-BkKXAqkX.js +0 -4
- package/chunks/interfaces-VUY4_yVO.js +0 -8742
- package/chunks/line-settings-DfYTUyPz.js +0 -4
- package/chunks/line.compiler-BpA_6Tc7.js +0 -188
- package/chunks/number.compiler-DbkWcG4S.js +0 -44
- package/chunks/pie-uv42Eqal.js +0 -10
- package/chunks/src-Dun_jXtz.js +0 -10295
- package/chunks/standalone-87YV_m9n.js +0 -687
- package/chunks/standalone-BLVAWLNJ.js +0 -385
- package/chunks/standalone-BPomtAVs.js +0 -2
- package/chunks/standalone-BXyBcUOQ.js +0 -2
- package/chunks/standalone-BllF4rDp.js +0 -383
- package/chunks/standalone-BqWyrnZI.js +0 -281
- package/chunks/standalone-DQxxNwF8.js +0 -675
- package/chunks/standalone-DS9T0FZ-.js +0 -830
- package/chunks/standalone-DzixzZAL.js +0 -411
- package/chunks/standalone-QJ1kKMnO.js +0 -6
- package/chunks/table.compiler-BrXkm4Fz.js +0 -213
- package/chunks/toInteger-DVZr-D1j.js +0 -11
- package/chunks/treemap-x_zmJoG7.js +0 -23
- package/chunks/types-dVVCsDWD.js +0 -4
- package/chunks/view-CLqWMV7Z.js +0 -156
- package/src/definitions/shared/index.d.ts +0 -5
- package/src/definitions/shared/lib/registry/descriptor-registry.d.ts +0 -587
- package/src/definitions/shared/lib/registry/index.d.ts +0 -3
- package/src/definitions/shared/lib/schemas/index.d.ts +0 -9
- package/src/definitions/shared/lib/types/index.d.ts +0 -3
- package/src/definitions/{shared/lib → model/definitions}/schemas/app-filter-bar.schema.d.ts +0 -0
- package/src/definitions/{shared/lib → model/definitions}/schemas/bar.schema.d.ts +0 -0
- package/src/definitions/{shared/lib → model/definitions}/schemas/filter.schema.d.ts +0 -0
- package/src/definitions/{shared/lib → model/definitions}/schemas/line.schema.d.ts +0 -0
- package/src/definitions/{shared/lib → model/definitions}/schemas/number.schema.d.ts +0 -0
- package/src/definitions/{shared/lib → model/definitions}/schemas/table.schema.d.ts +4 -4
- /package/src/definitions/{shared/lib → model/definitions}/types/compilation.types.d.ts +0 -0
- /package/src/definitions/{shared/lib → model/definitions}/types/descriptor.types.d.ts +0 -0
|
@@ -0,0 +1,383 @@
|
|
|
1
|
+
import { o as e, t } from "./rolldown-runtime-DleVn1XH.js";
|
|
2
|
+
import { Eo as n, Ks as r, Mt as i, No as a, Nt as o, R as s, Sa as c, Si as l, Ta as u, Xt as d, Ys as f, fc as p, in as m, zt as h } from "./isEqual-BDxAhUo8.js";
|
|
3
|
+
import { $t as ee, Ei as te, I as ne, Jn as g, P as _, Yi as v, o as y } from "./utils-Bg7K-t6K.js";
|
|
4
|
+
import { b } from "./ui-DQWtv2iM.js";
|
|
5
|
+
import { At as x, Ct as re, Et as S, Ft as C, H as ie, M as ae, Mt as oe, Nt as se, Ot as w, Qt as ce, Rt as le, St as T, Tt as E, U as D, Ut as O, Wt as k, X as A, Xt as j, Yt as M, Z as N, Zt as P, an as F, dn as I, gt as L, ht as R, i as z, j as B, jt as V, n as H, on as U, ot as W, rn as ue, rt as G, st as de, un as fe, ut as pe, vt as me, xt as he } from "./escobar-eDjtGpkC.js";
|
|
6
|
+
import { t as ge } from "./coloring-B1XAfg6b.js";
|
|
7
|
+
import { t as K } from "./set-coloring-datafield-B3uIS1Pe.js";
|
|
8
|
+
import { t as _e } from "./range-CiwTbMig.js";
|
|
9
|
+
v();
|
|
10
|
+
var ve = (e, t, n, r, i, a, o) => {
|
|
11
|
+
let s = e.dimensions.filter((e) => l(e)), c = e.measures.filter((e) => l(e)), u = ye(e, t, n, o);
|
|
12
|
+
return s[0] && (n.collections.push({
|
|
13
|
+
key: S.DimensionDomain,
|
|
14
|
+
data: { extract: [{ field: p(s[0].dataItem) }] }
|
|
15
|
+
}), u[M(e)] = {
|
|
16
|
+
data: { collection: S.DimensionDomain },
|
|
17
|
+
type: F.Band
|
|
18
|
+
}), c[0] && (u[j(e, c[0])] = {
|
|
19
|
+
data: { field: p(c[0].dataItem) },
|
|
20
|
+
expand: .02,
|
|
21
|
+
invert: D(!1, e.axes?.primaryMeasure),
|
|
22
|
+
...ie(e.axes?.primaryMeasure?.axisRange, !0)
|
|
23
|
+
}), {
|
|
24
|
+
...n,
|
|
25
|
+
scales: u
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
function ye(e, t, n, r) {
|
|
29
|
+
let i = e.dimensions.filter((e) => l(e)), a = e.measures.filter((e) => l(e));
|
|
30
|
+
switch (e.coloring?.type) {
|
|
31
|
+
case f.Categorical: {
|
|
32
|
+
let a = re(e, r, i[1]);
|
|
33
|
+
return R(n, 1, { color: { field: a } }), { categorical: he(K(e, a), t, a, {
|
|
34
|
+
customPalette: e.coloring.customPalette,
|
|
35
|
+
palette: e.coloring.palette,
|
|
36
|
+
sortOrder: e.coloring.sortOrder
|
|
37
|
+
}, n.collections) };
|
|
38
|
+
}
|
|
39
|
+
case f.Gradient: {
|
|
40
|
+
let r = E(e);
|
|
41
|
+
return R(n, 1, { color: { field: r } }), T(K(e, r), t, {});
|
|
42
|
+
}
|
|
43
|
+
case f.Single: {
|
|
44
|
+
let r = p(a[0]?.dataItem);
|
|
45
|
+
r && R(n, 1, { color: { field: r } });
|
|
46
|
+
let i = e?.coloring?.color ?? t.colors.brandColors[0];
|
|
47
|
+
return { [f.Single]: {
|
|
48
|
+
data: [],
|
|
49
|
+
unknown: i,
|
|
50
|
+
type: F.CategoricalColor,
|
|
51
|
+
range: [i]
|
|
52
|
+
} };
|
|
53
|
+
}
|
|
54
|
+
default: return {};
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
var be = (e, t, n) => {
|
|
58
|
+
let r = e.dimensions.filter((e) => l(e)), i = e.measures.filter((e) => l(e)), a = (e.supportingMeasures ?? []).filter((e) => l(e)), [o, s] = r, c = p(o?.dataItem), u = p(s?.dataItem), d = p(i[0]?.dataItem), f = ae(a), m = {
|
|
59
|
+
key: S.DotBarCollection,
|
|
60
|
+
data: { extract: [{
|
|
61
|
+
field: c,
|
|
62
|
+
trackBy: (e) => e,
|
|
63
|
+
reduce: "first",
|
|
64
|
+
props: {
|
|
65
|
+
start: {
|
|
66
|
+
field: d,
|
|
67
|
+
reduce: "min"
|
|
68
|
+
},
|
|
69
|
+
med: {
|
|
70
|
+
field: d,
|
|
71
|
+
reduce: "avg"
|
|
72
|
+
},
|
|
73
|
+
end: {
|
|
74
|
+
field: d,
|
|
75
|
+
reduce: "max"
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}] }
|
|
79
|
+
}, h = {
|
|
80
|
+
key: S.DotPointsCollection,
|
|
81
|
+
data: { extract: [{
|
|
82
|
+
field: u,
|
|
83
|
+
props: {
|
|
84
|
+
x: { field: d },
|
|
85
|
+
group: { field: c },
|
|
86
|
+
[d]: { field: d },
|
|
87
|
+
...f
|
|
88
|
+
}
|
|
89
|
+
}] }
|
|
90
|
+
};
|
|
91
|
+
return {
|
|
92
|
+
...n,
|
|
93
|
+
collections: [m, h]
|
|
94
|
+
};
|
|
95
|
+
}, xe = /* @__PURE__ */ t(((e, t) => {
|
|
96
|
+
var n = Math.floor, r = Math.random;
|
|
97
|
+
function i(e, t) {
|
|
98
|
+
return e + n(r() * (t - e + 1));
|
|
99
|
+
}
|
|
100
|
+
t.exports = i;
|
|
101
|
+
})), q = /* @__PURE__ */ t(((e, t) => {
|
|
102
|
+
var n = xe();
|
|
103
|
+
function r(e, t) {
|
|
104
|
+
var r = -1, i = e.length, a = i - 1;
|
|
105
|
+
for (t = t === void 0 ? i : t; ++r < t;) {
|
|
106
|
+
var o = n(r, a), s = e[o];
|
|
107
|
+
e[o] = e[r], e[r] = s;
|
|
108
|
+
}
|
|
109
|
+
return e.length = t, e;
|
|
110
|
+
}
|
|
111
|
+
t.exports = r;
|
|
112
|
+
})), Se = /* @__PURE__ */ t(((e, t) => {
|
|
113
|
+
var n = s(), r = q();
|
|
114
|
+
function i(e) {
|
|
115
|
+
return r(n(e));
|
|
116
|
+
}
|
|
117
|
+
t.exports = i;
|
|
118
|
+
})), Ce = /* @__PURE__ */ t(((e, t) => {
|
|
119
|
+
var n = o();
|
|
120
|
+
function r(e, t) {
|
|
121
|
+
return n(t, function(t) {
|
|
122
|
+
return e[t];
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
t.exports = r;
|
|
126
|
+
})), we = /* @__PURE__ */ t(((e, t) => {
|
|
127
|
+
var n = Ce(), r = h();
|
|
128
|
+
function i(e) {
|
|
129
|
+
return e == null ? [] : n(e, r(e));
|
|
130
|
+
}
|
|
131
|
+
t.exports = i;
|
|
132
|
+
})), Te = /* @__PURE__ */ t(((e, t) => {
|
|
133
|
+
var n = q(), r = we();
|
|
134
|
+
function i(e) {
|
|
135
|
+
return n(r(e));
|
|
136
|
+
}
|
|
137
|
+
t.exports = i;
|
|
138
|
+
})), Ee = /* @__PURE__ */ t(((e, t) => {
|
|
139
|
+
var n = Se(), r = Te(), i = d();
|
|
140
|
+
function a(e) {
|
|
141
|
+
return (i(e) ? n : r)(e);
|
|
142
|
+
}
|
|
143
|
+
t.exports = a;
|
|
144
|
+
})), De = /* @__PURE__ */ e(_e()), Oe = /* @__PURE__ */ e(Ee()), J = (e) => 1 - (e.barSettings.barPadding ?? 0);
|
|
145
|
+
function ke(e, t, n) {
|
|
146
|
+
let r = new ge(e, t, n?.[0]?.itemsNotAffectedByFiltering);
|
|
147
|
+
return r.getColorDefinition({
|
|
148
|
+
overwriteSources: [r.MAIN_FIELD],
|
|
149
|
+
ref: "color"
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
function Ae(e) {
|
|
153
|
+
let t = k([""], e, { valuePickerMode: e?.valuePickerMode }), n = t?.consume?.[1]?.style?.active?.strokeWidth;
|
|
154
|
+
return typeof n == "function" && (t.consume[1].style.active.strokeWidth = (e) => e.type === ue.Line ? 1 : n(e)), t;
|
|
155
|
+
}
|
|
156
|
+
function Y(e) {
|
|
157
|
+
return O({
|
|
158
|
+
triggerData: [""],
|
|
159
|
+
consumeData: ["", "group"],
|
|
160
|
+
consumerMode: fe.Or
|
|
161
|
+
}, e, { valuePickerMode: e?.valuePickerMode });
|
|
162
|
+
}
|
|
163
|
+
var X = 100, Z = .1, Q = .9, je = (0, Oe.default)((0, De.default)(Z, Q, (Q - Z) / X));
|
|
164
|
+
function Me(e, t) {
|
|
165
|
+
return ({ datum: n, resources: { scale: r } }, i) => {
|
|
166
|
+
let a = r(M(t)), o = t.jitterPoints ? je[i % X] : .5;
|
|
167
|
+
return a(n.group.value) + .5 * (1 - e) * a.bandwidth() + e * a.bandwidth() * o;
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
var Ne = (e, t, n, r, i, a) => {
|
|
171
|
+
let o = Pe(e, t, a), s = $(e, ke(e, t, i), a);
|
|
172
|
+
return {
|
|
173
|
+
...n,
|
|
174
|
+
components: [
|
|
175
|
+
...n.components,
|
|
176
|
+
o,
|
|
177
|
+
s
|
|
178
|
+
]
|
|
179
|
+
};
|
|
180
|
+
};
|
|
181
|
+
function Pe(e, t, n) {
|
|
182
|
+
let r = {
|
|
183
|
+
orientation: e.orientation,
|
|
184
|
+
major: { scale: M(e) },
|
|
185
|
+
minor: { scale: j(e, e.measures.filter((e) => l(e))[0]) },
|
|
186
|
+
box: {
|
|
187
|
+
width: J(e),
|
|
188
|
+
fill: e.barColor ?? "rgba(100, 100, 100, 0.2)",
|
|
189
|
+
rx: e.barSettings?.barRadius ?? 0,
|
|
190
|
+
roundAllEdges: !0
|
|
191
|
+
},
|
|
192
|
+
median: {
|
|
193
|
+
stroke: u.mainDarkNavy,
|
|
194
|
+
strokeWidth: 2
|
|
195
|
+
}
|
|
196
|
+
};
|
|
197
|
+
return e.barSettings?.strokeEnabled ? (r.box.stroke = e.barSettings?.strokeColor || t.colors.brandColors[0], r.box.strokeWidth = e.barSettings?.strokeWidth) : r.box.stroke = u.transparent, {
|
|
198
|
+
type: I.Box,
|
|
199
|
+
layout: { displayOrder: C.VisualizationElement },
|
|
200
|
+
key: "min-max-box",
|
|
201
|
+
data: { collection: S.DotBarCollection },
|
|
202
|
+
settings: r,
|
|
203
|
+
animations: {
|
|
204
|
+
enabled: !0,
|
|
205
|
+
presetId: "bar-chart"
|
|
206
|
+
},
|
|
207
|
+
brush: Ae(n)
|
|
208
|
+
};
|
|
209
|
+
}
|
|
210
|
+
function $(e, t, r) {
|
|
211
|
+
let i = Me(J(e) * .9, e);
|
|
212
|
+
return {
|
|
213
|
+
type: I.Point,
|
|
214
|
+
key: "dot-point",
|
|
215
|
+
layout: { displayOrder: C.VisualizationElement },
|
|
216
|
+
data: { collection: S.DotPointsCollection },
|
|
217
|
+
settings: {
|
|
218
|
+
x: { scale: j(e, e.measures.filter((e) => l(e))[0]) },
|
|
219
|
+
y: {
|
|
220
|
+
scale: M(e),
|
|
221
|
+
fn: i
|
|
222
|
+
},
|
|
223
|
+
shape: n.Circle,
|
|
224
|
+
size: e.pointSize,
|
|
225
|
+
strokeWidth: 2,
|
|
226
|
+
opacity: .8,
|
|
227
|
+
fill: t,
|
|
228
|
+
id: ({ datum: e }) => `${e.group.value}::${e.value}`
|
|
229
|
+
},
|
|
230
|
+
animations: { enabled: !0 },
|
|
231
|
+
brush: Y(r)
|
|
232
|
+
};
|
|
233
|
+
}
|
|
234
|
+
function Fe(e, t, n) {
|
|
235
|
+
if (!e.refLines?.x) return n;
|
|
236
|
+
let r = e.refLines.x.map((e) => W(e, ce.XAxisScale, t)), i = {
|
|
237
|
+
type: I.RefLine,
|
|
238
|
+
layout: { displayOrder: C.RefLine },
|
|
239
|
+
lines: { x: r }
|
|
240
|
+
};
|
|
241
|
+
return {
|
|
242
|
+
...n,
|
|
243
|
+
components: [...n.components, i]
|
|
244
|
+
};
|
|
245
|
+
}
|
|
246
|
+
var Ie = /* @__PURE__ */ t(((e, t) => {
|
|
247
|
+
var n = m(), r = b(), a = g(), o = i(), s = n.isFinite, c = Math.min;
|
|
248
|
+
function l(e) {
|
|
249
|
+
var t = Math[e];
|
|
250
|
+
return function(e, n) {
|
|
251
|
+
if (e = a(e), n = n == null ? 0 : c(r(n), 292), n && s(e)) {
|
|
252
|
+
var i = (o(e) + "e").split("e");
|
|
253
|
+
return i = (o(t(i[0] + "e" + (+i[1] + n))) + "e").split("e"), +(i[0] + "e" + (+i[1] - n));
|
|
254
|
+
}
|
|
255
|
+
return t(e);
|
|
256
|
+
};
|
|
257
|
+
}
|
|
258
|
+
t.exports = l;
|
|
259
|
+
})), Le = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
|
|
260
|
+
t.exports = Ie()("round");
|
|
261
|
+
})))());
|
|
262
|
+
function Re(e, t, n) {
|
|
263
|
+
let r = e.measures.filter((e) => l(e))[0];
|
|
264
|
+
return A(e, t, n, {
|
|
265
|
+
filter: ze,
|
|
266
|
+
placement: {
|
|
267
|
+
type: "bounds",
|
|
268
|
+
area: "target"
|
|
269
|
+
},
|
|
270
|
+
extract: N(e, t, Be(r?.formatter), Ve)
|
|
271
|
+
}, "tooltip", void 0, {
|
|
272
|
+
componentKeys: ["dot-point"],
|
|
273
|
+
yieldToComponentKeys: ["min-max-box"]
|
|
274
|
+
});
|
|
275
|
+
}
|
|
276
|
+
function ze(e) {
|
|
277
|
+
if (e.length === 0) return [];
|
|
278
|
+
let t = e[0];
|
|
279
|
+
return ["dot-point", "min-max-box"].includes(t.key) ? [t] : [];
|
|
280
|
+
}
|
|
281
|
+
function Be(e) {
|
|
282
|
+
return (t, n, r, i, a, o, s, c) => {
|
|
283
|
+
if (n.key === "dot-point") {
|
|
284
|
+
let t = n.data.x.value;
|
|
285
|
+
return !c && e ? t = r.formatter(e)(t, void 0, n.data) : c && (t = r.formatter(G(e))(n.data.x.value, void 0, n.data)), [{
|
|
286
|
+
label: n.data.label,
|
|
287
|
+
value: t
|
|
288
|
+
}];
|
|
289
|
+
} else if (n.key === "min-max-box") {
|
|
290
|
+
let t = n.data.start.value, i = (0, Le.default)(n.data.med.value, 2), a = n.data.end.value;
|
|
291
|
+
return !c && e ? (t = r.formatter(e)(t), i = r.formatter(e)(i), a = r.formatter(e)(a)) : c && (t = r.formatter(G(e))(t), i = r.formatter(G(e))(i), a = r.formatter(G(e))(a)), [
|
|
292
|
+
{
|
|
293
|
+
label: "Min",
|
|
294
|
+
value: t
|
|
295
|
+
},
|
|
296
|
+
{
|
|
297
|
+
label: "Avg",
|
|
298
|
+
value: i
|
|
299
|
+
},
|
|
300
|
+
{
|
|
301
|
+
label: "Max",
|
|
302
|
+
value: a
|
|
303
|
+
}
|
|
304
|
+
];
|
|
305
|
+
}
|
|
306
|
+
return [];
|
|
307
|
+
};
|
|
308
|
+
}
|
|
309
|
+
function Ve(e) {
|
|
310
|
+
return e.filter((e) => l(e))[1]?.label ?? "";
|
|
311
|
+
}
|
|
312
|
+
var He = (e, t, n) => {
|
|
313
|
+
let r = e.dimensions.filter((e) => l(e)), i = e.measures.filter((e) => l(e)), o = {
|
|
314
|
+
showAxisTooltip: e?.axes?.dimension?.showAxisTooltip,
|
|
315
|
+
formatter: r[0]?.formatter || {
|
|
316
|
+
type: "string",
|
|
317
|
+
format: ""
|
|
318
|
+
},
|
|
319
|
+
scale: M(e),
|
|
320
|
+
key: `${w.Dimension}-${e.orientation ?? a.Vertical}`,
|
|
321
|
+
settings: { direction: x(e) }
|
|
322
|
+
}, s = i[0], [c, u] = se([o, {
|
|
323
|
+
showAxisTooltip: e?.axes?.primaryMeasure?.showAxisTooltip,
|
|
324
|
+
formatter: s?.formatter,
|
|
325
|
+
scale: j(e, s),
|
|
326
|
+
key: `${w.Measure}-${e.orientation ?? a.Vertical}`,
|
|
327
|
+
settings: {
|
|
328
|
+
direction: oe(e),
|
|
329
|
+
labelDock: V(P(e), s?.secondaryAxis)
|
|
330
|
+
}
|
|
331
|
+
}]);
|
|
332
|
+
return {
|
|
333
|
+
...n,
|
|
334
|
+
components: [...n.components ?? [], ...c],
|
|
335
|
+
interactions: [...n.interactions ?? [], ...u]
|
|
336
|
+
};
|
|
337
|
+
};
|
|
338
|
+
function Ue(e, t, n, r, i, a) {
|
|
339
|
+
let { components: o, interactions: s } = L(e, t, n, r, i, a);
|
|
340
|
+
if (!e.coloring || e.coloring.type === f.Single) return {
|
|
341
|
+
...n,
|
|
342
|
+
components: o,
|
|
343
|
+
interactions: s
|
|
344
|
+
};
|
|
345
|
+
let c = e.dimensions?.find((t) => e.coloring.fieldId === t.dataItem.internalKey), l = o.map((e) => (e.type === U.CategoricalLegend || e.type === U.SequentialLegend) && c ? {
|
|
346
|
+
...e,
|
|
347
|
+
brush: Y(a)
|
|
348
|
+
} : e);
|
|
349
|
+
return {
|
|
350
|
+
...n,
|
|
351
|
+
components: l,
|
|
352
|
+
interactions: s
|
|
353
|
+
};
|
|
354
|
+
}
|
|
355
|
+
var We = class extends B {
|
|
356
|
+
constructor() {
|
|
357
|
+
super([
|
|
358
|
+
be,
|
|
359
|
+
ve,
|
|
360
|
+
le,
|
|
361
|
+
me,
|
|
362
|
+
Ue,
|
|
363
|
+
de,
|
|
364
|
+
Ne,
|
|
365
|
+
Fe,
|
|
366
|
+
Re,
|
|
367
|
+
He,
|
|
368
|
+
pe
|
|
369
|
+
]);
|
|
370
|
+
}
|
|
371
|
+
}, Ge = te(), Ke = new We(), qe = ee(({ vSpec: e, vTheme: t, data: n, elementSize: i, vizProperties: a }) => {
|
|
372
|
+
let o = _(), { activeKey: s } = y(), l = ne(), u = {
|
|
373
|
+
...a,
|
|
374
|
+
valuePickerMode: !!s
|
|
375
|
+
}, d = t || c, f = Ke.compile(e, d, n, i, u, r.Dot, o, l, H());
|
|
376
|
+
return f ? /* @__PURE__ */ (0, Ge.jsx)(z, {
|
|
377
|
+
config: u,
|
|
378
|
+
definition: f,
|
|
379
|
+
size: i,
|
|
380
|
+
vSpec: e
|
|
381
|
+
}) : null;
|
|
382
|
+
});
|
|
383
|
+
export { qe as DotChart };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { o as e } from "./rolldown-runtime-DleVn1XH.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { Ko as t, Sa as n, eo as r, to as i } from "./isEqual-BDxAhUo8.js";
|
|
3
|
+
import { $t as a, Ei as o, G as s, W as c, Yi as l, d as u } from "./utils-Bg7K-t6K.js";
|
|
4
4
|
import { t as d } from "./stroke-dash-UgMEcCS4.js";
|
|
5
|
-
import {
|
|
6
|
-
var p = /* @__PURE__ */ e(
|
|
5
|
+
import { _ as f } from "./coloring-B1XAfg6b.js";
|
|
6
|
+
var p = /* @__PURE__ */ e(l()), m = (e) => e === i.Line || e === i.Elbow, h = {
|
|
7
7
|
shape: i.Square,
|
|
8
8
|
backgroundColor: { code: "#c4c4c4" },
|
|
9
9
|
backgroundType: "color",
|
|
@@ -13,36 +13,36 @@ var p = /* @__PURE__ */ e(o()), m = (e) => e === i.Line || e === i.Elbow, h = {
|
|
|
13
13
|
borderRadiusY: 0,
|
|
14
14
|
preserveAspectRatio: !0,
|
|
15
15
|
strokeColor: { code: "#8d8d8d" },
|
|
16
|
-
imageFit:
|
|
16
|
+
imageFit: r.Fill,
|
|
17
17
|
strokeDash: null,
|
|
18
18
|
imageURL: null,
|
|
19
19
|
scale: 1,
|
|
20
20
|
rotate: 0,
|
|
21
21
|
heightBasedSize: !1
|
|
22
|
-
}, g = (e,
|
|
23
|
-
let
|
|
24
|
-
(
|
|
25
|
-
let c =
|
|
26
|
-
|
|
27
|
-
let l =
|
|
22
|
+
}, g = (e, n) => {
|
|
23
|
+
let r = { ...e?.shapeSettings }, a = 0, o = 0, s = r?.borderEnabled ?? h.borderEnabled;
|
|
24
|
+
(r?.shape === i.Square || r?.shape === i.Rectangle) && r?.borderRadius && (a = r?.borderRadius, o = a, r?.preserveAspectRatio || (n?.width > n?.height ? o = (n?.width || 1) / (n?.height || 1) * o : a = (n?.height || 1) / (n?.width || 1) * a)), m(r?.shape) && (r.backgroundColor = { code: "none" }, s = !0);
|
|
25
|
+
let c = r?.rotate ?? h.rotate;
|
|
26
|
+
r?.shape === i.Line && r?.heightBasedSize && (c += 90);
|
|
27
|
+
let l = r?.borderStyle === t.Line ? void 0 : r?.strokeDash ?? h.strokeDash;
|
|
28
28
|
return {
|
|
29
|
-
backgroundType:
|
|
30
|
-
shape:
|
|
31
|
-
backgroundColor:
|
|
32
|
-
imageURL:
|
|
33
|
-
imageFit:
|
|
29
|
+
backgroundType: r?.backgroundType ?? "color",
|
|
30
|
+
shape: r?.shape ?? h.shape,
|
|
31
|
+
backgroundColor: r?.backgroundColor?.code ? r?.backgroundColor : h.backgroundColor,
|
|
32
|
+
imageURL: r?.imageURL ?? h.imageURL,
|
|
33
|
+
imageFit: r?.imageFit ?? h.imageFit,
|
|
34
34
|
strokeDash: l,
|
|
35
|
-
lineThickness:
|
|
35
|
+
lineThickness: r?.lineThickness ?? h.lineThickness,
|
|
36
36
|
borderEnabled: s,
|
|
37
|
-
strokeColor:
|
|
38
|
-
preserveAspectRatio:
|
|
39
|
-
scale:
|
|
37
|
+
strokeColor: r?.strokeColor?.code ? r?.strokeColor : h.strokeColor,
|
|
38
|
+
preserveAspectRatio: r?.preserveAspectRatio ?? h.preserveAspectRatio,
|
|
39
|
+
scale: r?.scale ?? h.scale,
|
|
40
40
|
rotate: c,
|
|
41
|
-
heightBasedSize:
|
|
41
|
+
heightBasedSize: r?.heightBasedSize ?? h.heightBasedSize,
|
|
42
42
|
borderRadiusX: a,
|
|
43
43
|
borderRadiusY: o
|
|
44
44
|
};
|
|
45
|
-
}, _ =
|
|
45
|
+
}, _ = o(), v = ({ ...e }) => /* @__PURE__ */ (0, _.jsx)("path", {
|
|
46
46
|
d: "M0,50 L70,40 L70,20 L100,50 L70,80 L70,60 Z",
|
|
47
47
|
vectorEffect: "non-scaling-stroke",
|
|
48
48
|
...e
|
|
@@ -93,7 +93,7 @@ var p = /* @__PURE__ */ e(o()), m = (e) => e === i.Line || e === i.Elbow, h = {
|
|
|
93
93
|
case i.Elbow: return b;
|
|
94
94
|
default: return C;
|
|
95
95
|
}
|
|
96
|
-
}, E =
|
|
96
|
+
}, E = s({
|
|
97
97
|
mainContainer: {
|
|
98
98
|
width: "100%",
|
|
99
99
|
height: "100%",
|
|
@@ -111,7 +111,7 @@ var p = /* @__PURE__ */ e(o()), m = (e) => e === i.Line || e === i.Elbow, h = {
|
|
|
111
111
|
height: "100%",
|
|
112
112
|
transition: "ease-in-out 300ms"
|
|
113
113
|
}
|
|
114
|
-
}), D = ({ patternId: e, imgUrl: t, onLoadCallback:
|
|
114
|
+
}), D = ({ patternId: e, imgUrl: t, onLoadCallback: n, imageFit: i = r.Fill }) => /* @__PURE__ */ (0, _.jsx)("defs", { children: /* @__PURE__ */ (0, _.jsx)("pattern", {
|
|
115
115
|
id: e,
|
|
116
116
|
viewBox: "0 0 1 1",
|
|
117
117
|
patternUnits: "objectBoundingBox",
|
|
@@ -125,19 +125,19 @@ var p = /* @__PURE__ */ e(o()), m = (e) => e === i.Line || e === i.Elbow, h = {
|
|
|
125
125
|
width: "1",
|
|
126
126
|
height: "1",
|
|
127
127
|
preserveAspectRatio: i,
|
|
128
|
-
onLoad:
|
|
129
|
-
onError:
|
|
128
|
+
onLoad: n,
|
|
129
|
+
onError: n
|
|
130
130
|
})
|
|
131
|
-
}) }), O =
|
|
132
|
-
let a =
|
|
131
|
+
}) }), O = a(({ vSpec: e, vTheme: t, elementSize: r }) => {
|
|
132
|
+
let a = t || n, o = g(e, r), s = E(), l = u(), h = T(o.shape), v = `${c()}-background-image-fill`, y = `${c()}-insideStroke`, b = f(a, o.backgroundColor?.code), x = f(a, o.strokeColor?.code), S = d(o.strokeDash), C = o.shape === i.Line ? o.lineThickness / 2 : o.lineThickness;
|
|
133
133
|
return (0, p.useEffect)(() => {
|
|
134
|
-
(!o.imageURL || o.backgroundType === "color") &&
|
|
134
|
+
(!o.imageURL || o.backgroundType === "color") && l();
|
|
135
135
|
}, []), /* @__PURE__ */ (0, _.jsx)("div", {
|
|
136
|
-
className:
|
|
136
|
+
className: s.mainContainer,
|
|
137
137
|
"data-testid": "shape-container",
|
|
138
138
|
children: /* @__PURE__ */ (0, _.jsxs)("svg", {
|
|
139
139
|
viewBox: "0 0 100 100",
|
|
140
|
-
className:
|
|
140
|
+
className: s.svg,
|
|
141
141
|
style: { transform: `rotate(${o.rotate ?? 0}deg) scale(${o.scale ?? 1})` },
|
|
142
142
|
preserveAspectRatio: o.preserveAspectRatio ? "" : "none",
|
|
143
143
|
children: [
|
|
@@ -145,11 +145,11 @@ var p = /* @__PURE__ */ e(o()), m = (e) => e === i.Line || e === i.Elbow, h = {
|
|
|
145
145
|
patternId: v,
|
|
146
146
|
imgUrl: o.imageURL,
|
|
147
147
|
imageFit: o.imageFit,
|
|
148
|
-
onLoadCallback: () =>
|
|
148
|
+
onLoadCallback: () => l()
|
|
149
149
|
}) : null,
|
|
150
150
|
/* @__PURE__ */ (0, _.jsx)("defs", { children: /* @__PURE__ */ (0, _.jsx)("clipPath", {
|
|
151
151
|
id: y,
|
|
152
|
-
className:
|
|
152
|
+
className: s.shapeGroup,
|
|
153
153
|
style: { opacity: o.opacity === void 0 ? 1 : o.opacity },
|
|
154
154
|
children: /* @__PURE__ */ (0, _.jsx)(h, {
|
|
155
155
|
rx: `${o.borderRadiusX ?? 0}px`,
|
|
@@ -157,7 +157,7 @@ var p = /* @__PURE__ */ e(o()), m = (e) => e === i.Line || e === i.Elbow, h = {
|
|
|
157
157
|
})
|
|
158
158
|
}) }),
|
|
159
159
|
/* @__PURE__ */ (0, _.jsx)("g", {
|
|
160
|
-
className:
|
|
160
|
+
className: s.shapeGroup,
|
|
161
161
|
style: { opacity: o.opacity === void 0 ? 1 : o.opacity },
|
|
162
162
|
fill: o.imageURL && o.backgroundType === "image" ? `url(#${v})` : b,
|
|
163
163
|
stroke: x,
|