@astrato-io/visualizations 0.10.1 → 0.11.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 (133) hide show
  1. package/CHANGELOG.md +11 -1
  2. package/README.md +19 -1
  3. package/THIRD_PARTY_NOTICES.md +494 -0
  4. package/VISUALIZATION_DEFINITIONS.md +6 -145
  5. package/chunks/{Button-Dn3rJrYf.js → Button-CPG4WX8X.js} +3 -3
  6. package/chunks/{CircularProgress-BFeu06Yb.js → CircularProgress-PSLW8HmD.js} +12 -12
  7. package/chunks/FieldTypeIcon-5k2bkqd0.js +22 -0
  8. package/chunks/{LinearProgress-ClO6GUjN.js → LinearProgress-KQ2EQlGL.js} +16 -16
  9. package/chunks/{MenuOption-Czc34u4q.js → MenuOption-B-6K7kks.js} +151 -151
  10. package/chunks/{Title-BgYnaVTR.js → Title-BmvwZYkh.js} +32 -32
  11. package/chunks/{_createAggregator-BMu9uRax.js → _createAggregator-CFmH6gUN.js} +16 -16
  12. package/chunks/{app-filter-bar.compiler-CVir0wkl.js → app-filter-bar.compiler-BY5-T16I.js} +8 -8
  13. package/chunks/{bar-layout-C_UgRlVl.js → bar-layout-BNou0dZF.js} +2 -2
  14. package/chunks/{bar.compiler-DYuFdi9J.js → bar.compiler-BkhO7sDd.js} +58 -56
  15. package/chunks/{builder-C-TKA-My.js → builder-CNjuqD2z.js} +107 -56
  16. package/chunks/category-axis-D1OVyMrr.js +20 -0
  17. package/chunks/{coloring-BtnPiQ_o.js → coloring-BOiP0rmn.js} +51 -51
  18. package/chunks/{createSimplePaletteValueFilter--zrZxRV9.js → createSimplePaletteValueFilter-BkgQ7MFE.js} +166 -166
  19. package/chunks/defaults-B5_8S-J-.js +3 -0
  20. package/chunks/{definitions-CT304NDn.js → definitions-AS9GcavE.js} +228 -233
  21. package/chunks/{escobar-CvEV2ES1.js → escobar-cQ1eQ64G.js} +4183 -4183
  22. package/chunks/{extend-preset-D9-JP92b.js → extend-preset-BlCbcXKR.js} +427 -427
  23. package/chunks/{filter.compiler-CXeZznks.js → filter.compiler-CI7dDNM1.js} +10 -10
  24. package/chunks/{filtering-8_bFv-jb.js → filtering-Dwi7hDPZ.js} +308 -308
  25. package/chunks/{handlers-C6CZ0XJA.js → handlers-C63NVo7i.js} +4593 -4559
  26. package/chunks/{icon-picker-styles-BXiJ1SZS.js → icon-picker-styles-CBlxEu3s.js} +8 -8
  27. package/chunks/{isEqual-D8Ay63xR.js → isEqual-BdHo6wqq.js} +1 -1
  28. package/chunks/{isFocusVisible-Bu8gGZu5.js → isFocusVisible-C1nlVUwL.js} +9 -9
  29. package/chunks/line.compiler-DCv3h42f.js +198 -0
  30. package/chunks/linear-Bq_r9l5S.js +264 -0
  31. package/chunks/{logger-DdZpR7xZ.js → logger-Bc-DqDM_.js} +64 -64
  32. package/chunks/{lookup-BWllin0q.js → lookup-B3tWH2hX.js} +1 -0
  33. package/chunks/{map.compiler-Q_Y1Pvat.js → map.compiler-CRO6XpdI.js} +43 -43
  34. package/chunks/measure-format-default-B6ghxih7.js +22 -0
  35. package/chunks/{metadata-BQm_TXI1.js → metadata-CtkvZEhS.js} +1 -1
  36. package/chunks/number.compiler-kV4lobCZ.js +57 -0
  37. package/chunks/{operations-DKQWuLL7.js → operations-COl9wgqi.js} +8524 -8480
  38. package/chunks/{range-BdhzvYQ_.js → range-CMJ5yc5Z.js} +2 -2
  39. package/chunks/{react-dom-BGP4tbXV.js → react-dom-BjsCbYHq.js} +76 -76
  40. package/chunks/{render-wrappers-BZpyDnJy.js → render-wrappers-DFHi3Wkr.js} +1 -1
  41. package/chunks/{requirements-e8Fe96ag.js → requirements-C5YLmHKe.js} +250 -226
  42. package/chunks/{shared-C_2F90xq.js → shared-DyqxOie0.js} +504 -498
  43. package/chunks/standalone-06i1wmIX.js +6 -0
  44. package/chunks/{standalone-BDrXVxlP.js → standalone-9jrQ3zJT.js} +10 -10
  45. package/chunks/standalone-B6zUvxNQ.js +357 -0
  46. package/chunks/{standalone-BkbiH-o8.js → standalone-BYK2U0Vd.js} +418 -679
  47. package/chunks/standalone-Be5APcVv.js +762 -0
  48. package/chunks/{standalone-Cl0TSfqC.js → standalone-Bp4G3MDx.js} +123 -123
  49. package/chunks/{standalone-DNh9NcMa.js → standalone-BrjtMIdd.js} +145 -145
  50. package/chunks/{standalone-BTY3w_JA.js → standalone-Bsfz5vnJ.js} +53 -53
  51. package/chunks/standalone-BuXpKMnc.js +2 -0
  52. package/chunks/standalone-CIjNYyya.js +8378 -0
  53. package/chunks/{standalone-CsoMmE9T.js → standalone-CS5VGoja.js} +347 -347
  54. package/chunks/standalone-CUGt2FUF.js +2 -0
  55. package/chunks/{standalone-CaTxAydz.js → standalone-ChfEHb28.js} +2296 -1069
  56. package/chunks/standalone-CnF2OYLQ.js +355 -0
  57. package/chunks/standalone-CznEEiq3.js +422 -0
  58. package/chunks/{standalone-DflyWtuR.js → standalone-D9k5SCd8.js} +169 -169
  59. package/chunks/{standalone-Cc98Pdr6.js → standalone-DYVYccmY.js} +829 -829
  60. package/chunks/{standalone-CY_kjarf.js → standalone-DaNxWIKn.js} +22 -22
  61. package/chunks/{standalone-wOWRCpdn.js → standalone-Db_HNuWx.js} +48 -48
  62. package/chunks/standalone-DcuE8KBa.js +287 -0
  63. package/chunks/{standalone-BE_ONgiG.js → standalone-I5kRIsp8.js} +76 -76
  64. package/chunks/{standalone-B8ZSqauS.js → standalone-K2OvRAQM.js} +113 -113
  65. package/chunks/{standalone-z0o52o5t.js → standalone-c4CPN6ug.js} +1719 -1718
  66. package/chunks/{standalone-DHRalbVO.js → standalone-iOnJhCvA.js} +312 -312
  67. package/chunks/{standalone-CXY4FpF7.js → standalone-pCrzBiTy.js} +222 -222
  68. package/chunks/standalone-qrZaimgC.js +689 -0
  69. package/chunks/standalone-yqDJ8h3K.js +1012 -0
  70. package/chunks/{table.compiler-COaHE9VD.js → table.compiler-CMH_dtYs.js} +35 -35
  71. package/chunks/{useFieldName-CdnCWzhd.js → useFieldName-BfxBzhhH.js} +1 -1
  72. package/chunks/{utils-DganVptf.js → utils-BdJrEeIQ.js} +3924 -3910
  73. package/chunks/{view-Bzlros43.js → view-Q-_XIrWE.js} +1680 -1680
  74. package/chunks/{visualization-filters-D7i6oh1Z.js → visualization-filters-BwS0xUqs.js} +1705 -1686
  75. package/chunks/{with-html-element-CiIhFEa5.js → with-html-element-D_ooGNWI.js} +3962 -3950
  76. package/definitions.js +2 -2
  77. package/docs/operations/astrato-app-filter-bar.md +1 -1
  78. package/docs/operations/bar.md +30 -1
  79. package/docs/operations/combo.md +30 -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 +1 -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 +1 -1
  87. package/docs/operations/iframe.md +1 -1
  88. package/docs/operations/image.md +1 -1
  89. package/docs/operations/index.md +5 -4
  90. package/docs/operations/line.md +30 -1
  91. package/docs/operations/map.md +5274 -0
  92. package/docs/operations/number.md +1 -1
  93. package/docs/operations/pie.md +1 -1
  94. package/docs/operations/radar.md +1 -1
  95. package/docs/operations/sankey.md +1 -1
  96. package/docs/operations/scatter.md +1 -1
  97. package/docs/operations/shape.md +1 -1
  98. package/docs/operations/simpleTextObject.md +1 -1
  99. package/docs/operations/slider.md +1 -1
  100. package/docs/operations/table.md +1 -1
  101. package/docs/operations/tree.md +1 -1
  102. package/docs/operations/treemap.md +1 -1
  103. package/docs/operations/waterfall.md +1 -1
  104. package/docs/operations/word-cloud.md +1 -1
  105. package/getters.js +3 -3
  106. package/index.js +524 -500
  107. package/metadata.js +2 -2
  108. package/operations.js +6 -6
  109. package/package.json +73 -68
  110. package/src/definitions/index.d.ts +1 -7
  111. package/src/definitions/model/definitions/descriptors/descriptor-metadata.d.ts +3 -48
  112. package/src/definitions/model/definitions/schema-registry.d.ts +2 -2
  113. package/src/definitions/model/definitions/schemas/bar.schema.d.ts +1 -1
  114. package/src/definitions/model/definitions/schemas/broad-chart.schema.d.ts +2 -2
  115. package/src/definitions/model/definitions/schemas/common.schema.d.ts +14 -2
  116. package/src/definitions/model/definitions/schemas/index.d.ts +1 -1
  117. package/src/definitions/model/definitions/schemas/line.schema.d.ts +1 -1
  118. package/src/visualization-catalog.d.ts +3 -0
  119. package/styles.css +1 -1
  120. package/chunks/FieldTypeIcon-DrMoGpHJ.js +0 -22
  121. package/chunks/defaults-Dtk7fg3C.js +0 -3
  122. package/chunks/line.compiler-DmHpmQCC.js +0 -198
  123. package/chunks/number.compiler-DQdg6zTy.js +0 -53
  124. package/chunks/standalone-4MsKiqs0.js +0 -355
  125. package/chunks/standalone-B794g9pE.js +0 -1012
  126. package/chunks/standalone-BA2YXyJS.js +0 -422
  127. package/chunks/standalone-BgumbdaJ2.js +0 -357
  128. package/chunks/standalone-Blh4qejk.js +0 -689
  129. package/chunks/standalone-DH0xTEes.js +0 -2
  130. package/chunks/standalone-DcnHjNnC.js +0 -2
  131. package/chunks/standalone-DrHdGkY7.js +0 -762
  132. package/chunks/standalone-c_rROMtx.js +0 -287
  133. package/chunks/standalone-drcFLeN6.js +0 -6
@@ -1,41 +1,41 @@
1
1
  import { o as e } from "./rolldown-runtime-DleVn1XH.js";
2
- import { Fc as t, Io as n, Oa as r, Qr as i, do as a, gc as o, in as s, ki as c, ll as l, lo as u, rr as d, sa as f, ws as p, yc as m } from "./visualization-filters-D7i6oh1Z.js";
3
- import { F as h, N as g, ci as _, jt as v, s as y, zr as b } from "./utils-DganVptf.js";
4
- import "./logger-DdZpR7xZ.js";
5
- import { Dt as x, Gt as S, L as C, Ot as w, R as T, Wt as E, Yt as D, _ as O, _n as k, bn as A, dn as j, fn as M, i as ee, in as te, mn as N, n as ne, on as re, pn as P, rn as ie, ut as ae, vn as F, yn as I } from "./escobar-CvEV2ES1.js";
6
- import { _ as L } from "./MenuOption-Czc34u4q.js";
7
- import { a as oe, r as se, t as ce } from "./coloring-BtnPiQ_o.js";
8
- import { f as R, r as z, t as le, u as ue } from "./src-D9XogOrc.js";
9
- var de = /* @__PURE__ */ e(_()), B = {
2
+ import { Cc as t, Ec as n, Hc as r, Na as i, Pi as a, Uo as o, cr as s, fa as c, go as l, js as u, ln as d, mo as f, ri as p, yl as m } from "./visualization-filters-BwS0xUqs.js";
3
+ import { Br as h, I as g, Mt as _, P as v, li as y, s as ee } from "./utils-BdJrEeIQ.js";
4
+ import "./logger-Bc-DqDM_.js";
5
+ import { An as b, Cn as x, L as S, Lt as C, On as w, R as T, Rt as E, Sn as D, Tn as O, _ as k, _n as te, bt as ne, hn as re, i as ie, jn as A, kn as j, mn as ae, n as oe, nn as se, on as M, tn as ce, wn as N } from "./escobar-cQ1eQ64G.js";
6
+ import { _ as P } from "./MenuOption-B-6K7kks.js";
7
+ import { i as le, o as ue, t as de } from "./coloring-BOiP0rmn.js";
8
+ import { f as F, r as I, t as fe, u as pe } from "./src-D9XogOrc.js";
9
+ var me = /* @__PURE__ */ e(y()), L = {
10
10
  sankey: "key-sankey",
11
11
  labels: "key-labels",
12
12
  columnLabels: "key-column-labels"
13
- }, V = {
13
+ }, R = {
14
14
  NodeFlow: "flow",
15
15
  NodeColor: "color"
16
- }, H = {
16
+ }, z = {
17
17
  ColumnTitleLeft: "columnTitleLeft",
18
18
  ColumnTitleCenter: "columnTitleCenter",
19
19
  ColumnTitleRight: "columnTitleRight",
20
20
  NodeLabelLeft: "nodeLabelLeft",
21
21
  NodeLabelCenter: "nodeLabelCenter",
22
22
  NodeLabelRight: "nodeLabelRight"
23
- }, fe = class extends ce {
23
+ }, he = class extends de {
24
24
  dimensionIds = [];
25
25
  dimensionColoring = {};
26
- constructor(e, n, r) {
27
- super(e, n, r), this.dimensionIds = [], this.vSpec.dimensions.filter((e) => i(e)).forEach((e) => {
28
- let n = t(e.dataItem);
29
- this.dimensionColoring[n] = e.coloring, this.dimensionIds.push(n);
26
+ constructor(e, t, n) {
27
+ super(e, t, n), this.dimensionIds = [], this.vSpec.dimensions.filter((e) => p(e)).forEach((e) => {
28
+ let t = r(e.dataItem);
29
+ this.dimensionColoring[t] = e.coloring, this.dimensionIds.push(t);
30
30
  });
31
31
  }
32
32
  getColorByScale(e, t = {}) {
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];
33
+ 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;
34
+ if (c?.type === n.Categorical && c.persistentColors === !0) {
35
+ let e = o.range();
36
+ return e[this.getHash(a) % e.length];
37
37
  }
38
- return a(i);
38
+ return o(a);
39
39
  }
40
40
  getDatumFromProp(e, t, n) {
41
41
  return t === this.MAIN_FIELD ? e.datum : e.datum[t || n];
@@ -47,7 +47,7 @@ var de = /* @__PURE__ */ e(_()), B = {
47
47
  if ([i, ...Object.keys(i).filter((e) => {
48
48
  let t = i[e]?.source?.field;
49
49
  return t !== void 0 && this.dimensionIds.includes(t);
50
- }).map((e) => i[e])].find((e) => e.source?.field === r?.dataItemId ? a === "equals" ? r.value === e.value || r.value === String(e.value) : se(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) : le(r, e.value) : !1)) return r.color;
51
51
  }
52
52
  }
53
53
  getFilteredColor() {
@@ -56,7 +56,7 @@ var de = /* @__PURE__ */ e(_()), B = {
56
56
  getLinkColorDefinition() {
57
57
  return (e) => {
58
58
  if (this.notAffectedItems?.pattern?.length && this.vSpec.staticFilters.ignoreGlobalFilters && this.vSpec.staticFilters.showGlobalFiltersEffect) {
59
- let t = oe(e, this.notAffectedItems);
59
+ let t = ue(e, this.notAffectedItems);
60
60
  if (t) return t;
61
61
  }
62
62
  if (this.isColorOverwriteActive()) {
@@ -69,85 +69,85 @@ var de = /* @__PURE__ */ e(_()), B = {
69
69
  }
70
70
  };
71
71
  }
72
- }, pe = (e, t) => e.data.value === t.data.value ? 0 : e.data.value < t.data.value ? 1 : -1, me = (e, t) => e.data.value === t.data.value ? 0 : e.data.value < t.data.value ? -1 : 1, he = (e, t) => e.data.flow.value === t.data.flow.value ? 0 : e.data.flow.value < t.data.flow.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;
73
- function _e(e, n) {
74
- let r = e.dimensions.filter((e) => i(e)), a = (e.querySettings?.sortingOrder ?? []).map((e) => ({
75
- id: t(e.dataItem),
72
+ }, ge = (e, t) => e.data.value === t.data.value ? 0 : e.data.value < t.data.value ? 1 : -1, _e = (e, t) => e.data.value === t.data.value ? 0 : e.data.value < t.data.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, ye = (e, t) => e.data.flow.value === t.data.flow.value ? 0 : e.data.flow.value < t.data.flow.value ? -1 : 1;
73
+ function be(e, t) {
74
+ let n = e.dimensions.filter((e) => p(e)), i = (e.querySettings?.sortingOrder ?? []).map((e) => ({
75
+ id: r(e.dataItem),
76
76
  direction: e.sortDirection,
77
77
  type: e.fieldType
78
- })), o = a.find((e) => e.type === "measure"), s = o ? a.indexOf(o) : -1;
79
- return r.map((r) => {
80
- let i = t(r.dataItem), c;
78
+ })), a = i.find((e) => e.type === "measure"), o = a ? i.indexOf(a) : -1;
79
+ return n.map((n) => {
80
+ let c = r(n.dataItem), l;
81
81
  if (e.sankeySettings.applyDataSortOnNodeColumns) {
82
- let e = a.find((e) => e.id === i), t = e ? a.indexOf(e) : -1;
83
- e && t < s ? c = e.direction === "desc" ? pe : me : o && (c = o.direction === "desc" ? he : ge);
82
+ let e = i.find((e) => e.id === c), t = e ? i.indexOf(e) : -1;
83
+ e && t < o ? l = e.direction === "desc" ? ge : _e : a && (l = a.direction === "desc" ? ve : ye);
84
84
  }
85
85
  return {
86
- id: i,
87
- sort: c,
88
- isGrouped: d(e.dimensions, e.enableAlternate, n)
86
+ id: c,
87
+ sort: l,
88
+ isGrouped: s(e.dimensions, e.enableAlternate, t)
89
89
  };
90
90
  });
91
91
  }
92
- var ve = (e, t) => {
93
- let n = e.sankeySettings.linkColoring?.opacity ?? .3, i = t.valuePickerMode ?? !1, a = i ? t.valuePickerTargetDataItemId : "";
92
+ var xe = (e, t) => {
93
+ let n = e.sankeySettings.linkColoring?.opacity ?? .3, r = t.valuePickerMode ?? !1, a = r ? t.valuePickerTargetDataItemId : "";
94
94
  return {
95
95
  trigger: [{
96
- on: F.Tap,
97
- action: k.Toggle,
96
+ on: j.Tap,
97
+ action: w.Toggle,
98
98
  globalPropagation: "stop",
99
99
  data: ["", "linkTarget"],
100
- contexts: [P.Selection]
100
+ contexts: [N.Selection]
101
101
  }, {
102
- on: F.Over,
103
- action: k.Set,
102
+ on: j.Over,
103
+ action: w.Set,
104
104
  globalPropagation: "stop",
105
105
  data: ["", "linkTarget"],
106
- contexts: [P.Highlight]
106
+ contexts: [N.Highlight]
107
107
  }],
108
108
  consume: [
109
109
  {
110
- context: P.Selection,
110
+ context: N.Selection,
111
111
  data: ["", "linkTarget"],
112
112
  filter: (e) => e.data?.type?.value === "link",
113
- mode: I.Or,
113
+ mode: b.Or,
114
114
  style: { inactive: { opacity: n * .25 } }
115
115
  },
116
116
  {
117
- context: P.Selection,
117
+ context: N.Selection,
118
118
  data: [""],
119
119
  filter: (e) => e.data?.type?.value === "node",
120
- mode: I.Or,
120
+ mode: b.Or,
121
121
  style: { inactive: { fill: (e) => {
122
122
  let t = e, n = !t.fill || t.fill === "none" || t.fill === "transparent";
123
123
  switch (!0) {
124
124
  case n:
125
- case i && t.data.source.field === a: return t.fill;
126
- default: return ie(te(t.fill), .25);
125
+ case r && t.data.source.field === a: return t.fill;
126
+ default: return ae(re(t.fill), .25);
127
127
  }
128
128
  } } }
129
129
  },
130
130
  {
131
- context: P.Highlight,
131
+ context: N.Highlight,
132
132
  data: [""],
133
133
  filter: (e) => e.data?.type?.value === "node",
134
- mode: I.Or,
134
+ mode: b.Or,
135
135
  style: { active: {
136
- strokeWidth: (e) => i && e.data.source.field !== a ? 0 : 1,
137
- stroke: r.mainDarkNavy
136
+ strokeWidth: (e) => r && e.data.source.field !== a ? 0 : 1,
137
+ stroke: i.mainDarkNavy
138
138
  } }
139
139
  }
140
140
  ]
141
141
  };
142
- }, ye = (e, n, r, a, o, s) => {
143
- if (!s) throw Error("Missing Sankey visualization properties");
144
- let c = e.sankeySettings.nodeLabels.placements;
145
- if (!c) throw Error("Missing Sankey node label placements");
146
- let l = e.dimensions.filter((e) => i(e)), u = new fe(e, n, o?.[0]?.itemsNotAffectedByFiltering), d = e.sankeySettings.linkColoring?.opacity ?? .3, f = e.sankeySettings.linkColoring, m = l.map((e) => t(e.dataItem)), h = m.map((e, t) => `dim${t}`), g = e.sankeySettings.showNullNodes ? (e, t) => h[m.indexOf(t) + 1] : (e, t) => {
142
+ }, Se = (e, t, n, i, a, o) => {
143
+ if (!o) throw Error("Missing Sankey visualization properties");
144
+ let s = e.sankeySettings.nodeLabels.placements;
145
+ if (!s) throw Error("Missing Sankey node label placements");
146
+ let c = e.dimensions.filter((e) => p(e)), l = new he(e, t, a?.[0]?.itemsNotAffectedByFiltering), d = e.sankeySettings.linkColoring?.opacity ?? .3, f = e.sankeySettings.linkColoring, m = c.map((e) => r(e.dataItem)), h = m.map((e, t) => `dim${t}`), g = e.sankeySettings.showNullNodes ? (e, t) => h[m.indexOf(t) + 1] : (e, t) => {
147
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
148
  return h[i];
149
149
  }, _ = {
150
- key: B.sankey,
150
+ key: L.sankey,
151
151
  type: A.Sankey,
152
152
  data: { collection: "coll" },
153
153
  settings: {
@@ -157,21 +157,21 @@ var ve = (e, t) => {
157
157
  linkMargin: e.sankeySettings.linkMargin,
158
158
  showColumnHeaderLabels: e.sankeySettings.showColumnHeaderLabels,
159
159
  linkFillStrategy: e.sankeySettings.linkColoring.type,
160
- ...p({ nodeFillOverride: e.sankeySettings.nodeColoring.override ? e.sankeySettings.nodeColoring.color || n.colors.brandColors[0] : void 0 }),
161
- ...p({ showNodeDimensionLabel: e.sankeySettings.nodeLabels.enabled && e.sankeySettings.nodeLabels.showDimensionValue }),
162
- ...p({ showNodeFlowLabel: e.sankeySettings.nodeLabels.enabled && e.sankeySettings.nodeLabels.showFlowValue }),
160
+ ...u({ nodeFillOverride: e.sankeySettings.nodeColoring.override ? e.sankeySettings.nodeColoring.color || t.colors.brandColors[0] : void 0 }),
161
+ ...u({ showNodeDimensionLabel: e.sankeySettings.nodeLabels.enabled && e.sankeySettings.nodeLabels.showDimensionValue }),
162
+ ...u({ showNodeFlowLabel: e.sankeySettings.nodeLabels.enabled && e.sankeySettings.nodeLabels.showFlowValue }),
163
163
  showNodeLabelBackdrop: e.sankeySettings.nodeLabels.showBackdrop !== !1,
164
- ...p({ nodeLabelBackdropColor: e.sankeySettings.nodeLabels.backdropColor }),
165
- columnFields: _e(e, s.isPrintMode ?? !1),
166
- nodeLabelPlacements: c.filter((e) => e.enabled).map((e) => e.placement),
164
+ ...u({ nodeLabelBackdropColor: e.sankeySettings.nodeLabels.backdropColor }),
165
+ columnFields: be(e, o.isPrintMode ?? !1),
166
+ nodeLabelPlacements: s.filter((e) => e.enabled).map((e) => e.placement),
167
167
  node: {
168
168
  id: (e) => {
169
169
  let t = e.datum;
170
170
  return `${t.source.field}::${t.value}`;
171
171
  },
172
- fill: u.getColorDefinition({
173
- ref: V.NodeColor,
174
- overwriteSources: [u.MAIN_FIELD, "color"]
172
+ fill: l.getColorDefinition({
173
+ ref: R.NodeColor,
174
+ overwriteSources: [l.MAIN_FIELD, "color"]
175
175
  })
176
176
  },
177
177
  link: {
@@ -187,67 +187,67 @@ var ve = (e, t) => {
187
187
  return `${r.source.field}::${r.value}`;
188
188
  },
189
189
  value: { ref: "flow" },
190
- dataFill: u.getLinkColorDefinition(),
191
- fill: () => f.override ? f.color || n.colors.brandColors[0] : void 0,
190
+ dataFill: l.getLinkColorDefinition(),
191
+ fill: () => f.override ? f.color || t.colors.brandColors[0] : void 0,
192
192
  opacity: d
193
193
  }
194
194
  },
195
- brush: s.disable?.brushing === !0 ? void 0 : ve(e, s),
195
+ brush: o.disable?.brushing === !0 ? void 0 : xe(e, o),
196
196
  animations: {
197
197
  presetId: "simple-opacity",
198
198
  enabled: !0
199
199
  }
200
200
  };
201
201
  return {
202
- ...r,
203
- components: [...r.components, _]
202
+ ...n,
203
+ components: [...n.components, _]
204
204
  };
205
- }, be = (e, n, r) => {
206
- let a = e.measures.filter((e) => i(e)), o = e.dimensions.filter((e) => i(e)), s = t(a[0].dataItem), c = o.map((e) => t(e.dataItem)), l = c.map((e) => ({
205
+ }, Ce = (e, t, n) => {
206
+ let i = e.measures.filter((e) => p(e)), a = e.dimensions.filter((e) => p(e)), o = r(i[0].dataItem), s = a.map((e) => r(e.dataItem)), c = s.map((e) => ({
207
207
  field: e,
208
208
  trackBy: (e) => e,
209
209
  reduce: "first",
210
210
  props: {
211
- [V.NodeFlow]: {
212
- field: s,
211
+ [R.NodeFlow]: {
212
+ field: o,
213
213
  reduce: "sum"
214
214
  },
215
- [s]: {
216
- field: s,
215
+ [o]: {
216
+ field: o,
217
217
  reduce: "sum"
218
218
  },
219
- [V.NodeColor]: { field: e },
219
+ [R.NodeColor]: { field: e },
220
220
  type: "node"
221
221
  }
222
- })), u = c.slice(0, c.length - 1).map((e, t) => {
222
+ })), l = s.slice(0, s.length - 1).map((e, t) => {
223
223
  let n = {
224
- field: c[t],
224
+ field: s[t],
225
225
  props: {
226
- flow: { field: s },
227
- [s]: { field: s },
226
+ flow: { field: o },
227
+ [o]: { field: o },
228
228
  type: "link"
229
229
  }
230
230
  };
231
- return c.forEach((e, t) => {
231
+ return s.forEach((e, t) => {
232
232
  n.field !== e && (n.props[`dim${t}`] = { field: e });
233
233
  }), n;
234
- }), d = [{
234
+ }), u = [{
235
235
  key: "coll",
236
236
  data: {
237
- extract: [...l, ...u],
237
+ extract: [...c, ...l],
238
238
  filter: e.sankeySettings.showNullNodes ? void 0 : (e) => e.value !== null
239
239
  }
240
240
  }];
241
241
  return {
242
- ...r,
243
- collections: d,
242
+ ...n,
243
+ collections: u,
244
244
  formatters: { flow: {
245
245
  type: "excel-format",
246
- format: a[0].formatter?.format
246
+ format: i[0].formatter?.format
247
247
  } }
248
248
  };
249
- }, U = (e, t) => ({
250
- component: B.sankey,
249
+ }, B = (e, t) => ({
250
+ component: L.sankey,
251
251
  selector: e,
252
252
  strategy: {
253
253
  type: "rows",
@@ -260,15 +260,15 @@ var ve = (e, t) => {
260
260
  },
261
261
  label({ node: e }) {
262
262
  let t = e.desc, n = t.label;
263
- return t.isGrouped ? D(n) : n;
263
+ return t.isGrouped ? M(n) : n;
264
264
  }
265
265
  }]
266
266
  }
267
267
  }
268
- }), W = 64, xe = new L(j.fontLight), Se = new L(j.fontDark), G = (e, t, n) => {
269
- let r = new L(n.fonts.general.color);
268
+ }), V = 64, we = new P(D.fontLight), Te = new P(D.fontDark), H = (e, t, n) => {
269
+ let r = new P(n.fonts.general.color);
270
270
  return {
271
- component: B.sankey,
271
+ component: L.sankey,
272
272
  selector: e,
273
273
  strategy: {
274
274
  type: "rows",
@@ -287,81 +287,81 @@ var ve = (e, t) => {
287
287
  if (!t.backdrop && !t.background) return r.rgb();
288
288
  let n = t.backdrop?.fill || t.background;
289
289
  if (n === void 0) throw Error("Color: Unknown color parameter");
290
- return new L(n).betterContrast(r, xe, Se).rgb();
290
+ return new P(n).betterContrast(r, we, Te).rgb();
291
291
  },
292
292
  linkData({ node: e }) {
293
293
  return e.desc?.data;
294
294
  },
295
295
  label({ node: e, formatter: t }) {
296
- let n = e.desc, r = n.showFlow ? t("flow")(n.data?.[V.NodeFlow]?.value) : void 0, i = n.label?.length > W - 1 ? `${n.label?.substring(0, W - 1).replace(/\s+$/, "")}…` : n.label;
296
+ 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;
297
297
  return [n.showDimension ? i : void 0, r].filter(Boolean).join(": ");
298
298
  }
299
299
  }]
300
300
  }
301
301
  }
302
302
  };
303
- }, Ce = (e, r, a, o, c, u, f, p) => {
304
- if (!u) throw Error("Missing Sankey visualization properties");
305
- let m = [];
306
- p && m.push(S(B.columnLabels, B.columnLabels, p));
303
+ }, Ee = (e, t, n, i, a, c, l, u) => {
304
+ if (!c) throw Error("Missing Sankey visualization properties");
305
+ let f = [];
306
+ u && f.push(se(L.columnLabels, L.columnLabels, u));
307
307
  let h = {
308
308
  type: A.Labels,
309
- key: B.columnLabels,
309
+ key: L.columnLabels,
310
310
  layout: { displayOrder: 2 },
311
311
  settings: { sources: [
312
- U(`.${H.ColumnTitleLeft}`, 0),
313
- U(`.${H.ColumnTitleCenter}`, .5),
314
- U(`.${H.ColumnTitleRight}`, 1)
312
+ B(`.${z.ColumnTitleLeft}`, 0),
313
+ B(`.${z.ColumnTitleCenter}`, .5),
314
+ B(`.${z.ColumnTitleRight}`, 1)
315
315
  ] },
316
316
  style: { label: "$title" },
317
317
  animations: {
318
318
  presetId: "simple-opacity",
319
319
  enabled: !0
320
320
  }
321
- }, g = e?.measures.find(i), _ = g ? t(g.dataItem) : void 0;
322
- p && g && e.measures.length > 1 && m.push(E(A.Text, p));
321
+ }, g = e?.measures.find(p), _ = g ? r(g.dataItem) : void 0;
322
+ u && g && e.measures.length > 1 && f.push(ce(A.Text, u));
323
323
  let v;
324
324
  if (g && e.measures.length > 1) {
325
- let t = s(g) || g.label || g.dataItem?.name || "Measure";
325
+ let n = d(g) || g.label || g.dataItem?.name || "Measure";
326
326
  v = {
327
327
  type: A.Text,
328
328
  key: `text-${_}`,
329
- dataItemType: l.Measure,
329
+ dataItemType: m.Measure,
330
330
  dataItemRole: g.role,
331
- text: d(e.measures, e.enableAlternate, u.isPrintMode) ? D(t) : t,
331
+ text: s(e.measures, e.enableAlternate, c.isPrintMode) ? M(n) : n,
332
332
  layout: {
333
- dock: n.Bottom,
333
+ dock: o.Bottom,
334
334
  color: "red"
335
335
  },
336
336
  style: { text: {
337
- fontFamily: r.fonts.general.fontFamily,
338
- fontSize: `${j.fieldTitle.fontSize}px`,
337
+ fontFamily: t.fonts.general.fontFamily,
338
+ fontSize: `${D.fieldTitle.fontSize}px`,
339
339
  fontStyle: "normal",
340
- fill: r.fonts.general.color
340
+ fill: t.fonts.general.color
341
341
  } },
342
- anchor: n.Center
342
+ anchor: o.Center
343
343
  };
344
344
  }
345
345
  let y = {
346
346
  type: A.Labels,
347
- key: B.labels,
347
+ key: L.labels,
348
348
  layout: { displayOrder: 2 },
349
349
  settings: { sources: [
350
- G(`.${H.NodeLabelLeft}`, 0, r),
351
- G(`.${H.NodeLabelCenter}`, .5, r),
352
- G(`.${H.NodeLabelRight}`, 1, r)
350
+ H(`.${z.NodeLabelLeft}`, 0, t),
351
+ H(`.${z.NodeLabelCenter}`, .5, t),
352
+ H(`.${z.NodeLabelRight}`, 1, t)
353
353
  ] },
354
354
  style: { label: "$label" },
355
- brush: u.disable?.brushing === !0 ? void 0 : {
355
+ brush: c.disable?.brushing === !0 ? void 0 : {
356
356
  trigger: [{
357
- on: F.Tap,
358
- action: k.Toggle,
357
+ on: j.Tap,
358
+ action: w.Toggle,
359
359
  globalPropagation: "stop",
360
360
  data: [""],
361
- contexts: [P.Selection]
361
+ contexts: [N.Selection]
362
362
  }],
363
363
  consume: [{
364
- context: P.Selection,
364
+ context: N.Selection,
365
365
  data: [""],
366
366
  style: { inactive: { opacity: .3 } }
367
367
  }]
@@ -372,62 +372,62 @@ var ve = (e, t) => {
372
372
  }
373
373
  };
374
374
  return {
375
- ...a,
375
+ ...n,
376
376
  components: [
377
- ...a.components,
377
+ ...n.components,
378
378
  h,
379
379
  ...v ? [v] : [],
380
380
  y
381
381
  ],
382
- interactions: a.interactions ? [...a.interactions, ...m] : [...m]
382
+ interactions: n.interactions ? [...n.interactions, ...f] : [...f]
383
383
  };
384
- }, we = (e, n, r, i, a) => {
385
- if (r.type !== m.PerEachDimension) {
386
- let e = r.color || n?.colors?.brandColors?.[0] || "#aaa";
384
+ }, De = (e, t, i, o, s) => {
385
+ if (i.type !== n.PerEachDimension) {
386
+ let e = i.color || t?.colors?.brandColors?.[0] || "#aaa";
387
387
  return {
388
- type: N.CategoricalColor,
388
+ type: O.CategoricalColor,
389
389
  data: [],
390
390
  range: [e],
391
391
  unknown: e
392
392
  };
393
393
  }
394
- let o = i.coloring || {};
395
- if (o.type !== m.Categorical) {
396
- let t = a[e.dimensions.indexOf(i) % a.length], r = o.color || t || n?.colors?.brandColors?.[0] || "#aaa";
394
+ let c = o.coloring || {};
395
+ if (c.type !== n.Categorical) {
396
+ let n = s[e.dimensions.indexOf(o) % s.length], r = c.color || n || t?.colors?.brandColors?.[0] || "#aaa";
397
397
  return {
398
- type: N.CategoricalColor,
398
+ type: O.CategoricalColor,
399
399
  data: [],
400
400
  range: [r],
401
401
  unknown: r
402
402
  };
403
403
  }
404
- return w(e, n, t(i.dataItem), {
405
- customPalette: o.customPalette ?? c.customPalette,
406
- palette: o.palette
404
+ return E(e, t, r(o.dataItem), {
405
+ customPalette: c.customPalette ?? a.customPalette,
406
+ palette: c.palette
407
407
  });
408
- }, Te = (e, n, r) => {
409
- let a = e.dimensions.filter((e) => i(e));
410
- if (!a[0]) return r;
408
+ }, Oe = (e, t, n) => {
409
+ let i = e.dimensions.filter((e) => p(e));
410
+ if (!i[0]) return n;
411
411
  let o = e.coloring;
412
412
  if (!o) throw Error("Missing Sankey coloring settings");
413
- let s = {}, l = x({
413
+ let s = {}, c = C({
414
414
  palette: o.palette,
415
- customPalette: o.customPalette ?? c.customPalette
416
- }, n);
417
- return a.forEach((r) => {
418
- let i = t(r.dataItem);
419
- s[i] = we(e, n, o, r, l);
415
+ customPalette: o.customPalette ?? a.customPalette
416
+ }, t);
417
+ return i.forEach((n) => {
418
+ let i = r(n.dataItem);
419
+ s[i] = De(e, t, o, n, c);
420
420
  }), {
421
- ...r,
421
+ ...n,
422
422
  scales: s
423
423
  };
424
- }, Ee = (e, t, n) => {
425
- let r = e.dimensions.filter((e) => i(e)), a = e.measures.filter((e) => i(e));
426
- if (!r[0] || !a[0]) return n;
427
- let o = {
424
+ }, ke = (e, t, n) => {
425
+ let r = e.dimensions.filter((e) => p(e)), i = e.measures.filter((e) => p(e));
426
+ if (!r[0] || !i[0]) return n;
427
+ let a = {
428
428
  "$font-family": t.fonts.general.fontFamily,
429
429
  "$font-color": t.fonts.general.color,
430
- "$font-size": `${re(e.sankeySettings?.nodeLabels?.fontSize)}px`,
430
+ "$font-size": `${te(e.sankeySettings?.nodeLabels?.fontSize)}px`,
431
431
  $label: {
432
432
  fontSize: "$font-size",
433
433
  fontFamily: "$font-family",
@@ -436,62 +436,62 @@ var ve = (e, t) => {
436
436
  },
437
437
  $title: {
438
438
  "@extend": "$label",
439
- fontSize: `${j.fieldTitle.fontSize}px`,
439
+ fontSize: `${D.fieldTitle.fontSize}px`,
440
440
  padding: 4
441
441
  }
442
442
  };
443
443
  return {
444
444
  ...n,
445
- style: o
445
+ style: a
446
446
  };
447
- }, De = (e, t) => t?.data?.type?.value === "link" ? `${t.data.label} - ${t.data.linkTarget.label}` : t.data.label, Oe = (e, t, n, r, i, a, o) => {
448
- let c = [], l = s(e[0]) || e[0].label || e[0].dataItem.name || "", u = e.length ? l : "Count", d = t.desc?.flow ?? t.data?.flow.value, f = o ? n.formatter(ae())(d) : n.formatter("flow")(d);
449
- return c.push({
450
- label: u,
447
+ }, Ae = (e, t) => t?.data?.type?.value === "link" ? `${t.data.label} - ${t.data.linkTarget.label}` : t.data.label, je = (e, t, n, r, i, a, o) => {
448
+ let s = [], c = d(e[0]) || e[0].label || e[0].dataItem.name || "", l = e.length ? c : "Count", u = t.desc?.flow ?? t.data?.flow.value, f = o ? n.formatter(ne())(u) : n.formatter("flow")(u);
449
+ return s.push({
450
+ label: l,
451
451
  value: f
452
- }), c;
453
- }, ke = (e, t, n, r, i) => {
452
+ }), s;
453
+ }, Me = (e, t, n, r, i) => {
454
454
  let a = { placement: ({ nodes: e }) => ({
455
455
  area: "target",
456
456
  type: e[0]?.data?.type?.value === "link" ? "pointer" : "bounds"
457
457
  }) };
458
- return a.extract = T(e, t, Oe, De), C(e, t, n, a, "tooltip", i);
459
- }, Ae = class extends O {
458
+ return a.extract = T(e, t, je, Ae), S(e, t, n, a, "tooltip", i);
459
+ }, Ne = class extends k {
460
460
  constructor() {
461
461
  super([
462
- be,
463
- Te,
464
- ye,
465
462
  Ce,
463
+ Oe,
464
+ Se,
466
465
  Ee,
467
- ke
466
+ ke,
467
+ Me
468
468
  ]);
469
469
  }
470
- preCompile(e, n) {
471
- let r = e.measures.filter((e) => i(e)), a = e.dimensions.filter((e) => i(e)), o = r[0];
472
- if (!o) return;
473
- let s = t(o.dataItem), c = a.map((e) => t(e.dataItem));
474
- n.forEach((t) => {
470
+ preCompile(e, t) {
471
+ let n = e.measures.filter((e) => p(e)), i = e.dimensions.filter((e) => p(e)), a = n[0];
472
+ if (!a) return;
473
+ let o = r(a.dataItem), s = i.map((e) => r(e.dataItem));
474
+ t.forEach((t) => {
475
475
  if (t.items?.length) {
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.");
476
+ 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.");
477
+ 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.");
478
478
  }
479
479
  });
480
480
  }
481
- }, K = {
481
+ }, U = {
482
482
  showNullNodes: !1,
483
483
  nodePadding: .2,
484
484
  nodeWidth: .2,
485
485
  linkMargin: 0,
486
486
  showColumnHeaderLabels: !1,
487
- linkFillStrategy: u.Interpolated,
487
+ linkFillStrategy: f.Interpolated,
488
488
  nodeFillOverride: null,
489
489
  showNodeFlowLabel: !0,
490
490
  showNodeDimensionLabel: !0,
491
491
  showNodeLabelBackdrop: !0,
492
492
  nodeLabelBackdropColor: null,
493
493
  columnFields: [],
494
- nodeLabelPlacements: [a.Beside],
494
+ nodeLabelPlacements: [l.Beside],
495
495
  node: {
496
496
  id: "",
497
497
  fill: "#333333"
@@ -503,10 +503,10 @@ var ve = (e, t) => {
503
503
  value: 1
504
504
  }
505
505
  };
506
- function q(e, t) {
506
+ function W(e, t) {
507
507
  return e.dataFill === t.dataFill ? 0 : e.dataFill !== void 0 && t.dataFill !== void 0 && e.dataFill < t.dataFill ? -1 : 1;
508
508
  }
509
- function je(e) {
509
+ function Pe(e) {
510
510
  let t = e.target.x0 - e.source.x1, n = e.y0 - e.y1, r = Math.abs(n) < .1 ? 0 : .5;
511
511
  return [
512
512
  `M${e.source.x1},${e.y0}`,
@@ -515,12 +515,12 @@ function je(e) {
515
515
  `${e.target.x0},${e.y1}`
516
516
  ].join(" ");
517
517
  }
518
- function Me(e) {
518
+ function Fe(e) {
519
519
  return e.map((e) => ({
520
- type: M.Path,
520
+ type: x.Path,
521
521
  data: e.data,
522
522
  desc: { flow: e.value },
523
- d: je(e),
523
+ d: Pe(e),
524
524
  fill: "none",
525
525
  strokeWidth: Math.max(.5, e.width),
526
526
  stroke: e.fill,
@@ -530,26 +530,26 @@ function Me(e) {
530
530
  collider: { visual: !0 }
531
531
  }));
532
532
  }
533
- function Ne(e) {
533
+ function Ie(e) {
534
534
  let { data: t, resolver: n, settings: r, resolvedNodes: i } = e, a = {};
535
535
  i.forEach((e) => {
536
536
  a[e.id] = e;
537
537
  });
538
538
  let o = t.items.filter((e) => e.type.value === "link"), { items: s } = n.resolve({
539
539
  data: { items: o },
540
- defaults: { ...K.link },
540
+ defaults: { ...U.link },
541
541
  settings: r.link
542
542
  }), c = {};
543
543
  return s.filter((e) => !!e.linkTarget).forEach((e) => {
544
544
  let t = a[e.linkSource], n = a[e.linkTarget], i;
545
545
  if (!e.fill && !e.dataFill) switch (r.linkFillStrategy) {
546
- case u.Source:
546
+ case f.Source:
547
547
  e.fill = t.fill;
548
548
  break;
549
- case u.Target:
549
+ case f.Target:
550
550
  e.fill = n.fill;
551
551
  break;
552
- case u.Interpolated:
552
+ case f.Interpolated:
553
553
  e.fill = {
554
554
  type: "gradient",
555
555
  orientation: "linear",
@@ -579,10 +579,10 @@ function Ne(e) {
579
579
  opacity: e.opacity
580
580
  }));
581
581
  }
582
- function Pe(e) {
582
+ function Le(e) {
583
583
  let { data: t, resolver: n, settings: r } = e, i = t.items.filter((e) => e.type.value === "node"), { items: a } = n.resolve({
584
584
  data: { items: i },
585
- defaults: { ...K.node },
585
+ defaults: { ...U.node },
586
586
  settings: {
587
587
  ...r.node,
588
588
  fixedValue: ({ datum: e }) => e.flow.value
@@ -590,7 +590,7 @@ function Pe(e) {
590
590
  });
591
591
  return a;
592
592
  }
593
- function Fe(e, t) {
593
+ function Re(e, t) {
594
594
  let n = [];
595
595
  return e.map((e) => {
596
596
  let r = e.data, i = {};
@@ -608,11 +608,11 @@ function Fe(e, t) {
608
608
  }), i[e.dataFill].targetSum += e.value);
609
609
  });
610
610
  let a = Object.values(i);
611
- a.sort(q);
611
+ a.sort(W);
612
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;
613
613
  n.push({
614
614
  id: e.id,
615
- type: M.Rect,
615
+ type: x.Rect,
616
616
  x: e.x0 + t.nodeMargin,
617
617
  width: e.x1 - e.x0 - t.nodeMargin * 2,
618
618
  y: l,
@@ -629,7 +629,7 @@ function Fe(e, t) {
629
629
  let u = c * (Math.max(a, o) / e.value);
630
630
  n.push({
631
631
  id: `${e.id}::${s}`,
632
- type: M.Rect,
632
+ type: x.Rect,
633
633
  x: e.x0 + t.nodeMargin,
634
634
  width: e.x1 - e.x0 - t.nodeMargin * 2,
635
635
  y: l,
@@ -646,7 +646,7 @@ function Fe(e, t) {
646
646
  });
647
647
  }), n;
648
648
  }
649
- var J = (e, t, n = !1, r = [4, 2]) => ({
649
+ var G = (e, t, n = !1, r = [4, 2]) => ({
650
650
  data: e.data,
651
651
  background: n ? e.fill : void 0,
652
652
  label: e.data.label,
@@ -657,12 +657,12 @@ var J = (e, t, n = !1, r = [4, 2]) => ({
657
657
  opacity: t.backdropColor ? 1 : .8,
658
658
  padding: r
659
659
  } : void 0
660
- }), Ie = (e, t, n, r) => {
660
+ }), ze = (e, t, n, r) => {
661
661
  let { nodeLabelHeight: i, nodePadding: a } = r;
662
662
  return a < i ? [] : e.map((e) => {
663
- let t = n[e.layer], a = J(e, r, !1, [4, 0]), o = a.backdrop?.padding ?? [0, 0], s = t.align < .5 ? H.NodeLabelLeft : t.align > .5 ? H.NodeLabelRight : H.NodeLabelCenter;
663
+ 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;
664
664
  return {
665
- type: M.Rect,
665
+ type: x.Rect,
666
666
  id: `${e.id}::labelTarget`,
667
667
  x: t.fullX + (t.align < .5 ? r.nodeMargin + o[0] : 0),
668
668
  width: t.fullWidth - (t.align === .5 ? 0 : r.nodeMargin + o[0]),
@@ -673,11 +673,11 @@ var J = (e, t, n = !1, r = [4, 2]) => ({
673
673
  fill: "none"
674
674
  };
675
675
  });
676
- }, Le = (e) => e.canShowNodeLabelAboveNode, Re = (e, t, n, r) => {
676
+ }, Be = (e) => e.canShowNodeLabelAboveNode, Ve = (e, t, n, r) => {
677
677
  let { nodePadding: i } = r;
678
678
  return e.filter((e) => e.y1 - e.y0 + i >= r.nodeLabelHeight).map((e) => {
679
- let t = n[e.layer], a = t.align <= .5 ? H.NodeLabelLeft : H.NodeLabelRight, o = J(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: M.Rect,
679
+ 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 = {
680
+ type: x.Rect,
681
681
  id: `${e.id}::labelTarget`,
682
682
  x: t.gapX + l[0],
683
683
  width: t.gapWidth - 2 * l[0],
@@ -687,51 +687,51 @@ var J = (e, t, n = !1, r = [4, 2]) => ({
687
687
  tag: a,
688
688
  fill: "none"
689
689
  };
690
- return t.nodeWidth === 0 && (u.x = t.fullX + s[0], u.width = t.fullWidth - 2 * s[1], u.tag = t.align < .5 ? H.NodeLabelLeft : t.align > .5 ? H.NodeLabelRight : H.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 ? z.NodeLabelLeft : t.align > .5 ? z.NodeLabelRight : z.NodeLabelCenter), u;
691
691
  });
692
- }, ze = (e) => e.columnGap >= 20, Be = (e, t, n, r) => e.filter((e) => e.y1 - e.y0 >= r.nodeLabelHeight).map((e) => {
693
- let t = J(e, r, !0, [4, 2]);
692
+ }, He = (e) => e.columnGap >= 20, Ue = (e, t, n, r) => e.filter((e) => e.y1 - e.y0 >= r.nodeLabelHeight).map((e) => {
693
+ let t = G(e, r, !0, [4, 2]);
694
694
  return {
695
- type: M.Rect,
695
+ type: x.Rect,
696
696
  id: `${e.id}::labelTarget`,
697
697
  x: e.x0 + r.nodeMargin,
698
698
  width: e.x1 - e.x0 - r.nodeMargin * 2,
699
699
  y: e.y0,
700
700
  height: e.y1 - e.y0,
701
701
  desc: t,
702
- tag: H.NodeLabelCenter,
702
+ tag: z.NodeLabelCenter,
703
703
  fill: "none"
704
704
  };
705
- }), Ve = (e) => e.columnWidth >= 80, Y = {
706
- [a.Above]: {
707
- condition: Le,
708
- create: Ie
705
+ }), We = (e) => e.columnWidth >= 80, K = {
706
+ [l.Above]: {
707
+ condition: Be,
708
+ create: ze
709
709
  },
710
- [a.Beside]: {
711
- condition: ze,
712
- create: Re
710
+ [l.Beside]: {
711
+ condition: He,
712
+ create: Ve
713
713
  },
714
- [a.Inside]: {
715
- condition: Ve,
716
- create: Be
714
+ [l.Inside]: {
715
+ condition: We,
716
+ create: Ue
717
717
  }
718
- }, He = (e) => e.priority.find((t) => Y[t]?.condition(e)), Ue = (e, t, n, r) => {
718
+ }, Ge = (e) => e.priority.find((t) => K[t]?.condition(e)), Ke = (e, t, n, r) => {
719
719
  let i = [], a = n[0];
720
720
  if (!r.showDimensionLabel && !r.showFlowLabel) return [];
721
- let o = r.priority.find((e) => Y[e]?.condition({
721
+ let o = r.priority.find((e) => K[e]?.condition({
722
722
  canShowNodeLabelAboveNode: r.canShowNodeLabelAboveNode,
723
723
  columnGap: a.gapWidth,
724
724
  columnWidth: a.nodeWidth,
725
725
  priority: r.priority
726
726
  }));
727
- return o && i.push(...Y[o].create(e, t, n, r)), i;
727
+ return o && i.push(...K[o].create(e, t, n, r)), i;
728
728
  };
729
- function We(e, t) {
729
+ function qe(e, t) {
730
730
  let { headerHeight: n } = t;
731
731
  return e.map((e) => {
732
- let t = e.align < .5 ? H.ColumnTitleLeft : e.align > .5 ? H.ColumnTitleRight : H.ColumnTitleCenter;
732
+ let t = e.align < .5 ? z.ColumnTitleLeft : e.align > .5 ? z.ColumnTitleRight : z.ColumnTitleCenter;
733
733
  return {
734
- type: M.Rect,
734
+ type: x.Rect,
735
735
  id: `column::${e.field}::labelTarget`,
736
736
  tag: t,
737
737
  fill: "none",
@@ -748,7 +748,7 @@ function We(e, t) {
748
748
  };
749
749
  });
750
750
  }
751
- function Ge(e, t, n, r) {
751
+ function Je(e, t, n, r) {
752
752
  let i = {};
753
753
  e.columnFields.forEach((e) => {
754
754
  i[e.id] = {
@@ -766,9 +766,9 @@ function Ge(e, t, n, r) {
766
766
  field: e.id,
767
767
  sort: e.sort
768
768
  }));
769
- return Ke(a, t, n, e.showNullNodes), a;
769
+ return Ye(a, t, n, e.showNullNodes), a;
770
770
  }
771
- function Ke(e, t, n, r = !1) {
771
+ function Ye(e, t, n, r = !1) {
772
772
  (e.find((e) => !e.count) || !r) && e.forEach((r, i) => {
773
773
  let a = `dummy-${i}`, o = `dummy-${i + 1}`;
774
774
  t.unshift({
@@ -795,13 +795,13 @@ function Ke(e, t, n, r = !1) {
795
795
  });
796
796
  });
797
797
  }
798
- function qe(e, t) {
798
+ function Xe(e, t) {
799
799
  return {
800
800
  nodes: e.filter((e) => !e.id.startsWith("dummy-")),
801
801
  links: t.filter((e) => !e.source.id.startsWith("dummy-"))
802
802
  };
803
803
  }
804
- function Je(e, t, n) {
804
+ function Ze(e, t, n) {
805
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;
806
806
  a > o && r / a > .1 ? s = -a / 2 : o > a && r / o > .1 && (s = o / 2), s !== 0 && (e.forEach((e) => {
807
807
  e.y0 += s, e.y1 += s;
@@ -809,7 +809,7 @@ function Je(e, t, n) {
809
809
  e.y0 += s, e.y1 += s;
810
810
  }));
811
811
  }
812
- function Ye(e, t, n) {
812
+ function Qe(e, t, n) {
813
813
  return e.map((r) => {
814
814
  let i = t.find((e) => e.data.source.field === r.field);
815
815
  if (!i) throw Error(`Missing Sankey node for column ${r.field}`);
@@ -826,85 +826,85 @@ function Ye(e, t, n) {
826
826
  };
827
827
  });
828
828
  }
829
- function Xe(e, t, n, r, i) {
830
- 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;
831
- o += s * 2;
832
- let c = (n.width - o * 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 = He({
829
+ function $e(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)), 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 / c / 2 * t.nodePadding, _ = (t.showNodeDimensionLabel || t.showNodeFlowLabel) && p * c < h / 2, v = g, y = Ge({
833
833
  canShowNodeLabelAboveNode: _,
834
- columnGap: c,
835
- columnWidth: o,
834
+ columnGap: s,
835
+ columnWidth: a,
836
836
  priority: t.nodeLabelPlacements
837
837
  });
838
- return _ && y === a.Above && (m += p, v = Math.max(p, g)), {
839
- columnGap: c,
840
- columnWidth: o,
838
+ return _ && y === l.Above && (m += p, v = Math.max(p, g)), {
839
+ columnGap: s,
840
+ columnWidth: a,
841
841
  nodePadding: v,
842
842
  availableHeight: h,
843
843
  nodeLabelHeight: p,
844
- nodeMargin: s,
844
+ nodeMargin: o,
845
845
  top: m,
846
846
  showHeader: f,
847
847
  headerTitleHeight: u,
848
848
  canShowNodeLabelAboveNode: _
849
849
  };
850
850
  }
851
- function Ze(e, t) {
851
+ function et(e, t) {
852
852
  return e.sourceLinks.length ? e.depth : t - 1;
853
853
  }
854
- function X(e) {
854
+ function q(e) {
855
855
  return function() {
856
856
  return e;
857
857
  };
858
858
  }
859
- le();
860
- function Qe(e, t) {
861
- return Z(e.source, t.source) || e.index - t.index;
859
+ fe();
860
+ function J(e, t) {
861
+ return X(e.source, t.source) || e.index - t.index;
862
862
  }
863
- function $e(e, t) {
864
- return Z(e.target, t.target) || e.index - t.index;
863
+ function Y(e, t) {
864
+ return X(e.target, t.target) || e.index - t.index;
865
865
  }
866
- function Z(e, t) {
866
+ function X(e, t) {
867
867
  return e.y0 - t.y0;
868
868
  }
869
- function Q(e) {
869
+ function Z(e) {
870
870
  return e.value;
871
871
  }
872
- function et(e) {
872
+ function tt(e) {
873
873
  return e.index;
874
874
  }
875
- function tt(e) {
875
+ function nt(e) {
876
876
  return e.nodes;
877
877
  }
878
- function nt(e) {
878
+ function rt(e) {
879
879
  return e.links;
880
880
  }
881
- function rt(e, t) {
881
+ function Q(e, t) {
882
882
  let n = e.get(t);
883
883
  if (!n) throw Error("missing: " + t);
884
884
  return n;
885
885
  }
886
- function it({ nodes: e }) {
886
+ function $({ nodes: e }) {
887
887
  for (let t of e) {
888
888
  let e = t.y0, n = e;
889
889
  for (let n of t.sourceLinks) n.y0 = e + n.width / 2, e += n.width;
890
890
  for (let e of t.targetLinks) e.y1 = n + e.width / 2, n += e.width;
891
891
  }
892
892
  }
893
- function at() {
894
- let e = 0, t = 0, n = 1, r = 1, i = 24, a = 8, o, s = et, c = Ze, l, u, d = tt, f = nt, p = 6;
893
+ function it() {
894
+ let e = 0, t = 0, n = 1, r = 1, i = 24, a = 8, o, s = tt, c = et, l, u, d = nt, f = rt, p = 6;
895
895
  function m() {
896
896
  let e = {
897
897
  nodes: d.apply(null, arguments),
898
898
  links: f.apply(null, arguments)
899
899
  };
900
- return h(e), g(e), _(e), v(e), x(e), it(e), e;
900
+ return h(e), g(e), _(e), v(e), b(e), $(e), e;
901
901
  }
902
902
  m.update = function(e) {
903
- return it(e), e;
903
+ return $(e), e;
904
904
  }, m.nodeId = function(e) {
905
- return arguments.length ? (s = typeof e == "function" ? e : X(e), m) : s;
905
+ return arguments.length ? (s = typeof e == "function" ? e : q(e), m) : s;
906
906
  }, m.nodeAlign = function(e) {
907
- return arguments.length ? (c = typeof e == "function" ? e : X(e), m) : c;
907
+ return arguments.length ? (c = typeof e == "function" ? e : q(e), m) : c;
908
908
  }, m.nodeSort = function(e) {
909
909
  return arguments.length ? (l = e, m) : l;
910
910
  }, m.nodeWidth = function(e) {
@@ -912,9 +912,9 @@ function at() {
912
912
  }, m.nodePadding = function(e) {
913
913
  return arguments.length ? (a = o = +e, m) : a;
914
914
  }, m.nodes = function(e) {
915
- return arguments.length ? (d = typeof e == "function" ? e : X(e), m) : d;
915
+ return arguments.length ? (d = typeof e == "function" ? e : q(e), m) : d;
916
916
  }, m.links = function(e) {
917
- return arguments.length ? (f = typeof e == "function" ? e : X(e), m) : f;
917
+ return arguments.length ? (f = typeof e == "function" ? e : q(e), m) : f;
918
918
  }, m.linkSort = function(e) {
919
919
  return arguments.length ? (u = e, m) : u;
920
920
  }, m.size = function(i) {
@@ -930,12 +930,12 @@ function at() {
930
930
  for (let [e, r] of t.entries()) {
931
931
  r.index = e;
932
932
  let { source: t, target: i } = 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);
933
+ 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);
934
934
  }
935
935
  if (u != null) for (let { sourceLinks: t, targetLinks: n } of e) t.sort(u), n.sort(u);
936
936
  }
937
937
  function g({ nodes: e }) {
938
- for (let t of e) t.value = t.fixedValue === void 0 ? Math.max(z(t.sourceLinks, Q), z(t.targetLinks, Q)) : t.fixedValue;
938
+ for (let t of e) t.value = t.fixedValue === void 0 ? Math.max(I(t.sourceLinks, Z), I(t.targetLinks, Z)) : t.fixedValue;
939
939
  }
940
940
  function _({ nodes: e }) {
941
941
  let t = e.length, n = new Set(e), r = /* @__PURE__ */ new Set(), i = 0;
@@ -960,7 +960,7 @@ function at() {
960
960
  }
961
961
  }
962
962
  function y({ nodes: t }) {
963
- let r = R(t, (e) => e.depth) + 1, a = (n - e - i) / (r - 1), o = Array(r);
963
+ let r = F(t, (e) => e.depth) + 1, a = (n - e - i) / (r - 1), o = Array(r);
964
964
  for (let n of t) {
965
965
  let t = Math.max(0, Math.min(r - 1, Math.floor(c.call(null, n, r))));
966
966
  n.layer = t, n.x0 = e + t * a, n.x1 = n.x0 + i, o[t] ? o[t].push(n) : o[t] = [n];
@@ -968,8 +968,8 @@ function at() {
968
968
  if (l) for (let e of o) e.sort(l);
969
969
  return o;
970
970
  }
971
- function b(e) {
972
- let n = ue(e, (e) => (r - t - (e.length - 1) * o) / z(e, Q));
971
+ function ee(e) {
972
+ let n = pe(e, (e) => (r - t - (e.length - 1) * o) / I(e, Z));
973
973
  for (let i of e) {
974
974
  let e = t;
975
975
  for (let t of i) {
@@ -981,75 +981,75 @@ function at() {
981
981
  let n = i[t];
982
982
  n.y0 += e * (t + 1), n.y1 += e * (t + 1);
983
983
  }
984
- O(i);
984
+ D(i);
985
985
  }
986
986
  }
987
- function x(e) {
987
+ function b(e) {
988
988
  let n = y(e);
989
- o = Math.min(a, (r - t) / (R(n, (e) => e.length) - 1)), b(n);
989
+ o = Math.min(a, (r - t) / (F(n, (e) => e.length) - 1)), ee(n);
990
990
  for (let e = 0; e < p; ++e) {
991
991
  let t = .99 ** e, r = Math.max(1 - t, (e + 1) / p);
992
- C(n, t, r), S(n, t, r);
992
+ S(n, t, r), x(n, t, r);
993
993
  }
994
994
  }
995
- function S(e, t, n) {
995
+ function x(e, t, n) {
996
996
  for (let r = 1, i = e.length; r < i; ++r) {
997
997
  let i = e[r];
998
998
  for (let e of i) {
999
999
  let n = 0, r = 0;
1000
1000
  for (let { source: t, value: i } of e.targetLinks) {
1001
1001
  let a = i * (e.layer - t.layer);
1002
- n += k(t, e) * a, r += a;
1002
+ n += O(t, e) * a, r += a;
1003
1003
  }
1004
1004
  if (!(r > 0)) continue;
1005
1005
  let i = (n / r - e.y0) * t;
1006
- e.y0 += i, e.y1 += i, D(e);
1006
+ e.y0 += i, e.y1 += i, E(e);
1007
1007
  }
1008
- l === void 0 && i.sort(Z), w(i, n);
1008
+ l === void 0 && i.sort(X), C(i, n);
1009
1009
  }
1010
1010
  }
1011
- function C(e, t, n) {
1011
+ function S(e, t, n) {
1012
1012
  for (let r = e.length - 2; r >= 0; --r) {
1013
1013
  let i = e[r];
1014
1014
  for (let e of i) {
1015
1015
  let n = 0, r = 0;
1016
1016
  for (let { target: t, value: i } of e.sourceLinks) {
1017
1017
  let a = i * (t.layer - e.layer);
1018
- n += A(e, t) * a, r += a;
1018
+ n += k(e, t) * a, r += a;
1019
1019
  }
1020
1020
  if (!(r > 0)) continue;
1021
1021
  let i = (n / r - e.y0) * t;
1022
- e.y0 += i, e.y1 += i, D(e);
1022
+ e.y0 += i, e.y1 += i, E(e);
1023
1023
  }
1024
- l === void 0 && i.sort(Z), w(i, n);
1024
+ l === void 0 && i.sort(X), C(i, n);
1025
1025
  }
1026
1026
  }
1027
- function w(e, n) {
1027
+ function C(e, n) {
1028
1028
  let i = e.length >> 1, a = e[i];
1029
- E(e, a.y0 - o, i - 1, n), T(e, a.y1 + o, i + 1, n), E(e, r, e.length - 1, n), T(e, t, 0, n);
1029
+ T(e, a.y0 - o, i - 1, n), w(e, a.y1 + o, i + 1, n), T(e, r, e.length - 1, n), w(e, t, 0, n);
1030
1030
  }
1031
- function T(e, t, n, r) {
1031
+ function w(e, t, n, r) {
1032
1032
  for (; n < e.length; ++n) {
1033
1033
  let i = e[n], a = (t - i.y0) * r;
1034
1034
  a > 1e-6 && (i.y0 += a, i.y1 += a), t = i.y1 + o;
1035
1035
  }
1036
1036
  }
1037
- function E(e, t, n, r) {
1037
+ function T(e, t, n, r) {
1038
1038
  for (; n >= 0; --n) {
1039
1039
  let i = e[n], a = (i.y1 - t) * r;
1040
1040
  a > 1e-6 && (i.y0 -= a, i.y1 -= a), t = i.y0 - o;
1041
1041
  }
1042
1042
  }
1043
- function D({ sourceLinks: e, targetLinks: t }) {
1043
+ function E({ sourceLinks: e, targetLinks: t }) {
1044
1044
  if (u === void 0) {
1045
- for (let { source: { sourceLinks: e } } of t) e.sort($e);
1046
- for (let { target: { targetLinks: t } } of e) t.sort(Qe);
1045
+ for (let { source: { sourceLinks: e } } of t) e.sort(Y);
1046
+ for (let { target: { targetLinks: t } } of e) t.sort(J);
1047
1047
  }
1048
1048
  }
1049
- function O(e) {
1050
- if (u === void 0) for (let { sourceLinks: t, targetLinks: n } of e) t.sort($e), n.sort(Qe);
1049
+ function D(e) {
1050
+ if (u === void 0) for (let { sourceLinks: t, targetLinks: n } of e) t.sort(Y), n.sort(J);
1051
1051
  }
1052
- function k(e, t) {
1052
+ function O(e, t) {
1053
1053
  let n = e.y0 - (e.sourceLinks.length - 1) * o / 2;
1054
1054
  for (let { target: r, width: i } of e.sourceLinks) {
1055
1055
  if (r === t) break;
@@ -1061,7 +1061,7 @@ function at() {
1061
1061
  }
1062
1062
  return n;
1063
1063
  }
1064
- function A(e, t) {
1064
+ function k(e, t) {
1065
1065
  let n = t.y0 - (t.targetLinks.length - 1) * o / 2;
1066
1066
  for (let { source: r, width: i } of t.targetLinks) {
1067
1067
  if (r === e) break;
@@ -1075,17 +1075,17 @@ function at() {
1075
1075
  }
1076
1076
  return m;
1077
1077
  }
1078
- var $ = 4;
1078
+ var at = 4;
1079
1079
  function ot(e) {
1080
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) => {
1081
1081
  if (e.layer === void 0) throw Error("Missing Sankey node layer before sorting");
1082
1082
  let r = t[e.layer].sort;
1083
1083
  return r?.(e, n) ?? 0;
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 ? q(e, t) : e.dataFill ? 1 : -1).nodeSort(d).nodeAlign(u).extent(f).iterations(6)({
1084
+ } : void 0, f = [[0, s + at], [c.width, c.height - 2 * at]], p = it().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)({
1085
1085
  nodes: n,
1086
1086
  links: r
1087
- }), m = Ye(t, p.nodes, a), { nodes: h, links: g } = qe(p.nodes, p.links);
1088
- return Je(h, g, f), {
1087
+ }), m = Qe(t, p.nodes, a), { nodes: h, links: g } = Xe(p.nodes, p.links);
1088
+ return Ze(h, g, f), {
1089
1089
  nodes: h,
1090
1090
  links: g,
1091
1091
  columns: m
@@ -1098,23 +1098,23 @@ var st = {
1098
1098
  "renderer"
1099
1099
  ],
1100
1100
  defaultSettings: {
1101
- settings: K,
1101
+ settings: U,
1102
1102
  style: {
1103
1103
  title: "$title",
1104
1104
  label: "$label"
1105
1105
  }
1106
1106
  },
1107
1107
  render({ data: e }) {
1108
- let { settings: t } = this.settings, n = Pe({
1108
+ let { settings: t } = this.settings, n = Le({
1109
1109
  data: e,
1110
1110
  resolver: this.resolver,
1111
1111
  settings: t
1112
- }), r = Ne({
1112
+ }), r = Ie({
1113
1113
  data: e,
1114
1114
  resolver: this.resolver,
1115
1115
  settings: t,
1116
1116
  resolvedNodes: n
1117
- }), i = Ge(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 } = Xe(i, t, this.rect, this.renderer, this.style);
1117
+ }), i = Je(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 } = $e(i, t, this.rect, this.renderer, this.style);
1118
1118
  if (c < 8) return [];
1119
1119
  let { nodes: h, links: g, columns: _ } = ot({
1120
1120
  columns: i,
@@ -1125,7 +1125,7 @@ var st = {
1125
1125
  nodePadding: s,
1126
1126
  top: d,
1127
1127
  rect: this.rect
1128
- }), v = Fe(h, { nodeMargin: u }), y = Ue(h, v, _, {
1128
+ }), v = Re(h, { nodeMargin: u }), y = Ke(h, v, _, {
1129
1129
  nodeLabelHeight: l,
1130
1130
  canShowNodeLabelAboveNode: m,
1131
1131
  nodePadding: s,
@@ -1137,9 +1137,9 @@ var st = {
1137
1137
  priority: t.nodeLabelPlacements
1138
1138
  });
1139
1139
  return [
1140
- ...Me(g),
1140
+ ...Fe(g),
1141
1141
  ...v,
1142
- ...f ? We(_, { headerHeight: p }) : [],
1142
+ ...f ? qe(_, { headerHeight: p }) : [],
1143
1143
  ...y
1144
1144
  ];
1145
1145
  }
@@ -1147,23 +1147,23 @@ var st = {
1147
1147
  function ct(e) {
1148
1148
  e.component(A.Sankey, st);
1149
1149
  }
1150
- var lt = b(), ut = v(({ vSpec: e, vTheme: n, data: r, elementSize: i, vizProperties: a }) => {
1151
- let s = g(), [c] = (0, de.useState)(() => new Ae()), l = n || f, u = y(), d = h(), p = ne();
1150
+ var lt = h(), ut = _(({ vSpec: e, vTheme: n, data: i, elementSize: a, vizProperties: o }) => {
1151
+ let s = v(), [l] = (0, me.useState)(() => new Ne()), u = n || c, d = ee(), f = g(), p = oe();
1152
1152
  if (!e) return null;
1153
- let m = u.targetDataItemId;
1154
- if (!m && u.targetInternalKey) {
1155
- let n = e.dimensions.find((e) => e.dataItem.internalKey === u.targetInternalKey);
1156
- n && (m = t(n.dataItem));
1153
+ let m = d.targetDataItemId;
1154
+ if (!m && d.targetInternalKey) {
1155
+ let t = e.dimensions.find((e) => e.dataItem.internalKey === d.targetInternalKey);
1156
+ t && (m = r(t.dataItem));
1157
1157
  }
1158
- let _ = {
1159
- ...a,
1160
- valuePickerMode: !!u.activeKey,
1158
+ let h = {
1159
+ ...o,
1160
+ valuePickerMode: !!d.activeKey,
1161
1161
  valuePickerTargetDataItemId: m ?? void 0
1162
- }, v = c.compile(e, l, r, i, _, o.Sankey, s, d, p);
1163
- return v ? /* @__PURE__ */ (0, lt.jsx)(ee, {
1164
- config: a,
1165
- definition: v,
1166
- size: i,
1162
+ }, _ = l.compile(e, u, i, a, h, t.Sankey, s, f, p);
1163
+ return _ ? /* @__PURE__ */ (0, lt.jsx)(ie, {
1164
+ config: o,
1165
+ definition: _,
1166
+ size: a,
1167
1167
  vSpec: e,
1168
1168
  escobarPlugins: [ct]
1169
1169
  }) : null;