@astrato-io/visualizations 0.8.0 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (161) hide show
  1. package/README.md +9 -5
  2. package/THIRD_PARTY_NOTICES.md +403 -325
  3. package/VISUALIZATION_DEFINITIONS.md +319 -32
  4. package/chunks/{Button-BrGKp9Nm.js → Button-CCF851ea.js} +10 -10
  5. package/chunks/CircularProgress-yupH6YWs.js +765 -0
  6. package/chunks/FieldTypeIcon-D_MzsdfY.js +22 -0
  7. package/chunks/LinearProgress-CyFjN4px.js +327 -0
  8. package/chunks/{MenuOption-ByRqhRdX.js → MenuOption-CQpT79AP.js} +1391 -1008
  9. package/chunks/Title-C-p4ZarD.js +1804 -0
  10. package/chunks/_createAggregator-BF4qG9XK.js +50 -0
  11. package/chunks/{app-filter-bar.compiler-TwVTeoj5.js → app-filter-bar.compiler-8fxCo2q7.js} +10 -10
  12. package/chunks/bar-layout-DStC-GNV.js +9 -0
  13. package/chunks/{bar.compiler-DuQg8EUb.js → bar.compiler-CQAu8KL8.js} +102 -84
  14. package/chunks/{builder-DEDvNq1k.js → builder-CScg1TOS.js} +156 -60
  15. package/chunks/color-rules-DYJL4fIW.js +15 -0
  16. package/chunks/color-settings-DJFoFTip.js +5 -0
  17. package/chunks/{coloring-CncX_JRX.js → coloring-9jU3s_-p.js} +41 -41
  18. package/chunks/contains-BK-sRXcB.js +21 -0
  19. package/chunks/createSimplePaletteValueFilter-C4hZpCdn.js +2005 -0
  20. package/chunks/defaults-cyNhn37t.js +3 -0
  21. package/chunks/{definitions-BPJQTx16.js → definitions-C4grxhye.js} +612 -400
  22. package/chunks/{escobar-DRhRMYRE.js → escobar-CjirINHP.js} +5354 -5473
  23. package/chunks/{extend-preset-CUFNpmPe.js → extend-preset-D-l9u_we.js} +974 -909
  24. package/chunks/{filter.compiler-w27dlv0C.js → filter.compiler-lji2Acgn.js} +7 -7
  25. package/chunks/{filtering-cc7WqWpg.js → filtering-C1zakrrX.js} +570 -390
  26. package/chunks/handlers-ZviIUC-j.js +15387 -0
  27. package/chunks/{icon-picker-styles-CoJmwTRi.js → icon-picker-styles-Bj80ZUBK.js} +11 -11
  28. package/chunks/isEqual-Ch9OEye3.js +16 -0
  29. package/chunks/isFocusVisible-CgMP0qkR.js +144 -0
  30. package/chunks/label-format-type-C46pzgx7.js +17 -0
  31. package/chunks/{line.compiler-Ct1WhN2p.js → line.compiler-De5fiKuR.js} +6 -6
  32. package/chunks/{logger-DpQtYQnX.js → logger-CKRjhSHQ.js} +77 -66
  33. package/chunks/map.compiler-CKzorLgK.js +345 -0
  34. package/chunks/{metadata-WABZrt7Y.js → metadata-Bb9pTXrq.js} +1 -1
  35. package/chunks/{number.compiler-D8TPly-4.js → number.compiler-CaTmJkmi.js} +4 -4
  36. package/chunks/operations-DZoY50VX.js +31297 -0
  37. package/chunks/{range-Bi-7zT0k.js → range-D1BTmFMp.js} +2 -2
  38. package/chunks/react-dom-Dgv2azN2.js +368 -0
  39. package/chunks/{render-wrappers-OEmtaM8g.js → render-wrappers-_P3xwu5A.js} +1 -1
  40. package/chunks/{requirements-Dvd8jqYF.js → requirements-NHNrR8Ie.js} +55 -53
  41. package/chunks/responsive.styles-FItb913l.js +93 -0
  42. package/chunks/shared-UitWpq1J.js +1331 -0
  43. package/chunks/standalone-B0U6c3su.js +3638 -0
  44. package/chunks/{standalone-we5D5MIn.js → standalone-BBu90BhK.js} +113 -113
  45. package/chunks/standalone-BEekPuA12.js +357 -0
  46. package/chunks/{standalone-BMTCb10X.js → standalone-BOzHA_d4.js} +41 -41
  47. package/chunks/standalone-BR2JuRIC.js +422 -0
  48. package/chunks/{standalone-BGkmozIb.js → standalone-BapqaniK.js} +619 -619
  49. package/chunks/standalone-Bnnr87pc.js +2009 -0
  50. package/chunks/standalone-BwJqDj2Z.js +396 -0
  51. package/chunks/{standalone-BDhPQtzQ.js → standalone-ByKKqT5L.js} +308 -300
  52. package/chunks/{standalone-vBnBS2YC.js → standalone-CRdDZYeM.js} +1788 -1004
  53. package/chunks/standalone-CRfDOO1x.js +287 -0
  54. package/chunks/{standalone-D5Q5ngsD.js → standalone-CVknVdUC.js} +30 -27
  55. package/chunks/standalone-CbPk8bKn.js +580 -0
  56. package/chunks/{standalone-CJvIXsQE.js → standalone-Ck63MZzj.js} +234 -232
  57. package/chunks/{standalone-CM5XcAN5.js → standalone-DCFY1MAV.js} +8075 -7729
  58. package/chunks/{standalone-DW6NT205.js → standalone-DZDGX3aa.js} +168 -168
  59. package/chunks/standalone-DhfgeJIk.js +1012 -0
  60. package/chunks/{standalone-DT0wKji7.js → standalone-DibjA73M.js} +2 -2
  61. package/chunks/{standalone-XuGksArp.js → standalone-DtBk_iUz.js} +9 -8
  62. package/chunks/standalone-DxBAyqAu.js +772 -0
  63. package/chunks/standalone-KMQPsNsq.js +2 -0
  64. package/chunks/standalone-MBLSvsrY.js +2 -0
  65. package/chunks/standalone-U0WJwFlG.js +354 -0
  66. package/chunks/{standalone-C8ZAEutO.js → standalone-swGs70tD.js} +49 -51
  67. package/chunks/standalone-wgFAVnnm.js +355 -0
  68. package/chunks/standalone-xGV0dqPV.js +689 -0
  69. package/chunks/{table.compiler-DMeeHxb6.js → table.compiler-OWSx5MOq.js} +7 -7
  70. package/chunks/{typeof-CJDtcySz.js → typeof-DCq3QgvY.js} +6 -1
  71. package/chunks/useFieldName-B8iCYyw1.js +7 -0
  72. package/chunks/{utils-vdmi_2PK.js → utils-3Igg6xmO.js} +7668 -12779
  73. package/chunks/{view-BuwQugKb.js → view-DdMLZySj.js} +2430 -2110
  74. package/chunks/{visualization-filters-Cc4KU-l-.js → visualization-filters-CzvFHE6M.js} +5205 -4438
  75. package/chunks/with-html-element-DOfkR3C1.js +16094 -0
  76. package/definitions.js +2 -2
  77. package/docs/operations/astrato-app-filter-bar.md +1 -1
  78. package/docs/operations/bar.md +303 -2
  79. package/docs/operations/combo.md +262 -1
  80. package/docs/operations/date-picker.md +1 -1
  81. package/docs/operations/distribution-gauge.md +1 -1
  82. package/docs/operations/dot.md +148 -1
  83. package/docs/operations/filter.md +1 -1
  84. package/docs/operations/gauge.md +1 -1
  85. package/docs/operations/heatMap.md +1 -1
  86. package/docs/operations/histogram.md +262 -1
  87. package/docs/operations/iframe.md +1 -1
  88. package/docs/operations/image.md +1 -1
  89. package/docs/operations/index.md +8 -8
  90. package/docs/operations/line.md +262 -1
  91. package/docs/operations/number.md +1 -1
  92. package/docs/operations/pie.md +1 -1
  93. package/docs/operations/radar.md +1 -1
  94. package/docs/operations/sankey.md +1 -1
  95. package/docs/operations/scatter.md +148 -1
  96. package/docs/operations/shape.md +1 -1
  97. package/docs/operations/simpleTextObject.md +1 -1
  98. package/docs/operations/slider.md +1 -1
  99. package/docs/operations/table.md +439 -157
  100. package/docs/operations/tree.md +1 -1
  101. package/docs/operations/treemap.md +1 -1
  102. package/docs/operations/waterfall.md +1 -1
  103. package/docs/operations/word-cloud.md +1 -1
  104. package/getters.js +2 -2
  105. package/index.js +523 -469
  106. package/metadata.js +2 -2
  107. package/operations.js +5 -5
  108. package/package.json +74 -68
  109. package/src/definitions/index.d.ts +1 -1
  110. package/src/definitions/model/definitions/available-fields.d.ts +2 -2
  111. package/src/definitions/model/definitions/compilers/compile.d.ts +1 -0
  112. package/src/definitions/model/definitions/data-item-resolution.d.ts +3 -3
  113. package/src/definitions/model/definitions/descriptors/descriptor-metadata.d.ts +535 -349
  114. package/src/definitions/model/definitions/index.d.ts +2 -1
  115. package/src/definitions/model/definitions/schema-registry.d.ts +406 -101
  116. package/src/definitions/model/definitions/schemas/bar.schema.d.ts +10 -8
  117. package/src/definitions/model/definitions/schemas/common.schema.d.ts +33 -32
  118. package/src/definitions/model/definitions/schemas/index.d.ts +1 -0
  119. package/src/definitions/model/definitions/schemas/line.schema.d.ts +10 -10
  120. package/src/definitions/model/definitions/schemas/map.schema.d.ts +590 -0
  121. package/src/definitions/model/definitions/schemas/number.schema.d.ts +4 -4
  122. package/src/definitions/model/definitions/schemas/object.schema.d.ts +38 -38
  123. package/src/definitions/model/definitions/schemas/table.schema.d.ts +61 -61
  124. package/src/definitions/model/definitions/types/compilation.types.d.ts +7 -2
  125. package/src/definitions/model/definitions/types/definition.types.d.ts +2 -2
  126. package/src/definitions/model/definitions/types/index.d.ts +1 -1
  127. package/src/index.d.ts +1 -1
  128. package/src/operations/index.d.ts +1 -1
  129. package/src/types.d.ts +45 -41
  130. package/src/visualization-catalog.d.ts +26 -26
  131. package/chunks/DefaultPropsProvider-BsfB7QTn.js +0 -257
  132. package/chunks/FieldTypeIcon-Drs6hSJF.js +0 -22
  133. package/chunks/LinearProgress-VtfFx2vJ.js +0 -253
  134. package/chunks/Title-CO5dP1ma.js +0 -1691
  135. package/chunks/ToggleButton-KOBAimC1.js +0 -112
  136. package/chunks/color-rules-CN7TcGrC.js +0 -6
  137. package/chunks/color-settings-3VRlf_Vw.js +0 -6
  138. package/chunks/colorManipulator-D8Pjy1pf.js +0 -45
  139. package/chunks/handlers-TOT-7INo.js +0 -12871
  140. package/chunks/isEqual-B8loyPsC.js +0 -12
  141. package/chunks/label-format-type-weq1XfcX.js +0 -8
  142. package/chunks/operations-Dh4v1Ovt.js +0 -26280
  143. package/chunks/responsive.styles-DSiOGD7u.js +0 -82
  144. package/chunks/shared-Bn4N5QcZ.js +0 -1218
  145. package/chunks/standalone-B55oyW6c.js +0 -689
  146. package/chunks/standalone-BXKRE_Se.js +0 -468
  147. package/chunks/standalone-Bes8srx1.js +0 -354
  148. package/chunks/standalone-BjZp0QMe.js +0 -2
  149. package/chunks/standalone-BlMIwpEe.js +0 -1877
  150. package/chunks/standalone-C8qAelL4.js +0 -2
  151. package/chunks/standalone-CLmGb7nn2.js +0 -355
  152. package/chunks/standalone-CXNP6-xD.js +0 -420
  153. package/chunks/standalone-DLlyRIE6.js +0 -287
  154. package/chunks/standalone-DMcI1afI.js +0 -396
  155. package/chunks/standalone-DN4S1MjT.js +0 -3874
  156. package/chunks/standalone-DYQIQH4c.js +0 -2095
  157. package/chunks/standalone-D__XCp-h.js +0 -1003
  158. package/chunks/standalone-XTgSsTAa.js +0 -354
  159. package/chunks/useFieldName-Cjn9KCVp.js +0 -7
  160. package/chunks/useSlotProps-DLbQp4lc.js +0 -166
  161. package/chunks/with-html-element-D0uY2zjI.js +0 -7328
@@ -1,33 +1,41 @@
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) {
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
- }({}), z = /* @__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
- }({}), me = class extends ue {
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) => {
27
+ super(e, t, n), this.dimensionIds = [], this.vSpec.dimensions.filter((e) => o(e)).forEach((e) => {
20
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];
@@ -39,7 +47,7 @@ var pe = /* @__PURE__ */ e(m()), L = /* @__PURE__ */ function(e) {
39
47
  if ([i, ...Object.keys(i).filter((e) => {
40
48
  let t = i[e]?.source?.field;
41
49
  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;
50
+ }).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
51
  }
44
52
  }
45
53
  getFilteredColor() {
@@ -48,7 +56,7 @@ var pe = /* @__PURE__ */ e(m()), L = /* @__PURE__ */ function(e) {
48
56
  getLinkColorDefinition() {
49
57
  return (e) => {
50
58
  if (this.notAffectedItems?.pattern?.length && this.vSpec.staticFilters.ignoreGlobalFilters && this.vSpec.staticFilters.showGlobalFiltersEffect) {
51
- let t = ce(e, this.notAffectedItems);
59
+ let t = se(e, this.notAffectedItems);
52
60
  if (t) return t;
53
61
  }
54
62
  if (this.isColorOverwriteActive()) {
@@ -61,55 +69,55 @@ var pe = /* @__PURE__ */ e(m()), L = /* @__PURE__ */ function(e) {
61
69
  }
62
70
  };
63
71
  }
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) => ({
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;
73
+ function ve(e, t) {
74
+ let n = e.dimensions.filter((e) => o(e)), r = (e.querySettings?.sortingOrder ?? []).map((e) => ({
67
75
  id: a(e.dataItem),
68
76
  direction: e.sortDirection,
69
77
  type: e.fieldType
70
- })), i = r.find((e) => e.type === "measure"), o = i ? r.indexOf(i) : -1;
78
+ })), i = r.find((e) => e.type === "measure"), s = i ? r.indexOf(i) : -1;
71
79
  return n.map((n) => {
72
- let s = a(n.dataItem), c;
80
+ let o = a(n.dataItem), c;
73
81
  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);
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: s,
86
+ id: o,
79
87
  sort: c,
80
- isGrouped: u(e.dimensions, e.enableAlternate, t)
88
+ isGrouped: f(e.dimensions, e.enableAlternate, t)
81
89
  };
82
90
  });
83
91
  }
84
- var be = (e, t) => {
85
- let n = e.sankeySettings.linkColoring?.opacity ?? .3, i = t.valuePickerMode ?? !1, a = i ? t.valuePickerTargetDataItemId : "";
92
+ var ye = (e, t) => {
93
+ let r = e.sankeySettings.linkColoring?.opacity ?? .3, i = t.valuePickerMode ?? !1, a = i ? t.valuePickerTargetDataItemId : "";
86
94
  return {
87
95
  trigger: [{
88
- on: k.Tap,
89
- action: A.Toggle,
96
+ on: A.Tap,
97
+ action: j.Toggle,
90
98
  globalPropagation: "stop",
91
99
  data: ["", "linkTarget"],
92
- contexts: [E.Selection]
100
+ contexts: [O.Selection]
93
101
  }, {
94
- on: k.Over,
95
- action: A.Set,
102
+ on: A.Over,
103
+ action: j.Set,
96
104
  globalPropagation: "stop",
97
105
  data: ["", "linkTarget"],
98
- contexts: [E.Highlight]
106
+ contexts: [O.Highlight]
99
107
  }],
100
108
  consume: [
101
109
  {
102
- context: E.Selection,
110
+ context: O.Selection,
103
111
  data: ["", "linkTarget"],
104
112
  filter: (e) => e.data?.type?.value === "link",
105
- mode: T.Or,
106
- style: { inactive: { opacity: n * .25 } }
113
+ mode: E.Or,
114
+ style: { inactive: { opacity: r * .25 } }
107
115
  },
108
116
  {
109
- context: E.Selection,
117
+ context: O.Selection,
110
118
  data: [""],
111
119
  filter: (e) => e.data?.type?.value === "node",
112
- mode: T.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) {
@@ -120,27 +128,27 @@ var be = (e, t) => {
120
128
  } } }
121
129
  },
122
130
  {
123
- context: E.Highlight,
131
+ context: O.Highlight,
124
132
  data: [""],
125
133
  filter: (e) => e.data?.type?.value === "node",
126
- mode: T.Or,
134
+ mode: E.Or,
127
135
  style: { active: {
128
136
  strokeWidth: (e) => i && e.data.source.field !== a ? 0 : 1,
129
- stroke: r.mainDarkNavy
137
+ stroke: n.mainDarkNavy
130
138
  } }
131
139
  }
132
140
  ]
133
141
  };
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) => {
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: L.sankey,
143
- type: N.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 be = (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: ye(e, o.isPrintMode ?? !1),
158
- nodeLabelPlacements: s.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: R.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 be = (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: o.disable?.brushing === !0 ? void 0 : be(e, o),
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
- }, 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) => ({
205
+ }, xe = (e, t, n) => {
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
- [R.NodeFlow]: {
204
- field: o,
211
+ [B.NodeFlow]: {
212
+ field: s,
205
213
  reduce: "sum"
206
214
  },
207
- [o]: {
208
- field: o,
215
+ [s]: {
216
+ field: s,
209
217
  reduce: "sum"
210
218
  },
211
- [R.NodeColor]: { field: e },
219
+ [B.NodeColor]: { field: e },
212
220
  type: "node"
213
221
  }
214
- })), l = s.slice(0, s.length - 1).map((e, t) => {
222
+ })), u = c.slice(0, c.length - 1).map((e, t) => {
215
223
  let n = {
216
- field: s[t],
224
+ field: c[t],
217
225
  props: {
218
- flow: { field: o },
219
- [o]: { field: o },
226
+ flow: { field: s },
227
+ [s]: { field: s },
220
228
  type: "link"
221
229
  }
222
230
  };
223
- return s.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
- }, B = (e, t) => ({
242
- component: L.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 be = (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
- }), 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);
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: L.sankey,
271
+ component: z.sankey,
264
272
  selector: e,
265
273
  strategy: {
266
274
  type: "rows",
@@ -279,81 +287,81 @@ var be = (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 P(n).betterContrast(r, Ce, we).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?.[R.NodeFlow]?.value) : void 0, i = n.label?.length > V - 1 ? `${n.label?.substring(0, V - 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
- }, Te = (e, t, n, r, i, c, d, f) => {
296
- if (!c) 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(L.columnLabels, L.columnLabels, f));
306
+ p && m.push(T(z.columnLabels, z.columnLabels, p));
299
307
  let h = {
300
- type: N.Labels,
301
- key: L.columnLabels,
308
+ type: F.Labels,
309
+ key: z.columnLabels,
302
310
  layout: { displayOrder: 2 },
303
311
  settings: { sources: [
304
- B(`.${z.ColumnTitleLeft}`, 0),
305
- B(`.${z.ColumnTitleCenter}`, .5),
306
- B(`.${z.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 ? a(g.dataItem) : void 0;
314
- f && g && e.measures.length > 1 && m.push(w(N.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 = l(g) || g.label || g.dataItem?.name || "Measure";
325
+ let n = u(g) || g.label || g.dataItem?.name || "Measure";
318
326
  v = {
319
- type: N.Text,
327
+ type: F.Text,
320
328
  key: `text-${_}`,
321
329
  dataItemType: s.Measure,
322
330
  dataItemRole: g.role,
323
- text: u(e.measures, e.enableAlternate, c.isPrintMode) ? S(n) : n,
331
+ text: f(e.measures, e.enableAlternate, l.isPrintMode) ? N(n) : n,
324
332
  layout: {
325
- dock: o.Bottom,
333
+ dock: r.Bottom,
326
334
  color: "red"
327
335
  },
328
336
  style: { text: {
329
337
  fontFamily: t.fonts.general.fontFamily,
330
- fontSize: `${j.fieldTitle.fontSize}px`,
338
+ fontSize: `${M.fieldTitle.fontSize}px`,
331
339
  fontStyle: "normal",
332
340
  fill: t.fonts.general.color
333
341
  } },
334
- anchor: o.Center
342
+ anchor: r.Center
335
343
  };
336
344
  }
337
345
  let y = {
338
- type: N.Labels,
339
- key: L.labels,
346
+ type: F.Labels,
347
+ key: z.labels,
340
348
  layout: { displayOrder: 2 },
341
349
  settings: { sources: [
342
- H(`.${z.NodeLabelLeft}`, 0, t),
343
- H(`.${z.NodeLabelCenter}`, .5, t),
344
- H(`.${z.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: c.disable?.brushing === !0 ? void 0 : {
355
+ brush: l.disable?.brushing === !0 ? void 0 : {
348
356
  trigger: [{
349
- on: k.Tap,
350
- action: A.Toggle,
357
+ on: A.Tap,
358
+ action: j.Toggle,
351
359
  globalPropagation: "stop",
352
360
  data: [""],
353
- contexts: [E.Selection]
361
+ contexts: [O.Selection]
354
362
  }],
355
363
  consume: [{
356
- context: E.Selection,
364
+ context: O.Selection,
357
365
  data: [""],
358
366
  style: { inactive: { opacity: .3 } }
359
367
  }]
@@ -373,48 +381,48 @@ var be = (e, t) => {
373
381
  ],
374
382
  interactions: n.interactions ? [...n.interactions, ...m] : [...m]
375
383
  };
376
- }, Ee = (e, t, r, i, o) => {
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: O.CategoricalColor,
388
+ type: k.CategoricalColor,
381
389
  data: [],
382
390
  range: [e],
383
391
  unknown: e
384
392
  };
385
393
  }
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";
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: O.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, a(i.dataItem), {
397
- customPalette: s.customPalette ?? c.customPalette,
404
+ return x(e, t, a(r.dataItem), {
405
+ customPalette: s.customPalette ?? i.customPalette,
398
406
  palette: s.palette
399
407
  });
400
- }, De = (e, t, n) => {
401
- let r = e.dimensions.filter((e) => p(e));
408
+ }, Ee = (e, t, n) => {
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 o = {}, s = se({
406
- palette: i.palette,
407
- customPalette: i.customPalette ?? c.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
418
  let r = a(n.dataItem);
411
- o[r] = Ee(e, t, i, n, s);
419
+ c[r] = Te(e, t, s, n, l);
412
420
  }), {
413
421
  ...n,
414
- scales: o
422
+ scales: c
415
423
  };
416
- }, Oe = (e, t, n) => {
417
- let r = e.dimensions.filter((e) => p(e)), i = e.measures.filter((e) => p(e));
424
+ }, De = (e, t, n) => {
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,
@@ -428,7 +436,7 @@ var be = (e, t) => {
428
436
  },
429
437
  $title: {
430
438
  "@extend": "$label",
431
- fontSize: `${j.fieldTitle.fontSize}px`,
439
+ fontSize: `${M.fieldTitle.fontSize}px`,
432
440
  padding: 4
433
441
  }
434
442
  };
@@ -436,54 +444,54 @@ var be = (e, t) => {
436
444
  ...n,
437
445
  style: a
438
446
  };
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);
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);
441
449
  return s.push({
442
- label: u,
450
+ label: l,
443
451
  value: f
444
452
  }), s;
445
- }, je = (e, t, n, r, i) => {
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 = oe(e, t, Ae, ke), D(e, t, n, a, "tooltip", i);
451
- }, Me = 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
- Se,
455
- De,
456
462
  xe,
457
- Te,
458
- Oe,
459
- je
463
+ Ee,
464
+ be,
465
+ we,
466
+ De,
467
+ Ae
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 o = a(i.dataItem), s = r.map((e) => a(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[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.");
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
- }, U = {
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: [i.Beside],
494
+ nodeLabelPlacements: [p.Beside],
487
495
  node: {
488
496
  id: "",
489
497
  fill: "#333333"
@@ -495,10 +503,10 @@ var be = (e, t) => {
495
503
  value: 1
496
504
  }
497
505
  };
498
- function W(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
- function Ne(e) {
509
+ function Me(e) {
502
510
  let t = e.target.x0 - e.source.x1, n = e.y0 - e.y1, r = Math.abs(n) < .1 ? 0 : .5;
503
511
  return [
504
512
  `M${e.source.x1},${e.y0}`,
@@ -507,12 +515,12 @@ function Ne(e) {
507
515
  `${e.target.x0},${e.y1}`
508
516
  ].join(" ");
509
517
  }
510
- function Pe(e) {
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
- d: Ne(e),
523
+ d: Me(e),
516
524
  fill: "none",
517
525
  strokeWidth: Math.max(.5, e.width),
518
526
  stroke: e.fill,
@@ -522,44 +530,44 @@ function Pe(e) {
522
530
  collider: { visual: !0 }
523
531
  }));
524
532
  }
525
- function Fe(e) {
526
- let { data: n, resolver: r, settings: i, resolvedNodes: a } = e, o = {};
527
- a.forEach((e) => {
528
- o[e.id] = e;
533
+ function Pe(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: { ...U.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,
@@ -571,10 +579,10 @@ function Fe(e) {
571
579
  opacity: e.opacity
572
580
  }));
573
581
  }
574
- function Ie(e) {
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: { ...U.node },
585
+ defaults: { ...G.node },
578
586
  settings: {
579
587
  ...r.node,
580
588
  fixedValue: ({ datum: e }) => e.flow.value
@@ -582,7 +590,7 @@ function Ie(e) {
582
590
  });
583
591
  return a;
584
592
  }
585
- function Le(e, t) {
593
+ function Ie(e, t) {
586
594
  let n = [];
587
595
  return e.map((e) => {
588
596
  let r = e.data, i = {};
@@ -600,11 +608,11 @@ function Le(e, t) {
600
608
  }), i[e.dataFill].targetSum += e.value);
601
609
  });
602
610
  let a = Object.values(i);
603
- a.sort(W);
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 Le(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 Le(e, t) {
638
646
  });
639
647
  }), n;
640
648
  }
641
- var G = (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,
@@ -649,12 +657,12 @@ var G = (e, t, n = !1, r = [4, 2]) => ({
649
657
  opacity: t.backdropColor ? 1 : .8,
650
658
  padding: r
651
659
  } : void 0
652
- }), Re = (e, t, n, r) => {
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 = 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;
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]),
@@ -665,11 +673,11 @@ var G = (e, t, n = !1, r = [4, 2]) => ({
665
673
  fill: "none"
666
674
  };
667
675
  });
668
- }, ze = (e) => e.canShowNodeLabelAboveNode, Be = (e, t, n, r) => {
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 ? 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 = {
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 G = (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 ? z.NodeLabelLeft : t.align > .5 ? z.NodeLabelRight : z.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
- }, 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]);
692
+ }, Be = (e) => e.columnGap >= 20, Ve = (e, t, n, r) => e.filter((e) => e.y1 - e.y0 >= r.nodeLabelHeight).map((e) => {
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: z.NodeLabelCenter,
702
+ tag: V.NodeLabelCenter,
695
703
  fill: "none"
696
704
  };
697
- }), Ue = (e) => e.columnWidth >= 80, K = {
698
- [i.Above]: {
699
- condition: ze,
700
- create: Re
705
+ }), He = (e) => e.columnWidth >= 80, J = {
706
+ [p.Above]: {
707
+ condition: Re,
708
+ create: Le
701
709
  },
702
- [i.Beside]: {
703
- condition: Ve,
704
- create: Be
710
+ [p.Beside]: {
711
+ condition: Be,
712
+ create: ze
705
713
  },
706
- [i.Inside]: {
707
- condition: Ue,
708
- create: He
714
+ [p.Inside]: {
715
+ condition: He,
716
+ create: Ve
709
717
  }
710
- }, We = (e) => e.priority.find((t) => K[t]?.condition(e)), Ge = (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) => K[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(...K[o].create(e, t, n, r)), i;
727
+ return o && i.push(...J[o].create(e, t, n, r)), i;
720
728
  };
721
- function Ke(e, t) {
729
+ function Ge(e, t) {
722
730
  let { headerHeight: n } = t;
723
731
  return e.map((e) => {
724
- let t = e.align < .5 ? z.ColumnTitleLeft : e.align > .5 ? z.ColumnTitleRight : z.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",
@@ -740,7 +748,7 @@ function Ke(e, t) {
740
748
  };
741
749
  });
742
750
  }
743
- function qe(e, t, n, r) {
751
+ function Ke(e, t, n, r) {
744
752
  let i = {};
745
753
  e.columnFields.forEach((e) => {
746
754
  i[e.id] = {
@@ -758,9 +766,9 @@ function qe(e, t, n, r) {
758
766
  field: e.id,
759
767
  sort: e.sort
760
768
  }));
761
- return Je(a, t, n, e.showNullNodes), a;
769
+ return qe(a, t, n, e.showNullNodes), a;
762
770
  }
763
- function Je(e, t, n, r = !1) {
771
+ function qe(e, t, n, r = !1) {
764
772
  (e.find((e) => !e.count) || !r) && e.forEach((r, i) => {
765
773
  let a = `dummy-${i}`, o = `dummy-${i + 1}`;
766
774
  t.unshift({
@@ -787,13 +795,13 @@ function Je(e, t, n, r = !1) {
787
795
  });
788
796
  });
789
797
  }
790
- function Ye(e, t) {
798
+ function Je(e, t) {
791
799
  return {
792
800
  nodes: e.filter((e) => !e.id.startsWith("dummy-")),
793
801
  links: t.filter((e) => !e.source.id.startsWith("dummy-"))
794
802
  };
795
803
  }
796
- function Xe(e, t, n) {
804
+ function Ye(e, t, n) {
797
805
  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
806
  a > o && r / a > .1 ? s = -a / 2 : o > a && r / o > .1 && (s = o / 2), s !== 0 && (e.forEach((e) => {
799
807
  e.y0 += s, e.y1 += s;
@@ -801,7 +809,7 @@ function Xe(e, t, n) {
801
809
  e.y0 += s, e.y1 += s;
802
810
  }));
803
811
  }
804
- function Ze(e, t, n) {
812
+ function Xe(e, t, n) {
805
813
  return e.map((r) => {
806
814
  let i = t.find((e) => e.data.source.field === r.field);
807
815
  if (!i) throw Error(`Missing Sankey node for column ${r.field}`);
@@ -818,47 +826,47 @@ function Ze(e, t, n) {
818
826
  };
819
827
  });
820
828
  }
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({
829
+ function Ze(e, t, n, r, i) {
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,
827
- columnWidth: o,
834
+ columnGap: s,
835
+ columnWidth: a,
828
836
  priority: t.nodeLabelPlacements
829
837
  });
830
- return _ && y === i.Above && (m += p, v = Math.max(p, g)), {
831
- columnGap: c,
832
- columnWidth: o,
838
+ return _ && y === p.Above && (m += f, v = Math.max(f, g)), {
839
+ columnGap: s,
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
- function $e(e, t) {
851
+ function Qe(e, t) {
844
852
  return e.sourceLinks.length ? e.depth : t - 1;
845
853
  }
846
- function q(e) {
854
+ function Y(e) {
847
855
  return function() {
848
856
  return e;
849
857
  };
850
858
  }
851
- de();
852
- function J(e, t) {
853
- return X(e.source, t.source) || e.index - t.index;
854
- }
855
- function Y(e, t) {
856
- return X(e.target, t.target) || e.index - t.index;
859
+ ue();
860
+ function $e(e, t) {
861
+ return Z(e.source, t.source) || e.index - t.index;
857
862
  }
858
863
  function X(e, t) {
864
+ return Z(e.target, t.target) || e.index - t.index;
865
+ }
866
+ function Z(e, t) {
859
867
  return e.y0 - t.y0;
860
868
  }
861
- function Z(e) {
869
+ function Q(e) {
862
870
  return e.value;
863
871
  }
864
872
  function et(e) {
@@ -870,33 +878,33 @@ function tt(e) {
870
878
  function nt(e) {
871
879
  return e.links;
872
880
  }
873
- function Q(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 $({ 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 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;
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), $(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 $(e), e;
903
+ return it(e), e;
896
904
  }, m.nodeId = function(e) {
897
- return arguments.length ? (s = typeof e == "function" ? e : q(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 : q(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 rt() {
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 : q(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 : q(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 rt() {
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 = Q(n, t)), typeof i != "object" && (i = r.target = Q(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(I(t.sourceLinks, Z), I(t.targetLinks, Z)) : 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 rt() {
952
960
  }
953
961
  }
954
962
  function y({ nodes: t }) {
955
- let r = F(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 rt() {
961
969
  return o;
962
970
  }
963
971
  function b(e) {
964
- let n = fe(e, (e) => (r - t - (e.length - 1) * o) / I(e, Z));
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 rt() {
978
986
  }
979
987
  function x(e) {
980
988
  let n = y(e);
981
- o = Math.min(a, (r - t) / (F(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);
@@ -997,7 +1005,7 @@ function rt() {
997
1005
  let i = (n / r - e.y0) * t;
998
1006
  e.y0 += i, e.y1 += i, D(e);
999
1007
  }
1000
- l === void 0 && i.sort(X), w(i, n);
1008
+ l === void 0 && i.sort(Z), w(i, n);
1001
1009
  }
1002
1010
  }
1003
1011
  function C(e, t, n) {
@@ -1013,7 +1021,7 @@ function rt() {
1013
1021
  let i = (n / r - e.y0) * t;
1014
1022
  e.y0 += i, e.y1 += i, D(e);
1015
1023
  }
1016
- l === void 0 && i.sort(X), w(i, n);
1024
+ l === void 0 && i.sort(Z), w(i, n);
1017
1025
  }
1018
1026
  }
1019
1027
  function w(e, n) {
@@ -1034,12 +1042,12 @@ function rt() {
1034
1042
  }
1035
1043
  function D({ sourceLinks: e, targetLinks: t }) {
1036
1044
  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);
1045
+ for (let { source: { sourceLinks: e } } of t) e.sort(X);
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(Y), n.sort(J);
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;
@@ -1067,48 +1075,48 @@ function rt() {
1067
1075
  }
1068
1076
  return m;
1069
1077
  }
1070
- var it = 4;
1071
- function at(e) {
1078
+ var $ = 4;
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 + 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)({
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
- }), m = Ze(t, p.nodes, a), { nodes: h, links: g } = Ye(p.nodes, p.links);
1080
- return Xe(h, g, f), {
1087
+ }), m = Xe(t, p.nodes, a), { nodes: h, links: g } = Je(p.nodes, p.links);
1088
+ return Ye(h, g, f), {
1081
1089
  nodes: h,
1082
1090
  links: g,
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: U,
1101
+ settings: G,
1094
1102
  style: {
1095
1103
  title: "$title",
1096
1104
  label: "$label"
1097
1105
  }
1098
1106
  },
1099
1107
  render({ data: e }) {
1100
- let { settings: t } = this.settings, n = Ie({
1108
+ let { settings: t } = this.settings, n = Fe({
1101
1109
  data: e,
1102
1110
  resolver: this.resolver,
1103
1111
  settings: t
1104
- }), r = Fe({
1112
+ }), r = Pe({
1105
1113
  data: e,
1106
1114
  resolver: this.resolver,
1107
1115
  settings: t,
1108
1116
  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);
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,
@@ -1117,7 +1125,7 @@ var ot = {
1117
1125
  nodePadding: s,
1118
1126
  top: d,
1119
1127
  rect: this.rect
1120
- }), v = Le(h, { nodeMargin: u }), y = Ge(h, v, _, {
1128
+ }), v = Ie(h, { nodeMargin: u }), y = We(h, v, _, {
1121
1129
  nodeLabelHeight: l,
1122
1130
  canShowNodeLabelAboveNode: m,
1123
1131
  nodePadding: s,
@@ -1129,35 +1137,35 @@ var ot = {
1129
1137
  priority: t.nodeLabelPlacements
1130
1138
  });
1131
1139
  return [
1132
- ...Pe(g),
1140
+ ...Ne(g),
1133
1141
  ...v,
1134
- ...f ? Ke(_, { headerHeight: p }) : [],
1142
+ ...f ? Ge(_, { headerHeight: p }) : [],
1135
1143
  ...y
1136
1144
  ];
1137
1145
  }
1138
1146
  };
1139
- function st(e) {
1140
- e.component(N.Sankey, ot);
1147
+ function ct(e) {
1148
+ e.component(F.Sankey, st);
1141
1149
  }
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();
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 m = l.targetDataItemId;
1146
- if (!m && l.targetInternalKey) {
1147
- let t = e.dimensions.find((e) => e.dataItem.internalKey === l.targetInternalKey);
1153
+ let m = u.targetDataItemId;
1154
+ if (!m && u.targetInternalKey) {
1155
+ let t = e.dimensions.find((e) => e.dataItem.internalKey === u.targetInternalKey);
1148
1156
  t && (m = a(t.dataItem));
1149
1157
  }
1150
1158
  let _ = {
1151
1159
  ...i,
1152
- valuePickerMode: !!l.activeKey,
1160
+ valuePickerMode: !!u.activeKey,
1153
1161
  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, {
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
- definition: y,
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 };