@astrato-io/visualizations 0.6.4 → 0.7.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.
Files changed (220) hide show
  1. package/CHANGELOG.md +0 -0
  2. package/README.md +32 -2
  3. package/THIRD_PARTY_NOTICES.md +68 -205
  4. package/VISUALIZATION_DEFINITIONS.md +68 -114
  5. package/chunks/Button-BrGKp9Nm.js +110 -0
  6. package/chunks/DefaultPropsProvider-BsfB7QTn.js +257 -0
  7. package/chunks/FieldTypeIcon-Drs6hSJF.js +22 -0
  8. package/chunks/{LinearProgress-CUZ0D8_t.js → LinearProgress-VtfFx2vJ.js} +51 -51
  9. package/chunks/MenuOption-ByRqhRdX.js +3934 -0
  10. package/chunks/Title-CO5dP1ma.js +1691 -0
  11. package/chunks/ToggleButton-KOBAimC1.js +112 -0
  12. package/chunks/app-filter-bar.compiler-TwVTeoj5.js +64 -0
  13. package/chunks/bar.compiler-DuQg8EUb.js +374 -0
  14. package/chunks/builder-DEDvNq1k.js +201 -0
  15. package/chunks/{color-settings-ZIvgNTq1.js → color-rules-CN7TcGrC.js} +2 -6
  16. package/chunks/color-settings-3VRlf_Vw.js +6 -0
  17. package/chunks/colorManipulator-D8Pjy1pf.js +45 -0
  18. package/chunks/coloring-CncX_JRX.js +278 -0
  19. package/chunks/{src-BC7cGcJ-.js → definitions-BPJQTx16.js} +650 -464
  20. package/chunks/{escobar-BGqT1EsE.js → escobar-DRhRMYRE.js} +6282 -4931
  21. package/chunks/event-bus-CrLB-Y8z.js +3 -0
  22. package/chunks/extend-preset-CUFNpmPe.js +4398 -0
  23. package/chunks/filter.compiler-w27dlv0C.js +70 -0
  24. package/chunks/filtering-cc7WqWpg.js +1153 -0
  25. package/chunks/handlers-TOT-7INo.js +12871 -0
  26. package/chunks/icon-picker-styles-CoJmwTRi.js +2246 -0
  27. package/chunks/isEqual-B8loyPsC.js +12 -0
  28. package/chunks/label-format-type-weq1XfcX.js +8 -0
  29. package/chunks/line.compiler-Ct1WhN2p.js +198 -0
  30. package/chunks/logger-DpQtYQnX.js +1163 -0
  31. package/chunks/lookup-BWllin0q.js +36 -0
  32. package/chunks/{metadata-CPXdYoln.js → metadata-WABZrt7Y.js} +1 -1
  33. package/chunks/number.compiler-D8TPly-4.js +53 -0
  34. package/chunks/{src-C0LgoUWY.js → operations-Dh4v1Ovt.js} +7716 -7541
  35. package/chunks/{range-DrzdfBX4.js → range-Bi-7zT0k.js} +2 -2
  36. package/chunks/registry-KervaxqJ.js +31 -0
  37. package/chunks/render-wrappers-OEmtaM8g.js +2 -0
  38. package/chunks/{registry-CExpGJ1N.js → requirements-PAoRaJyb.js} +294 -326
  39. package/chunks/responsive.styles-DSiOGD7u.js +82 -0
  40. package/chunks/shared-Bn4N5QcZ.js +1218 -0
  41. package/chunks/src-77e3mC7i.js +391 -0
  42. package/chunks/standalone-B55oyW6c.js +689 -0
  43. package/chunks/{standalone-CY57qwZ-.js → standalone-BDhPQtzQ.js} +386 -352
  44. package/chunks/{standalone-BDCwI6Hn.js → standalone-BGkmozIb.js} +1108 -953
  45. package/chunks/standalone-BMTCb10X.js +179 -0
  46. package/chunks/standalone-BXKRE_Se.js +468 -0
  47. package/chunks/standalone-Bes8srx1.js +354 -0
  48. package/chunks/standalone-BjZp0QMe.js +2 -0
  49. package/chunks/{standalone-BH5NqDwp.js → standalone-BlMIwpEe.js} +687 -573
  50. package/chunks/{standalone-CCNtaJ7s.js → standalone-C8ZAEutO.js} +44 -43
  51. package/chunks/standalone-C8qAelL4.js +2 -0
  52. package/chunks/standalone-CJvIXsQE.js +743 -0
  53. package/chunks/standalone-CLmGb7nn2.js +355 -0
  54. package/chunks/{ui-D1HQNIBy.js → standalone-CM5XcAN5.js} +15946 -17658
  55. package/chunks/standalone-CXNP6-xD.js +420 -0
  56. package/chunks/{standalone-BYm1UjLr.js → standalone-D5Q5ngsD.js} +59 -57
  57. package/chunks/standalone-DLlyRIE6.js +287 -0
  58. package/chunks/standalone-DMcI1afI.js +396 -0
  59. package/chunks/{standalone-jiz0L2Dg.js → standalone-DN4S1MjT.js} +1113 -1094
  60. package/chunks/{standalone-QJ1kKMnO.js → standalone-DT0wKji7.js} +2 -2
  61. package/chunks/{standalone-D5vnf-9y.js → standalone-DVTJwsTY.js} +1110 -1035
  62. package/chunks/standalone-DW6NT205.js +518 -0
  63. package/chunks/standalone-DYQIQH4c.js +2095 -0
  64. package/chunks/standalone-D__XCp-h.js +1003 -0
  65. package/chunks/standalone-XTgSsTAa.js +354 -0
  66. package/chunks/standalone-XuGksArp.js +68 -0
  67. package/chunks/{standalone-CNyNHKVx.js → standalone-we5D5MIn.js} +176 -172
  68. package/chunks/table.compiler-DMeeHxb6.js +222 -0
  69. package/chunks/useFieldName-Cjn9KCVp.js +7 -0
  70. package/chunks/useSlotProps-DLbQp4lc.js +166 -0
  71. package/chunks/{utils-Ba9T0TqC.js → utils-vdmi_2PK.js} +6266 -6517
  72. package/chunks/{src-DvX5LU9T.js → view-BuwQugKb.js} +2893 -5956
  73. package/chunks/visualization-filters-Cc4KU-l-.js +7455 -0
  74. package/chunks/web-components-DqClFkgO.js +1185 -0
  75. package/chunks/with-html-element-D0uY2zjI.js +7328 -0
  76. package/definitions.js +3 -3
  77. package/docs/operations/astrato-app-filter-bar.md +17 -17
  78. package/docs/operations/bar.md +1006 -1071
  79. package/docs/operations/combo.md +717 -738
  80. package/docs/operations/date-picker.md +27 -27
  81. package/docs/operations/distribution-gauge.md +471 -607
  82. package/docs/operations/dot.md +787 -879
  83. package/docs/operations/filter.md +139 -163
  84. package/docs/operations/gauge.md +491 -627
  85. package/docs/operations/heatMap.md +834 -916
  86. package/docs/operations/histogram.md +166 -180
  87. package/docs/operations/iframe.md +5 -5
  88. package/docs/operations/image.md +16 -16
  89. package/docs/operations/index.md +12 -12
  90. package/docs/operations/line.md +811 -888
  91. package/docs/operations/number.md +470 -536
  92. package/docs/operations/pie.md +825 -958
  93. package/docs/operations/radar.md +599 -679
  94. package/docs/operations/sankey.md +462 -584
  95. package/docs/operations/scatter.md +823 -929
  96. package/docs/operations/shape.md +34 -34
  97. package/docs/operations/simpleTextObject.md +18 -25
  98. package/docs/operations/slider.md +33 -43
  99. package/docs/operations/table.md +1177 -1150
  100. package/docs/operations/tree.md +404 -397
  101. package/docs/operations/treemap.md +595 -673
  102. package/docs/operations/waterfall.md +369 -379
  103. package/docs/operations/word-cloud.md +512 -583
  104. package/getters.js +7 -7
  105. package/index.js +3 -1183
  106. package/metadata.js +18 -18
  107. package/operations.js +13 -13
  108. package/package.json +133 -88
  109. package/render.js +10 -0
  110. package/src/charts/bar.d.ts +1 -0
  111. package/src/charts/combo.d.ts +1 -0
  112. package/src/charts/dot.d.ts +1 -0
  113. package/src/charts/gauge-distribution.d.ts +1 -0
  114. package/src/charts/gauge.d.ts +1 -0
  115. package/src/charts/heat-map.d.ts +1 -0
  116. package/src/charts/histogram.d.ts +1 -0
  117. package/src/charts/line.d.ts +1 -0
  118. package/src/charts/pie.d.ts +1 -0
  119. package/src/charts/radar.d.ts +1 -0
  120. package/src/charts/sankey.d.ts +1 -0
  121. package/src/charts/scatter.d.ts +1 -0
  122. package/src/charts/table.d.ts +1 -0
  123. package/src/charts/tree.d.ts +1 -0
  124. package/src/charts/treemap.d.ts +1 -0
  125. package/src/charts/waterfall.d.ts +1 -0
  126. package/src/charts/word-cloud.d.ts +1 -0
  127. package/src/definitions/index.d.ts +2 -2
  128. package/src/definitions/{shared/lib → model/definitions}/available-fields.d.ts +0 -1
  129. package/src/definitions/{shared/lib/compilers/index.d.ts → model/definitions/compilers/compile.d.ts} +1 -1
  130. package/src/definitions/model/definitions/data-item-resolution.d.ts +19 -0
  131. package/src/definitions/model/definitions/descriptors/descriptor-metadata.d.ts +1364 -0
  132. package/src/definitions/model/definitions/descriptors/json-schema.d.ts +2 -0
  133. package/src/definitions/model/definitions/diagnostics.d.ts +5 -0
  134. package/src/definitions/model/definitions/field-suggestions.d.ts +2 -0
  135. package/src/definitions/model/definitions/index.d.ts +23 -0
  136. package/src/definitions/{shared/lib → model/definitions}/registry/compile.d.ts +1 -1
  137. package/src/definitions/model/definitions/registry/descriptor-registry.d.ts +3 -0
  138. package/src/definitions/model/definitions/schema-registry.d.ts +660 -0
  139. package/src/definitions/{shared/lib → model/definitions}/schemas/broad-chart.schema.d.ts +1 -1
  140. package/src/definitions/{shared/lib → model/definitions}/schemas/common.schema.d.ts +0 -1
  141. package/src/definitions/model/definitions/schemas/index.d.ts +9 -0
  142. package/src/definitions/{shared/lib → model/definitions}/schemas/object.schema.d.ts +8 -8
  143. package/src/definitions/{shared/lib → model/definitions}/types/compilation.types.d.ts +10 -0
  144. package/src/definitions/{shared/lib → model/definitions}/types/definition.types.d.ts +1 -1
  145. package/src/definitions/model/definitions/types/index.d.ts +3 -0
  146. package/src/definitions/{shared/lib/registry → model/definitions}/validation.d.ts +1 -1
  147. package/src/getters/index.d.ts +3 -3
  148. package/src/index.d.ts +1 -1
  149. package/src/objects/app-filter-bar.d.ts +1 -0
  150. package/src/objects/date-picker.d.ts +1 -0
  151. package/src/objects/filter.d.ts +1 -0
  152. package/src/objects/iframe.d.ts +1 -0
  153. package/src/objects/image.d.ts +1 -0
  154. package/src/objects/number.d.ts +1 -0
  155. package/src/objects/shape.d.ts +1 -0
  156. package/src/objects/slider.d.ts +1 -0
  157. package/src/objects/text.d.ts +1 -0
  158. package/src/operations/index.d.ts +3 -3
  159. package/src/registry/create-visualization-registry.d.ts +5 -0
  160. package/src/render/index.d.ts +34 -0
  161. package/src/runtime/index.d.ts +2 -2
  162. package/src/types.d.ts +9 -4
  163. package/src/web-components/index.d.ts +3 -3
  164. package/chunks/Radio-Ciu-F4CU.js +0 -957
  165. package/chunks/ToggleButton-BCJc3Jlc.js +0 -153
  166. package/chunks/_baseFlatten-DPXPOrea.js +0 -7076
  167. package/chunks/app-filter-bar.compiler-j_CVoWTa.js +0 -55
  168. package/chunks/bar.compiler-oqaPzIut.js +0 -370
  169. package/chunks/coloring-C16AUZEi.js +0 -663
  170. package/chunks/data-item-resolution-1lvYB5ln.js +0 -53
  171. package/chunks/event-bus-KiSiCJrC.js +0 -2683
  172. package/chunks/events-WZut5Ow6.js +0 -4
  173. package/chunks/filter.compiler-CuLtc_02.js +0 -60
  174. package/chunks/filtering-Yq4DEa0t.js +0 -953
  175. package/chunks/gauge-target-type-BkKXAqkX.js +0 -4
  176. package/chunks/grouping-type-BX_9Ix5q.js +0 -3
  177. package/chunks/interfaces-VUY4_yVO.js +0 -8742
  178. package/chunks/line-settings-DfYTUyPz.js +0 -4
  179. package/chunks/line.compiler-BpA_6Tc7.js +0 -188
  180. package/chunks/number.compiler-DbkWcG4S.js +0 -44
  181. package/chunks/pie-uv42Eqal.js +0 -10
  182. package/chunks/requirements-DNhuShLS.js +0 -6
  183. package/chunks/shared-CKDL4hx9.js +0 -1171
  184. package/chunks/src-Cum_2NLV.js +0 -12145
  185. package/chunks/src-Dun_jXtz.js +0 -10295
  186. package/chunks/standalone-87YV_m9n.js +0 -687
  187. package/chunks/standalone-BLVAWLNJ.js +0 -385
  188. package/chunks/standalone-BPomtAVs.js +0 -2
  189. package/chunks/standalone-BXyBcUOQ.js +0 -2
  190. package/chunks/standalone-BllF4rDp.js +0 -383
  191. package/chunks/standalone-BmfMt74U.js +0 -726
  192. package/chunks/standalone-BqWyrnZI.js +0 -281
  193. package/chunks/standalone-C85u7U6I.js +0 -340
  194. package/chunks/standalone-CDQnr6qT.js +0 -345
  195. package/chunks/standalone-CZynjFG7.js +0 -12979
  196. package/chunks/standalone-DFPva_ku.js +0 -299
  197. package/chunks/standalone-DQxxNwF8.js +0 -675
  198. package/chunks/standalone-DS9T0FZ-.js +0 -830
  199. package/chunks/standalone-Dx3MLlrO.js +0 -512
  200. package/chunks/standalone-DzixzZAL.js +0 -411
  201. package/chunks/standalone-lBm9hQ-q.js +0 -179
  202. package/chunks/standalone-rJ45Zfl1.js +0 -68
  203. package/chunks/table.compiler-BrXkm4Fz.js +0 -213
  204. package/chunks/toInteger-DVZr-D1j.js +0 -11
  205. package/chunks/treemap-x_zmJoG7.js +0 -23
  206. package/chunks/types-dVVCsDWD.js +0 -4
  207. package/chunks/useFieldName-oqQ3bvnO.js +0 -7
  208. package/chunks/view-CLqWMV7Z.js +0 -156
  209. package/src/definitions/shared/index.d.ts +0 -5
  210. package/src/definitions/shared/lib/registry/descriptor-registry.d.ts +0 -587
  211. package/src/definitions/shared/lib/registry/index.d.ts +0 -3
  212. package/src/definitions/shared/lib/schemas/index.d.ts +0 -9
  213. package/src/definitions/shared/lib/types/index.d.ts +0 -3
  214. package/src/definitions/{shared/lib → model/definitions}/schemas/app-filter-bar.schema.d.ts +0 -0
  215. package/src/definitions/{shared/lib → model/definitions}/schemas/bar.schema.d.ts +0 -0
  216. package/src/definitions/{shared/lib → model/definitions}/schemas/filter.schema.d.ts +0 -0
  217. package/src/definitions/{shared/lib → model/definitions}/schemas/line.schema.d.ts +0 -0
  218. package/src/definitions/{shared/lib → model/definitions}/schemas/number.schema.d.ts +0 -0
  219. package/src/definitions/{shared/lib → model/definitions}/schemas/table.schema.d.ts +4 -4
  220. /package/src/definitions/{shared/lib → model/definitions}/types/descriptor.types.d.ts +0 -0
@@ -1,411 +0,0 @@
1
- import { o as e } from "./rolldown-runtime-DleVn1XH.js";
2
- import { Do as t, Eo as n, La as r, No as i, Ta as a, Ti as o, Xa as s, Xs as c, Ya as l, pc as u, qs as d, ti as f, yn as p } from "./interfaces-VUY4_yVO.js";
3
- import { I as m, Ki as h, P as g, R as _, W as v, Zt as y, fn as b, wi as x, xn as S } from "./utils-Ba9T0TqC.js";
4
- import { Rn as C, zn as w } from "./event-bus-KiSiCJrC.js";
5
- import { a as T } from "./src-Cum_2NLV.js";
6
- import { At as E, Bt as D, It as ee, Jt as te, M as ne, Mt as re, Nt as ie, Ot as O, Qt as k, St as ae, Wt as A, X as j, Yt as M, gt as N, ht as P, i as oe, in as F, j as se, nn as I, qt as L, t as ce, un as R, zt as z } from "./escobar-BGqT1EsE.js";
7
- import { t as B } from "./coloring-C16AUZEi.js";
8
- import { t as V } from "./debounce-fn-CUixuz45.js";
9
- import { t as H } from "./set-coloring-datafield-B3uIS1Pe.js";
10
- var U = 100, W = (e, t, n) => {
11
- let r = e.element.getBoundingClientRect(), i = {
12
- x: t.clientX - r.left,
13
- y: t.clientY - r.top
14
- };
15
- return e.chart?.shapesAt(i, {
16
- components: [{
17
- key: n,
18
- opts: { propagation: "stop" }
19
- }],
20
- propagation: "stop"
21
- })?.[0];
22
- }, G = (e, t) => {
23
- let n = null, r = V((r, i) => {
24
- let a = W(r, i, e);
25
- !a && n && (t(e, "mouseleave", n.key, i, n), n = null), a?.data?._ID && n?.data?._ID && a.data._ID !== n.data._ID && (t(e, "mouseleave", n.key, i, n), n = null), a && (t(e, "mousemove", a.key, i, a), n = a);
26
- }, U), i = V((r) => {
27
- n &&= (t(e, "mouseleave", n.key, r, n), null);
28
- }, U);
29
- return {
30
- type: "native",
31
- key: "action-events-interaction",
32
- events: {
33
- click(n) {
34
- let r = W(this, n, e);
35
- r && t(e, "click", r.key, n, r);
36
- },
37
- mousemove(e) {
38
- r(this, e);
39
- },
40
- mouseleave(e) {
41
- i(e);
42
- }
43
- }
44
- };
45
- }, K = /* @__PURE__ */ e(h()), le = t.Rectangle, q = (e) => ({
46
- shape: e?.heatMapSettings?.shape ?? le,
47
- minSize: e?.heatMapSettings?.minSize ?? .1,
48
- maxSize: e?.heatMapSettings?.maxSize ?? 1
49
- }), ue = (e, t, n, r, i, a, o, s) => {
50
- let c = [], { shape: l } = q(e), u = `${R.Point}-${l}`;
51
- if ((e?.enableEmitEvents ?? !1) && s) {
52
- let e = G(u, s);
53
- c.push(e);
54
- }
55
- return {
56
- ...n,
57
- interactions: n.interactions ? [...n.interactions, ...c] : [...c]
58
- };
59
- }, de = (e, t, n) => {
60
- let r = e.dimensions.filter(o), i = r.filter((e) => e.role === l.HEAT_MAP_HORIZONTAL), a = r.filter((e) => e.role === l.HEAT_MAP_VERTICAL), s = i[0], c = a[0], [u, d] = ie([{
61
- showAxisTooltip: e?.axes?.dimension?.showAxisTooltip,
62
- formatter: s?.formatter,
63
- scale: M(e),
64
- key: O.Dimension,
65
- settings: { direction: E(e) }
66
- }, {
67
- showAxisTooltip: e?.axes?.secondaryDimension?.showAxisTooltip,
68
- formatter: c?.formatter,
69
- scale: k.YAxisScale,
70
- key: O.DimensionSec,
71
- settings: {
72
- direction: re(e),
73
- isVerticalDimension: !0
74
- }
75
- }]);
76
- return {
77
- ...n,
78
- components: [...n.components ?? [], ...u],
79
- interactions: [...n.interactions ?? [], ...d]
80
- };
81
- }, fe = (e, t, n, a, s, c, u, d) => {
82
- let p = [], m = [], h = [];
83
- if (d) {
84
- let e = ee(R.Text, d);
85
- h.push(e);
86
- }
87
- let g = e.dimensions.filter((e) => e.role === l.HEAT_MAP_HORIZONTAL), _ = g.filter(o), v = e.dimensions.filter((e) => e.role === l.HEAT_MAP_VERTICAL), y = v.filter(o), b = {
88
- ...t.axis.dimension,
89
- ...t.fonts
90
- }, x = {
91
- ...t.axis.measure,
92
- ...t.fonts
93
- }, S = _[0], C = y[0], w = e.measures.filter((e) => e.role === r.HEAT_MAP_COLOR), T = w.filter(o), E = {};
94
- if (S) {
95
- let t = e.axes?.dimension || E, n = t.secondaryAxis ? i.Top : i.Bottom;
96
- if (p.push(z(k.XAxisScale, t, b, n, S.formatter, c)), t.showAxisName) {
97
- let r = f(g, e.enableAlternate, c?.isPrintMode);
98
- m.push(D(_, r, n, b, t.colors?.title, t.axisTitle ? t.axisTitle : L(S, u), t.titleFontSize));
99
- }
100
- }
101
- if (C) {
102
- let t = e.axes?.secondaryDimension || E, n = t.secondaryAxis ? i.Right : i.Left;
103
- if (p.push(z(k.YAxisScale, t, b, n, C.formatter, c)), t.showAxisName) {
104
- let r = f(v, e.enableAlternate, c?.isPrintMode);
105
- m.push(D(y, r, n, b, t.colors?.title, t.axisTitle ? t.axisTitle : L(C, u), t.titleFontSize));
106
- }
107
- }
108
- if (w.length > 1) {
109
- let t = e.axes?.primaryMeasure || {}, n = f(w, e.enableAlternate, c?.isPrintMode);
110
- m.push(D(T, n, i.Right, x, t.colors?.title, t.axisTitle, t.titleFontSize));
111
- }
112
- return {
113
- ...n,
114
- components: [
115
- ...n.components,
116
- ...p,
117
- ...m
118
- ],
119
- interactions: n.interactions ? [...n.collections, ...h] : [...h]
120
- };
121
- }, pe = /* @__PURE__ */ e(p()), me = (e) => (t, n) => t.value === e ? -1 : +(n.value === e), he = (e) => (t, n) => t.value === e ? 1 : n.value === e ? -1 : 0, J = (e, t = 0) => (n, r) => {
122
- let i = e ? n[e] : n, a = e ? r[e] : r;
123
- return i.value !== a.value && i.value === null ? -t : i.value !== a.value && a.value === null ? t : i.value === a.value ? 0 : i.value < a.value ? -t : t;
124
- }, ge = (e) => (t, n) => {
125
- let r = 0;
126
- for (let i = 0; i < e.length; i++) if (r = e[i](t, n), r !== 0) return r;
127
- return r;
128
- }, _e = (e) => [
129
- "SUM",
130
- "MIN",
131
- "MAX",
132
- "AVG"
133
- ].includes(e.aggregation?.funcName) ? e.aggregation?.funcName.toLowerCase() : e.aggregation?.funcName === "COUNT" ? "sum" : "avg", Y = (e, t, r) => {
134
- let i = r?.sortingOrder.findIndex((t) => u(t.dataItem) === u(e));
135
- if (i < 0) return;
136
- let a = r?.sortingOrder[i], o = r?.sortingOrder.slice(0, i).filter((e) => e.fieldType === "measure");
137
- if (a) {
138
- let e, i = [];
139
- r?.topN?.enabled && r.topN.showOthers && ((0, pe.default)(r.topN.dimensionIdx) || r.topN.dimensionIdx === t) && (e = r.topN.othersPosition === w.First ? me(r.topN.othersLabel?.stringLabel ?? "Others") : r.topN.othersPosition === w.Last ? he(r.topN.othersLabel?.stringLabel ?? "Others") : void 0, e && i.push(e));
140
- let s = {};
141
- return o.forEach((e, t) => {
142
- let r = `m${t}`;
143
- i.push(J(r, e.sortDirection === n.Asc ? 1 : -1)), s[r] = {
144
- field: u(e.dataItem),
145
- reduce: _e(e.dataItem)
146
- };
147
- }), i.push(J("", a.sortDirection === n.Asc ? 1 : -1)), {
148
- props: s,
149
- sort: ge(i)
150
- };
151
- }
152
- }, ve = (e, t, n) => {
153
- let i = e.dimensions.filter(o), a = e.measures.filter(o), s = i.filter((e) => e.role === l.HEAT_MAP_HORIZONTAL), d = i.filter((e) => e.role === l.HEAT_MAP_VERTICAL), f = a.filter((e) => e.role === r.HEAT_MAP_COLOR), p = a.filter((e) => e.role === r.HEAT_MAP_SIZE), m = s[0], h = d[0], g = f[0], _ = p[0], { coloring: v } = e || {}, y = v?.fieldId;
154
- e.coloring?.type === c.Gradient && (y ||= u(g.dataItem)), y && P(n, 0, { color: { field: y } });
155
- let b = ae(H(e, y), t, {});
156
- if (m) {
157
- let t = Y(m.dataItem, 0, e.querySettings);
158
- b[k.XAxisScale] = {
159
- data: {
160
- extract: {
161
- field: u(m.dataItem),
162
- trackBy: (e) => e,
163
- reduce: "first",
164
- props: t?.props
165
- },
166
- sort: t?.sort
167
- },
168
- type: F.Band
169
- };
170
- }
171
- if (h) {
172
- let t = Y(h.dataItem, 1, e.querySettings);
173
- b[k.YAxisScale] = {
174
- data: {
175
- extract: {
176
- field: u(h.dataItem),
177
- trackBy: (e) => e,
178
- reduce: "first",
179
- props: t?.props
180
- },
181
- sort: t?.sort
182
- },
183
- type: F.Band
184
- };
185
- }
186
- let x = u(g.dataItem);
187
- if (b[x] = { data: { field: x } }, _) {
188
- let e = u(_.dataItem);
189
- b[e] = {
190
- type: F.Linear,
191
- data: { extract: { field: e } }
192
- };
193
- }
194
- return {
195
- ...n,
196
- scales: b
197
- };
198
- }, X = /* @__PURE__ */ function(e) {
199
- return e.measure = "measure", e.group = "group", e.size = "size", e;
200
- }({}), ye = (e, t, n) => {
201
- let i = e.dimensions.filter(o), a = e.measures.filter(o), s = ne((e.supportingMeasures ?? []).filter(o)), c = i.filter((e) => e.role === l.HEAT_MAP_HORIZONTAL), d = i.filter((e) => e.role === l.HEAT_MAP_VERTICAL), f = a.filter((e) => e.role === r.HEAT_MAP_COLOR), p = a.filter((e) => e.role === r.HEAT_MAP_SIZE);
202
- if (!i.length) return n;
203
- let m = c[0], h = d[0], g = f[0], _ = p[0], v = u(g?.dataItem), y = u(_?.dataItem), b = u(m?.dataItem), x = u(h?.dataItem), S = [{
204
- key: k.Collection,
205
- data: { extract: [{
206
- field: b,
207
- props: {
208
- measure: { field: v },
209
- group: { field: x },
210
- size: _ ? { field: y } : void 0,
211
- secondColorOverwrite: { field: x },
212
- ...s
213
- }
214
- }] }
215
- }];
216
- return v && (S[0].data.extract[0].props[v] = { field: v }), y && (S[0].data.extract[0].props[y] = { field: y }), {
217
- ...n,
218
- collections: S
219
- };
220
- }, Z = (e, t, n, i, a, s) => {
221
- let l = e.measures.filter(o), d = l.filter((e) => e.role === r.HEAT_MAP_COLOR), f = l.filter((e) => e.role === r.HEAT_MAP_SIZE), p = d[0], m = f[0], { shape: h, minSize: g, maxSize: _ } = q(e), v = _;
222
- m && (v = (e) => e.resources.scale(u(m.dataItem))(e.datum.size.value) * (_ - g) + g);
223
- let y = new B(e, t, a?.[0]?.itemsNotAffectedByFiltering), b = {
224
- type: R.Point,
225
- key: `${R.Point}-${h}`,
226
- data: { collection: k.Collection },
227
- settings: {
228
- x: { scale: k.XAxisScale },
229
- y: {
230
- scale: k.YAxisScale,
231
- ref: X.group
232
- },
233
- fill: y.getColorDefinition({
234
- ref: "color",
235
- overwriteSources: [
236
- y.MAIN_FIELD,
237
- "secondColorOverwrite",
238
- "color"
239
- ],
240
- dataItemId: e.coloring?.type === c.Single ? u(p?.dataItem) : null
241
- }),
242
- shape: h,
243
- size: v
244
- },
245
- animations: {
246
- enabled: !0,
247
- presetId: "simple-opacity"
248
- },
249
- brush: A(["", X.group], s)
250
- };
251
- return {
252
- ...n,
253
- components: [...n.components, b]
254
- };
255
- }, Q = {
256
- top: 0,
257
- bottom: 0,
258
- left: 2,
259
- right: 2
260
- }, be = (e, t, n, r) => {
261
- let i;
262
- return u(e.dataItem) === u(n.dataItem) ? i = r?.measure : u(t.dataItem) === u(n.dataItem) && (i = r?.size), i ? i.value === null ? "-" : i.label ?? "" : "";
263
- }, xe = (e, t, n, r) => {
264
- if (u(e.dataItem) === u(n.dataItem)) return r.measure?.value;
265
- if (u(t.dataItem) === u(n.dataItem)) return r.size?.value;
266
- }, Se = (e, n, i) => {
267
- let a, c = e.measures.filter(o), l = c.filter((e) => e.role === r.HEAT_MAP_COLOR), u = c.filter((e) => e.role === r.HEAT_MAP_SIZE), d = l[0], f = u[0], { shape: p } = q(e), m;
268
- switch (p) {
269
- case t.Circle:
270
- m = I.Circle;
271
- break;
272
- case t.Square:
273
- case t.Rectangle:
274
- case t.Bar:
275
- m = I.Rect;
276
- break;
277
- default: m = I.Path;
278
- }
279
- if (d?.dataLabels?.show) a = d;
280
- else if (f?.dataLabels?.show) a = f;
281
- else return i;
282
- let h = {
283
- type: R.Labels,
284
- key: "heat-map-label",
285
- settings: { sources: [{
286
- component: `${R.Point}-${p}`,
287
- selector: m,
288
- strategy: {
289
- type: "bar",
290
- settings: {
291
- direction: "right",
292
- fontFamily: n.fonts.general.fontFamily,
293
- fontSize: te(a.dataLabels?.size),
294
- labels: [{
295
- label({ data: e, formatter: t }) {
296
- if (!e) return "";
297
- let n = be(d, f, a, e);
298
- if (s(a.formatter)) {
299
- let t = xe(d, f, a, e);
300
- return t === null ? "-" : t === void 0 ? "" : b(a.formatter.format, a.formatter)(t, void 0, e);
301
- }
302
- return a.formatter && t && n && n !== "-" ? t(a.formatter)(n) : n;
303
- },
304
- placements: [{
305
- position: C.Inside,
306
- fill: "#fff",
307
- align: .5,
308
- justify: .5,
309
- padding: Q
310
- }, {
311
- position: C.Inside,
312
- fill: "#000",
313
- align: .5,
314
- justify: .5,
315
- padding: Q
316
- }]
317
- }]
318
- }
319
- }
320
- }] },
321
- animations: {
322
- enabled: !0,
323
- presetId: "chart-labels"
324
- }
325
- };
326
- return {
327
- ...i,
328
- components: [...i?.components ?? [], h]
329
- };
330
- }, Ce = (e, t, n) => {
331
- let { shape: r } = q(e), i = `${R.Point}-${r}`;
332
- return j(e, t, n, {
333
- filter: (e) => e.filter((e) => e.key === i),
334
- placement: {
335
- type: "pointer",
336
- area: "target"
337
- }
338
- });
339
- }, we = class extends se {
340
- constructor() {
341
- super([
342
- ye,
343
- ve,
344
- fe,
345
- Z,
346
- N,
347
- Ce,
348
- Se,
349
- de,
350
- ue
351
- ]);
352
- }
353
- preCompile(e) {
354
- let t = e.dimensions.filter(o), n = e.measures.filter(o), i = t.filter((e) => e.role === l.HEAT_MAP_HORIZONTAL), a = t.filter((e) => e.role === l.HEAT_MAP_VERTICAL), s = n.filter((e) => e.role === r.HEAT_MAP_COLOR), c = i[0], u = a[0], d = s[0];
355
- if (!c || !u || !d) throw Error("Charts w/o horizontal or vertical dimension or color measure are not supported ATM.");
356
- }
357
- }, Te = ({ id: e, clientX: t, clientY: n, vBackendAPI: r, ...i }) => {
358
- let { top: a, left: o } = r.daedalus.convertCoordinatesToContainerPosition(t, n);
359
- T({
360
- id: e,
361
- top: a,
362
- left: o,
363
- ...i
364
- }, { vBackendAPI: r });
365
- }, $ = (e, t, n, r, i) => {
366
- let a, o, [s, c, l, d] = r, f = s.name, p = c.name, m = l.name, h = n.data.value, g = n.data.group.value, _ = n.data.measure.value;
367
- if (d) {
368
- let e = u(d);
369
- a = n.data[e].value, o = d.name;
370
- }
371
- Te({
372
- id: e,
373
- clientX: t.clientX,
374
- clientY: t.clientY,
375
- xAxisValue: h,
376
- yAxisValue: g,
377
- measureColorValue: _,
378
- measureSizeValue: a,
379
- xAxisName: f,
380
- yAxisName: p,
381
- measureColorName: m,
382
- measureSizeName: o,
383
- vBackendAPI: i
384
- });
385
- }, Ee = (e) => T({ id: "onCellLeave" }, { vBackendAPI: e }), De = () => {
386
- let e = S(), t = _(), n = v();
387
- return (0, K.useCallback)((r, i, a, o, s) => {
388
- let c;
389
- switch (i) {
390
- case "click":
391
- r === R.Text ? c = ce(r, n, o, a) : s.key && $("onCellClick", o, s, t, e);
392
- break;
393
- case "mousemove":
394
- $("onCellHover", o, s, t, e);
395
- break;
396
- case "mouseleave":
397
- Ee(e);
398
- break;
399
- }
400
- c && e.emitEvent(c.action, c.payload);
401
- }, [e, t]);
402
- }, Oe = x(), ke = y(({ vSpec: e, vTheme: t, data: n, elementSize: r, vizProperties: i }) => {
403
- let o = g(), [s] = (0, K.useState)(() => new we()), c = m(), l = De(), u = t || a, f = s.compile(e, u, n, r, i, d.HeatMap, o, c, l);
404
- return f ? /* @__PURE__ */ (0, Oe.jsx)(oe, {
405
- config: i,
406
- definition: f,
407
- size: r,
408
- vSpec: e
409
- }) : null;
410
- });
411
- export { ke as HeatMapChart };
@@ -1,179 +0,0 @@
1
- import { o as e } from "./rolldown-runtime-DleVn1XH.js";
2
- import { Ta as t, no as n, qo as r, ro as i } from "./interfaces-VUY4_yVO.js";
3
- import { G as a, Ki as o, W as s, Zt as c, d as l, wi as u } from "./utils-Ba9T0TqC.js";
4
- import { t as d } from "./stroke-dash-UgMEcCS4.js";
5
- import { s as f } from "./coloring-C16AUZEi.js";
6
- var p = /* @__PURE__ */ e(o()), m = (e) => e === i.Line || e === i.Elbow, h = {
7
- shape: i.Square,
8
- backgroundColor: { code: "#c4c4c4" },
9
- backgroundType: "color",
10
- lineThickness: 2,
11
- borderEnabled: !1,
12
- borderRadiusX: 0,
13
- borderRadiusY: 0,
14
- preserveAspectRatio: !0,
15
- strokeColor: { code: "#8d8d8d" },
16
- imageFit: n.Fill,
17
- strokeDash: null,
18
- imageURL: null,
19
- scale: 1,
20
- rotate: 0,
21
- heightBasedSize: !1
22
- }, g = (e, t) => {
23
- let n = { ...e?.shapeSettings }, a = 0, o = 0, s = n?.borderEnabled ?? h.borderEnabled;
24
- (n?.shape === i.Square || n?.shape === i.Rectangle) && n?.borderRadius && (a = n?.borderRadius, o = a, n?.preserveAspectRatio || (t?.width > t?.height ? o = (t?.width || 1) / (t?.height || 1) * o : a = (t?.height || 1) / (t?.width || 1) * a)), m(n?.shape) && (n.backgroundColor = { code: "none" }, s = !0);
25
- let c = n?.rotate ?? h.rotate;
26
- n?.shape === i.Line && n?.heightBasedSize && (c += 90);
27
- let l = n?.borderStyle === r.Line ? void 0 : n?.strokeDash ?? h.strokeDash;
28
- return {
29
- backgroundType: n?.backgroundType ?? "color",
30
- shape: n?.shape ?? h.shape,
31
- backgroundColor: n?.backgroundColor?.code ? n?.backgroundColor : h.backgroundColor,
32
- imageURL: n?.imageURL ?? h.imageURL,
33
- imageFit: n?.imageFit ?? h.imageFit,
34
- strokeDash: l,
35
- lineThickness: n?.lineThickness ?? h.lineThickness,
36
- borderEnabled: s,
37
- strokeColor: n?.strokeColor?.code ? n?.strokeColor : h.strokeColor,
38
- preserveAspectRatio: n?.preserveAspectRatio ?? h.preserveAspectRatio,
39
- scale: n?.scale ?? h.scale,
40
- rotate: c,
41
- heightBasedSize: n?.heightBasedSize ?? h.heightBasedSize,
42
- borderRadiusX: a,
43
- borderRadiusY: o
44
- };
45
- }, _ = u(), v = ({ ...e }) => /* @__PURE__ */ (0, _.jsx)("path", {
46
- d: "M0,50 L70,40 L70,20 L100,50 L70,80 L70,60 Z",
47
- vectorEffect: "non-scaling-stroke",
48
- ...e
49
- }), y = ({ ...e }) => /* @__PURE__ */ (0, _.jsx)("circle", {
50
- cx: "50",
51
- cy: "50",
52
- r: "49.5",
53
- strokeWidth: "{0.02em}",
54
- vectorEffect: "non-scaling-stroke",
55
- ...e
56
- }), b = ({ ...e }) => /* @__PURE__ */ (0, _.jsx)("path", {
57
- d: "M0,0L100, 0L100, 100",
58
- vectorEffect: "non-scaling-stroke",
59
- ...e
60
- }), x = ({ ...e }) => /* @__PURE__ */ (0, _.jsx)("path", {
61
- d: "M50,7.2857421875 l38.7369140625,21.4685546875 v42.4912109375 L50,92.7142578125 L11.2630859375,71.245703125 V28.754296875 L50,7.2857421875 M50,0z",
62
- vectorEffect: "non-scaling-stroke",
63
- ...e
64
- }), S = ({ heightBasedSize: e, ...t }) => e ? /* @__PURE__ */ (0, _.jsx)("path", {
65
- d: "M50,0L50, 100",
66
- vectorEffect: "non-scaling-stroke",
67
- ...t
68
- }) : /* @__PURE__ */ (0, _.jsx)("path", {
69
- d: "M0,50L100, 50",
70
- vectorEffect: "non-scaling-stroke",
71
- ...t
72
- }), C = ({ ...e }) => /* @__PURE__ */ (0, _.jsx)("rect", {
73
- x: "0",
74
- y: "0",
75
- width: "100",
76
- height: "100",
77
- strokeWidth: "{0.02em}",
78
- vectorEffect: "non-scaling-stroke",
79
- ...e
80
- }), w = ({ ...e }) => /* @__PURE__ */ (0, _.jsx)("polygon", {
81
- points: "50,0 93.3,75 6.7,75",
82
- vectorEffect: "non-scaling-stroke",
83
- ...e
84
- }), T = (e) => {
85
- switch (e) {
86
- case i.Circle: return y;
87
- case i.Rectangle:
88
- case i.Square: return C;
89
- case i.Triangle: return w;
90
- case i.Hexagon: return x;
91
- case i.Line: return S;
92
- case i.Arrow: return v;
93
- case i.Elbow: return b;
94
- default: return C;
95
- }
96
- }, E = a({
97
- mainContainer: {
98
- width: "100%",
99
- height: "100%",
100
- display: "flex",
101
- lineHeight: 1,
102
- overflow: "hidden"
103
- },
104
- svg: {
105
- width: "100%",
106
- height: "100%",
107
- transition: "ease-in-out 300ms"
108
- },
109
- shapeGroup: {
110
- width: "100%",
111
- height: "100%",
112
- transition: "ease-in-out 300ms"
113
- }
114
- }), D = ({ patternId: e, imgUrl: t, onLoadCallback: r, imageFit: i = n.Fill }) => /* @__PURE__ */ (0, _.jsx)("defs", { children: /* @__PURE__ */ (0, _.jsx)("pattern", {
115
- id: e,
116
- viewBox: "0 0 1 1",
117
- patternUnits: "objectBoundingBox",
118
- width: "100%",
119
- height: "100%",
120
- preserveAspectRatio: i,
121
- children: /* @__PURE__ */ (0, _.jsx)("image", {
122
- xlinkHref: t,
123
- x: "0",
124
- y: "0",
125
- width: "1",
126
- height: "1",
127
- preserveAspectRatio: i,
128
- onLoad: r,
129
- onError: r
130
- })
131
- }) }), O = c(({ vSpec: e, vTheme: n, elementSize: r }) => {
132
- let a = n || t, o = g(e, r), c = E(), u = l(), h = T(o.shape), v = `${s()}-background-image-fill`, y = `${s()}-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
- return (0, p.useEffect)(() => {
134
- (!o.imageURL || o.backgroundType === "color") && u();
135
- }, []), /* @__PURE__ */ (0, _.jsx)("div", {
136
- className: c.mainContainer,
137
- "data-testid": "shape-container",
138
- children: /* @__PURE__ */ (0, _.jsxs)("svg", {
139
- viewBox: "0 0 100 100",
140
- className: c.svg,
141
- style: { transform: `rotate(${o.rotate ?? 0}deg) scale(${o.scale ?? 1})` },
142
- preserveAspectRatio: o.preserveAspectRatio ? "" : "none",
143
- children: [
144
- o.backgroundType === "image" ? /* @__PURE__ */ (0, _.jsx)(D, {
145
- patternId: v,
146
- imgUrl: o.imageURL,
147
- imageFit: o.imageFit,
148
- onLoadCallback: () => u()
149
- }) : null,
150
- /* @__PURE__ */ (0, _.jsx)("defs", { children: /* @__PURE__ */ (0, _.jsx)("clipPath", {
151
- id: y,
152
- className: c.shapeGroup,
153
- style: { opacity: o.opacity === void 0 ? 1 : o.opacity },
154
- children: /* @__PURE__ */ (0, _.jsx)(h, {
155
- rx: `${o.borderRadiusX ?? 0}px`,
156
- ry: `${o.borderRadiusY ?? 0}px`
157
- })
158
- }) }),
159
- /* @__PURE__ */ (0, _.jsx)("g", {
160
- className: c.shapeGroup,
161
- style: { opacity: o.opacity === void 0 ? 1 : o.opacity },
162
- fill: o.imageURL && o.backgroundType === "image" ? `url(#${v})` : b,
163
- stroke: x,
164
- strokeWidth: `${o.borderEnabled ? C : 0}px`,
165
- strokeDasharray: S,
166
- children: /* @__PURE__ */ (0, _.jsx)("g", {
167
- clipPath: m(o.shape) ? void 0 : `url(#${y})`,
168
- children: /* @__PURE__ */ (0, _.jsx)(h, {
169
- rx: `${o.borderRadiusX ?? 0}px`,
170
- ry: `${o.borderRadiusY ?? 0}px`,
171
- ...o.shape === i.Line ? { heightBasedSize: o.heightBasedSize } : {}
172
- })
173
- })
174
- })
175
- ]
176
- })
177
- });
178
- });
179
- export { O as Shape };
@@ -1,68 +0,0 @@
1
- import { o as e } from "./rolldown-runtime-DleVn1XH.js";
2
- import { Pn as t, vr as n } from "./interfaces-VUY4_yVO.js";
3
- import { G as r, Ki as i, d as a, wi as o, xn as s } from "./utils-Ba9T0TqC.js";
4
- var c = /* @__PURE__ */ e(i()), l = r({
5
- iframeWrapper: {
6
- width: "100%",
7
- height: "100%",
8
- display: "flex",
9
- justifyContent: "center",
10
- alignItems: "center",
11
- position: "relative"
12
- },
13
- overlay: {
14
- position: "absolute",
15
- top: 0,
16
- left: 0,
17
- width: "100%",
18
- height: "100%",
19
- backgroundColor: "transparent",
20
- pointerEvents: "all",
21
- zIndex: 1
22
- },
23
- emptyState: {
24
- width: "100%",
25
- height: "100%"
26
- }
27
- }), u = o(), d = n(), f = ({ vSpec: e = d }) => {
28
- let n = t(e.iframeSettings.url, null), r = a(), i = l(), o = s();
29
- if ((0, c.useEffect)(() => {
30
- r();
31
- }, []), !n) return /* @__PURE__ */ (0, u.jsx)("div", {
32
- className: i.emptyState,
33
- "data-testid": "iframe-empty-container"
34
- });
35
- let f = "\n allow-scripts\n allow-forms\n allow-same-origin\n allow-popups\n allow-popups-to-escape-sandbox\n allow-modals\n allow-downloads\n ", p = "\n autoplay\n clipboard-write\n clipboard-read\n ";
36
- return o.daedalus.objectCapabilities.editable ? /* @__PURE__ */ (0, u.jsxs)("div", {
37
- className: i.iframeWrapper,
38
- "data-testid": "iframe-container",
39
- children: [/* @__PURE__ */ (0, u.jsx)("iframe", {
40
- src: n,
41
- width: "100%",
42
- height: "100%",
43
- style: { border: "none" },
44
- sandbox: f,
45
- allow: p,
46
- loading: "lazy",
47
- referrerPolicy: "no-referrer-when-downgrade",
48
- "data-testid": "iframe-content"
49
- }), /* @__PURE__ */ (0, u.jsx)("div", {
50
- className: i.overlay,
51
- "data-testid": "iframe-overlay"
52
- })]
53
- }) : /* @__PURE__ */ (0, u.jsx)("div", {
54
- className: i.iframeWrapper,
55
- "data-testid": "iframe-container",
56
- children: /* @__PURE__ */ (0, u.jsx)("iframe", {
57
- src: n,
58
- width: "100%",
59
- height: "100%",
60
- style: { border: "none" },
61
- sandbox: f,
62
- allow: p,
63
- loading: "lazy",
64
- referrerPolicy: "no-referrer-when-downgrade"
65
- })
66
- });
67
- };
68
- export { f as IframeObject };