@astrato-io/visualizations 0.9.0 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (145) hide show
  1. package/README.md +8 -4
  2. package/THIRD_PARTY_NOTICES.md +163 -14
  3. package/VISUALIZATION_DEFINITIONS.md +319 -32
  4. package/chunks/{Button-5CxPEACP.js → Button-CCF851ea.js} +4 -4
  5. package/chunks/{CircularProgress-DFS-LQb7.js → CircularProgress-yupH6YWs.js} +39 -39
  6. package/chunks/FieldTypeIcon-D_MzsdfY.js +22 -0
  7. package/chunks/{LinearProgress-CjIQfkNA.js → LinearProgress-CyFjN4px.js} +9 -9
  8. package/chunks/{MenuOption-Cb7B7x6z.js → MenuOption-CQpT79AP.js} +143 -142
  9. package/chunks/{Title-CtFw1bVg.js → Title-C-p4ZarD.js} +22 -22
  10. package/chunks/_createAggregator-BF4qG9XK.js +50 -0
  11. package/chunks/{app-filter-bar.compiler-B9775gLJ.js → app-filter-bar.compiler-8fxCo2q7.js} +10 -10
  12. package/chunks/bar-layout-DStC-GNV.js +9 -0
  13. package/chunks/{bar.compiler-B7wlH_Ro.js → bar.compiler-CQAu8KL8.js} +102 -84
  14. package/chunks/{builder-Dxo7D7c6.js → builder-CScg1TOS.js} +71 -38
  15. package/chunks/color-rules-DYJL4fIW.js +15 -0
  16. package/chunks/color-settings-DJFoFTip.js +5 -0
  17. package/chunks/{coloring-B-Wa8D5P.js → coloring-9jU3s_-p.js} +41 -41
  18. package/chunks/createSimplePaletteValueFilter-C4hZpCdn.js +2005 -0
  19. package/chunks/defaults-cyNhn37t.js +3 -0
  20. package/chunks/{definitions-DNpzD9tY.js → definitions-C4grxhye.js} +613 -401
  21. package/chunks/{escobar-C4Nm3eJ7.js → escobar-CjirINHP.js} +5326 -5079
  22. package/chunks/{extend-preset-BVKFtoe-.js → extend-preset-D-l9u_we.js} +974 -909
  23. package/chunks/{filter.compiler-BlS3zoy_.js → filter.compiler-lji2Acgn.js} +10 -10
  24. package/chunks/{filtering-CGuLpg7u.js → filtering-C1zakrrX.js} +385 -429
  25. package/chunks/handlers-ZviIUC-j.js +15387 -0
  26. package/chunks/{icon-picker-styles-DYQgVEKG.js → icon-picker-styles-Bj80ZUBK.js} +11 -11
  27. package/chunks/isEqual-Ch9OEye3.js +16 -0
  28. package/chunks/{isFocusVisible-B1_z03UT.js → isFocusVisible-CgMP0qkR.js} +1 -1
  29. package/chunks/label-format-type-C46pzgx7.js +17 -0
  30. package/chunks/{line.compiler-Bo9i9qag.js → line.compiler-De5fiKuR.js} +9 -9
  31. package/chunks/{logger-3lng-wOw.js → logger-CKRjhSHQ.js} +71 -64
  32. package/chunks/map.compiler-CKzorLgK.js +345 -0
  33. package/chunks/{metadata-Fmx1swpK.js → metadata-Bb9pTXrq.js} +1 -1
  34. package/chunks/{number.compiler-CdLd5aGW.js → number.compiler-CaTmJkmi.js} +7 -7
  35. package/chunks/operations-DZoY50VX.js +31297 -0
  36. package/chunks/{range-CzO4isKK.js → range-D1BTmFMp.js} +2 -2
  37. package/chunks/{react-dom-BwZT0N3F.js → react-dom-Dgv2azN2.js} +70 -70
  38. package/chunks/{render-wrappers-CAuvgMxi.js → render-wrappers-_P3xwu5A.js} +1 -1
  39. package/chunks/{requirements-CYpVh65U.js → requirements-NHNrR8Ie.js} +59 -57
  40. package/chunks/shared-UitWpq1J.js +1331 -0
  41. package/chunks/{standalone-CoQxJ6ov.js → standalone-B0U6c3su.js} +804 -804
  42. package/chunks/{standalone-C6XDHYAM.js → standalone-BBu90BhK.js} +109 -109
  43. package/chunks/standalone-BEekPuA12.js +357 -0
  44. package/chunks/{standalone-CPUiiWNP.js → standalone-BOzHA_d4.js} +41 -41
  45. package/chunks/standalone-BR2JuRIC.js +422 -0
  46. package/chunks/{standalone-DuwTOBXH.js → standalone-BapqaniK.js} +592 -592
  47. package/chunks/{standalone-DWPfdP0A.js → standalone-Bnnr87pc.js} +523 -523
  48. package/chunks/standalone-BwJqDj2Z.js +396 -0
  49. package/chunks/{standalone-LFVgLhia.js → standalone-ByKKqT5L.js} +266 -258
  50. package/chunks/{standalone-BDrQMxLi.js → standalone-CRdDZYeM.js} +1788 -1004
  51. package/chunks/standalone-CRfDOO1x.js +287 -0
  52. package/chunks/{standalone-BvWdpUL3.js → standalone-CVknVdUC.js} +21 -18
  53. package/chunks/standalone-CbPk8bKn.js +580 -0
  54. package/chunks/{standalone-r4ObFvys.js → standalone-Ck63MZzj.js} +218 -216
  55. package/chunks/{standalone-Cu73fzSr.js → standalone-DCFY1MAV.js} +6040 -5820
  56. package/chunks/{standalone-CiaaibTa.js → standalone-DZDGX3aa.js} +174 -174
  57. package/chunks/standalone-DhfgeJIk.js +1012 -0
  58. package/chunks/standalone-DibjA73M.js +6 -0
  59. package/chunks/{standalone-CXniic5x.js → standalone-DtBk_iUz.js} +6 -5
  60. package/chunks/standalone-DxBAyqAu.js +772 -0
  61. package/chunks/standalone-KMQPsNsq.js +2 -0
  62. package/chunks/standalone-MBLSvsrY.js +2 -0
  63. package/chunks/standalone-U0WJwFlG.js +354 -0
  64. package/chunks/{standalone-CNkHsynO.js → standalone-swGs70tD.js} +54 -56
  65. package/chunks/standalone-wgFAVnnm.js +355 -0
  66. package/chunks/standalone-xGV0dqPV.js +689 -0
  67. package/chunks/{table.compiler-C1qjqXaT.js → table.compiler-OWSx5MOq.js} +4 -4
  68. package/chunks/{useFieldName-mWrD_uk_.js → useFieldName-B8iCYyw1.js} +1 -1
  69. package/chunks/{utils-DYYD4Zzf.js → utils-3Igg6xmO.js} +4740 -4737
  70. package/chunks/{view-7fH6mGmY.js → view-DdMLZySj.js} +1988 -1632
  71. package/chunks/{visualization-filters-mVnsnvLP.js → visualization-filters-CzvFHE6M.js} +3158 -2417
  72. package/chunks/{with-html-element-B0Clt4jY.js → with-html-element-DOfkR3C1.js} +3353 -3160
  73. package/definitions.js +2 -2
  74. package/docs/operations/astrato-app-filter-bar.md +1 -1
  75. package/docs/operations/bar.md +303 -2
  76. package/docs/operations/combo.md +262 -1
  77. package/docs/operations/date-picker.md +1 -1
  78. package/docs/operations/distribution-gauge.md +1 -1
  79. package/docs/operations/dot.md +148 -1
  80. package/docs/operations/filter.md +1 -1
  81. package/docs/operations/gauge.md +1 -1
  82. package/docs/operations/heatMap.md +1 -1
  83. package/docs/operations/histogram.md +262 -1
  84. package/docs/operations/iframe.md +1 -1
  85. package/docs/operations/image.md +1 -1
  86. package/docs/operations/index.md +7 -7
  87. package/docs/operations/line.md +262 -1
  88. package/docs/operations/number.md +1 -1
  89. package/docs/operations/pie.md +1 -1
  90. package/docs/operations/radar.md +1 -1
  91. package/docs/operations/sankey.md +1 -1
  92. package/docs/operations/scatter.md +148 -1
  93. package/docs/operations/shape.md +1 -1
  94. package/docs/operations/simpleTextObject.md +1 -1
  95. package/docs/operations/slider.md +1 -1
  96. package/docs/operations/table.md +374 -157
  97. package/docs/operations/tree.md +1 -1
  98. package/docs/operations/treemap.md +1 -1
  99. package/docs/operations/waterfall.md +1 -1
  100. package/docs/operations/word-cloud.md +1 -1
  101. package/getters.js +2 -2
  102. package/index.js +507 -459
  103. package/metadata.js +2 -2
  104. package/operations.js +5 -5
  105. package/package.json +72 -67
  106. package/src/definitions/index.d.ts +1 -1
  107. package/src/definitions/model/definitions/available-fields.d.ts +2 -2
  108. package/src/definitions/model/definitions/compilers/compile.d.ts +1 -0
  109. package/src/definitions/model/definitions/data-item-resolution.d.ts +3 -3
  110. package/src/definitions/model/definitions/descriptors/descriptor-metadata.d.ts +188 -2
  111. package/src/definitions/model/definitions/index.d.ts +2 -1
  112. package/src/definitions/model/definitions/schema-registry.d.ts +305 -0
  113. package/src/definitions/model/definitions/schemas/bar.schema.d.ts +2 -0
  114. package/src/definitions/model/definitions/schemas/common.schema.d.ts +4 -3
  115. package/src/definitions/model/definitions/schemas/index.d.ts +1 -0
  116. package/src/definitions/model/definitions/schemas/map.schema.d.ts +590 -0
  117. package/src/definitions/model/definitions/types/compilation.types.d.ts +7 -2
  118. package/src/definitions/model/definitions/types/definition.types.d.ts +2 -2
  119. package/src/definitions/model/definitions/types/index.d.ts +1 -1
  120. package/src/index.d.ts +1 -1
  121. package/src/operations/index.d.ts +1 -1
  122. package/src/types.d.ts +45 -41
  123. package/chunks/FieldTypeIcon-pSVQFemC.js +0 -22
  124. package/chunks/ToggleButton-Br9HCPCv.js +0 -150
  125. package/chunks/color-rules-CN7TcGrC.js +0 -6
  126. package/chunks/color-settings-3VRlf_Vw.js +0 -6
  127. package/chunks/handlers-CMbyj5y1.js +0 -12930
  128. package/chunks/isEqual-DBg_b35N.js +0 -12
  129. package/chunks/label-format-type-weq1XfcX.js +0 -8
  130. package/chunks/operations-HSqnCRvv.js +0 -26324
  131. package/chunks/shared-DFoJxjVN.js +0 -1218
  132. package/chunks/standalone-530a5lvf.js +0 -1003
  133. package/chunks/standalone-5DnapeHH.js +0 -420
  134. package/chunks/standalone-B4jrf4KE.js +0 -354
  135. package/chunks/standalone-B6s_xG2u.js +0 -354
  136. package/chunks/standalone-BMoJXGYe.js +0 -2
  137. package/chunks/standalone-BfvGggeM2.js +0 -355
  138. package/chunks/standalone-CMJJIi9v.js +0 -2
  139. package/chunks/standalone-C_Jd4gkj.js +0 -6
  140. package/chunks/standalone-DBeXQrwH.js +0 -468
  141. package/chunks/standalone-DMCwtebn.js +0 -396
  142. package/chunks/standalone-DpSRmAWx.js +0 -287
  143. package/chunks/standalone-kzAhwH19.js +0 -689
  144. package/chunks/standalone-mb7LwEiq.js +0 -3874
  145. /package/chunks/{src-BOS6SqkZ2.js → src-BOS6SqkZ.js} +0 -0
@@ -1,33 +1,41 @@
1
1
  import { o as e } from "./rolldown-runtime-DleVn1XH.js";
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
- return e.sankey = "key-sankey", e.labels = "key-labels", e.columnLabels = "key-column-labels", e;
11
- }({}), z = /* @__PURE__ */ function(e) {
12
- return e.NodeFlow = "flow", e.NodeColor = "color", e;
13
- }({}), B = /* @__PURE__ */ function(e) {
14
- return e.ColumnTitleLeft = "columnTitleLeft", e.ColumnTitleCenter = "columnTitleCenter", e.ColumnTitleRight = "columnTitleRight", e.NodeLabelLeft = "nodeLabelLeft", e.NodeLabelCenter = "nodeLabelCenter", e.NodeLabelRight = "nodeLabelRight", e;
15
- }({}), pe = class extends le {
2
+ import { Cs as t, Da as n, Fo as r, Oi as i, Pc as a, Qr as o, cl as s, co as c, hc as l, in as u, oa as d, rr as f, uo as p, vc as m } from "./visualization-filters-CzvFHE6M.js";
3
+ import { F as h, N as g, ci as _, jt as v, s as y, zr as b } from "./utils-3Igg6xmO.js";
4
+ import "./logger-CKRjhSHQ.js";
5
+ import { Et as x, Ht as S, I as C, Tt as w, Ut as T, _n as E, ct as D, dn as O, fn as k, gn as A, hn as j, i as ee, in as te, ln as M, n as ne, nn as re, nt as ie, qt as N, tn as ae, tt as oe, un as P, vn as F } from "./escobar-CjirINHP.js";
6
+ import { _ as I } from "./MenuOption-CQpT79AP.js";
7
+ import { a as se, r as ce, t as le } from "./coloring-9jU3s_-p.js";
8
+ import { f as L, r as R, t as ue, u as de } from "./src-D9XogOrc.js";
9
+ var fe = /* @__PURE__ */ e(_()), z = {
10
+ sankey: "key-sankey",
11
+ labels: "key-labels",
12
+ columnLabels: "key-column-labels"
13
+ }, B = {
14
+ NodeFlow: "flow",
15
+ NodeColor: "color"
16
+ }, V = {
17
+ ColumnTitleLeft: "columnTitleLeft",
18
+ ColumnTitleCenter: "columnTitleCenter",
19
+ ColumnTitleRight: "columnTitleRight",
20
+ NodeLabelLeft: "nodeLabelLeft",
21
+ NodeLabelCenter: "nodeLabelCenter",
22
+ NodeLabelRight: "nodeLabelRight"
23
+ }, pe = class extends le {
16
24
  dimensionIds = [];
17
25
  dimensionColoring = {};
18
26
  constructor(e, t, n) {
19
- super(e, t, n), this.dimensionIds = [], this.vSpec.dimensions.filter((e) => p(e)).forEach((e) => {
20
- let t = s(e.dataItem);
27
+ super(e, t, n), this.dimensionIds = [], this.vSpec.dimensions.filter((e) => o(e)).forEach((e) => {
28
+ let t = a(e.dataItem);
21
29
  this.dimensionColoring[t] = e.coloring, this.dimensionIds.push(t);
22
30
  });
23
31
  }
24
32
  getColorByScale(e, t = {}) {
25
- let { ref: r } = t, i = this.getDatumFromProp(e, r, "color"), a = i?.value, o = e.resources.scale(i.source?.field ?? i.label), s = i.source?.field, c = s ? this.dimensionColoring[s] : void 0;
26
- if (c?.type === n.Categorical && c.persistentColors === !0) {
27
- let e = o.range();
28
- return e[this.getHash(a) % e.length];
33
+ let { ref: n } = t, r = this.getDatumFromProp(e, n, "color"), i = r?.value, a = e.resources.scale(r.source?.field ?? r.label), o = r.source?.field, s = o ? this.dimensionColoring[o] : void 0;
34
+ if (s?.type === m.Categorical && s.persistentColors === !0) {
35
+ let e = a.range();
36
+ return e[this.getHash(i) % e.length];
29
37
  }
30
- return o(a);
38
+ return a(i);
31
39
  }
32
40
  getDatumFromProp(e, t, n) {
33
41
  return t === this.MAIN_FIELD ? e.datum : e.datum[t || n];
@@ -63,84 +71,84 @@ var fe = /* @__PURE__ */ e(_()), R = /* @__PURE__ */ function(e) {
63
71
  }
64
72
  }, 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
73
  function ve(e, t) {
66
- let n = e.dimensions.filter((e) => p(e)), i = (e.querySettings?.sortingOrder ?? []).map((e) => ({
67
- id: s(e.dataItem),
74
+ let n = e.dimensions.filter((e) => o(e)), r = (e.querySettings?.sortingOrder ?? []).map((e) => ({
75
+ id: a(e.dataItem),
68
76
  direction: e.sortDirection,
69
77
  type: e.fieldType
70
- })), a = i.find((e) => e.type === "measure"), o = a ? i.indexOf(a) : -1;
78
+ })), i = r.find((e) => e.type === "measure"), s = i ? r.indexOf(i) : -1;
71
79
  return n.map((n) => {
72
- let c = s(n.dataItem), l;
80
+ let o = a(n.dataItem), c;
73
81
  if (e.sankeySettings.applyDataSortOnNodeColumns) {
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);
82
+ let e = r.find((e) => e.id === o), t = e ? r.indexOf(e) : -1;
83
+ e && t < s ? c = e.direction === "desc" ? me : he : i && (c = i.direction === "desc" ? ge : _e);
76
84
  }
77
85
  return {
78
- id: c,
79
- sort: l,
80
- isGrouped: r(e.dimensions, e.enableAlternate, t)
86
+ id: o,
87
+ sort: c,
88
+ isGrouped: f(e.dimensions, e.enableAlternate, t)
81
89
  };
82
90
  });
83
91
  }
84
92
  var ye = (e, t) => {
85
- let n = e.sankeySettings.linkColoring?.opacity ?? .3, r = t.valuePickerMode ?? !1, a = r ? t.valuePickerTargetDataItemId : "";
93
+ let r = e.sankeySettings.linkColoring?.opacity ?? .3, i = t.valuePickerMode ?? !1, a = i ? t.valuePickerTargetDataItemId : "";
86
94
  return {
87
95
  trigger: [{
88
- on: j.Tap,
89
- action: N.Toggle,
96
+ on: A.Tap,
97
+ action: j.Toggle,
90
98
  globalPropagation: "stop",
91
99
  data: ["", "linkTarget"],
92
- contexts: [P.Selection]
100
+ contexts: [O.Selection]
93
101
  }, {
94
- on: j.Over,
95
- action: N.Set,
102
+ on: A.Over,
103
+ action: j.Set,
96
104
  globalPropagation: "stop",
97
105
  data: ["", "linkTarget"],
98
- contexts: [P.Highlight]
106
+ contexts: [O.Highlight]
99
107
  }],
100
108
  consume: [
101
109
  {
102
- context: P.Selection,
110
+ context: O.Selection,
103
111
  data: ["", "linkTarget"],
104
112
  filter: (e) => e.data?.type?.value === "link",
105
- mode: A.Or,
106
- style: { inactive: { opacity: n * .25 } }
113
+ mode: E.Or,
114
+ style: { inactive: { opacity: r * .25 } }
107
115
  },
108
116
  {
109
- context: P.Selection,
117
+ context: O.Selection,
110
118
  data: [""],
111
119
  filter: (e) => e.data?.type?.value === "node",
112
- mode: A.Or,
120
+ mode: E.Or,
113
121
  style: { inactive: { fill: (e) => {
114
122
  let t = e, n = !t.fill || t.fill === "none" || t.fill === "transparent";
115
123
  switch (!0) {
116
124
  case n:
117
- case r && t.data.source.field === a: return t.fill;
118
- default: return O(ie(t.fill), .25);
125
+ case i && t.data.source.field === a: return t.fill;
126
+ default: return ae(re(t.fill), .25);
119
127
  }
120
128
  } } }
121
129
  },
122
130
  {
123
- context: P.Highlight,
131
+ context: O.Highlight,
124
132
  data: [""],
125
133
  filter: (e) => e.data?.type?.value === "node",
126
- mode: A.Or,
134
+ mode: E.Or,
127
135
  style: { active: {
128
- strokeWidth: (e) => r && e.data.source.field !== a ? 0 : 1,
129
- stroke: i.mainDarkNavy
136
+ strokeWidth: (e) => i && e.data.source.field !== a ? 0 : 1,
137
+ stroke: n.mainDarkNavy
130
138
  } }
131
139
  }
132
140
  ]
133
141
  };
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
- 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
- return m[i];
141
- }, g = {
142
- key: R.sankey,
143
- type: T.Sankey,
142
+ }, be = (e, n, r, i, s, c) => {
143
+ if (!c) throw Error("Missing Sankey visualization properties");
144
+ let l = e.sankeySettings.nodeLabels.placements;
145
+ if (!l) throw Error("Missing Sankey node label placements");
146
+ let u = e.dimensions.filter((e) => o(e)), d = new pe(e, n, s?.[0]?.itemsNotAffectedByFiltering), f = e.sankeySettings.linkColoring?.opacity ?? .3, p = e.sankeySettings.linkColoring, m = u.map((e) => a(e.dataItem)), h = m.map((e, t) => `dim${t}`), g = e.sankeySettings.showNullNodes ? (e, t) => h[m.indexOf(t) + 1] : (e, t) => {
147
+ let n = m.indexOf(t), r = m.slice(n + 1).find((t) => e[h[m.indexOf(t)]].value !== null), i = r === void 0 ? -1 : m.indexOf(r);
148
+ return h[i];
149
+ }, _ = {
150
+ key: z.sankey,
151
+ type: F.Sankey,
144
152
  data: { collection: "coll" },
145
153
  settings: {
146
154
  showNullNodes: e.sankeySettings.showNullNodes,
@@ -149,21 +157,21 @@ var ye = (e, t) => {
149
157
  linkMargin: e.sankeySettings.linkMargin,
150
158
  showColumnHeaderLabels: e.sankeySettings.showColumnHeaderLabels,
151
159
  linkFillStrategy: e.sankeySettings.linkColoring.type,
152
- nodeFillOverride: e.sankeySettings.nodeColoring.override ? e.sankeySettings.nodeColoring.color || t.colors.brandColors[0] : void 0,
153
- showNodeDimensionLabel: e.sankeySettings.nodeLabels.enabled && e.sankeySettings.nodeLabels.showDimensionValue,
154
- showNodeFlowLabel: e.sankeySettings.nodeLabels.enabled && e.sankeySettings.nodeLabels.showFlowValue,
160
+ ...t({ nodeFillOverride: e.sankeySettings.nodeColoring.override ? e.sankeySettings.nodeColoring.color || n.colors.brandColors[0] : void 0 }),
161
+ ...t({ showNodeDimensionLabel: e.sankeySettings.nodeLabels.enabled && e.sankeySettings.nodeLabels.showDimensionValue }),
162
+ ...t({ showNodeFlowLabel: e.sankeySettings.nodeLabels.enabled && e.sankeySettings.nodeLabels.showFlowValue }),
155
163
  showNodeLabelBackdrop: e.sankeySettings.nodeLabels.showBackdrop !== !1,
156
- nodeLabelBackdropColor: e.sankeySettings.nodeLabels.backdropColor,
157
- columnFields: ve(e, a.isPrintMode ?? !1),
158
- nodeLabelPlacements: o.filter((e) => e.enabled).map((e) => e.placement),
164
+ ...t({ nodeLabelBackdropColor: e.sankeySettings.nodeLabels.backdropColor }),
165
+ columnFields: ve(e, c.isPrintMode ?? !1),
166
+ nodeLabelPlacements: l.filter((e) => e.enabled).map((e) => e.placement),
159
167
  node: {
160
168
  id: (e) => {
161
169
  let t = e.datum;
162
170
  return `${t.source.field}::${t.value}`;
163
171
  },
164
- fill: l.getColorDefinition({
165
- ref: z.NodeColor,
166
- overwriteSources: [l.MAIN_FIELD, "color"]
172
+ fill: d.getColorDefinition({
173
+ ref: B.NodeColor,
174
+ overwriteSources: [d.MAIN_FIELD, "color"]
167
175
  })
168
176
  },
169
177
  link: {
@@ -172,74 +180,74 @@ var ye = (e, t) => {
172
180
  return `${t.source.field}::${t.value}`;
173
181
  },
174
182
  linkTarget: (e) => {
175
- let t = e.datum, n = h(t, t.source.field);
183
+ let t = e.datum, n = g(t, t.source.field);
176
184
  if (!n) return null;
177
185
  t.linkTarget = t[n];
178
186
  let r = t[n];
179
187
  return `${r.source.field}::${r.value}`;
180
188
  },
181
189
  value: { ref: "flow" },
182
- dataFill: l.getLinkColorDefinition(),
183
- fill: () => d.override ? d.color || t.colors.brandColors[0] : void 0,
184
- opacity: u
190
+ dataFill: d.getLinkColorDefinition(),
191
+ fill: () => p.override ? p.color || n.colors.brandColors[0] : void 0,
192
+ opacity: f
185
193
  }
186
194
  },
187
- brush: a.disable?.brushing === !0 ? void 0 : ye(e, a),
195
+ brush: c.disable?.brushing === !0 ? void 0 : ye(e, c),
188
196
  animations: {
189
197
  presetId: "simple-opacity",
190
198
  enabled: !0
191
199
  }
192
200
  };
193
201
  return {
194
- ...n,
195
- components: [...n.components, g]
202
+ ...r,
203
+ components: [...r.components, _]
196
204
  };
197
205
  }, 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) => ({
206
+ let r = e.measures.filter((e) => o(e)), i = e.dimensions.filter((e) => o(e)), s = a(r[0].dataItem), c = i.map((e) => a(e.dataItem)), l = c.map((e) => ({
199
207
  field: e,
200
208
  trackBy: (e) => e,
201
209
  reduce: "first",
202
210
  props: {
203
- [z.NodeFlow]: {
204
- field: a,
211
+ [B.NodeFlow]: {
212
+ field: s,
205
213
  reduce: "sum"
206
214
  },
207
- [a]: {
208
- field: a,
215
+ [s]: {
216
+ field: s,
209
217
  reduce: "sum"
210
218
  },
211
- [z.NodeColor]: { field: e },
219
+ [B.NodeColor]: { field: e },
212
220
  type: "node"
213
221
  }
214
- })), l = o.slice(0, o.length - 1).map((e, t) => {
222
+ })), u = c.slice(0, c.length - 1).map((e, t) => {
215
223
  let n = {
216
- field: o[t],
224
+ field: c[t],
217
225
  props: {
218
- flow: { field: a },
219
- [a]: { field: a },
226
+ flow: { field: s },
227
+ [s]: { field: s },
220
228
  type: "link"
221
229
  }
222
230
  };
223
- return o.forEach((e, t) => {
231
+ return c.forEach((e, t) => {
224
232
  n.field !== e && (n.props[`dim${t}`] = { field: e });
225
233
  }), n;
226
- }), u = [{
234
+ }), d = [{
227
235
  key: "coll",
228
236
  data: {
229
- extract: [...c, ...l],
237
+ extract: [...l, ...u],
230
238
  filter: e.sankeySettings.showNullNodes ? void 0 : (e) => e.value !== null
231
239
  }
232
240
  }];
233
241
  return {
234
242
  ...n,
235
- collections: u,
243
+ collections: d,
236
244
  formatters: { flow: {
237
245
  type: "excel-format",
238
246
  format: r[0].formatter?.format
239
247
  } }
240
248
  };
241
- }, V = (e, t) => ({
242
- component: R.sankey,
249
+ }, H = (e, t) => ({
250
+ component: z.sankey,
243
251
  selector: e,
244
252
  strategy: {
245
253
  type: "rows",
@@ -252,15 +260,15 @@ var ye = (e, t) => {
252
260
  },
253
261
  label({ node: e }) {
254
262
  let t = e.desc, n = t.label;
255
- return t.isGrouped ? S(n) : n;
263
+ return t.isGrouped ? N(n) : n;
256
264
  }
257
265
  }]
258
266
  }
259
267
  }
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);
268
+ }), U = 64, Se = new I(M.fontLight), Ce = new I(M.fontDark), W = (e, t, n) => {
269
+ let r = new I(n.fonts.general.color);
262
270
  return {
263
- component: R.sankey,
271
+ component: z.sankey,
264
272
  selector: e,
265
273
  strategy: {
266
274
  type: "rows",
@@ -279,81 +287,81 @@ var ye = (e, t) => {
279
287
  if (!t.backdrop && !t.background) return r.rgb();
280
288
  let n = t.backdrop?.fill || t.background;
281
289
  if (n === void 0) throw Error("Color: Unknown color parameter");
282
- return new F(n).betterContrast(r, Se, Ce).rgb();
290
+ return new I(n).betterContrast(r, Se, Ce).rgb();
283
291
  },
284
292
  linkData({ node: e }) {
285
293
  return e.desc?.data;
286
294
  },
287
295
  label({ node: e, formatter: t }) {
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;
296
+ let n = e.desc, r = n.showFlow ? t("flow")(n.data?.[B.NodeFlow]?.value) : void 0, i = n.label?.length > U - 1 ? `${n.label?.substring(0, U - 1).replace(/\s+$/, "")}…` : n.label;
289
297
  return [n.showDimension ? i : void 0, r].filter(Boolean).join(": ");
290
298
  }
291
299
  }]
292
300
  }
293
301
  }
294
302
  };
295
- }, we = (e, t, n, i, o, u, d, f) => {
296
- if (!u) throw Error("Missing Sankey visualization properties");
303
+ }, we = (e, t, n, i, c, l, d, p) => {
304
+ if (!l) throw Error("Missing Sankey visualization properties");
297
305
  let m = [];
298
- f && m.push(x(R.columnLabels, R.columnLabels, f));
306
+ p && m.push(T(z.columnLabels, z.columnLabels, p));
299
307
  let h = {
300
- type: T.Labels,
301
- key: R.columnLabels,
308
+ type: F.Labels,
309
+ key: z.columnLabels,
302
310
  layout: { displayOrder: 2 },
303
311
  settings: { sources: [
304
- V(`.${B.ColumnTitleLeft}`, 0),
305
- V(`.${B.ColumnTitleCenter}`, .5),
306
- V(`.${B.ColumnTitleRight}`, 1)
312
+ H(`.${V.ColumnTitleLeft}`, 0),
313
+ H(`.${V.ColumnTitleCenter}`, .5),
314
+ H(`.${V.ColumnTitleRight}`, 1)
307
315
  ] },
308
316
  style: { label: "$title" },
309
317
  animations: {
310
318
  presetId: "simple-opacity",
311
319
  enabled: !0
312
320
  }
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));
321
+ }, g = e?.measures.find(o), _ = g ? a(g.dataItem) : void 0;
322
+ p && g && e.measures.length > 1 && m.push(S(F.Text, p));
315
323
  let v;
316
324
  if (g && e.measures.length > 1) {
317
- let n = a(g) || g.label || g.dataItem?.name || "Measure";
325
+ let n = u(g) || g.label || g.dataItem?.name || "Measure";
318
326
  v = {
319
- type: T.Text,
327
+ type: F.Text,
320
328
  key: `text-${_}`,
321
- dataItemType: l.Measure,
329
+ dataItemType: s.Measure,
322
330
  dataItemRole: g.role,
323
- text: r(e.measures, e.enableAlternate, u.isPrintMode) ? S(n) : n,
331
+ text: f(e.measures, e.enableAlternate, l.isPrintMode) ? N(n) : n,
324
332
  layout: {
325
- dock: c.Bottom,
333
+ dock: r.Bottom,
326
334
  color: "red"
327
335
  },
328
336
  style: { text: {
329
337
  fontFamily: t.fonts.general.fontFamily,
330
- fontSize: `${E.fieldTitle.fontSize}px`,
338
+ fontSize: `${M.fieldTitle.fontSize}px`,
331
339
  fontStyle: "normal",
332
340
  fill: t.fonts.general.color
333
341
  } },
334
- anchor: c.Center
342
+ anchor: r.Center
335
343
  };
336
344
  }
337
345
  let y = {
338
- type: T.Labels,
339
- key: R.labels,
346
+ type: F.Labels,
347
+ key: z.labels,
340
348
  layout: { displayOrder: 2 },
341
349
  settings: { sources: [
342
- U(`.${B.NodeLabelLeft}`, 0, t),
343
- U(`.${B.NodeLabelCenter}`, .5, t),
344
- U(`.${B.NodeLabelRight}`, 1, t)
350
+ W(`.${V.NodeLabelLeft}`, 0, t),
351
+ W(`.${V.NodeLabelCenter}`, .5, t),
352
+ W(`.${V.NodeLabelRight}`, 1, t)
345
353
  ] },
346
354
  style: { label: "$label" },
347
- brush: u.disable?.brushing === !0 ? void 0 : {
355
+ brush: l.disable?.brushing === !0 ? void 0 : {
348
356
  trigger: [{
349
- on: j.Tap,
350
- action: N.Toggle,
357
+ on: A.Tap,
358
+ action: j.Toggle,
351
359
  globalPropagation: "stop",
352
360
  data: [""],
353
- contexts: [P.Selection]
361
+ contexts: [O.Selection]
354
362
  }],
355
363
  consume: [{
356
- context: P.Selection,
364
+ context: O.Selection,
357
365
  data: [""],
358
366
  style: { inactive: { opacity: .3 } }
359
367
  }]
@@ -373,53 +381,53 @@ var ye = (e, t) => {
373
381
  ],
374
382
  interactions: n.interactions ? [...n.interactions, ...m] : [...m]
375
383
  };
376
- }, Te = (e, t, r, i, a) => {
377
- if (r.type !== n.PerEachDimension) {
378
- let e = r.color || t?.colors?.brandColors?.[0] || "#aaa";
384
+ }, Te = (e, t, n, r, o) => {
385
+ if (n.type !== m.PerEachDimension) {
386
+ let e = n.color || t?.colors?.brandColors?.[0] || "#aaa";
379
387
  return {
380
- type: D.CategoricalColor,
388
+ type: k.CategoricalColor,
381
389
  data: [],
382
390
  range: [e],
383
391
  unknown: e
384
392
  };
385
393
  }
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";
394
+ let s = r.coloring || {};
395
+ if (s.type !== m.Categorical) {
396
+ let n = o[e.dimensions.indexOf(r) % o.length], i = s.color || n || t?.colors?.brandColors?.[0] || "#aaa";
389
397
  return {
390
- type: D.CategoricalColor,
398
+ type: k.CategoricalColor,
391
399
  data: [],
392
- range: [r],
393
- unknown: r
400
+ range: [i],
401
+ unknown: i
394
402
  };
395
403
  }
396
- return C(e, t, s(i.dataItem), {
397
- customPalette: o.customPalette ?? u.customPalette,
398
- palette: o.palette
404
+ return x(e, t, a(r.dataItem), {
405
+ customPalette: s.customPalette ?? i.customPalette,
406
+ palette: s.palette
399
407
  });
400
408
  }, Ee = (e, t, n) => {
401
- let r = e.dimensions.filter((e) => p(e));
409
+ let r = e.dimensions.filter((e) => o(e));
402
410
  if (!r[0]) return n;
403
- let i = e.coloring;
404
- if (!i) throw Error("Missing Sankey coloring settings");
405
- let a = {}, o = oe({
406
- palette: i.palette,
407
- customPalette: i.customPalette ?? u.customPalette
411
+ let s = e.coloring;
412
+ if (!s) throw Error("Missing Sankey coloring settings");
413
+ let c = {}, l = w({
414
+ palette: s.palette,
415
+ customPalette: s.customPalette ?? i.customPalette
408
416
  }, t);
409
417
  return r.forEach((n) => {
410
- let r = s(n.dataItem);
411
- a[r] = Te(e, t, i, n, o);
418
+ let r = a(n.dataItem);
419
+ c[r] = Te(e, t, s, n, l);
412
420
  }), {
413
421
  ...n,
414
- scales: a
422
+ scales: c
415
423
  };
416
424
  }, De = (e, t, n) => {
417
- let r = e.dimensions.filter((e) => p(e)), i = e.measures.filter((e) => p(e));
425
+ let r = e.dimensions.filter((e) => o(e)), i = e.measures.filter((e) => o(e));
418
426
  if (!r[0] || !i[0]) return n;
419
427
  let a = {
420
428
  "$font-family": t.fonts.general.fontFamily,
421
429
  "$font-color": t.fonts.general.color,
422
- "$font-size": `${ne(e.sankeySettings?.nodeLabels?.fontSize)}px`,
430
+ "$font-size": `${te(e.sankeySettings?.nodeLabels?.fontSize)}px`,
423
431
  $label: {
424
432
  fontSize: "$font-size",
425
433
  fontFamily: "$font-family",
@@ -428,7 +436,7 @@ var ye = (e, t) => {
428
436
  },
429
437
  $title: {
430
438
  "@extend": "$label",
431
- fontSize: `${E.fieldTitle.fontSize}px`,
439
+ fontSize: `${M.fieldTitle.fontSize}px`,
432
440
  padding: 4
433
441
  }
434
442
  };
@@ -436,19 +444,19 @@ var ye = (e, t) => {
436
444
  ...n,
437
445
  style: a
438
446
  };
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
- label: u,
447
+ }, Oe = (e, t) => t?.data?.type?.value === "link" ? `${t.data.label} - ${t.data.linkTarget.label}` : t.data.label, ke = (e, t, n, r, i, a, o) => {
448
+ let s = [], c = u(e[0]) || e[0].label || e[0].dataItem.name || "", l = e.length ? c : "Count", d = t.desc?.flow ?? t.data?.flow.value, f = o ? n.formatter(D())(d) : n.formatter("flow")(d);
449
+ return s.push({
450
+ label: l,
443
451
  value: f
444
- }), c;
452
+ }), s;
445
453
  }, Ae = (e, t, n, r, i) => {
446
454
  let a = { placement: ({ nodes: e }) => ({
447
455
  area: "target",
448
456
  type: e[0]?.data?.type?.value === "link" ? "pointer" : "bounds"
449
457
  }) };
450
- return a.extract = ae(e, t, ke, Oe), k(e, t, n, a, "tooltip", i);
451
- }, je = class extends b {
458
+ return a.extract = ie(e, t, ke, Oe), oe(e, t, n, a, "tooltip", i);
459
+ }, je = class extends C {
452
460
  constructor() {
453
461
  super([
454
462
  xe,
@@ -460,30 +468,30 @@ var ye = (e, t) => {
460
468
  ]);
461
469
  }
462
470
  preCompile(e, t) {
463
- let n = e.measures.filter((e) => p(e)), r = e.dimensions.filter((e) => p(e)), i = n[0];
471
+ let n = e.measures.filter((e) => o(e)), r = e.dimensions.filter((e) => o(e)), i = n[0];
464
472
  if (!i) return;
465
- let a = s(i.dataItem), o = r.map((e) => s(e.dataItem));
473
+ let s = a(i.dataItem), c = r.map((e) => a(e.dataItem));
466
474
  t.forEach((t) => {
467
475
  if (t.items?.length) {
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.");
476
+ if (t.items = t.items.filter((e) => e[s] > 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.");
477
+ if (!e.sankeySettings.showNullNodes && !t.items.find((e) => c.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
478
  }
471
479
  });
472
480
  }
473
- }, W = {
481
+ }, G = {
474
482
  showNullNodes: !1,
475
483
  nodePadding: .2,
476
484
  nodeWidth: .2,
477
485
  linkMargin: 0,
478
486
  showColumnHeaderLabels: !1,
479
- linkFillStrategy: t.Interpolated,
487
+ linkFillStrategy: c.Interpolated,
480
488
  nodeFillOverride: null,
481
489
  showNodeFlowLabel: !0,
482
490
  showNodeDimensionLabel: !0,
483
491
  showNodeLabelBackdrop: !0,
484
492
  nodeLabelBackdropColor: null,
485
493
  columnFields: [],
486
- nodeLabelPlacements: [o.Beside],
494
+ nodeLabelPlacements: [p.Beside],
487
495
  node: {
488
496
  id: "",
489
497
  fill: "#333333"
@@ -495,7 +503,7 @@ var ye = (e, t) => {
495
503
  value: 1
496
504
  }
497
505
  };
498
- function G(e, t) {
506
+ function K(e, t) {
499
507
  return e.dataFill === t.dataFill ? 0 : e.dataFill !== void 0 && t.dataFill !== void 0 && e.dataFill < t.dataFill ? -1 : 1;
500
508
  }
501
509
  function Me(e) {
@@ -509,7 +517,7 @@ function Me(e) {
509
517
  }
510
518
  function Ne(e) {
511
519
  return e.map((e) => ({
512
- type: M.Path,
520
+ type: P.Path,
513
521
  data: e.data,
514
522
  desc: { flow: e.value },
515
523
  d: Me(e),
@@ -523,43 +531,43 @@ function Ne(e) {
523
531
  }));
524
532
  }
525
533
  function Pe(e) {
526
- let { data: n, resolver: r, settings: i, resolvedNodes: a } = e, o = {};
527
- a.forEach((e) => {
528
- o[e.id] = e;
534
+ let { data: t, resolver: n, settings: r, resolvedNodes: i } = e, a = {};
535
+ i.forEach((e) => {
536
+ a[e.id] = e;
529
537
  });
530
- let s = n.items.filter((e) => e.type.value === "link"), { items: c } = r.resolve({
531
- data: { items: s },
532
- defaults: { ...W.link },
533
- settings: i.link
538
+ let o = t.items.filter((e) => e.type.value === "link"), { items: s } = n.resolve({
539
+ data: { items: o },
540
+ defaults: { ...G.link },
541
+ settings: r.link
534
542
  }), l = {};
535
- return c.filter((e) => !!e.linkTarget).forEach((e) => {
536
- let n = o[e.linkSource], r = o[e.linkTarget], a;
537
- if (!e.fill && !e.dataFill) switch (i.linkFillStrategy) {
538
- case t.Source:
539
- e.fill = n.fill;
543
+ return s.filter((e) => !!e.linkTarget).forEach((e) => {
544
+ let t = a[e.linkSource], n = a[e.linkTarget], i;
545
+ if (!e.fill && !e.dataFill) switch (r.linkFillStrategy) {
546
+ case c.Source:
547
+ e.fill = t.fill;
540
548
  break;
541
- case t.Target:
542
- e.fill = r.fill;
549
+ case c.Target:
550
+ e.fill = n.fill;
543
551
  break;
544
- case t.Interpolated:
552
+ case c.Interpolated:
545
553
  e.fill = {
546
554
  type: "gradient",
547
555
  orientation: "linear",
548
556
  degree: -180,
549
557
  stops: [{
550
- color: n.fill,
558
+ color: t.fill,
551
559
  offset: 0
552
560
  }, {
553
- color: r.fill,
561
+ color: n.fill,
554
562
  offset: 1
555
563
  }]
556
- }, a = `${n.fill}::${r.fill}`;
564
+ }, i = `${t.fill}::${n.fill}`;
557
565
  break;
558
566
  }
559
567
  else e.dataFill && (e.fill = e.dataFill);
560
- a ||= e.fill, e.fillId = a;
561
- let s = `${e.linkSource}::${e.linkTarget}`;
562
- l[s] && l[s].fillId !== e.fillId && (s += `::${e.fillId}`), l[s] ? l[s].value += e.value : (l[s] = e, e.id = s);
568
+ i ||= e.fill, e.fillId = i;
569
+ let o = `${e.linkSource}::${e.linkTarget}`;
570
+ l[o] && l[o].fillId !== e.fillId && (o += `::${e.fillId}`), l[o] ? l[o].value += e.value : (l[o] = e, e.id = o);
563
571
  }), Object.values(l).map((e) => ({
564
572
  source: e.linkSource,
565
573
  target: e.linkTarget,
@@ -574,7 +582,7 @@ function Pe(e) {
574
582
  function Fe(e) {
575
583
  let { data: t, resolver: n, settings: r } = e, i = t.items.filter((e) => e.type.value === "node"), { items: a } = n.resolve({
576
584
  data: { items: i },
577
- defaults: { ...W.node },
585
+ defaults: { ...G.node },
578
586
  settings: {
579
587
  ...r.node,
580
588
  fixedValue: ({ datum: e }) => e.flow.value
@@ -600,11 +608,11 @@ function Ie(e, t) {
600
608
  }), i[e.dataFill].targetSum += e.value);
601
609
  });
602
610
  let a = Object.values(i);
603
- a.sort(G);
611
+ a.sort(K);
604
612
  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
613
  n.push({
606
614
  id: e.id,
607
- type: M.Rect,
615
+ type: P.Rect,
608
616
  x: e.x0 + t.nodeMargin,
609
617
  width: e.x1 - e.x0 - t.nodeMargin * 2,
610
618
  y: l,
@@ -621,7 +629,7 @@ function Ie(e, t) {
621
629
  let u = c * (Math.max(a, o) / e.value);
622
630
  n.push({
623
631
  id: `${e.id}::${s}`,
624
- type: M.Rect,
632
+ type: P.Rect,
625
633
  x: e.x0 + t.nodeMargin,
626
634
  width: e.x1 - e.x0 - t.nodeMargin * 2,
627
635
  y: l,
@@ -638,7 +646,7 @@ function Ie(e, t) {
638
646
  });
639
647
  }), n;
640
648
  }
641
- var K = (e, t, n = !1, r = [4, 2]) => ({
649
+ var q = (e, t, n = !1, r = [4, 2]) => ({
642
650
  data: e.data,
643
651
  background: n ? e.fill : void 0,
644
652
  label: e.data.label,
@@ -652,9 +660,9 @@ var K = (e, t, n = !1, r = [4, 2]) => ({
652
660
  }), Le = (e, t, n, r) => {
653
661
  let { nodeLabelHeight: i, nodePadding: a } = r;
654
662
  return a < i ? [] : e.map((e) => {
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;
663
+ let t = n[e.layer], a = q(e, r, !1, [4, 0]), o = a.backdrop?.padding ?? [0, 0], s = t.align < .5 ? V.NodeLabelLeft : t.align > .5 ? V.NodeLabelRight : V.NodeLabelCenter;
656
664
  return {
657
- type: M.Rect,
665
+ type: P.Rect,
658
666
  id: `${e.id}::labelTarget`,
659
667
  x: t.fullX + (t.align < .5 ? r.nodeMargin + o[0] : 0),
660
668
  width: t.fullWidth - (t.align === .5 ? 0 : r.nodeMargin + o[0]),
@@ -668,8 +676,8 @@ var K = (e, t, n = !1, r = [4, 2]) => ({
668
676
  }, Re = (e) => e.canShowNodeLabelAboveNode, ze = (e, t, n, r) => {
669
677
  let { nodePadding: i } = r;
670
678
  return e.filter((e) => e.y1 - e.y0 + i >= r.nodeLabelHeight).map((e) => {
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
- type: M.Rect,
679
+ let t = n[e.layer], a = t.align <= .5 ? V.NodeLabelLeft : V.NodeLabelRight, o = q(e, r, !1, [4, 2]), s = o.backdrop?.padding ?? [0, 0], c = [2, 2], l = [s[0] + c[0], s[1] + c[1]], u = {
680
+ type: P.Rect,
673
681
  id: `${e.id}::labelTarget`,
674
682
  x: t.gapX + l[0],
675
683
  width: t.gapWidth - 2 * l[0],
@@ -679,51 +687,51 @@ var K = (e, t, n = !1, r = [4, 2]) => ({
679
687
  tag: a,
680
688
  fill: "none"
681
689
  };
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;
690
+ return t.nodeWidth === 0 && (u.x = t.fullX + s[0], u.width = t.fullWidth - 2 * s[1], u.tag = t.align < .5 ? V.NodeLabelLeft : t.align > .5 ? V.NodeLabelRight : V.NodeLabelCenter), u;
683
691
  });
684
692
  }, 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]);
693
+ let t = q(e, r, !0, [4, 2]);
686
694
  return {
687
- type: M.Rect,
695
+ type: P.Rect,
688
696
  id: `${e.id}::labelTarget`,
689
697
  x: e.x0 + r.nodeMargin,
690
698
  width: e.x1 - e.x0 - r.nodeMargin * 2,
691
699
  y: e.y0,
692
700
  height: e.y1 - e.y0,
693
701
  desc: t,
694
- tag: B.NodeLabelCenter,
702
+ tag: V.NodeLabelCenter,
695
703
  fill: "none"
696
704
  };
697
- }), He = (e) => e.columnWidth >= 80, q = {
698
- [o.Above]: {
705
+ }), He = (e) => e.columnWidth >= 80, J = {
706
+ [p.Above]: {
699
707
  condition: Re,
700
708
  create: Le
701
709
  },
702
- [o.Beside]: {
710
+ [p.Beside]: {
703
711
  condition: Be,
704
712
  create: ze
705
713
  },
706
- [o.Inside]: {
714
+ [p.Inside]: {
707
715
  condition: He,
708
716
  create: Ve
709
717
  }
710
- }, Ue = (e) => e.priority.find((t) => q[t]?.condition(e)), We = (e, t, n, r) => {
718
+ }, Ue = (e) => e.priority.find((t) => J[t]?.condition(e)), We = (e, t, n, r) => {
711
719
  let i = [], a = n[0];
712
720
  if (!r.showDimensionLabel && !r.showFlowLabel) return [];
713
- let o = r.priority.find((e) => q[e]?.condition({
721
+ let o = r.priority.find((e) => J[e]?.condition({
714
722
  canShowNodeLabelAboveNode: r.canShowNodeLabelAboveNode,
715
723
  columnGap: a.gapWidth,
716
724
  columnWidth: a.nodeWidth,
717
725
  priority: r.priority
718
726
  }));
719
- return o && i.push(...q[o].create(e, t, n, r)), i;
727
+ return o && i.push(...J[o].create(e, t, n, r)), i;
720
728
  };
721
729
  function Ge(e, t) {
722
730
  let { headerHeight: n } = t;
723
731
  return e.map((e) => {
724
- let t = e.align < .5 ? B.ColumnTitleLeft : e.align > .5 ? B.ColumnTitleRight : B.ColumnTitleCenter;
732
+ let t = e.align < .5 ? V.ColumnTitleLeft : e.align > .5 ? V.ColumnTitleRight : V.ColumnTitleCenter;
725
733
  return {
726
- type: M.Rect,
734
+ type: P.Rect,
727
735
  id: `column::${e.field}::labelTarget`,
728
736
  tag: t,
729
737
  fill: "none",
@@ -819,37 +827,37 @@ function Xe(e, t, n) {
819
827
  });
820
828
  }
821
829
  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({
830
+ let a = Math.max(0, n.width / (e.length * 2) * t.nodeWidth), o = a > 0 ? t.linkMargin * .5 * Math.min(24, (n.width - a * e.length) / (e.length - 1) / 2) : 0;
831
+ a += o * 2;
832
+ let s = (n.width - a * e.length) / (e.length - 1), c = Math.max(...e.map((e) => e.count)), l = r.measureText(i.title).height + 2 * i.title.padding, u = 8 + l, d = t.showColumnHeaderLabels && n.height - 8 - u > 0, f = r.measureText(i.label).height + 2 * i.label.padding, m = d ? u : 0, h = n.height - m, g = h / c / 2 * t.nodePadding, _ = (t.showNodeDimensionLabel || t.showNodeFlowLabel) && f * c < h / 2, v = g, y = Ue({
825
833
  canShowNodeLabelAboveNode: _,
826
- columnGap: c,
834
+ columnGap: s,
827
835
  columnWidth: a,
828
836
  priority: t.nodeLabelPlacements
829
837
  });
830
- return _ && y === o.Above && (m += p, v = Math.max(p, g)), {
831
- columnGap: c,
838
+ return _ && y === p.Above && (m += f, v = Math.max(f, g)), {
839
+ columnGap: s,
832
840
  columnWidth: a,
833
841
  nodePadding: v,
834
842
  availableHeight: h,
835
- nodeLabelHeight: p,
836
- nodeMargin: s,
843
+ nodeLabelHeight: f,
844
+ nodeMargin: o,
837
845
  top: m,
838
- showHeader: f,
839
- headerTitleHeight: u,
846
+ showHeader: d,
847
+ headerTitleHeight: l,
840
848
  canShowNodeLabelAboveNode: _
841
849
  };
842
850
  }
843
851
  function Qe(e, t) {
844
852
  return e.sourceLinks.length ? e.depth : t - 1;
845
853
  }
846
- function J(e) {
854
+ function Y(e) {
847
855
  return function() {
848
856
  return e;
849
857
  };
850
858
  }
851
859
  ue();
852
- function Y(e, t) {
860
+ function $e(e, t) {
853
861
  return Z(e.source, t.source) || e.index - t.index;
854
862
  }
855
863
  function X(e, t) {
@@ -861,42 +869,42 @@ function Z(e, t) {
861
869
  function Q(e) {
862
870
  return e.value;
863
871
  }
864
- function $e(e) {
872
+ function et(e) {
865
873
  return e.index;
866
874
  }
867
- function et(e) {
875
+ function tt(e) {
868
876
  return e.nodes;
869
877
  }
870
- function tt(e) {
878
+ function nt(e) {
871
879
  return e.links;
872
880
  }
873
- function nt(e, t) {
881
+ function rt(e, t) {
874
882
  let n = e.get(t);
875
883
  if (!n) throw Error("missing: " + t);
876
884
  return n;
877
885
  }
878
- function rt({ nodes: e }) {
886
+ function it({ nodes: e }) {
879
887
  for (let t of e) {
880
888
  let e = t.y0, n = e;
881
889
  for (let n of t.sourceLinks) n.y0 = e + n.width / 2, e += n.width;
882
890
  for (let e of t.targetLinks) e.y1 = n + e.width / 2, n += e.width;
883
891
  }
884
892
  }
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;
893
+ function at() {
894
+ let e = 0, t = 0, n = 1, r = 1, i = 24, a = 8, o, s = et, c = Qe, l, u, d = tt, f = nt, p = 6;
887
895
  function m() {
888
896
  let e = {
889
897
  nodes: d.apply(null, arguments),
890
898
  links: f.apply(null, arguments)
891
899
  };
892
- return h(e), g(e), _(e), v(e), x(e), rt(e), e;
900
+ return h(e), g(e), _(e), v(e), x(e), it(e), e;
893
901
  }
894
902
  m.update = function(e) {
895
- return rt(e), e;
903
+ return it(e), e;
896
904
  }, m.nodeId = function(e) {
897
- return arguments.length ? (s = typeof e == "function" ? e : J(e), m) : s;
905
+ return arguments.length ? (s = typeof e == "function" ? e : Y(e), m) : s;
898
906
  }, m.nodeAlign = function(e) {
899
- return arguments.length ? (c = typeof e == "function" ? e : J(e), m) : c;
907
+ return arguments.length ? (c = typeof e == "function" ? e : Y(e), m) : c;
900
908
  }, m.nodeSort = function(e) {
901
909
  return arguments.length ? (l = e, m) : l;
902
910
  }, m.nodeWidth = function(e) {
@@ -904,9 +912,9 @@ function it() {
904
912
  }, m.nodePadding = function(e) {
905
913
  return arguments.length ? (a = o = +e, m) : a;
906
914
  }, m.nodes = function(e) {
907
- return arguments.length ? (d = typeof e == "function" ? e : J(e), m) : d;
915
+ return arguments.length ? (d = typeof e == "function" ? e : Y(e), m) : d;
908
916
  }, m.links = function(e) {
909
- return arguments.length ? (f = typeof e == "function" ? e : J(e), m) : f;
917
+ return arguments.length ? (f = typeof e == "function" ? e : Y(e), m) : f;
910
918
  }, m.linkSort = function(e) {
911
919
  return arguments.length ? (u = e, m) : u;
912
920
  }, m.size = function(i) {
@@ -922,12 +930,12 @@ function it() {
922
930
  for (let [e, r] of t.entries()) {
923
931
  r.index = e;
924
932
  let { source: t, target: i } = 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);
933
+ typeof t != "object" && (t = r.source = rt(n, t)), typeof i != "object" && (i = r.target = rt(n, i)), t.sourceLinks.push(r), i.targetLinks.push(r);
926
934
  }
927
935
  if (u != null) for (let { sourceLinks: t, targetLinks: n } of e) t.sort(u), n.sort(u);
928
936
  }
929
937
  function g({ nodes: e }) {
930
- for (let t of e) t.value = t.fixedValue === void 0 ? Math.max(L(t.sourceLinks, Q), L(t.targetLinks, Q)) : t.fixedValue;
938
+ for (let t of e) t.value = t.fixedValue === void 0 ? Math.max(R(t.sourceLinks, Q), R(t.targetLinks, Q)) : t.fixedValue;
931
939
  }
932
940
  function _({ nodes: e }) {
933
941
  let t = e.length, n = new Set(e), r = /* @__PURE__ */ new Set(), i = 0;
@@ -952,7 +960,7 @@ function it() {
952
960
  }
953
961
  }
954
962
  function y({ nodes: t }) {
955
- let r = I(t, (e) => e.depth) + 1, a = (n - e - i) / (r - 1), o = Array(r);
963
+ let r = L(t, (e) => e.depth) + 1, a = (n - e - i) / (r - 1), o = Array(r);
956
964
  for (let n of t) {
957
965
  let t = Math.max(0, Math.min(r - 1, Math.floor(c.call(null, n, r))));
958
966
  n.layer = t, n.x0 = e + t * a, n.x1 = n.x0 + i, o[t] ? o[t].push(n) : o[t] = [n];
@@ -961,7 +969,7 @@ function it() {
961
969
  return o;
962
970
  }
963
971
  function b(e) {
964
- let n = de(e, (e) => (r - t - (e.length - 1) * o) / L(e, Q));
972
+ let n = de(e, (e) => (r - t - (e.length - 1) * o) / R(e, Q));
965
973
  for (let i of e) {
966
974
  let e = t;
967
975
  for (let t of i) {
@@ -978,7 +986,7 @@ function it() {
978
986
  }
979
987
  function x(e) {
980
988
  let n = y(e);
981
- o = Math.min(a, (r - t) / (I(n, (e) => e.length) - 1)), b(n);
989
+ o = Math.min(a, (r - t) / (L(n, (e) => e.length) - 1)), b(n);
982
990
  for (let e = 0; e < p; ++e) {
983
991
  let t = .99 ** e, r = Math.max(1 - t, (e + 1) / p);
984
992
  C(n, t, r), S(n, t, r);
@@ -1035,11 +1043,11 @@ function it() {
1035
1043
  function D({ sourceLinks: e, targetLinks: t }) {
1036
1044
  if (u === void 0) {
1037
1045
  for (let { source: { sourceLinks: e } } of t) e.sort(X);
1038
- for (let { target: { targetLinks: t } } of e) t.sort(Y);
1046
+ for (let { target: { targetLinks: t } } of e) t.sort($e);
1039
1047
  }
1040
1048
  }
1041
1049
  function O(e) {
1042
- if (u === void 0) for (let { sourceLinks: t, targetLinks: n } of e) t.sort(X), n.sort(Y);
1050
+ if (u === void 0) for (let { sourceLinks: t, targetLinks: n } of e) t.sort(X), n.sort($e);
1043
1051
  }
1044
1052
  function k(e, t) {
1045
1053
  let n = e.y0 - (e.sourceLinks.length - 1) * o / 2;
@@ -1068,12 +1076,12 @@ function it() {
1068
1076
  return m;
1069
1077
  }
1070
1078
  var $ = 4;
1071
- function at(e) {
1079
+ function ot(e) {
1072
1080
  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
1081
  if (e.layer === void 0) throw Error("Missing Sankey node layer before sorting");
1074
1082
  let r = t[e.layer].sort;
1075
1083
  return r?.(e, n) ?? 0;
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)({
1084
+ } : void 0, f = [[0, s + $], [c.width, c.height - 2 * $]], p = at().nodeId((e) => e.id).nodePadding(o).nodeWidth(i).linkSort((e, t) => e.dataFill && t.dataFill ? K(e, t) : e.dataFill ? 1 : -1).nodeSort(d).nodeAlign(u).extent(f).iterations(6)({
1077
1085
  nodes: n,
1078
1086
  links: r
1079
1087
  }), m = Xe(t, p.nodes, a), { nodes: h, links: g } = Je(p.nodes, p.links);
@@ -1083,14 +1091,14 @@ function at(e) {
1083
1091
  columns: m
1084
1092
  };
1085
1093
  }
1086
- var ot = {
1094
+ var st = {
1087
1095
  require: [
1088
1096
  "resolver",
1089
1097
  "chart",
1090
1098
  "renderer"
1091
1099
  ],
1092
1100
  defaultSettings: {
1093
- settings: W,
1101
+ settings: G,
1094
1102
  style: {
1095
1103
  title: "$title",
1096
1104
  label: "$label"
@@ -1108,7 +1116,7 @@ var ot = {
1108
1116
  resolvedNodes: n
1109
1117
  }), 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
1118
  if (c < 8) return [];
1111
- let { nodes: h, links: g, columns: _ } = at({
1119
+ let { nodes: h, links: g, columns: _ } = ot({
1112
1120
  columns: i,
1113
1121
  sankeyNodes: n,
1114
1122
  sankeyLinks: r,
@@ -1136,28 +1144,28 @@ var ot = {
1136
1144
  ];
1137
1145
  }
1138
1146
  };
1139
- function st(e) {
1140
- e.component(T.Sankey, ot);
1147
+ function ct(e) {
1148
+ e.component(F.Sankey, st);
1141
1149
  }
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();
1150
+ var lt = b(), ut = v(({ vSpec: e, vTheme: t, data: n, elementSize: r, vizProperties: i }) => {
1151
+ let o = g(), [s] = (0, fe.useState)(() => new je()), c = t || d, u = y(), f = h(), p = ne();
1144
1152
  if (!e) return null;
1145
- let g = l.targetDataItemId;
1146
- if (!g && l.targetInternalKey) {
1147
- let t = e.dimensions.find((e) => e.dataItem.internalKey === l.targetInternalKey);
1148
- t && (g = s(t.dataItem));
1153
+ let m = u.targetDataItemId;
1154
+ if (!m && u.targetInternalKey) {
1155
+ let t = e.dimensions.find((e) => e.dataItem.internalKey === u.targetInternalKey);
1156
+ t && (m = a(t.dataItem));
1149
1157
  }
1150
1158
  let _ = {
1151
1159
  ...i,
1152
- valuePickerMode: !!l.activeKey,
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, {
1160
+ valuePickerMode: !!u.activeKey,
1161
+ valuePickerTargetDataItemId: m ?? void 0
1162
+ }, v = s.compile(e, c, n, r, _, l.Sankey, o, f, p);
1163
+ return v ? /* @__PURE__ */ (0, lt.jsx)(ee, {
1156
1164
  config: i,
1157
1165
  definition: v,
1158
1166
  size: r,
1159
1167
  vSpec: e,
1160
- escobarPlugins: [st]
1168
+ escobarPlugins: [ct]
1161
1169
  }) : null;
1162
1170
  });
1163
- export { lt as Sankey };
1171
+ export { ut as Sankey };