@astrato-io/visualizations 0.7.0 → 0.9.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 (162) hide show
  1. package/README.md +1 -25
  2. package/THIRD_PARTY_NOTICES.md +307 -378
  3. package/chunks/{Button-BrGKp9Nm.js → Button-5CxPEACP.js} +11 -11
  4. package/chunks/CircularProgress-DFS-LQb7.js +765 -0
  5. package/chunks/FieldTypeIcon-pSVQFemC.js +22 -0
  6. package/chunks/LinearProgress-CjIQfkNA.js +327 -0
  7. package/chunks/{MenuOption-ByRqhRdX.js → MenuOption-Cb7B7x6z.js} +1384 -1002
  8. package/chunks/Title-CtFw1bVg.js +1804 -0
  9. package/chunks/ToggleButton-Br9HCPCv.js +150 -0
  10. package/chunks/{app-filter-bar.compiler-TwVTeoj5.js → app-filter-bar.compiler-B9775gLJ.js} +3 -3
  11. package/chunks/{bar.compiler-DuQg8EUb.js → bar.compiler-B7wlH_Ro.js} +4 -4
  12. package/chunks/{builder-DEDvNq1k.js → builder-Dxo7D7c6.js} +118 -55
  13. package/chunks/{coloring-CncX_JRX.js → coloring-B-Wa8D5P.js} +3 -3
  14. package/chunks/contains-BK-sRXcB.js +21 -0
  15. package/chunks/{definitions-BPJQTx16.js → definitions-DNpzD9tY.js} +26 -26
  16. package/chunks/{escobar-DRhRMYRE.js → escobar-C4Nm3eJ7.js} +4436 -4802
  17. package/chunks/{extend-preset-CUFNpmPe.js → extend-preset-BVKFtoe-.js} +46 -46
  18. package/chunks/{filter.compiler-w27dlv0C.js → filter.compiler-BlS3zoy_.js} +7 -7
  19. package/chunks/{filtering-cc7WqWpg.js → filtering-CGuLpg7u.js} +494 -270
  20. package/chunks/{handlers-TOT-7INo.js → handlers-CMbyj5y1.js} +1513 -1454
  21. package/chunks/{icon-picker-styles-CoJmwTRi.js → icon-picker-styles-DYQgVEKG.js} +8 -8
  22. package/chunks/{isEqual-B8loyPsC.js → isEqual-DBg_b35N.js} +1 -1
  23. package/chunks/isFocusVisible-B1_z03UT.js +144 -0
  24. package/chunks/{line.compiler-Ct1WhN2p.js → line.compiler-Bo9i9qag.js} +7 -7
  25. package/chunks/{logger-DpQtYQnX.js → logger-3lng-wOw.js} +7 -3
  26. package/chunks/{metadata-WABZrt7Y.js → metadata-Fmx1swpK.js} +1 -1
  27. package/chunks/{number.compiler-D8TPly-4.js → number.compiler-CdLd5aGW.js} +7 -7
  28. package/chunks/{operations-Dh4v1Ovt.js → operations-HSqnCRvv.js} +9156 -9112
  29. package/chunks/{range-Bi-7zT0k.js → range-CzO4isKK.js} +2 -2
  30. package/chunks/react-dom-BwZT0N3F.js +368 -0
  31. package/chunks/{render-wrappers-OEmtaM8g.js → render-wrappers-CAuvgMxi.js} +1 -1
  32. package/chunks/{requirements-PAoRaJyb.js → requirements-CYpVh65U.js} +330 -302
  33. package/chunks/responsive.styles-FItb913l.js +93 -0
  34. package/chunks/{shared-Bn4N5QcZ.js → shared-DFoJxjVN.js} +401 -401
  35. package/chunks/{standalone-D__XCp-h.js → standalone-530a5lvf.js} +306 -306
  36. package/chunks/{standalone-CXNP6-xD.js → standalone-5DnapeHH.js} +112 -112
  37. package/chunks/{standalone-XTgSsTAa.js → standalone-B4jrf4KE.js} +70 -70
  38. package/chunks/{standalone-Bes8srx1.js → standalone-B6s_xG2u.js} +14 -14
  39. package/chunks/{standalone-DVTJwsTY.js → standalone-BDrQMxLi.js} +623 -614
  40. package/chunks/standalone-BMoJXGYe.js +2 -0
  41. package/chunks/{standalone-CLmGb7nn2.js → standalone-BfvGggeM2.js} +76 -76
  42. package/chunks/{standalone-D5Q5ngsD.js → standalone-BvWdpUL3.js} +26 -26
  43. package/chunks/{standalone-we5D5MIn.js → standalone-C6XDHYAM.js} +31 -31
  44. package/chunks/standalone-CMJJIi9v.js +2 -0
  45. package/chunks/{standalone-C8ZAEutO.js → standalone-CNkHsynO.js} +28 -28
  46. package/chunks/{standalone-BMTCb10X.js → standalone-CPUiiWNP.js} +5 -5
  47. package/chunks/{standalone-XuGksArp.js → standalone-CXniic5x.js} +9 -9
  48. package/chunks/standalone-C_Jd4gkj.js +6 -0
  49. package/chunks/{standalone-DW6NT205.js → standalone-CiaaibTa.js} +142 -142
  50. package/chunks/standalone-CoQxJ6ov.js +3638 -0
  51. package/chunks/{standalone-CM5XcAN5.js → standalone-Cu73fzSr.js} +7660 -7534
  52. package/chunks/standalone-DBeXQrwH.js +468 -0
  53. package/chunks/{standalone-DMcI1afI.js → standalone-DMCwtebn.js} +81 -81
  54. package/chunks/{standalone-BlMIwpEe.js → standalone-DWPfdP0A.js} +800 -668
  55. package/chunks/{standalone-DLlyRIE6.js → standalone-DpSRmAWx.js} +59 -59
  56. package/chunks/{standalone-BGkmozIb.js → standalone-DuwTOBXH.js} +256 -256
  57. package/chunks/{standalone-BDhPQtzQ.js → standalone-LFVgLhia.js} +234 -234
  58. package/chunks/{standalone-B55oyW6c.js → standalone-kzAhwH19.js} +149 -149
  59. package/chunks/{standalone-DN4S1MjT.js → standalone-mb7LwEiq.js} +885 -885
  60. package/chunks/{standalone-CJvIXsQE.js → standalone-r4ObFvys.js} +155 -155
  61. package/chunks/{table.compiler-DMeeHxb6.js → table.compiler-C1qjqXaT.js} +7 -7
  62. package/chunks/{typeof-CJDtcySz.js → typeof-DCq3QgvY.js} +6 -1
  63. package/chunks/useFieldName-mWrD_uk_.js +7 -0
  64. package/chunks/{utils-vdmi_2PK.js → utils-DYYD4Zzf.js} +7593 -12707
  65. package/chunks/{view-BuwQugKb.js → view-7fH6mGmY.js} +2034 -2070
  66. package/chunks/{visualization-filters-Cc4KU-l-.js → visualization-filters-mVnsnvLP.js} +3581 -3555
  67. package/chunks/with-html-element-B0Clt4jY.js +15901 -0
  68. package/definitions.js +2 -2
  69. package/docs/operations/astrato-app-filter-bar.md +1 -1
  70. package/docs/operations/bar.md +1 -1
  71. package/docs/operations/combo.md +1 -1
  72. package/docs/operations/date-picker.md +1 -1
  73. package/docs/operations/distribution-gauge.md +1 -1
  74. package/docs/operations/dot.md +1 -1
  75. package/docs/operations/filter.md +1 -1
  76. package/docs/operations/gauge.md +1 -1
  77. package/docs/operations/heatMap.md +1 -1
  78. package/docs/operations/histogram.md +1 -1
  79. package/docs/operations/iframe.md +1 -1
  80. package/docs/operations/image.md +1 -1
  81. package/docs/operations/index.md +2 -2
  82. package/docs/operations/line.md +1 -1
  83. package/docs/operations/number.md +1 -1
  84. package/docs/operations/pie.md +1 -1
  85. package/docs/operations/radar.md +1 -1
  86. package/docs/operations/sankey.md +1 -1
  87. package/docs/operations/scatter.md +1 -1
  88. package/docs/operations/shape.md +1 -1
  89. package/docs/operations/simpleTextObject.md +1 -1
  90. package/docs/operations/slider.md +1 -1
  91. package/docs/operations/table.md +66 -1
  92. package/docs/operations/tree.md +1 -1
  93. package/docs/operations/treemap.md +1 -1
  94. package/docs/operations/waterfall.md +1 -1
  95. package/docs/operations/word-cloud.md +1 -1
  96. package/getters.js +2 -2
  97. package/index.js +1191 -3
  98. package/metadata.js +15 -16
  99. package/operations.js +5 -5
  100. package/package.json +67 -102
  101. package/src/definitions/model/definitions/descriptors/descriptor-metadata.d.ts +348 -348
  102. package/src/definitions/model/definitions/schema-registry.d.ts +101 -101
  103. package/src/definitions/model/definitions/schemas/bar.schema.d.ts +8 -8
  104. package/src/definitions/model/definitions/schemas/common.schema.d.ts +29 -29
  105. package/src/definitions/model/definitions/schemas/line.schema.d.ts +10 -10
  106. package/src/definitions/model/definitions/schemas/number.schema.d.ts +4 -4
  107. package/src/definitions/model/definitions/schemas/object.schema.d.ts +38 -38
  108. package/src/definitions/model/definitions/schemas/table.schema.d.ts +61 -61
  109. package/src/getters/index.d.ts +3 -3
  110. package/src/index.d.ts +1 -1
  111. package/src/operations/index.d.ts +3 -3
  112. package/src/runtime/index.d.ts +2 -2
  113. package/src/types.d.ts +4 -8
  114. package/src/visualization-catalog.d.ts +26 -26
  115. package/src/web-components/index.d.ts +3 -3
  116. package/chunks/DefaultPropsProvider-BsfB7QTn.js +0 -257
  117. package/chunks/FieldTypeIcon-Drs6hSJF.js +0 -22
  118. package/chunks/LinearProgress-VtfFx2vJ.js +0 -253
  119. package/chunks/Title-CO5dP1ma.js +0 -1691
  120. package/chunks/ToggleButton-KOBAimC1.js +0 -112
  121. package/chunks/colorManipulator-D8Pjy1pf.js +0 -45
  122. package/chunks/registry-KervaxqJ.js +0 -31
  123. package/chunks/responsive.styles-DSiOGD7u.js +0 -82
  124. package/chunks/standalone-BXKRE_Se.js +0 -468
  125. package/chunks/standalone-BjZp0QMe.js +0 -2
  126. package/chunks/standalone-C8qAelL4.js +0 -2
  127. package/chunks/standalone-DT0wKji7.js +0 -6
  128. package/chunks/standalone-DYQIQH4c.js +0 -2095
  129. package/chunks/useFieldName-Cjn9KCVp.js +0 -7
  130. package/chunks/useSlotProps-DLbQp4lc.js +0 -166
  131. package/chunks/web-components-DqClFkgO.js +0 -1185
  132. package/chunks/with-html-element-D0uY2zjI.js +0 -7328
  133. package/render.js +0 -10
  134. package/src/charts/bar.d.ts +0 -1
  135. package/src/charts/combo.d.ts +0 -1
  136. package/src/charts/dot.d.ts +0 -1
  137. package/src/charts/gauge-distribution.d.ts +0 -1
  138. package/src/charts/gauge.d.ts +0 -1
  139. package/src/charts/heat-map.d.ts +0 -1
  140. package/src/charts/histogram.d.ts +0 -1
  141. package/src/charts/line.d.ts +0 -1
  142. package/src/charts/pie.d.ts +0 -1
  143. package/src/charts/radar.d.ts +0 -1
  144. package/src/charts/sankey.d.ts +0 -1
  145. package/src/charts/scatter.d.ts +0 -1
  146. package/src/charts/table.d.ts +0 -1
  147. package/src/charts/tree.d.ts +0 -1
  148. package/src/charts/treemap.d.ts +0 -1
  149. package/src/charts/waterfall.d.ts +0 -1
  150. package/src/charts/word-cloud.d.ts +0 -1
  151. package/src/objects/app-filter-bar.d.ts +0 -1
  152. package/src/objects/date-picker.d.ts +0 -1
  153. package/src/objects/filter.d.ts +0 -1
  154. package/src/objects/iframe.d.ts +0 -1
  155. package/src/objects/image.d.ts +0 -1
  156. package/src/objects/number.d.ts +0 -1
  157. package/src/objects/shape.d.ts +0 -1
  158. package/src/objects/slider.d.ts +0 -1
  159. package/src/objects/text.d.ts +0 -1
  160. package/src/registry/create-visualization-registry.d.ts +0 -5
  161. package/src/render/index.d.ts +0 -34
  162. /package/chunks/{src-BOS6SqkZ.js → src-BOS6SqkZ2.js} +0 -0
@@ -1,23 +1,23 @@
1
1
  import { o as e } from "./rolldown-runtime-DleVn1XH.js";
2
- import { Ca as t, Ds as n, Hi as r, Ta as i, Us as a, Xa as o, _c as s, hi as c, hn as l, mr as u, ws as d, zi as f, zr as p } from "./visualization-filters-Cc4KU-l-.js";
3
- import { Ei as m, F as h, N as g, Xt as _, o as v, ri as y } from "./utils-vdmi_2PK.js";
4
- import "./logger-DpQtYQnX.js";
5
- import { F as b, Ht as x, Kt as S, Tt as C, Vt as w, _n as T, dn as E, et as D, fn as O, gn as k, hn as A, i as ee, in as te, ln as j, n as ne, nn as re, st as ie, tn as ae, tt as oe, un as M, vn as N, wt as se } from "./escobar-DRhRMYRE.js";
6
- import { _ as P } from "./MenuOption-ByRqhRdX.js";
7
- import { a as ce, r as le, t as ue } from "./coloring-CncX_JRX.js";
8
- import { f as F, r as I, t as de, u as fe } from "./src-D9XogOrc.js";
9
- var pe = /* @__PURE__ */ e(m()), L = /* @__PURE__ */ function(e) {
2
+ import { Ca as t, Ds as n, Gn as r, Hi as i, Kt as a, Ta as o, Us as s, Xa as c, _c as l, hi as u, ws as d, zi as f, zr as p } from "./visualization-filters-mVnsnvLP.js";
3
+ import { F as m, N as h, Ot as g, ei as _, jr as v, s as y } from "./utils-DYYD4Zzf.js";
4
+ import "./logger-3lng-wOw.js";
5
+ import { F as b, Ht as x, Kt as S, Tt as C, Vt as w, _n as T, cn as E, dn as D, en as O, et as k, gn as A, hn as j, i as ee, ln as M, mn as N, n as te, rn as ne, st as re, tn as ie, tt as ae, un as P, wt as oe } from "./escobar-C4Nm3eJ7.js";
6
+ import { _ as F } from "./MenuOption-Cb7B7x6z.js";
7
+ import { a as se, r as ce, t as le } from "./coloring-B-Wa8D5P.js";
8
+ import { f as I, r as L, t as ue, u as de } from "./src-D9XogOrc.js";
9
+ var fe = /* @__PURE__ */ e(_()), R = /* @__PURE__ */ function(e) {
10
10
  return e.sankey = "key-sankey", e.labels = "key-labels", e.columnLabels = "key-column-labels", e;
11
- }({}), R = /* @__PURE__ */ function(e) {
12
- return e.NodeFlow = "flow", e.NodeColor = "color", e;
13
11
  }({}), z = /* @__PURE__ */ function(e) {
12
+ return e.NodeFlow = "flow", e.NodeColor = "color", e;
13
+ }({}), B = /* @__PURE__ */ function(e) {
14
14
  return e.ColumnTitleLeft = "columnTitleLeft", e.ColumnTitleCenter = "columnTitleCenter", e.ColumnTitleRight = "columnTitleRight", e.NodeLabelLeft = "nodeLabelLeft", e.NodeLabelCenter = "nodeLabelCenter", e.NodeLabelRight = "nodeLabelRight", e;
15
- }({}), me = class extends ue {
15
+ }({}), pe = class extends le {
16
16
  dimensionIds = [];
17
17
  dimensionColoring = {};
18
18
  constructor(e, t, n) {
19
19
  super(e, t, n), this.dimensionIds = [], this.vSpec.dimensions.filter((e) => p(e)).forEach((e) => {
20
- let t = a(e.dataItem);
20
+ let t = s(e.dataItem);
21
21
  this.dimensionColoring[t] = e.coloring, this.dimensionIds.push(t);
22
22
  });
23
23
  }
@@ -39,7 +39,7 @@ var pe = /* @__PURE__ */ e(m()), L = /* @__PURE__ */ function(e) {
39
39
  if ([i, ...Object.keys(i).filter((e) => {
40
40
  let t = i[e]?.source?.field;
41
41
  return t !== void 0 && this.dimensionIds.includes(t);
42
- }).map((e) => i[e])].find((e) => e.source?.field === r?.dataItemId ? a === "equals" ? r.value === e.value || r.value === String(e.value) : le(r, e.value) : !1)) return r.color;
42
+ }).map((e) => i[e])].find((e) => e.source?.field === r?.dataItemId ? a === "equals" ? r.value === e.value || r.value === String(e.value) : ce(r, e.value) : !1)) return r.color;
43
43
  }
44
44
  }
45
45
  getFilteredColor() {
@@ -48,7 +48,7 @@ var pe = /* @__PURE__ */ e(m()), L = /* @__PURE__ */ function(e) {
48
48
  getLinkColorDefinition() {
49
49
  return (e) => {
50
50
  if (this.notAffectedItems?.pattern?.length && this.vSpec.staticFilters.ignoreGlobalFilters && this.vSpec.staticFilters.showGlobalFiltersEffect) {
51
- let t = ce(e, this.notAffectedItems);
51
+ let t = se(e, this.notAffectedItems);
52
52
  if (t) return t;
53
53
  }
54
54
  if (this.isColorOverwriteActive()) {
@@ -61,86 +61,86 @@ var pe = /* @__PURE__ */ e(m()), L = /* @__PURE__ */ function(e) {
61
61
  }
62
62
  };
63
63
  }
64
- }, he = (e, t) => e.data.value === t.data.value ? 0 : e.data.value < t.data.value ? 1 : -1, ge = (e, t) => e.data.value === t.data.value ? 0 : e.data.value < t.data.value ? -1 : 1, _e = (e, t) => e.data.flow.value === t.data.flow.value ? 0 : e.data.flow.value < t.data.flow.value ? 1 : -1, ve = (e, t) => e.data.flow.value === t.data.flow.value ? 0 : e.data.flow.value < t.data.flow.value ? -1 : 1;
65
- function ye(e, t) {
66
- let n = e.dimensions.filter((e) => p(e)), r = (e.querySettings?.sortingOrder ?? []).map((e) => ({
67
- id: a(e.dataItem),
64
+ }, me = (e, t) => e.data.value === t.data.value ? 0 : e.data.value < t.data.value ? 1 : -1, he = (e, t) => e.data.value === t.data.value ? 0 : e.data.value < t.data.value ? -1 : 1, ge = (e, t) => e.data.flow.value === t.data.flow.value ? 0 : e.data.flow.value < t.data.flow.value ? 1 : -1, _e = (e, t) => e.data.flow.value === t.data.flow.value ? 0 : e.data.flow.value < t.data.flow.value ? -1 : 1;
65
+ function ve(e, t) {
66
+ let n = e.dimensions.filter((e) => p(e)), i = (e.querySettings?.sortingOrder ?? []).map((e) => ({
67
+ id: s(e.dataItem),
68
68
  direction: e.sortDirection,
69
69
  type: e.fieldType
70
- })), i = r.find((e) => e.type === "measure"), o = i ? r.indexOf(i) : -1;
70
+ })), a = i.find((e) => e.type === "measure"), o = a ? i.indexOf(a) : -1;
71
71
  return n.map((n) => {
72
- let s = a(n.dataItem), c;
72
+ let c = s(n.dataItem), l;
73
73
  if (e.sankeySettings.applyDataSortOnNodeColumns) {
74
- let e = r.find((e) => e.id === s), t = e ? r.indexOf(e) : -1;
75
- e && t < o ? c = e.direction === "desc" ? he : ge : i && (c = i.direction === "desc" ? _e : ve);
74
+ let e = i.find((e) => e.id === c), t = e ? i.indexOf(e) : -1;
75
+ e && t < o ? l = e.direction === "desc" ? me : he : a && (l = a.direction === "desc" ? ge : _e);
76
76
  }
77
77
  return {
78
- id: s,
79
- sort: c,
80
- isGrouped: u(e.dimensions, e.enableAlternate, t)
78
+ id: c,
79
+ sort: l,
80
+ isGrouped: r(e.dimensions, e.enableAlternate, t)
81
81
  };
82
82
  });
83
83
  }
84
- var be = (e, t) => {
85
- let n = e.sankeySettings.linkColoring?.opacity ?? .3, i = t.valuePickerMode ?? !1, a = i ? t.valuePickerTargetDataItemId : "";
84
+ var ye = (e, t) => {
85
+ let n = e.sankeySettings.linkColoring?.opacity ?? .3, r = t.valuePickerMode ?? !1, a = r ? t.valuePickerTargetDataItemId : "";
86
86
  return {
87
87
  trigger: [{
88
- on: k.Tap,
89
- action: A.Toggle,
88
+ on: j.Tap,
89
+ action: N.Toggle,
90
90
  globalPropagation: "stop",
91
91
  data: ["", "linkTarget"],
92
- contexts: [E.Selection]
92
+ contexts: [P.Selection]
93
93
  }, {
94
- on: k.Over,
95
- action: A.Set,
94
+ on: j.Over,
95
+ action: N.Set,
96
96
  globalPropagation: "stop",
97
97
  data: ["", "linkTarget"],
98
- contexts: [E.Highlight]
98
+ contexts: [P.Highlight]
99
99
  }],
100
100
  consume: [
101
101
  {
102
- context: E.Selection,
102
+ context: P.Selection,
103
103
  data: ["", "linkTarget"],
104
104
  filter: (e) => e.data?.type?.value === "link",
105
- mode: T.Or,
105
+ mode: A.Or,
106
106
  style: { inactive: { opacity: n * .25 } }
107
107
  },
108
108
  {
109
- context: E.Selection,
109
+ context: P.Selection,
110
110
  data: [""],
111
111
  filter: (e) => e.data?.type?.value === "node",
112
- mode: T.Or,
112
+ mode: A.Or,
113
113
  style: { inactive: { fill: (e) => {
114
114
  let t = e, n = !t.fill || t.fill === "none" || t.fill === "transparent";
115
115
  switch (!0) {
116
116
  case n:
117
- case i && t.data.source.field === a: return t.fill;
118
- default: return ae(re(t.fill), .25);
117
+ case r && t.data.source.field === a: return t.fill;
118
+ default: return O(ie(t.fill), .25);
119
119
  }
120
120
  } } }
121
121
  },
122
122
  {
123
- context: E.Highlight,
123
+ context: P.Highlight,
124
124
  data: [""],
125
125
  filter: (e) => e.data?.type?.value === "node",
126
- mode: T.Or,
126
+ mode: A.Or,
127
127
  style: { active: {
128
- strokeWidth: (e) => i && e.data.source.field !== a ? 0 : 1,
129
- stroke: r.mainDarkNavy
128
+ strokeWidth: (e) => r && e.data.source.field !== a ? 0 : 1,
129
+ stroke: i.mainDarkNavy
130
130
  } }
131
131
  }
132
132
  ]
133
133
  };
134
- }, xe = (e, t, n, r, i, o) => {
135
- if (!o) throw Error("Missing Sankey visualization properties");
136
- let s = e.sankeySettings.nodeLabels.placements;
137
- if (!s) throw Error("Missing Sankey node label placements");
138
- let c = e.dimensions.filter((e) => p(e)), l = new me(e, t, i?.[0]?.itemsNotAffectedByFiltering), u = e.sankeySettings.linkColoring?.opacity ?? .3, d = e.sankeySettings.linkColoring, f = c.map((e) => a(e.dataItem)), m = f.map((e, t) => `dim${t}`), h = e.sankeySettings.showNullNodes ? (e, t) => m[f.indexOf(t) + 1] : (e, t) => {
134
+ }, be = (e, t, n, r, i, a) => {
135
+ if (!a) throw Error("Missing Sankey visualization properties");
136
+ let o = e.sankeySettings.nodeLabels.placements;
137
+ if (!o) throw Error("Missing Sankey node label placements");
138
+ let c = e.dimensions.filter((e) => p(e)), l = new pe(e, t, i?.[0]?.itemsNotAffectedByFiltering), u = e.sankeySettings.linkColoring?.opacity ?? .3, d = e.sankeySettings.linkColoring, f = c.map((e) => s(e.dataItem)), m = f.map((e, t) => `dim${t}`), h = e.sankeySettings.showNullNodes ? (e, t) => m[f.indexOf(t) + 1] : (e, t) => {
139
139
  let n = f.indexOf(t), r = f.slice(n + 1).find((t) => e[m[f.indexOf(t)]].value !== null), i = r === void 0 ? -1 : f.indexOf(r);
140
140
  return m[i];
141
141
  }, g = {
142
- key: L.sankey,
143
- type: N.Sankey,
142
+ key: R.sankey,
143
+ type: T.Sankey,
144
144
  data: { collection: "coll" },
145
145
  settings: {
146
146
  showNullNodes: e.sankeySettings.showNullNodes,
@@ -154,15 +154,15 @@ var be = (e, t) => {
154
154
  showNodeFlowLabel: e.sankeySettings.nodeLabels.enabled && e.sankeySettings.nodeLabels.showFlowValue,
155
155
  showNodeLabelBackdrop: e.sankeySettings.nodeLabels.showBackdrop !== !1,
156
156
  nodeLabelBackdropColor: e.sankeySettings.nodeLabels.backdropColor,
157
- columnFields: ye(e, o.isPrintMode ?? !1),
158
- nodeLabelPlacements: s.filter((e) => e.enabled).map((e) => e.placement),
157
+ columnFields: ve(e, a.isPrintMode ?? !1),
158
+ nodeLabelPlacements: o.filter((e) => e.enabled).map((e) => e.placement),
159
159
  node: {
160
160
  id: (e) => {
161
161
  let t = e.datum;
162
162
  return `${t.source.field}::${t.value}`;
163
163
  },
164
164
  fill: l.getColorDefinition({
165
- ref: R.NodeColor,
165
+ ref: z.NodeColor,
166
166
  overwriteSources: [l.MAIN_FIELD, "color"]
167
167
  })
168
168
  },
@@ -184,7 +184,7 @@ var be = (e, t) => {
184
184
  opacity: u
185
185
  }
186
186
  },
187
- brush: o.disable?.brushing === !0 ? void 0 : be(e, o),
187
+ brush: a.disable?.brushing === !0 ? void 0 : ye(e, a),
188
188
  animations: {
189
189
  presetId: "simple-opacity",
190
190
  enabled: !0
@@ -194,33 +194,33 @@ var be = (e, t) => {
194
194
  ...n,
195
195
  components: [...n.components, g]
196
196
  };
197
- }, Se = (e, t, n) => {
198
- let r = e.measures.filter((e) => p(e)), i = e.dimensions.filter((e) => p(e)), o = a(r[0].dataItem), s = i.map((e) => a(e.dataItem)), c = s.map((e) => ({
197
+ }, xe = (e, t, n) => {
198
+ let r = e.measures.filter((e) => p(e)), i = e.dimensions.filter((e) => p(e)), a = s(r[0].dataItem), o = i.map((e) => s(e.dataItem)), c = o.map((e) => ({
199
199
  field: e,
200
200
  trackBy: (e) => e,
201
201
  reduce: "first",
202
202
  props: {
203
- [R.NodeFlow]: {
204
- field: o,
203
+ [z.NodeFlow]: {
204
+ field: a,
205
205
  reduce: "sum"
206
206
  },
207
- [o]: {
208
- field: o,
207
+ [a]: {
208
+ field: a,
209
209
  reduce: "sum"
210
210
  },
211
- [R.NodeColor]: { field: e },
211
+ [z.NodeColor]: { field: e },
212
212
  type: "node"
213
213
  }
214
- })), l = s.slice(0, s.length - 1).map((e, t) => {
214
+ })), l = o.slice(0, o.length - 1).map((e, t) => {
215
215
  let n = {
216
- field: s[t],
216
+ field: o[t],
217
217
  props: {
218
- flow: { field: o },
219
- [o]: { field: o },
218
+ flow: { field: a },
219
+ [a]: { field: a },
220
220
  type: "link"
221
221
  }
222
222
  };
223
- return s.forEach((e, t) => {
223
+ return o.forEach((e, t) => {
224
224
  n.field !== e && (n.props[`dim${t}`] = { field: e });
225
225
  }), n;
226
226
  }), u = [{
@@ -238,8 +238,8 @@ var be = (e, t) => {
238
238
  format: r[0].formatter?.format
239
239
  } }
240
240
  };
241
- }, B = (e, t) => ({
242
- component: L.sankey,
241
+ }, V = (e, t) => ({
242
+ component: R.sankey,
243
243
  selector: e,
244
244
  strategy: {
245
245
  type: "rows",
@@ -257,10 +257,10 @@ var be = (e, t) => {
257
257
  }]
258
258
  }
259
259
  }
260
- }), V = 64, Ce = new P(j.fontLight), we = new P(j.fontDark), H = (e, t, n) => {
261
- let r = new P(n.fonts.general.color);
260
+ }), H = 64, Se = new F(E.fontLight), Ce = new F(E.fontDark), U = (e, t, n) => {
261
+ let r = new F(n.fonts.general.color);
262
262
  return {
263
- component: L.sankey,
263
+ component: R.sankey,
264
264
  selector: e,
265
265
  strategy: {
266
266
  type: "rows",
@@ -279,81 +279,81 @@ var be = (e, t) => {
279
279
  if (!t.backdrop && !t.background) return r.rgb();
280
280
  let n = t.backdrop?.fill || t.background;
281
281
  if (n === void 0) throw Error("Color: Unknown color parameter");
282
- return new P(n).betterContrast(r, Ce, we).rgb();
282
+ return new F(n).betterContrast(r, Se, Ce).rgb();
283
283
  },
284
284
  linkData({ node: e }) {
285
285
  return e.desc?.data;
286
286
  },
287
287
  label({ node: e, formatter: t }) {
288
- let n = e.desc, r = n.showFlow ? t("flow")(n.data?.[R.NodeFlow]?.value) : void 0, i = n.label?.length > V - 1 ? `${n.label?.substring(0, V - 1).replace(/\s+$/, "")}…` : n.label;
288
+ let n = e.desc, r = n.showFlow ? t("flow")(n.data?.[z.NodeFlow]?.value) : void 0, i = n.label?.length > H - 1 ? `${n.label?.substring(0, H - 1).replace(/\s+$/, "")}…` : n.label;
289
289
  return [n.showDimension ? i : void 0, r].filter(Boolean).join(": ");
290
290
  }
291
291
  }]
292
292
  }
293
293
  }
294
294
  };
295
- }, Te = (e, t, n, r, i, c, d, f) => {
296
- if (!c) throw Error("Missing Sankey visualization properties");
295
+ }, we = (e, t, n, i, o, u, d, f) => {
296
+ if (!u) throw Error("Missing Sankey visualization properties");
297
297
  let m = [];
298
- f && m.push(x(L.columnLabels, L.columnLabels, f));
298
+ f && m.push(x(R.columnLabels, R.columnLabels, f));
299
299
  let h = {
300
- type: N.Labels,
301
- key: L.columnLabels,
300
+ type: T.Labels,
301
+ key: R.columnLabels,
302
302
  layout: { displayOrder: 2 },
303
303
  settings: { sources: [
304
- B(`.${z.ColumnTitleLeft}`, 0),
305
- B(`.${z.ColumnTitleCenter}`, .5),
306
- B(`.${z.ColumnTitleRight}`, 1)
304
+ V(`.${B.ColumnTitleLeft}`, 0),
305
+ V(`.${B.ColumnTitleCenter}`, .5),
306
+ V(`.${B.ColumnTitleRight}`, 1)
307
307
  ] },
308
308
  style: { label: "$title" },
309
309
  animations: {
310
310
  presetId: "simple-opacity",
311
311
  enabled: !0
312
312
  }
313
- }, g = e?.measures.find(p), _ = g ? a(g.dataItem) : void 0;
314
- f && g && e.measures.length > 1 && m.push(w(N.Text, f));
313
+ }, g = e?.measures.find(p), _ = g ? s(g.dataItem) : void 0;
314
+ f && g && e.measures.length > 1 && m.push(w(T.Text, f));
315
315
  let v;
316
316
  if (g && e.measures.length > 1) {
317
- let n = l(g) || g.label || g.dataItem?.name || "Measure";
317
+ let n = a(g) || g.label || g.dataItem?.name || "Measure";
318
318
  v = {
319
- type: N.Text,
319
+ type: T.Text,
320
320
  key: `text-${_}`,
321
- dataItemType: s.Measure,
321
+ dataItemType: l.Measure,
322
322
  dataItemRole: g.role,
323
- text: u(e.measures, e.enableAlternate, c.isPrintMode) ? S(n) : n,
323
+ text: r(e.measures, e.enableAlternate, u.isPrintMode) ? S(n) : n,
324
324
  layout: {
325
- dock: o.Bottom,
325
+ dock: c.Bottom,
326
326
  color: "red"
327
327
  },
328
328
  style: { text: {
329
329
  fontFamily: t.fonts.general.fontFamily,
330
- fontSize: `${j.fieldTitle.fontSize}px`,
330
+ fontSize: `${E.fieldTitle.fontSize}px`,
331
331
  fontStyle: "normal",
332
332
  fill: t.fonts.general.color
333
333
  } },
334
- anchor: o.Center
334
+ anchor: c.Center
335
335
  };
336
336
  }
337
337
  let y = {
338
- type: N.Labels,
339
- key: L.labels,
338
+ type: T.Labels,
339
+ key: R.labels,
340
340
  layout: { displayOrder: 2 },
341
341
  settings: { sources: [
342
- H(`.${z.NodeLabelLeft}`, 0, t),
343
- H(`.${z.NodeLabelCenter}`, .5, t),
344
- H(`.${z.NodeLabelRight}`, 1, t)
342
+ U(`.${B.NodeLabelLeft}`, 0, t),
343
+ U(`.${B.NodeLabelCenter}`, .5, t),
344
+ U(`.${B.NodeLabelRight}`, 1, t)
345
345
  ] },
346
346
  style: { label: "$label" },
347
- brush: c.disable?.brushing === !0 ? void 0 : {
347
+ brush: u.disable?.brushing === !0 ? void 0 : {
348
348
  trigger: [{
349
- on: k.Tap,
350
- action: A.Toggle,
349
+ on: j.Tap,
350
+ action: N.Toggle,
351
351
  globalPropagation: "stop",
352
352
  data: [""],
353
- contexts: [E.Selection]
353
+ contexts: [P.Selection]
354
354
  }],
355
355
  consume: [{
356
- context: E.Selection,
356
+ context: P.Selection,
357
357
  data: [""],
358
358
  style: { inactive: { opacity: .3 } }
359
359
  }]
@@ -373,53 +373,53 @@ var be = (e, t) => {
373
373
  ],
374
374
  interactions: n.interactions ? [...n.interactions, ...m] : [...m]
375
375
  };
376
- }, Ee = (e, t, r, i, o) => {
376
+ }, Te = (e, t, r, i, a) => {
377
377
  if (r.type !== n.PerEachDimension) {
378
378
  let e = r.color || t?.colors?.brandColors?.[0] || "#aaa";
379
379
  return {
380
- type: O.CategoricalColor,
380
+ type: D.CategoricalColor,
381
381
  data: [],
382
382
  range: [e],
383
383
  unknown: e
384
384
  };
385
385
  }
386
- let s = i.coloring || {};
387
- if (s.type !== n.Categorical) {
388
- let n = o[e.dimensions.indexOf(i) % o.length], r = s.color || n || t?.colors?.brandColors?.[0] || "#aaa";
386
+ let o = i.coloring || {};
387
+ if (o.type !== n.Categorical) {
388
+ let n = a[e.dimensions.indexOf(i) % a.length], r = o.color || n || t?.colors?.brandColors?.[0] || "#aaa";
389
389
  return {
390
- type: O.CategoricalColor,
390
+ type: D.CategoricalColor,
391
391
  data: [],
392
392
  range: [r],
393
393
  unknown: r
394
394
  };
395
395
  }
396
- return C(e, t, a(i.dataItem), {
397
- customPalette: s.customPalette ?? c.customPalette,
398
- palette: s.palette
396
+ return C(e, t, s(i.dataItem), {
397
+ customPalette: o.customPalette ?? u.customPalette,
398
+ palette: o.palette
399
399
  });
400
- }, De = (e, t, n) => {
400
+ }, Ee = (e, t, n) => {
401
401
  let r = e.dimensions.filter((e) => p(e));
402
402
  if (!r[0]) return n;
403
403
  let i = e.coloring;
404
404
  if (!i) throw Error("Missing Sankey coloring settings");
405
- let o = {}, s = se({
405
+ let a = {}, o = oe({
406
406
  palette: i.palette,
407
- customPalette: i.customPalette ?? c.customPalette
407
+ customPalette: i.customPalette ?? u.customPalette
408
408
  }, t);
409
409
  return r.forEach((n) => {
410
- let r = a(n.dataItem);
411
- o[r] = Ee(e, t, i, n, s);
410
+ let r = s(n.dataItem);
411
+ a[r] = Te(e, t, i, n, o);
412
412
  }), {
413
413
  ...n,
414
- scales: o
414
+ scales: a
415
415
  };
416
- }, Oe = (e, t, n) => {
416
+ }, De = (e, t, n) => {
417
417
  let r = e.dimensions.filter((e) => p(e)), i = e.measures.filter((e) => p(e));
418
418
  if (!r[0] || !i[0]) return n;
419
419
  let a = {
420
420
  "$font-family": t.fonts.general.fontFamily,
421
421
  "$font-color": t.fonts.general.color,
422
- "$font-size": `${te(e.sankeySettings?.nodeLabels?.fontSize)}px`,
422
+ "$font-size": `${ne(e.sankeySettings?.nodeLabels?.fontSize)}px`,
423
423
  $label: {
424
424
  fontSize: "$font-size",
425
425
  fontFamily: "$font-family",
@@ -428,7 +428,7 @@ var be = (e, t) => {
428
428
  },
429
429
  $title: {
430
430
  "@extend": "$label",
431
- fontSize: `${j.fieldTitle.fontSize}px`,
431
+ fontSize: `${E.fieldTitle.fontSize}px`,
432
432
  padding: 4
433
433
  }
434
434
  };
@@ -436,41 +436,41 @@ var be = (e, t) => {
436
436
  ...n,
437
437
  style: a
438
438
  };
439
- }, ke = (e, t) => t?.data?.type?.value === "link" ? `${t.data.label} - ${t.data.linkTarget.label}` : t.data.label, Ae = (e, t, n, r, i, a, o) => {
440
- let s = [], c = l(e[0]) || e[0].label || e[0].dataItem.name || "", u = e.length ? c : "Count", d = t.desc?.flow ?? t.data?.flow.value, f = o ? n.formatter(ie())(d) : n.formatter("flow")(d);
441
- return s.push({
439
+ }, Oe = (e, t) => t?.data?.type?.value === "link" ? `${t.data.label} - ${t.data.linkTarget.label}` : t.data.label, ke = (e, t, n, r, i, o, s) => {
440
+ let c = [], l = a(e[0]) || e[0].label || e[0].dataItem.name || "", u = e.length ? l : "Count", d = t.desc?.flow ?? t.data?.flow.value, f = s ? n.formatter(re())(d) : n.formatter("flow")(d);
441
+ return c.push({
442
442
  label: u,
443
443
  value: f
444
- }), s;
445
- }, je = (e, t, n, r, i) => {
444
+ }), c;
445
+ }, Ae = (e, t, n, r, i) => {
446
446
  let a = { placement: ({ nodes: e }) => ({
447
447
  area: "target",
448
448
  type: e[0]?.data?.type?.value === "link" ? "pointer" : "bounds"
449
449
  }) };
450
- return a.extract = oe(e, t, Ae, ke), D(e, t, n, a, "tooltip", i);
451
- }, Me = class extends b {
450
+ return a.extract = ae(e, t, ke, Oe), k(e, t, n, a, "tooltip", i);
451
+ }, je = class extends b {
452
452
  constructor() {
453
453
  super([
454
- Se,
455
- De,
456
454
  xe,
457
- Te,
458
- Oe,
459
- je
455
+ Ee,
456
+ be,
457
+ we,
458
+ De,
459
+ Ae
460
460
  ]);
461
461
  }
462
462
  preCompile(e, t) {
463
463
  let n = e.measures.filter((e) => p(e)), r = e.dimensions.filter((e) => p(e)), i = n[0];
464
464
  if (!i) return;
465
- let o = a(i.dataItem), s = r.map((e) => a(e.dataItem));
465
+ let a = s(i.dataItem), o = r.map((e) => s(e.dataItem));
466
466
  t.forEach((t) => {
467
467
  if (t.items?.length) {
468
- if (t.items = t.items.filter((e) => e[o] > 0), !t.items.length) throw Error("Current data query resulted in only negative and/or null values which can not be displayed in this chart.");
469
- if (!e.sankeySettings.showNullNodes && !t.items.find((e) => s.find((t) => e[t] !== null))) throw Error("Current dataset contains only non-null dimension values and can not be displayed in the current configuration of this chart.");
468
+ if (t.items = t.items.filter((e) => e[a] > 0), !t.items.length) throw Error("Current data query resulted in only negative and/or null values which can not be displayed in this chart.");
469
+ if (!e.sankeySettings.showNullNodes && !t.items.find((e) => o.find((t) => e[t] !== null))) throw Error("Current dataset contains only non-null dimension values and can not be displayed in the current configuration of this chart.");
470
470
  }
471
471
  });
472
472
  }
473
- }, U = {
473
+ }, W = {
474
474
  showNullNodes: !1,
475
475
  nodePadding: .2,
476
476
  nodeWidth: .2,
@@ -483,7 +483,7 @@ var be = (e, t) => {
483
483
  showNodeLabelBackdrop: !0,
484
484
  nodeLabelBackdropColor: null,
485
485
  columnFields: [],
486
- nodeLabelPlacements: [i.Beside],
486
+ nodeLabelPlacements: [o.Beside],
487
487
  node: {
488
488
  id: "",
489
489
  fill: "#333333"
@@ -495,10 +495,10 @@ var be = (e, t) => {
495
495
  value: 1
496
496
  }
497
497
  };
498
- function W(e, t) {
498
+ function G(e, t) {
499
499
  return e.dataFill === t.dataFill ? 0 : e.dataFill !== void 0 && t.dataFill !== void 0 && e.dataFill < t.dataFill ? -1 : 1;
500
500
  }
501
- function Ne(e) {
501
+ function Me(e) {
502
502
  let t = e.target.x0 - e.source.x1, n = e.y0 - e.y1, r = Math.abs(n) < .1 ? 0 : .5;
503
503
  return [
504
504
  `M${e.source.x1},${e.y0}`,
@@ -507,12 +507,12 @@ function Ne(e) {
507
507
  `${e.target.x0},${e.y1}`
508
508
  ].join(" ");
509
509
  }
510
- function Pe(e) {
510
+ function Ne(e) {
511
511
  return e.map((e) => ({
512
512
  type: M.Path,
513
513
  data: e.data,
514
514
  desc: { flow: e.value },
515
- d: Ne(e),
515
+ d: Me(e),
516
516
  fill: "none",
517
517
  strokeWidth: Math.max(.5, e.width),
518
518
  stroke: e.fill,
@@ -522,14 +522,14 @@ function Pe(e) {
522
522
  collider: { visual: !0 }
523
523
  }));
524
524
  }
525
- function Fe(e) {
525
+ function Pe(e) {
526
526
  let { data: n, resolver: r, settings: i, resolvedNodes: a } = e, o = {};
527
527
  a.forEach((e) => {
528
528
  o[e.id] = e;
529
529
  });
530
530
  let s = n.items.filter((e) => e.type.value === "link"), { items: c } = r.resolve({
531
531
  data: { items: s },
532
- defaults: { ...U.link },
532
+ defaults: { ...W.link },
533
533
  settings: i.link
534
534
  }), l = {};
535
535
  return c.filter((e) => !!e.linkTarget).forEach((e) => {
@@ -571,10 +571,10 @@ function Fe(e) {
571
571
  opacity: e.opacity
572
572
  }));
573
573
  }
574
- function Ie(e) {
574
+ function Fe(e) {
575
575
  let { data: t, resolver: n, settings: r } = e, i = t.items.filter((e) => e.type.value === "node"), { items: a } = n.resolve({
576
576
  data: { items: i },
577
- defaults: { ...U.node },
577
+ defaults: { ...W.node },
578
578
  settings: {
579
579
  ...r.node,
580
580
  fixedValue: ({ datum: e }) => e.flow.value
@@ -582,7 +582,7 @@ function Ie(e) {
582
582
  });
583
583
  return a;
584
584
  }
585
- function Le(e, t) {
585
+ function Ie(e, t) {
586
586
  let n = [];
587
587
  return e.map((e) => {
588
588
  let r = e.data, i = {};
@@ -600,7 +600,7 @@ function Le(e, t) {
600
600
  }), i[e.dataFill].targetSum += e.value);
601
601
  });
602
602
  let a = Object.values(i);
603
- a.sort(W);
603
+ a.sort(G);
604
604
  let o = a.reduce(([e, t], n) => [e + n.sourceSum, t + n.targetSum], [0, 0]), s = 1 - Math.max(...o) / e.value, c = e.y1 - e.y0, l = e.y0;
605
605
  n.push({
606
606
  id: e.id,
@@ -638,7 +638,7 @@ function Le(e, t) {
638
638
  });
639
639
  }), n;
640
640
  }
641
- var G = (e, t, n = !1, r = [4, 2]) => ({
641
+ var K = (e, t, n = !1, r = [4, 2]) => ({
642
642
  data: e.data,
643
643
  background: n ? e.fill : void 0,
644
644
  label: e.data.label,
@@ -649,10 +649,10 @@ var G = (e, t, n = !1, r = [4, 2]) => ({
649
649
  opacity: t.backdropColor ? 1 : .8,
650
650
  padding: r
651
651
  } : void 0
652
- }), Re = (e, t, n, r) => {
652
+ }), Le = (e, t, n, r) => {
653
653
  let { nodeLabelHeight: i, nodePadding: a } = r;
654
654
  return a < i ? [] : e.map((e) => {
655
- let t = n[e.layer], a = G(e, r, !1, [4, 0]), o = a.backdrop?.padding ?? [0, 0], s = t.align < .5 ? z.NodeLabelLeft : t.align > .5 ? z.NodeLabelRight : z.NodeLabelCenter;
655
+ let t = n[e.layer], a = K(e, r, !1, [4, 0]), o = a.backdrop?.padding ?? [0, 0], s = t.align < .5 ? B.NodeLabelLeft : t.align > .5 ? B.NodeLabelRight : B.NodeLabelCenter;
656
656
  return {
657
657
  type: M.Rect,
658
658
  id: `${e.id}::labelTarget`,
@@ -665,10 +665,10 @@ var G = (e, t, n = !1, r = [4, 2]) => ({
665
665
  fill: "none"
666
666
  };
667
667
  });
668
- }, ze = (e) => e.canShowNodeLabelAboveNode, Be = (e, t, n, r) => {
668
+ }, Re = (e) => e.canShowNodeLabelAboveNode, ze = (e, t, n, r) => {
669
669
  let { nodePadding: i } = r;
670
670
  return e.filter((e) => e.y1 - e.y0 + i >= r.nodeLabelHeight).map((e) => {
671
- let t = n[e.layer], a = t.align <= .5 ? z.NodeLabelLeft : z.NodeLabelRight, o = G(e, r, !1, [4, 2]), s = o.backdrop?.padding ?? [0, 0], c = [2, 2], l = [s[0] + c[0], s[1] + c[1]], u = {
671
+ let t = n[e.layer], a = t.align <= .5 ? B.NodeLabelLeft : B.NodeLabelRight, o = K(e, r, !1, [4, 2]), s = o.backdrop?.padding ?? [0, 0], c = [2, 2], l = [s[0] + c[0], s[1] + c[1]], u = {
672
672
  type: M.Rect,
673
673
  id: `${e.id}::labelTarget`,
674
674
  x: t.gapX + l[0],
@@ -679,10 +679,10 @@ var G = (e, t, n = !1, r = [4, 2]) => ({
679
679
  tag: a,
680
680
  fill: "none"
681
681
  };
682
- return t.nodeWidth === 0 && (u.x = t.fullX + s[0], u.width = t.fullWidth - 2 * s[1], u.tag = t.align < .5 ? z.NodeLabelLeft : t.align > .5 ? z.NodeLabelRight : z.NodeLabelCenter), u;
682
+ return t.nodeWidth === 0 && (u.x = t.fullX + s[0], u.width = t.fullWidth - 2 * s[1], u.tag = t.align < .5 ? B.NodeLabelLeft : t.align > .5 ? B.NodeLabelRight : B.NodeLabelCenter), u;
683
683
  });
684
- }, Ve = (e) => e.columnGap >= 20, He = (e, t, n, r) => e.filter((e) => e.y1 - e.y0 >= r.nodeLabelHeight).map((e) => {
685
- let t = G(e, r, !0, [4, 2]);
684
+ }, Be = (e) => e.columnGap >= 20, Ve = (e, t, n, r) => e.filter((e) => e.y1 - e.y0 >= r.nodeLabelHeight).map((e) => {
685
+ let t = K(e, r, !0, [4, 2]);
686
686
  return {
687
687
  type: M.Rect,
688
688
  id: `${e.id}::labelTarget`,
@@ -691,37 +691,37 @@ var G = (e, t, n = !1, r = [4, 2]) => ({
691
691
  y: e.y0,
692
692
  height: e.y1 - e.y0,
693
693
  desc: t,
694
- tag: z.NodeLabelCenter,
694
+ tag: B.NodeLabelCenter,
695
695
  fill: "none"
696
696
  };
697
- }), Ue = (e) => e.columnWidth >= 80, K = {
698
- [i.Above]: {
699
- condition: ze,
700
- create: Re
697
+ }), He = (e) => e.columnWidth >= 80, q = {
698
+ [o.Above]: {
699
+ condition: Re,
700
+ create: Le
701
701
  },
702
- [i.Beside]: {
703
- condition: Ve,
704
- create: Be
702
+ [o.Beside]: {
703
+ condition: Be,
704
+ create: ze
705
705
  },
706
- [i.Inside]: {
707
- condition: Ue,
708
- create: He
706
+ [o.Inside]: {
707
+ condition: He,
708
+ create: Ve
709
709
  }
710
- }, We = (e) => e.priority.find((t) => K[t]?.condition(e)), Ge = (e, t, n, r) => {
710
+ }, Ue = (e) => e.priority.find((t) => q[t]?.condition(e)), We = (e, t, n, r) => {
711
711
  let i = [], a = n[0];
712
712
  if (!r.showDimensionLabel && !r.showFlowLabel) return [];
713
- let o = r.priority.find((e) => K[e]?.condition({
713
+ let o = r.priority.find((e) => q[e]?.condition({
714
714
  canShowNodeLabelAboveNode: r.canShowNodeLabelAboveNode,
715
715
  columnGap: a.gapWidth,
716
716
  columnWidth: a.nodeWidth,
717
717
  priority: r.priority
718
718
  }));
719
- return o && i.push(...K[o].create(e, t, n, r)), i;
719
+ return o && i.push(...q[o].create(e, t, n, r)), i;
720
720
  };
721
- function Ke(e, t) {
721
+ function Ge(e, t) {
722
722
  let { headerHeight: n } = t;
723
723
  return e.map((e) => {
724
- let t = e.align < .5 ? z.ColumnTitleLeft : e.align > .5 ? z.ColumnTitleRight : z.ColumnTitleCenter;
724
+ let t = e.align < .5 ? B.ColumnTitleLeft : e.align > .5 ? B.ColumnTitleRight : B.ColumnTitleCenter;
725
725
  return {
726
726
  type: M.Rect,
727
727
  id: `column::${e.field}::labelTarget`,
@@ -740,7 +740,7 @@ function Ke(e, t) {
740
740
  };
741
741
  });
742
742
  }
743
- function qe(e, t, n, r) {
743
+ function Ke(e, t, n, r) {
744
744
  let i = {};
745
745
  e.columnFields.forEach((e) => {
746
746
  i[e.id] = {
@@ -758,9 +758,9 @@ function qe(e, t, n, r) {
758
758
  field: e.id,
759
759
  sort: e.sort
760
760
  }));
761
- return Je(a, t, n, e.showNullNodes), a;
761
+ return qe(a, t, n, e.showNullNodes), a;
762
762
  }
763
- function Je(e, t, n, r = !1) {
763
+ function qe(e, t, n, r = !1) {
764
764
  (e.find((e) => !e.count) || !r) && e.forEach((r, i) => {
765
765
  let a = `dummy-${i}`, o = `dummy-${i + 1}`;
766
766
  t.unshift({
@@ -787,13 +787,13 @@ function Je(e, t, n, r = !1) {
787
787
  });
788
788
  });
789
789
  }
790
- function Ye(e, t) {
790
+ function Je(e, t) {
791
791
  return {
792
792
  nodes: e.filter((e) => !e.id.startsWith("dummy-")),
793
793
  links: t.filter((e) => !e.source.id.startsWith("dummy-"))
794
794
  };
795
795
  }
796
- function Xe(e, t, n) {
796
+ function Ye(e, t, n) {
797
797
  let r = n[1][1] - n[0][1], i = e.reduce(([e, t], n) => [Math.min(e, n.y0), Math.max(t, n.y1)], [e[0].y0, e[0].y1]), a = i[0] - n[0][1], o = n[1][1] - i[1], s = 0;
798
798
  a > o && r / a > .1 ? s = -a / 2 : o > a && r / o > .1 && (s = o / 2), s !== 0 && (e.forEach((e) => {
799
799
  e.y0 += s, e.y1 += s;
@@ -801,7 +801,7 @@ function Xe(e, t, n) {
801
801
  e.y0 += s, e.y1 += s;
802
802
  }));
803
803
  }
804
- function Ze(e, t, n) {
804
+ function Xe(e, t, n) {
805
805
  return e.map((r) => {
806
806
  let i = t.find((e) => e.data.source.field === r.field);
807
807
  if (!i) throw Error(`Missing Sankey node for column ${r.field}`);
@@ -818,18 +818,18 @@ function Ze(e, t, n) {
818
818
  };
819
819
  });
820
820
  }
821
- function Qe(e, t, n, r, a) {
822
- let o = Math.max(0, n.width / (e.length * 2) * t.nodeWidth), s = o > 0 ? t.linkMargin * .5 * Math.min(24, (n.width - o * e.length) / (e.length - 1) / 2) : 0;
823
- o += s * 2;
824
- let c = (n.width - o * e.length) / (e.length - 1), l = Math.max(...e.map((e) => e.count)), u = r.measureText(a.title).height + 2 * a.title.padding, d = 8 + u, f = t.showColumnHeaderLabels && n.height - 8 - d > 0, p = r.measureText(a.label).height + 2 * a.label.padding, m = f ? d : 0, h = n.height - m, g = h / l / 2 * t.nodePadding, _ = (t.showNodeDimensionLabel || t.showNodeFlowLabel) && p * l < h / 2, v = g, y = We({
821
+ function Ze(e, t, n, r, i) {
822
+ let a = Math.max(0, n.width / (e.length * 2) * t.nodeWidth), s = a > 0 ? t.linkMargin * .5 * Math.min(24, (n.width - a * e.length) / (e.length - 1) / 2) : 0;
823
+ a += s * 2;
824
+ let c = (n.width - a * e.length) / (e.length - 1), l = Math.max(...e.map((e) => e.count)), u = r.measureText(i.title).height + 2 * i.title.padding, d = 8 + u, f = t.showColumnHeaderLabels && n.height - 8 - d > 0, p = r.measureText(i.label).height + 2 * i.label.padding, m = f ? d : 0, h = n.height - m, g = h / l / 2 * t.nodePadding, _ = (t.showNodeDimensionLabel || t.showNodeFlowLabel) && p * l < h / 2, v = g, y = Ue({
825
825
  canShowNodeLabelAboveNode: _,
826
826
  columnGap: c,
827
- columnWidth: o,
827
+ columnWidth: a,
828
828
  priority: t.nodeLabelPlacements
829
829
  });
830
- return _ && y === i.Above && (m += p, v = Math.max(p, g)), {
830
+ return _ && y === o.Above && (m += p, v = Math.max(p, g)), {
831
831
  columnGap: c,
832
- columnWidth: o,
832
+ columnWidth: a,
833
833
  nodePadding: v,
834
834
  availableHeight: h,
835
835
  nodeLabelHeight: p,
@@ -840,63 +840,63 @@ function Qe(e, t, n, r, a) {
840
840
  canShowNodeLabelAboveNode: _
841
841
  };
842
842
  }
843
- function $e(e, t) {
843
+ function Qe(e, t) {
844
844
  return e.sourceLinks.length ? e.depth : t - 1;
845
845
  }
846
- function q(e) {
846
+ function J(e) {
847
847
  return function() {
848
848
  return e;
849
849
  };
850
850
  }
851
- de();
852
- function J(e, t) {
853
- return X(e.source, t.source) || e.index - t.index;
854
- }
851
+ ue();
855
852
  function Y(e, t) {
856
- return X(e.target, t.target) || e.index - t.index;
853
+ return Z(e.source, t.source) || e.index - t.index;
857
854
  }
858
855
  function X(e, t) {
856
+ return Z(e.target, t.target) || e.index - t.index;
857
+ }
858
+ function Z(e, t) {
859
859
  return e.y0 - t.y0;
860
860
  }
861
- function Z(e) {
861
+ function Q(e) {
862
862
  return e.value;
863
863
  }
864
- function et(e) {
864
+ function $e(e) {
865
865
  return e.index;
866
866
  }
867
- function tt(e) {
867
+ function et(e) {
868
868
  return e.nodes;
869
869
  }
870
- function nt(e) {
870
+ function tt(e) {
871
871
  return e.links;
872
872
  }
873
- function Q(e, t) {
873
+ function nt(e, t) {
874
874
  let n = e.get(t);
875
875
  if (!n) throw Error("missing: " + t);
876
876
  return n;
877
877
  }
878
- function $({ nodes: e }) {
878
+ function rt({ nodes: e }) {
879
879
  for (let t of e) {
880
880
  let e = t.y0, n = e;
881
881
  for (let n of t.sourceLinks) n.y0 = e + n.width / 2, e += n.width;
882
882
  for (let e of t.targetLinks) e.y1 = n + e.width / 2, n += e.width;
883
883
  }
884
884
  }
885
- function rt() {
886
- let e = 0, t = 0, n = 1, r = 1, i = 24, a = 8, o, s = et, c = $e, l, u, d = tt, f = nt, p = 6;
885
+ function it() {
886
+ let e = 0, t = 0, n = 1, r = 1, i = 24, a = 8, o, s = $e, c = Qe, l, u, d = et, f = tt, p = 6;
887
887
  function m() {
888
888
  let e = {
889
889
  nodes: d.apply(null, arguments),
890
890
  links: f.apply(null, arguments)
891
891
  };
892
- return h(e), g(e), _(e), v(e), x(e), $(e), e;
892
+ return h(e), g(e), _(e), v(e), x(e), rt(e), e;
893
893
  }
894
894
  m.update = function(e) {
895
- return $(e), e;
895
+ return rt(e), e;
896
896
  }, m.nodeId = function(e) {
897
- return arguments.length ? (s = typeof e == "function" ? e : q(e), m) : s;
897
+ return arguments.length ? (s = typeof e == "function" ? e : J(e), m) : s;
898
898
  }, m.nodeAlign = function(e) {
899
- return arguments.length ? (c = typeof e == "function" ? e : q(e), m) : c;
899
+ return arguments.length ? (c = typeof e == "function" ? e : J(e), m) : c;
900
900
  }, m.nodeSort = function(e) {
901
901
  return arguments.length ? (l = e, m) : l;
902
902
  }, m.nodeWidth = function(e) {
@@ -904,9 +904,9 @@ function rt() {
904
904
  }, m.nodePadding = function(e) {
905
905
  return arguments.length ? (a = o = +e, m) : a;
906
906
  }, m.nodes = function(e) {
907
- return arguments.length ? (d = typeof e == "function" ? e : q(e), m) : d;
907
+ return arguments.length ? (d = typeof e == "function" ? e : J(e), m) : d;
908
908
  }, m.links = function(e) {
909
- return arguments.length ? (f = typeof e == "function" ? e : q(e), m) : f;
909
+ return arguments.length ? (f = typeof e == "function" ? e : J(e), m) : f;
910
910
  }, m.linkSort = function(e) {
911
911
  return arguments.length ? (u = e, m) : u;
912
912
  }, m.size = function(i) {
@@ -922,12 +922,12 @@ function rt() {
922
922
  for (let [e, r] of t.entries()) {
923
923
  r.index = e;
924
924
  let { source: t, target: i } = r;
925
- typeof t != "object" && (t = r.source = Q(n, t)), typeof i != "object" && (i = r.target = Q(n, i)), t.sourceLinks.push(r), i.targetLinks.push(r);
925
+ typeof t != "object" && (t = r.source = nt(n, t)), typeof i != "object" && (i = r.target = nt(n, i)), t.sourceLinks.push(r), i.targetLinks.push(r);
926
926
  }
927
927
  if (u != null) for (let { sourceLinks: t, targetLinks: n } of e) t.sort(u), n.sort(u);
928
928
  }
929
929
  function g({ nodes: e }) {
930
- for (let t of e) t.value = t.fixedValue === void 0 ? Math.max(I(t.sourceLinks, Z), I(t.targetLinks, Z)) : t.fixedValue;
930
+ for (let t of e) t.value = t.fixedValue === void 0 ? Math.max(L(t.sourceLinks, Q), L(t.targetLinks, Q)) : t.fixedValue;
931
931
  }
932
932
  function _({ nodes: e }) {
933
933
  let t = e.length, n = new Set(e), r = /* @__PURE__ */ new Set(), i = 0;
@@ -952,7 +952,7 @@ function rt() {
952
952
  }
953
953
  }
954
954
  function y({ nodes: t }) {
955
- let r = F(t, (e) => e.depth) + 1, a = (n - e - i) / (r - 1), o = Array(r);
955
+ let r = I(t, (e) => e.depth) + 1, a = (n - e - i) / (r - 1), o = Array(r);
956
956
  for (let n of t) {
957
957
  let t = Math.max(0, Math.min(r - 1, Math.floor(c.call(null, n, r))));
958
958
  n.layer = t, n.x0 = e + t * a, n.x1 = n.x0 + i, o[t] ? o[t].push(n) : o[t] = [n];
@@ -961,7 +961,7 @@ function rt() {
961
961
  return o;
962
962
  }
963
963
  function b(e) {
964
- let n = fe(e, (e) => (r - t - (e.length - 1) * o) / I(e, Z));
964
+ let n = de(e, (e) => (r - t - (e.length - 1) * o) / L(e, Q));
965
965
  for (let i of e) {
966
966
  let e = t;
967
967
  for (let t of i) {
@@ -978,7 +978,7 @@ function rt() {
978
978
  }
979
979
  function x(e) {
980
980
  let n = y(e);
981
- o = Math.min(a, (r - t) / (F(n, (e) => e.length) - 1)), b(n);
981
+ o = Math.min(a, (r - t) / (I(n, (e) => e.length) - 1)), b(n);
982
982
  for (let e = 0; e < p; ++e) {
983
983
  let t = .99 ** e, r = Math.max(1 - t, (e + 1) / p);
984
984
  C(n, t, r), S(n, t, r);
@@ -997,7 +997,7 @@ function rt() {
997
997
  let i = (n / r - e.y0) * t;
998
998
  e.y0 += i, e.y1 += i, D(e);
999
999
  }
1000
- l === void 0 && i.sort(X), w(i, n);
1000
+ l === void 0 && i.sort(Z), w(i, n);
1001
1001
  }
1002
1002
  }
1003
1003
  function C(e, t, n) {
@@ -1013,7 +1013,7 @@ function rt() {
1013
1013
  let i = (n / r - e.y0) * t;
1014
1014
  e.y0 += i, e.y1 += i, D(e);
1015
1015
  }
1016
- l === void 0 && i.sort(X), w(i, n);
1016
+ l === void 0 && i.sort(Z), w(i, n);
1017
1017
  }
1018
1018
  }
1019
1019
  function w(e, n) {
@@ -1034,12 +1034,12 @@ function rt() {
1034
1034
  }
1035
1035
  function D({ sourceLinks: e, targetLinks: t }) {
1036
1036
  if (u === void 0) {
1037
- for (let { source: { sourceLinks: e } } of t) e.sort(Y);
1038
- for (let { target: { targetLinks: t } } of e) t.sort(J);
1037
+ for (let { source: { sourceLinks: e } } of t) e.sort(X);
1038
+ for (let { target: { targetLinks: t } } of e) t.sort(Y);
1039
1039
  }
1040
1040
  }
1041
1041
  function O(e) {
1042
- if (u === void 0) for (let { sourceLinks: t, targetLinks: n } of e) t.sort(Y), n.sort(J);
1042
+ if (u === void 0) for (let { sourceLinks: t, targetLinks: n } of e) t.sort(X), n.sort(Y);
1043
1043
  }
1044
1044
  function k(e, t) {
1045
1045
  let n = e.y0 - (e.sourceLinks.length - 1) * o / 2;
@@ -1067,17 +1067,17 @@ function rt() {
1067
1067
  }
1068
1068
  return m;
1069
1069
  }
1070
- var it = 4;
1070
+ var $ = 4;
1071
1071
  function at(e) {
1072
1072
  let { columns: t, sankeyNodes: n, sankeyLinks: r, columnWidth: i, columnGap: a, nodePadding: o, top: s, rect: c } = e, l = t.map((e) => e.field), u = (e) => l.indexOf(e.data.source.field), d = t.find((e) => !!e.sort) ? (e, n) => {
1073
1073
  if (e.layer === void 0) throw Error("Missing Sankey node layer before sorting");
1074
1074
  let r = t[e.layer].sort;
1075
1075
  return r?.(e, n) ?? 0;
1076
- } : void 0, f = [[0, s + it], [c.width, c.height - 2 * it]], p = rt().nodeId((e) => e.id).nodePadding(o).nodeWidth(i).linkSort((e, t) => e.dataFill && t.dataFill ? W(e, t) : e.dataFill ? 1 : -1).nodeSort(d).nodeAlign(u).extent(f).iterations(6)({
1076
+ } : void 0, f = [[0, s + $], [c.width, c.height - 2 * $]], p = it().nodeId((e) => e.id).nodePadding(o).nodeWidth(i).linkSort((e, t) => e.dataFill && t.dataFill ? G(e, t) : e.dataFill ? 1 : -1).nodeSort(d).nodeAlign(u).extent(f).iterations(6)({
1077
1077
  nodes: n,
1078
1078
  links: r
1079
- }), m = Ze(t, p.nodes, a), { nodes: h, links: g } = Ye(p.nodes, p.links);
1080
- return Xe(h, g, f), {
1079
+ }), m = Xe(t, p.nodes, a), { nodes: h, links: g } = Je(p.nodes, p.links);
1080
+ return Ye(h, g, f), {
1081
1081
  nodes: h,
1082
1082
  links: g,
1083
1083
  columns: m
@@ -1090,23 +1090,23 @@ var ot = {
1090
1090
  "renderer"
1091
1091
  ],
1092
1092
  defaultSettings: {
1093
- settings: U,
1093
+ settings: W,
1094
1094
  style: {
1095
1095
  title: "$title",
1096
1096
  label: "$label"
1097
1097
  }
1098
1098
  },
1099
1099
  render({ data: e }) {
1100
- let { settings: t } = this.settings, n = Ie({
1100
+ let { settings: t } = this.settings, n = Fe({
1101
1101
  data: e,
1102
1102
  resolver: this.resolver,
1103
1103
  settings: t
1104
- }), r = Fe({
1104
+ }), r = Pe({
1105
1105
  data: e,
1106
1106
  resolver: this.resolver,
1107
1107
  settings: t,
1108
1108
  resolvedNodes: n
1109
- }), i = qe(t, n, r, this.chart.dataset()), { columnGap: a, columnWidth: o, nodePadding: s, availableHeight: c, nodeLabelHeight: l, nodeMargin: u, top: d, showHeader: f, headerTitleHeight: p, canShowNodeLabelAboveNode: m } = Qe(i, t, this.rect, this.renderer, this.style);
1109
+ }), i = Ke(t, n, r, this.chart.dataset()), { columnGap: a, columnWidth: o, nodePadding: s, availableHeight: c, nodeLabelHeight: l, nodeMargin: u, top: d, showHeader: f, headerTitleHeight: p, canShowNodeLabelAboveNode: m } = Ze(i, t, this.rect, this.renderer, this.style);
1110
1110
  if (c < 8) return [];
1111
1111
  let { nodes: h, links: g, columns: _ } = at({
1112
1112
  columns: i,
@@ -1117,7 +1117,7 @@ var ot = {
1117
1117
  nodePadding: s,
1118
1118
  top: d,
1119
1119
  rect: this.rect
1120
- }), v = Le(h, { nodeMargin: u }), y = Ge(h, v, _, {
1120
+ }), v = Ie(h, { nodeMargin: u }), y = We(h, v, _, {
1121
1121
  nodeLabelHeight: l,
1122
1122
  canShowNodeLabelAboveNode: m,
1123
1123
  nodePadding: s,
@@ -1129,32 +1129,32 @@ var ot = {
1129
1129
  priority: t.nodeLabelPlacements
1130
1130
  });
1131
1131
  return [
1132
- ...Pe(g),
1132
+ ...Ne(g),
1133
1133
  ...v,
1134
- ...f ? Ke(_, { headerHeight: p }) : [],
1134
+ ...f ? Ge(_, { headerHeight: p }) : [],
1135
1135
  ...y
1136
1136
  ];
1137
1137
  }
1138
1138
  };
1139
1139
  function st(e) {
1140
- e.component(N.Sankey, ot);
1140
+ e.component(T.Sankey, ot);
1141
1141
  }
1142
- var ct = y(), lt = _(({ vSpec: e, vTheme: t, data: n, elementSize: r, vizProperties: i }) => {
1143
- let o = g(), [s] = (0, pe.useState)(() => new Me()), c = t || f, l = v(), u = h(), p = ne();
1142
+ var ct = v(), lt = g(({ vSpec: e, vTheme: t, data: n, elementSize: r, vizProperties: i }) => {
1143
+ let a = h(), [o] = (0, fe.useState)(() => new je()), c = t || f, l = y(), u = m(), p = te();
1144
1144
  if (!e) return null;
1145
- let m = l.targetDataItemId;
1146
- if (!m && l.targetInternalKey) {
1145
+ let g = l.targetDataItemId;
1146
+ if (!g && l.targetInternalKey) {
1147
1147
  let t = e.dimensions.find((e) => e.dataItem.internalKey === l.targetInternalKey);
1148
- t && (m = a(t.dataItem));
1148
+ t && (g = s(t.dataItem));
1149
1149
  }
1150
1150
  let _ = {
1151
1151
  ...i,
1152
1152
  valuePickerMode: !!l.activeKey,
1153
- valuePickerTargetDataItemId: m ?? void 0
1154
- }, y = s.compile(e, c, n, r, _, d.Sankey, o, u, p);
1155
- return y ? /* @__PURE__ */ (0, ct.jsx)(ee, {
1153
+ valuePickerTargetDataItemId: g ?? void 0
1154
+ }, v = o.compile(e, c, n, r, _, d.Sankey, a, u, p);
1155
+ return v ? /* @__PURE__ */ (0, ct.jsx)(ee, {
1156
1156
  config: i,
1157
- definition: y,
1157
+ definition: v,
1158
1158
  size: r,
1159
1159
  vSpec: e,
1160
1160
  escobarPlugins: [st]