@astrato-io/visualizations 0.6.4 → 0.6.5
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.
- package/CHANGELOG.md +0 -0
- package/THIRD_PARTY_NOTICES.md +94 -4
- package/chunks/ClickAwayListener-BbeNMAvj.js +52 -0
- package/chunks/{LinearProgress-CUZ0D8_t.js → LinearProgress-B1FeWaen.js} +54 -54
- package/chunks/app-filter-bar.compiler-BGJ7HAbr.js +64 -0
- package/chunks/bar.compiler-CT0ZbQKc.js +374 -0
- package/chunks/{src-Cum_2NLV.js → builder-B6dWSIdD.js} +5779 -5635
- package/chunks/{coloring-C16AUZEi.js → coloring-B1XAfg6b.js} +234 -233
- package/chunks/{src-BC7cGcJ-.js → definitions-D3OVqmXl.js} +438 -360
- package/chunks/{escobar-BGqT1EsE.js → escobar-eDjtGpkC.js} +4645 -4619
- package/chunks/filter.compiler-DBsyRBJt.js +70 -0
- package/chunks/{filtering-Yq4DEa0t.js → filtering-tqjAyJH5.js} +432 -313
- package/chunks/{grouping-type-BX_9Ix5q.js → grouping-type-On4s9Thj.js} +1 -1
- package/chunks/handlers-VTBfIZYZ.js +13072 -0
- package/chunks/isEqual-BDxAhUo8.js +7514 -0
- package/chunks/line.compiler-CzdM5Ld0.js +198 -0
- package/chunks/{metadata-CPXdYoln.js → metadata-BGElBy5Z.js} +1 -1
- package/chunks/number.compiler-G-R7y16P.js +53 -0
- package/chunks/{src-C0LgoUWY.js → operations-CTNUX6Sy.js} +9576 -9432
- package/chunks/{range-DrzdfBX4.js → range-CiwTbMig.js} +2 -2
- package/chunks/{registry-CExpGJ1N.js → registry-CsQQzukD.js} +153 -153
- package/chunks/{requirements-DNhuShLS.js → requirements-DYjZCFyf.js} +1 -1
- package/chunks/{shared-CKDL4hx9.js → shared-CBvcC5YV.js} +460 -413
- package/chunks/{standalone-D5vnf-9y.js → standalone-0M4HlmDW2.js} +823 -822
- package/chunks/standalone-0ashe9w1.js +411 -0
- package/chunks/{standalone-C85u7U6I.js → standalone-B7jax8wa.js} +93 -94
- package/chunks/standalone-BK0VYU-l.js +463 -0
- package/chunks/{standalone-BDCwI6Hn.js → standalone-BMIbT1b2.js} +815 -815
- package/chunks/standalone-BZV5vOwA.js +6 -0
- package/chunks/standalone-BhDrWj4p.js +1980 -0
- package/chunks/{standalone-CNyNHKVx.js → standalone-BtSHCp2U2.js} +97 -98
- package/chunks/{standalone-CDQnr6qT.js → standalone-BvaKdky9.js} +95 -96
- package/chunks/standalone-BwtM31-f.js +2 -0
- package/chunks/{standalone-CY57qwZ-.js → standalone-C3gg736V.js} +153 -153
- package/chunks/{standalone-DFPva_ku.js → standalone-CC1VUjO32.js} +60 -60
- package/chunks/{standalone-CCNtaJ7s.js → standalone-C_rYnZ0N.js} +41 -41
- package/chunks/{standalone-CZynjFG7.js → standalone-CoLrAxRV.js} +3701 -3482
- package/chunks/{standalone-jiz0L2Dg.js → standalone-DC-aUgXC.js} +104 -104
- package/chunks/standalone-DCtRoTWg.js +675 -0
- package/chunks/standalone-DUDFTBqL.js +833 -0
- package/chunks/standalone-DhZkX9Td.js +2 -0
- package/chunks/{standalone-Dx3MLlrO.js → standalone-DtLElfuM.js} +141 -141
- package/chunks/{standalone-BmfMt74U.js → standalone-G9Q4Uczu.js} +192 -192
- package/chunks/{standalone-BH5NqDwp.js → standalone-JuLF-OoH.js} +390 -391
- package/chunks/standalone-_DeX21JJ.js +383 -0
- package/chunks/{standalone-lBm9hQ-q.js → standalone-gFhKZh8m.js} +34 -34
- package/chunks/standalone-tDNy-SFH.js +281 -0
- package/chunks/{standalone-rJ45Zfl1.js → standalone-v1oxfU20.js} +10 -10
- package/chunks/{standalone-BYm1UjLr.js → standalone-vzBY6q0I2.js} +18 -18
- package/chunks/table.compiler-tb914oj3.js +222 -0
- package/chunks/{ui-D1HQNIBy.js → ui-DQWtv2iM.js} +13485 -3973
- package/chunks/{useFieldName-oqQ3bvnO.js → useFieldName-BvdcoJRl.js} +1 -1
- package/chunks/{utils-Ba9T0TqC.js → utils-Bg7K-t6K.js} +7306 -6024
- package/chunks/{src-DvX5LU9T.js → view-Bn83C8d9.js} +2555 -4831
- package/definitions.js +3 -3
- package/docs/operations/astrato-app-filter-bar.md +17 -17
- package/docs/operations/bar.md +989 -1071
- package/docs/operations/combo.md +717 -738
- package/docs/operations/date-picker.md +25 -25
- package/docs/operations/distribution-gauge.md +471 -607
- package/docs/operations/dot.md +787 -879
- package/docs/operations/filter.md +139 -163
- package/docs/operations/gauge.md +491 -627
- package/docs/operations/heatMap.md +834 -916
- package/docs/operations/histogram.md +166 -180
- package/docs/operations/iframe.md +5 -5
- package/docs/operations/image.md +16 -16
- package/docs/operations/index.md +12 -12
- package/docs/operations/line.md +811 -888
- package/docs/operations/number.md +470 -536
- package/docs/operations/pie.md +825 -958
- package/docs/operations/radar.md +599 -679
- package/docs/operations/sankey.md +462 -584
- package/docs/operations/scatter.md +823 -929
- package/docs/operations/shape.md +34 -34
- package/docs/operations/simpleTextObject.md +18 -25
- package/docs/operations/slider.md +33 -43
- package/docs/operations/table.md +1160 -1150
- package/docs/operations/tree.md +354 -361
- package/docs/operations/treemap.md +545 -637
- package/docs/operations/waterfall.md +369 -379
- package/docs/operations/word-cloud.md +512 -583
- package/getters.js +3 -3
- package/index.js +51 -51
- package/metadata.js +3 -3
- package/operations.js +7 -7
- package/package.json +80 -86
- package/src/definitions/index.d.ts +2 -2
- package/src/definitions/{shared/lib → model/definitions}/available-fields.d.ts +0 -1
- package/src/definitions/{shared/lib/compilers/index.d.ts → model/definitions/compilers/compile.d.ts} +1 -1
- package/src/definitions/model/definitions/data-item-resolution.d.ts +19 -0
- package/src/definitions/model/definitions/descriptors/descriptor-metadata.d.ts +1341 -0
- package/src/definitions/model/definitions/descriptors/json-schema.d.ts +2 -0
- package/src/definitions/model/definitions/diagnostics.d.ts +5 -0
- package/src/definitions/model/definitions/field-suggestions.d.ts +2 -0
- package/src/definitions/model/definitions/index.d.ts +23 -0
- package/src/definitions/{shared/lib → model/definitions}/registry/compile.d.ts +1 -1
- package/src/definitions/model/definitions/registry/descriptor-registry.d.ts +3 -0
- package/src/definitions/model/definitions/schema-registry.d.ts +660 -0
- package/src/definitions/{shared/lib → model/definitions}/schemas/broad-chart.schema.d.ts +1 -1
- package/src/definitions/{shared/lib → model/definitions}/schemas/common.schema.d.ts +0 -1
- package/src/definitions/model/definitions/schemas/index.d.ts +9 -0
- package/src/definitions/{shared/lib → model/definitions}/schemas/object.schema.d.ts +6 -6
- package/src/definitions/{shared/lib → model/definitions}/types/definition.types.d.ts +1 -1
- package/src/definitions/model/definitions/types/index.d.ts +3 -0
- package/src/definitions/{shared/lib/registry → model/definitions}/validation.d.ts +1 -1
- package/chunks/Radio-Ciu-F4CU.js +0 -957
- package/chunks/ToggleButton-BCJc3Jlc.js +0 -153
- package/chunks/_baseFlatten-DPXPOrea.js +0 -7076
- package/chunks/app-filter-bar.compiler-j_CVoWTa.js +0 -55
- package/chunks/bar.compiler-oqaPzIut.js +0 -370
- package/chunks/data-item-resolution-1lvYB5ln.js +0 -53
- package/chunks/event-bus-KiSiCJrC.js +0 -2683
- package/chunks/filter.compiler-CuLtc_02.js +0 -60
- package/chunks/gauge-target-type-BkKXAqkX.js +0 -4
- package/chunks/interfaces-VUY4_yVO.js +0 -8742
- package/chunks/line-settings-DfYTUyPz.js +0 -4
- package/chunks/line.compiler-BpA_6Tc7.js +0 -188
- package/chunks/number.compiler-DbkWcG4S.js +0 -44
- package/chunks/pie-uv42Eqal.js +0 -10
- package/chunks/src-Dun_jXtz.js +0 -10295
- package/chunks/standalone-87YV_m9n.js +0 -687
- package/chunks/standalone-BLVAWLNJ.js +0 -385
- package/chunks/standalone-BPomtAVs.js +0 -2
- package/chunks/standalone-BXyBcUOQ.js +0 -2
- package/chunks/standalone-BllF4rDp.js +0 -383
- package/chunks/standalone-BqWyrnZI.js +0 -281
- package/chunks/standalone-DQxxNwF8.js +0 -675
- package/chunks/standalone-DS9T0FZ-.js +0 -830
- package/chunks/standalone-DzixzZAL.js +0 -411
- package/chunks/standalone-QJ1kKMnO.js +0 -6
- package/chunks/table.compiler-BrXkm4Fz.js +0 -213
- package/chunks/toInteger-DVZr-D1j.js +0 -11
- package/chunks/treemap-x_zmJoG7.js +0 -23
- package/chunks/types-dVVCsDWD.js +0 -4
- package/chunks/view-CLqWMV7Z.js +0 -156
- package/src/definitions/shared/index.d.ts +0 -5
- package/src/definitions/shared/lib/registry/descriptor-registry.d.ts +0 -587
- package/src/definitions/shared/lib/registry/index.d.ts +0 -3
- package/src/definitions/shared/lib/schemas/index.d.ts +0 -9
- package/src/definitions/shared/lib/types/index.d.ts +0 -3
- package/src/definitions/{shared/lib → model/definitions}/schemas/app-filter-bar.schema.d.ts +0 -0
- package/src/definitions/{shared/lib → model/definitions}/schemas/bar.schema.d.ts +0 -0
- package/src/definitions/{shared/lib → model/definitions}/schemas/filter.schema.d.ts +0 -0
- package/src/definitions/{shared/lib → model/definitions}/schemas/line.schema.d.ts +0 -0
- package/src/definitions/{shared/lib → model/definitions}/schemas/number.schema.d.ts +0 -0
- package/src/definitions/{shared/lib → model/definitions}/schemas/table.schema.d.ts +4 -4
- /package/src/definitions/{shared/lib → model/definitions}/types/compilation.types.d.ts +0 -0
- /package/src/definitions/{shared/lib → model/definitions}/types/descriptor.types.d.ts +0 -0
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
import { o as e } from "./rolldown-runtime-DleVn1XH.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { f as
|
|
8
|
-
var fe = /* @__PURE__ */ e(
|
|
2
|
+
import { Gn as t, Ks as n, Mo as r, Qi as i, Sa as a, Si as o, Ta as s, Uc as c, Ys as l, Zr as u, ao as d, fc as f, so as p } from "./isEqual-BDxAhUo8.js";
|
|
3
|
+
import { $t as m, Ei as h, I as g, P as _, Yi as v, o as y } from "./utils-Bg7K-t6K.js";
|
|
4
|
+
import { Vt as b, mt as x } from "./ui-DQWtv2iM.js";
|
|
5
|
+
import { It as S, Jt as C, Lt as w, Vt as T, X as E, Z as D, an as O, bt as k, cn as A, dn as j, i as ee, in as M, j as te, ln as N, n as ne, nn as re, rn as P, rt as ie, tn as ae, un as F, xt as oe } from "./escobar-eDjtGpkC.js";
|
|
6
|
+
import { h as se, p as ce, t as le } from "./coloring-B1XAfg6b.js";
|
|
7
|
+
import { f as I, r as L, t as ue, u as de } from "./src-D9XogOrc.js";
|
|
8
|
+
var fe = /* @__PURE__ */ e(v()), R = /* @__PURE__ */ function(e) {
|
|
9
9
|
return e.sankey = "key-sankey", e.labels = "key-labels", e.columnLabels = "key-column-labels", e;
|
|
10
10
|
}({}), z = /* @__PURE__ */ function(e) {
|
|
11
11
|
return e.NodeFlow = "flow", e.NodeColor = "color", e;
|
|
12
12
|
}({}), B = /* @__PURE__ */ function(e) {
|
|
13
13
|
return e.ColumnTitleLeft = "columnTitleLeft", e.ColumnTitleCenter = "columnTitleCenter", e.ColumnTitleRight = "columnTitleRight", e.NodeLabelLeft = "nodeLabelLeft", e.NodeLabelCenter = "nodeLabelCenter", e.NodeLabelRight = "nodeLabelRight", e;
|
|
14
|
-
}({}), pe = class extends
|
|
14
|
+
}({}), pe = class extends le {
|
|
15
15
|
dimensionIds = [];
|
|
16
16
|
dimensionColoring = {};
|
|
17
17
|
constructor(e, t, n) {
|
|
18
|
-
super(e, t, n), this.dimensionIds = [], this.vSpec.dimensions.filter((e) =>
|
|
19
|
-
let t =
|
|
18
|
+
super(e, t, n), this.dimensionIds = [], this.vSpec.dimensions.filter((e) => o(e)).forEach((e) => {
|
|
19
|
+
let t = f(e.dataItem);
|
|
20
20
|
this.dimensionColoring[t] = e.coloring, this.dimensionIds.push(t);
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
23
|
getColorByScale(e, t = {}) {
|
|
24
|
-
let { ref: n } = t, r = this.getDatumFromProp(e, n, "color"), i = r?.value, a = e.resources.scale(r.source?.field ?? r.label),
|
|
25
|
-
if (
|
|
24
|
+
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 && this.dimensionColoring[r.source.field];
|
|
25
|
+
if (o?.type === l.Categorical && o.persistentColors === !0) {
|
|
26
26
|
let e = a.range();
|
|
27
27
|
return e[this.getHash(i) % e.length];
|
|
28
28
|
}
|
|
@@ -35,7 +35,7 @@ var fe = /* @__PURE__ */ e(h()), R = /* @__PURE__ */ function(e) {
|
|
|
35
35
|
let t = this.vSpec.coloring?.overwrites;
|
|
36
36
|
for (let n = 0; n < t.length; n++) {
|
|
37
37
|
let r = t[n], i = e.datum, a = r.operator || "equals";
|
|
38
|
-
if ([i, ...Object.keys(i).filter((e) => this.dimensionIds.includes(i[e]?.source?.field)).map((e) => i[e])].find((e) => e.source.field === r?.dataItemId ? a === "equals" ? r.value === e.value || r.value === String(e.value) :
|
|
38
|
+
if ([i, ...Object.keys(i).filter((e) => this.dimensionIds.includes(i[e]?.source?.field)).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;
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
41
|
getFilteredColor() {
|
|
@@ -44,7 +44,7 @@ var fe = /* @__PURE__ */ e(h()), R = /* @__PURE__ */ function(e) {
|
|
|
44
44
|
getLinkColorDefinition() {
|
|
45
45
|
return (e) => {
|
|
46
46
|
if (this.notAffectedItems?.pattern?.length && this.vSpec.staticFilters.ignoreGlobalFilters && this.vSpec.staticFilters.showGlobalFiltersEffect) {
|
|
47
|
-
let t =
|
|
47
|
+
let t = se(e, this.notAffectedItems);
|
|
48
48
|
if (t) return t;
|
|
49
49
|
}
|
|
50
50
|
if (this.isColorOverwriteActive()) {
|
|
@@ -59,36 +59,36 @@ var fe = /* @__PURE__ */ e(h()), R = /* @__PURE__ */ function(e) {
|
|
|
59
59
|
}
|
|
60
60
|
}, 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;
|
|
61
61
|
function ve(e, t) {
|
|
62
|
-
let n = e.dimensions.filter((e) =>
|
|
63
|
-
id:
|
|
62
|
+
let n = e.dimensions.filter((e) => o(e)), r = (e.querySettings?.sortingOrder ?? []).map((e) => ({
|
|
63
|
+
id: f(e.dataItem),
|
|
64
64
|
direction: e.sortDirection,
|
|
65
65
|
type: e.fieldType
|
|
66
|
-
})),
|
|
66
|
+
})), i = r.find((e) => e.type === "measure"), a = r.indexOf(i);
|
|
67
67
|
return n.map((n) => {
|
|
68
|
-
let
|
|
68
|
+
let o = f(n.dataItem), s;
|
|
69
69
|
if (e.sankeySettings.applyDataSortOnNodeColumns) {
|
|
70
|
-
let e = r.find((e) => e.id ===
|
|
71
|
-
e && t <
|
|
70
|
+
let e = r.find((e) => e.id === o), t = r.indexOf(e);
|
|
71
|
+
e && t < a ? s = e.direction === "desc" ? me : he : i && (s = i.direction === "desc" ? ge : _e);
|
|
72
72
|
}
|
|
73
73
|
return {
|
|
74
|
-
id:
|
|
74
|
+
id: o,
|
|
75
75
|
sort: s,
|
|
76
|
-
isGrouped:
|
|
76
|
+
isGrouped: u(e.dimensions, e.enableAlternate, t)
|
|
77
77
|
};
|
|
78
78
|
});
|
|
79
79
|
}
|
|
80
80
|
var ye = (e, t) => {
|
|
81
|
-
let
|
|
81
|
+
let n = e.sankeySettings.linkColoring?.opacity ?? .3, r = t.valuePickerMode ?? !1, i = r ? t.valuePickerTargetDataItemId : "";
|
|
82
82
|
return {
|
|
83
83
|
trigger: [{
|
|
84
|
-
on:
|
|
85
|
-
action:
|
|
84
|
+
on: N.Tap,
|
|
85
|
+
action: A.Toggle,
|
|
86
86
|
globalPropagation: "stop",
|
|
87
87
|
data: ["", "linkTarget"],
|
|
88
88
|
contexts: [M.Selection]
|
|
89
89
|
}, {
|
|
90
|
-
on:
|
|
91
|
-
action:
|
|
90
|
+
on: N.Over,
|
|
91
|
+
action: A.Set,
|
|
92
92
|
globalPropagation: "stop",
|
|
93
93
|
data: ["", "linkTarget"],
|
|
94
94
|
contexts: [M.Highlight]
|
|
@@ -98,20 +98,20 @@ var ye = (e, t) => {
|
|
|
98
98
|
context: M.Selection,
|
|
99
99
|
data: ["", "linkTarget"],
|
|
100
100
|
filter: (e) => e.data?.type?.value === "link",
|
|
101
|
-
mode:
|
|
102
|
-
style: { inactive: { opacity:
|
|
101
|
+
mode: F.Or,
|
|
102
|
+
style: { inactive: { opacity: n * .25 } }
|
|
103
103
|
},
|
|
104
104
|
{
|
|
105
105
|
context: M.Selection,
|
|
106
106
|
data: [""],
|
|
107
107
|
filter: (e) => e.data?.type?.value === "node",
|
|
108
|
-
mode:
|
|
108
|
+
mode: F.Or,
|
|
109
109
|
style: { inactive: { fill: (e) => {
|
|
110
110
|
let t = !e.fill || e.fill === "none" || e.fill === "transparent";
|
|
111
111
|
switch (!0) {
|
|
112
112
|
case t:
|
|
113
|
-
case
|
|
114
|
-
default: return
|
|
113
|
+
case r && e.data.source.field === i: return e.fill;
|
|
114
|
+
default: return ae(re(e.fill), .25);
|
|
115
115
|
}
|
|
116
116
|
} } }
|
|
117
117
|
},
|
|
@@ -119,21 +119,21 @@ var ye = (e, t) => {
|
|
|
119
119
|
context: M.Highlight,
|
|
120
120
|
data: [""],
|
|
121
121
|
filter: (e) => e.data?.type?.value === "node",
|
|
122
|
-
mode:
|
|
122
|
+
mode: F.Or,
|
|
123
123
|
style: { active: {
|
|
124
|
-
strokeWidth: (e) =>
|
|
125
|
-
stroke:
|
|
124
|
+
strokeWidth: (e) => r && e.data.source.field !== i ? 0 : 1,
|
|
125
|
+
stroke: s.mainDarkNavy
|
|
126
126
|
} }
|
|
127
127
|
}
|
|
128
128
|
]
|
|
129
129
|
};
|
|
130
|
-
}, be = (e, t, n, r,
|
|
131
|
-
let s = e.dimensions.filter((e) =>
|
|
132
|
-
let n =
|
|
133
|
-
return p[
|
|
130
|
+
}, be = (e, t, n, r, i, a) => {
|
|
131
|
+
let s = e.dimensions.filter((e) => o(e)), c = new pe(e, t, i?.[0]?.itemsNotAffectedByFiltering), l = e.sankeySettings.linkColoring?.opacity ?? .3, u = e.sankeySettings.linkColoring, d = s.map((e) => f(e.dataItem)), p = d.map((e, t) => `dim${t}`), m = e.sankeySettings.showNullNodes ? (e, t) => p[d.indexOf(t) + 1] : (e, t) => {
|
|
132
|
+
let n = d.indexOf(t), r = d.slice(n + 1).find((t) => e[p[d.indexOf(t)]].value !== null);
|
|
133
|
+
return p[d.indexOf(r)];
|
|
134
134
|
}, h = {
|
|
135
135
|
key: R.sankey,
|
|
136
|
-
type:
|
|
136
|
+
type: j.Sankey,
|
|
137
137
|
data: { collection: "coll" },
|
|
138
138
|
settings: {
|
|
139
139
|
showNullNodes: e.sankeySettings.showNullNodes,
|
|
@@ -147,7 +147,7 @@ var ye = (e, t) => {
|
|
|
147
147
|
showNodeFlowLabel: e.sankeySettings.nodeLabels.enabled && e.sankeySettings.nodeLabels.showFlowValue,
|
|
148
148
|
showNodeLabelBackdrop: e.sankeySettings.nodeLabels.showBackdrop !== !1,
|
|
149
149
|
nodeLabelBackdropColor: e.sankeySettings.nodeLabels.backdropColor,
|
|
150
|
-
columnFields: ve(e,
|
|
150
|
+
columnFields: ve(e, a.isPrintMode),
|
|
151
151
|
nodeLabelPlacements: e.sankeySettings.nodeLabels.placements.filter((e) => e.enabled).map((e) => e.placement),
|
|
152
152
|
node: {
|
|
153
153
|
id: (e) => `${e.datum.source.field}::${e.datum.value}`,
|
|
@@ -164,11 +164,11 @@ var ye = (e, t) => {
|
|
|
164
164
|
},
|
|
165
165
|
value: { ref: "flow" },
|
|
166
166
|
dataFill: c.getLinkColorDefinition(),
|
|
167
|
-
fill: () =>
|
|
168
|
-
opacity:
|
|
167
|
+
fill: () => u.override ? u.color || t.colors.brandColors[0] : void 0,
|
|
168
|
+
opacity: l
|
|
169
169
|
}
|
|
170
170
|
},
|
|
171
|
-
brush:
|
|
171
|
+
brush: a.disable?.brushing === !0 ? void 0 : ye(e, a),
|
|
172
172
|
animations: {
|
|
173
173
|
presetId: "simple-opacity",
|
|
174
174
|
enabled: !0
|
|
@@ -179,44 +179,44 @@ var ye = (e, t) => {
|
|
|
179
179
|
components: [...n.components, h]
|
|
180
180
|
};
|
|
181
181
|
}, xe = (e, t, n) => {
|
|
182
|
-
let r = e.measures.filter((e) =>
|
|
182
|
+
let r = e.measures.filter((e) => o(e)), i = e.dimensions.filter((e) => o(e)), a = f(r[0].dataItem), s = i.map((e) => f(e.dataItem)), c = s.map((e) => ({
|
|
183
183
|
field: e,
|
|
184
184
|
trackBy: (e) => e,
|
|
185
185
|
reduce: "first",
|
|
186
186
|
props: {
|
|
187
187
|
[z.NodeFlow]: {
|
|
188
|
-
field:
|
|
188
|
+
field: a,
|
|
189
189
|
reduce: "sum"
|
|
190
190
|
},
|
|
191
|
-
[
|
|
192
|
-
field:
|
|
191
|
+
[a]: {
|
|
192
|
+
field: a,
|
|
193
193
|
reduce: "sum"
|
|
194
194
|
},
|
|
195
195
|
[z.NodeColor]: { field: e },
|
|
196
196
|
type: "node"
|
|
197
197
|
}
|
|
198
|
-
})),
|
|
198
|
+
})), l = s.slice(0, s.length - 1).map((e, t) => {
|
|
199
199
|
let n = {
|
|
200
200
|
field: s[t],
|
|
201
201
|
props: {
|
|
202
|
-
flow: { field:
|
|
203
|
-
[
|
|
202
|
+
flow: { field: a },
|
|
203
|
+
[a]: { field: a },
|
|
204
204
|
type: "link"
|
|
205
205
|
}
|
|
206
206
|
};
|
|
207
207
|
return s.forEach((e, t) => {
|
|
208
208
|
n.field !== e && (n.props[`dim${t}`] = { field: e });
|
|
209
209
|
}), n;
|
|
210
|
-
}),
|
|
210
|
+
}), u = [{
|
|
211
211
|
key: "coll",
|
|
212
212
|
data: {
|
|
213
|
-
extract: [...c, ...
|
|
213
|
+
extract: [...c, ...l],
|
|
214
214
|
filter: e.sankeySettings.showNullNodes ? void 0 : (e) => e.value !== null
|
|
215
215
|
}
|
|
216
216
|
}];
|
|
217
217
|
return {
|
|
218
218
|
...n,
|
|
219
|
-
collections:
|
|
219
|
+
collections: u,
|
|
220
220
|
formatters: { flow: {
|
|
221
221
|
type: "excel-format",
|
|
222
222
|
format: r[0].formatter?.format
|
|
@@ -234,13 +234,13 @@ var ye = (e, t) => {
|
|
|
234
234
|
linkData: ({ node: e }) => e.desc.field,
|
|
235
235
|
label({ node: e }) {
|
|
236
236
|
let t = e.desc.label;
|
|
237
|
-
return e.desc?.isGrouped ?
|
|
237
|
+
return e.desc?.isGrouped ? T(t) : t;
|
|
238
238
|
}
|
|
239
239
|
}]
|
|
240
240
|
}
|
|
241
241
|
}
|
|
242
|
-
}), H = 64, Se = new
|
|
243
|
-
let r = new
|
|
242
|
+
}), H = 64, Se = new x(b.fontLight), Ce = new x(b.fontDark), U = (e, t, n) => {
|
|
243
|
+
let r = new x(n.fonts.general.color);
|
|
244
244
|
return {
|
|
245
245
|
component: R.sankey,
|
|
246
246
|
selector: e,
|
|
@@ -257,7 +257,7 @@ var ye = (e, t) => {
|
|
|
257
257
|
return e.desc?.backdrop;
|
|
258
258
|
},
|
|
259
259
|
fill({ node: e }) {
|
|
260
|
-
return !e.desc.backdrop && !e.desc.background ? r.rgb() : new
|
|
260
|
+
return !e.desc.backdrop && !e.desc.background ? r.rgb() : new x(e.desc?.backdrop?.fill || e.desc.background).betterContrast(r, Se, Ce).rgb();
|
|
261
261
|
},
|
|
262
262
|
linkData({ node: e }) {
|
|
263
263
|
return e.desc?.data;
|
|
@@ -270,11 +270,11 @@ var ye = (e, t) => {
|
|
|
270
270
|
}
|
|
271
271
|
}
|
|
272
272
|
};
|
|
273
|
-
}, we = (e, n,
|
|
273
|
+
}, we = (e, n, i, a, s, l, d, p) => {
|
|
274
274
|
let m = [];
|
|
275
|
-
|
|
275
|
+
p && m.push(w(R.columnLabels, R.columnLabels, p));
|
|
276
276
|
let h = {
|
|
277
|
-
type:
|
|
277
|
+
type: j.Labels,
|
|
278
278
|
key: R.columnLabels,
|
|
279
279
|
layout: { displayOrder: 2 },
|
|
280
280
|
settings: { sources: [
|
|
@@ -287,27 +287,27 @@ var ye = (e, t) => {
|
|
|
287
287
|
presetId: "simple-opacity",
|
|
288
288
|
enabled: !0
|
|
289
289
|
}
|
|
290
|
-
}, g = e?.measures.find(
|
|
291
|
-
|
|
290
|
+
}, g = e?.measures.find(o), _ = g ? f(g.dataItem) : void 0, v = g && (t(g) || g.label || g.dataItem?.name || "Measure");
|
|
291
|
+
p && g && e.measures.length > 1 && m.push(S(j.Text, p));
|
|
292
292
|
let y = g && e.measures.length > 1 ? {
|
|
293
|
-
type:
|
|
293
|
+
type: j.Text,
|
|
294
294
|
key: `text-${_}`,
|
|
295
|
-
dataItemType:
|
|
295
|
+
dataItemType: c.Measure,
|
|
296
296
|
dataItemRole: g.role,
|
|
297
|
-
text:
|
|
297
|
+
text: u(e.measures, e.enableAlternate, l.isPrintMode) ? T(v) : v,
|
|
298
298
|
layout: {
|
|
299
|
-
dock:
|
|
299
|
+
dock: r.Bottom,
|
|
300
300
|
color: "red"
|
|
301
301
|
},
|
|
302
302
|
style: { text: {
|
|
303
303
|
fontFamily: n.fonts.general.fontFamily,
|
|
304
|
-
fontSize: `${
|
|
304
|
+
fontSize: `${b.fieldTitle.fontSize}px`,
|
|
305
305
|
fontStyle: "normal",
|
|
306
306
|
fill: n.fonts.general.color
|
|
307
307
|
} },
|
|
308
|
-
anchor:
|
|
308
|
+
anchor: r.Center
|
|
309
309
|
} : void 0, x = {
|
|
310
|
-
type:
|
|
310
|
+
type: j.Labels,
|
|
311
311
|
key: R.labels,
|
|
312
312
|
layout: { displayOrder: 2 },
|
|
313
313
|
settings: { sources: [
|
|
@@ -316,10 +316,10 @@ var ye = (e, t) => {
|
|
|
316
316
|
U(`.${B.NodeLabelRight}`, 1, n)
|
|
317
317
|
] },
|
|
318
318
|
style: { label: "$label" },
|
|
319
|
-
brush:
|
|
319
|
+
brush: l.disable?.brushing === !0 ? void 0 : {
|
|
320
320
|
trigger: [{
|
|
321
|
-
on:
|
|
322
|
-
action:
|
|
321
|
+
on: N.Tap,
|
|
322
|
+
action: A.Toggle,
|
|
323
323
|
globalPropagation: "stop",
|
|
324
324
|
data: [""],
|
|
325
325
|
contexts: [M.Selection]
|
|
@@ -336,60 +336,60 @@ var ye = (e, t) => {
|
|
|
336
336
|
}
|
|
337
337
|
};
|
|
338
338
|
return {
|
|
339
|
-
...
|
|
339
|
+
...i,
|
|
340
340
|
components: [
|
|
341
|
-
...
|
|
341
|
+
...i.components,
|
|
342
342
|
h,
|
|
343
343
|
...y ? [y] : [],
|
|
344
344
|
x
|
|
345
345
|
],
|
|
346
|
-
interactions:
|
|
346
|
+
interactions: i.interactions ? [...i.interactions, ...m] : [...m]
|
|
347
347
|
};
|
|
348
|
-
}, Te = (e, t, n, r,
|
|
349
|
-
if (n.type !==
|
|
348
|
+
}, Te = (e, t, n, r, a) => {
|
|
349
|
+
if (n.type !== l.PerEachDimension) {
|
|
350
350
|
let e = n.color || t?.colors?.brandColors?.[0] || "#aaa";
|
|
351
351
|
return {
|
|
352
|
-
type:
|
|
352
|
+
type: O.CategoricalColor,
|
|
353
353
|
data: [],
|
|
354
354
|
range: [e],
|
|
355
355
|
unknown: e
|
|
356
356
|
};
|
|
357
357
|
}
|
|
358
|
-
let
|
|
359
|
-
if (
|
|
360
|
-
let n =
|
|
358
|
+
let o = r.coloring || {};
|
|
359
|
+
if (o.type !== l.Categorical) {
|
|
360
|
+
let n = a[e.dimensions.indexOf(r) % a.length], i = o.color || n || t?.colors?.brandColors?.[0] || "#aaa";
|
|
361
361
|
return {
|
|
362
|
-
type:
|
|
362
|
+
type: O.CategoricalColor,
|
|
363
363
|
data: [],
|
|
364
|
-
range: [
|
|
365
|
-
unknown:
|
|
364
|
+
range: [i],
|
|
365
|
+
unknown: i
|
|
366
366
|
};
|
|
367
367
|
}
|
|
368
|
-
return
|
|
369
|
-
customPalette:
|
|
370
|
-
palette:
|
|
368
|
+
return oe(e, t, f(r.dataItem), {
|
|
369
|
+
customPalette: o.customPalette ?? i.customPalette,
|
|
370
|
+
palette: o.palette
|
|
371
371
|
});
|
|
372
372
|
}, Ee = (e, t, n) => {
|
|
373
|
-
let r = e.dimensions.filter((e) =>
|
|
373
|
+
let r = e.dimensions.filter((e) => o(e));
|
|
374
374
|
if (!r[0]) return n;
|
|
375
|
-
let a = {},
|
|
375
|
+
let a = {}, s = k({
|
|
376
376
|
palette: e.coloring.palette,
|
|
377
|
-
customPalette: e.coloring.customPalette ??
|
|
377
|
+
customPalette: e.coloring.customPalette ?? i.customPalette
|
|
378
378
|
}, t);
|
|
379
379
|
return r.forEach((n) => {
|
|
380
|
-
let r =
|
|
381
|
-
a[r] = Te(e, t, e.coloring, n,
|
|
380
|
+
let r = f(n.dataItem);
|
|
381
|
+
a[r] = Te(e, t, e.coloring, n, s);
|
|
382
382
|
}), {
|
|
383
383
|
...n,
|
|
384
384
|
scales: a
|
|
385
385
|
};
|
|
386
386
|
}, De = (e, t, n) => {
|
|
387
|
-
let r = e.dimensions.filter((e) =>
|
|
388
|
-
if (!r[0] || !
|
|
389
|
-
let
|
|
387
|
+
let r = e.dimensions.filter((e) => o(e)), i = e.measures.filter((e) => o(e));
|
|
388
|
+
if (!r[0] || !i[0]) return n;
|
|
389
|
+
let a = {
|
|
390
390
|
"$font-family": t.fonts.general.fontFamily,
|
|
391
391
|
"$font-color": t.fonts.general.color,
|
|
392
|
-
"$font-size": `${
|
|
392
|
+
"$font-size": `${C(e.sankeySettings?.nodeLabels?.fontSize)}px`,
|
|
393
393
|
$label: {
|
|
394
394
|
fontSize: "$font-size",
|
|
395
395
|
fontFamily: "$font-family",
|
|
@@ -398,17 +398,17 @@ var ye = (e, t) => {
|
|
|
398
398
|
},
|
|
399
399
|
$title: {
|
|
400
400
|
"@extend": "$label",
|
|
401
|
-
fontSize: `${
|
|
401
|
+
fontSize: `${b.fieldTitle.fontSize}px`,
|
|
402
402
|
padding: 4
|
|
403
403
|
}
|
|
404
404
|
};
|
|
405
405
|
return {
|
|
406
406
|
...n,
|
|
407
|
-
style:
|
|
407
|
+
style: a
|
|
408
408
|
};
|
|
409
|
-
}, Oe = (e, t) => t?.data?.type?.value === "link" ? `${t.data.label} - ${t.data.linkTarget.label}` : t.data.label, ke = (e,
|
|
410
|
-
let c = [], l =
|
|
411
|
-
return d =
|
|
409
|
+
}, Oe = (e, t) => t?.data?.type?.value === "link" ? `${t.data.label} - ${t.data.linkTarget.label}` : t.data.label, ke = (e, n, r, i, a, o, s) => {
|
|
410
|
+
let c = [], l = t(e[0]) || e[0].label || e[0].dataItem.name || "", u = e.length ? l : "Count", d = n.desc?.flow ?? n.data?.flow.value;
|
|
411
|
+
return d = s ? r.formatter(ie())(d) : r.formatter("flow")(d), c.push({
|
|
412
412
|
label: u,
|
|
413
413
|
value: d
|
|
414
414
|
}), c;
|
|
@@ -417,7 +417,7 @@ var ye = (e, t) => {
|
|
|
417
417
|
area: "target",
|
|
418
418
|
type: e[0]?.data?.type?.value === "link" ? "pointer" : "bounds"
|
|
419
419
|
}) };
|
|
420
|
-
return a.extract =
|
|
420
|
+
return a.extract = D(e, t, ke, Oe), E(e, t, n, a, "tooltip", i);
|
|
421
421
|
}, je = class extends te {
|
|
422
422
|
constructor() {
|
|
423
423
|
super([
|
|
@@ -430,12 +430,12 @@ var ye = (e, t) => {
|
|
|
430
430
|
]);
|
|
431
431
|
}
|
|
432
432
|
preCompile(e, t) {
|
|
433
|
-
let n = e.measures.filter((e) =>
|
|
434
|
-
if (!
|
|
435
|
-
let
|
|
433
|
+
let n = e.measures.filter((e) => o(e)), r = e.dimensions.filter((e) => o(e)), i = n[0];
|
|
434
|
+
if (!i) return;
|
|
435
|
+
let a = f(i.dataItem), s = r.map((e) => f(e.dataItem));
|
|
436
436
|
t.forEach((t) => {
|
|
437
437
|
if (t.items?.length) {
|
|
438
|
-
if (t.items = t.items.filter((e) => e[
|
|
438
|
+
if (t.items = t.items.filter((e) => e[a] > 0), !t.items.length) throw Error("Current data query resulted in only negative and/or null values which can not be displayed in this chart.");
|
|
439
439
|
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.");
|
|
440
440
|
}
|
|
441
441
|
});
|
|
@@ -453,7 +453,7 @@ var ye = (e, t) => {
|
|
|
453
453
|
showNodeLabelBackdrop: !0,
|
|
454
454
|
nodeLabelBackdropColor: null,
|
|
455
455
|
columnFields: [],
|
|
456
|
-
nodeLabelPlacements: [
|
|
456
|
+
nodeLabelPlacements: [p.Beside],
|
|
457
457
|
node: {
|
|
458
458
|
id: "",
|
|
459
459
|
fill: "#333333"
|
|
@@ -479,7 +479,7 @@ function Me(e) {
|
|
|
479
479
|
}
|
|
480
480
|
function Ne(e) {
|
|
481
481
|
return e.map((e) => ({
|
|
482
|
-
type:
|
|
482
|
+
type: P.Path,
|
|
483
483
|
data: e.data,
|
|
484
484
|
desc: { flow: e.value },
|
|
485
485
|
d: Me(e),
|
|
@@ -574,7 +574,7 @@ function Ie(e, t) {
|
|
|
574
574
|
let a = i.reduce(([e, t], n) => [e + n.sourceSum, t + n.targetSum], [0, 0]), o = 1 - Math.max(...a) / e.value, s = e.y1 - e.y0, c = e.y0;
|
|
575
575
|
n.push({
|
|
576
576
|
id: e.id,
|
|
577
|
-
type:
|
|
577
|
+
type: P.Rect,
|
|
578
578
|
x: e.x0 + t.nodeMargin,
|
|
579
579
|
width: e.x1 - e.x0 - t.nodeMargin * 2,
|
|
580
580
|
y: c,
|
|
@@ -591,7 +591,7 @@ function Ie(e, t) {
|
|
|
591
591
|
let l = s * (Math.max(i, a) / e.value);
|
|
592
592
|
n.push({
|
|
593
593
|
id: `${e.id}::${o}`,
|
|
594
|
-
type:
|
|
594
|
+
type: P.Rect,
|
|
595
595
|
x: e.x0 + t.nodeMargin,
|
|
596
596
|
width: e.x1 - e.x0 - t.nodeMargin * 2,
|
|
597
597
|
y: c,
|
|
@@ -624,7 +624,7 @@ var K = (e, t, n = !1, r = [4, 2]) => ({
|
|
|
624
624
|
return a < i ? [] : e.map((e) => {
|
|
625
625
|
let t = n[e.layer], a = K(e, r, !1, [4, 0]), o = a.backdrop?.padding ?? [0, 0], s = t.align < .5 ? B.NodeLabelLeft : t.align > .5 ? B.NodeLabelRight : B.NodeLabelCenter;
|
|
626
626
|
return {
|
|
627
|
-
type:
|
|
627
|
+
type: P.Rect,
|
|
628
628
|
id: `${e.id}::labelTarget`,
|
|
629
629
|
x: t.fullX + (t.align < .5 ? r.nodeMargin + o[0] : 0),
|
|
630
630
|
width: t.fullWidth - (t.align === .5 ? 0 : r.nodeMargin + o[0]),
|
|
@@ -639,7 +639,7 @@ var K = (e, t, n = !1, r = [4, 2]) => ({
|
|
|
639
639
|
let { nodePadding: i } = r;
|
|
640
640
|
return e.filter((e) => e.y1 - e.y0 + i >= r.nodeLabelHeight).map((e) => {
|
|
641
641
|
let t = n[e.layer], a = t.align <= .5 ? B.NodeLabelLeft : B.NodeLabelRight, o = K(e, r, !1, [4, 2]), s = o.backdrop?.padding ?? [0, 0], c = [2, 2], l = [s[0] + c[0], s[1] + c[1]], u = {
|
|
642
|
-
type:
|
|
642
|
+
type: P.Rect,
|
|
643
643
|
id: `${e.id}::labelTarget`,
|
|
644
644
|
x: t.gapX + l[0],
|
|
645
645
|
width: t.gapWidth - 2 * l[0],
|
|
@@ -654,7 +654,7 @@ var K = (e, t, n = !1, r = [4, 2]) => ({
|
|
|
654
654
|
}, Be = (e) => e.columnGap >= 20, Ve = (e, t, n, r) => e.filter((e) => e.y1 - e.y0 >= r.nodeLabelHeight).map((e) => {
|
|
655
655
|
let t = K(e, r, !0, [4, 2]);
|
|
656
656
|
return {
|
|
657
|
-
type:
|
|
657
|
+
type: P.Rect,
|
|
658
658
|
id: `${e.id}::labelTarget`,
|
|
659
659
|
x: e.x0 + r.nodeMargin,
|
|
660
660
|
width: e.x1 - e.x0 - r.nodeMargin * 2,
|
|
@@ -665,15 +665,15 @@ var K = (e, t, n = !1, r = [4, 2]) => ({
|
|
|
665
665
|
fill: "none"
|
|
666
666
|
};
|
|
667
667
|
}), He = (e) => e.columnWidth >= 80, q = {
|
|
668
|
-
[
|
|
668
|
+
[p.Above]: {
|
|
669
669
|
condition: Re,
|
|
670
670
|
create: Le
|
|
671
671
|
},
|
|
672
|
-
[
|
|
672
|
+
[p.Beside]: {
|
|
673
673
|
condition: Be,
|
|
674
674
|
create: ze
|
|
675
675
|
},
|
|
676
|
-
[
|
|
676
|
+
[p.Inside]: {
|
|
677
677
|
condition: He,
|
|
678
678
|
create: Ve
|
|
679
679
|
}
|
|
@@ -693,7 +693,7 @@ function Ge(e, t) {
|
|
|
693
693
|
return e.map((e) => {
|
|
694
694
|
let t = e.align < .5 ? B.ColumnTitleLeft : e.align > .5 ? B.ColumnTitleRight : B.ColumnTitleCenter;
|
|
695
695
|
return {
|
|
696
|
-
type:
|
|
696
|
+
type: P.Rect,
|
|
697
697
|
id: `column::${e.field}::labelTarget`,
|
|
698
698
|
tag: t,
|
|
699
699
|
fill: "none",
|
|
@@ -789,22 +789,22 @@ function Xe(e, t, n) {
|
|
|
789
789
|
function Ze(e, t, n, r, i) {
|
|
790
790
|
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;
|
|
791
791
|
a += o * 2;
|
|
792
|
-
let s = (n.width - a * e.length) / (e.length - 1),
|
|
792
|
+
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({
|
|
793
793
|
canShowNodeLabelAboveNode: _,
|
|
794
794
|
columnGap: s,
|
|
795
795
|
columnWidth: a,
|
|
796
796
|
priority: t.nodeLabelPlacements
|
|
797
797
|
});
|
|
798
|
-
return _ && y ===
|
|
798
|
+
return _ && y === p.Above && (m += f, v = Math.max(f, g)), {
|
|
799
799
|
columnGap: s,
|
|
800
800
|
columnWidth: a,
|
|
801
801
|
nodePadding: v,
|
|
802
802
|
availableHeight: h,
|
|
803
|
-
nodeLabelHeight:
|
|
803
|
+
nodeLabelHeight: f,
|
|
804
804
|
nodeMargin: o,
|
|
805
805
|
top: m,
|
|
806
|
-
showHeader:
|
|
807
|
-
headerTitleHeight:
|
|
806
|
+
showHeader: d,
|
|
807
|
+
headerTitleHeight: l,
|
|
808
808
|
canShowNodeLabelAboveNode: _
|
|
809
809
|
};
|
|
810
810
|
}
|
|
@@ -838,29 +838,29 @@ function et(e) {
|
|
|
838
838
|
function tt(e) {
|
|
839
839
|
return e.links;
|
|
840
840
|
}
|
|
841
|
-
function
|
|
841
|
+
function $(e, t) {
|
|
842
842
|
let n = e.get(t);
|
|
843
843
|
if (!n) throw Error("missing: " + t);
|
|
844
844
|
return n;
|
|
845
845
|
}
|
|
846
|
-
function
|
|
846
|
+
function nt({ nodes: e }) {
|
|
847
847
|
for (let t of e) {
|
|
848
848
|
let e = t.y0, n = e;
|
|
849
849
|
for (let n of t.sourceLinks) n.y0 = e + n.width / 2, e += n.width;
|
|
850
850
|
for (let e of t.targetLinks) e.y1 = n + e.width / 2, n += e.width;
|
|
851
851
|
}
|
|
852
852
|
}
|
|
853
|
-
function
|
|
853
|
+
function rt() {
|
|
854
854
|
let e = 0, t = 0, n = 1, r = 1, i = 24, a = 8, o, s = $e, c = Qe, l, u, d = et, f = tt, p = 6;
|
|
855
855
|
function m() {
|
|
856
856
|
let e = {
|
|
857
857
|
nodes: d.apply(null, arguments),
|
|
858
858
|
links: f.apply(null, arguments)
|
|
859
859
|
};
|
|
860
|
-
return h(e), g(e), _(e), v(e), x(e),
|
|
860
|
+
return h(e), g(e), _(e), v(e), x(e), nt(e), e;
|
|
861
861
|
}
|
|
862
862
|
m.update = function(e) {
|
|
863
|
-
return
|
|
863
|
+
return nt(e), e;
|
|
864
864
|
}, m.nodeId = function(e) {
|
|
865
865
|
return arguments.length ? (s = typeof e == "function" ? e : J(e), m) : s;
|
|
866
866
|
}, m.nodeAlign = function(e) {
|
|
@@ -890,7 +890,7 @@ function it() {
|
|
|
890
890
|
for (let [e, r] of t.entries()) {
|
|
891
891
|
r.index = e;
|
|
892
892
|
let { source: t, target: i } = r;
|
|
893
|
-
typeof t != "object" && (t = r.source =
|
|
893
|
+
typeof t != "object" && (t = r.source = $(n, t)), typeof i != "object" && (i = r.target = $(n, i)), t.sourceLinks.push(r), i.targetLinks.push(r);
|
|
894
894
|
}
|
|
895
895
|
if (u != null) for (let { sourceLinks: t, targetLinks: n } of e) t.sort(u), n.sort(u);
|
|
896
896
|
}
|
|
@@ -920,7 +920,7 @@ function it() {
|
|
|
920
920
|
}
|
|
921
921
|
}
|
|
922
922
|
function y({ nodes: t }) {
|
|
923
|
-
let r =
|
|
923
|
+
let r = I(t, (e) => e.depth) + 1, a = (n - e - i) / (r - 1), o = Array(r);
|
|
924
924
|
for (let n of t) {
|
|
925
925
|
let t = Math.max(0, Math.min(r - 1, Math.floor(c.call(null, n, r))));
|
|
926
926
|
n.layer = t, n.x0 = e + t * a, n.x1 = n.x0 + i, o[t] ? o[t].push(n) : o[t] = [n];
|
|
@@ -941,12 +941,12 @@ function it() {
|
|
|
941
941
|
let n = i[t];
|
|
942
942
|
n.y0 += e * (t + 1), n.y1 += e * (t + 1);
|
|
943
943
|
}
|
|
944
|
-
|
|
944
|
+
O(i);
|
|
945
945
|
}
|
|
946
946
|
}
|
|
947
947
|
function x(e) {
|
|
948
948
|
let n = y(e);
|
|
949
|
-
o = Math.min(a, (r - t) / (
|
|
949
|
+
o = Math.min(a, (r - t) / (I(n, (e) => e.length) - 1)), b(n);
|
|
950
950
|
for (let e = 0; e < p; ++e) {
|
|
951
951
|
let t = .99 ** e, r = Math.max(1 - t, (e + 1) / p);
|
|
952
952
|
C(n, t, r), S(n, t, r);
|
|
@@ -959,7 +959,7 @@ function it() {
|
|
|
959
959
|
let n = 0, r = 0;
|
|
960
960
|
for (let { source: t, value: i } of e.targetLinks) {
|
|
961
961
|
let a = i * (e.layer - t.layer);
|
|
962
|
-
n +=
|
|
962
|
+
n += k(t, e) * a, r += a;
|
|
963
963
|
}
|
|
964
964
|
if (!(r > 0)) continue;
|
|
965
965
|
let i = (n / r - e.y0) * t;
|
|
@@ -975,7 +975,7 @@ function it() {
|
|
|
975
975
|
let n = 0, r = 0;
|
|
976
976
|
for (let { target: t, value: i } of e.sourceLinks) {
|
|
977
977
|
let a = i * (t.layer - e.layer);
|
|
978
|
-
n +=
|
|
978
|
+
n += A(e, t) * a, r += a;
|
|
979
979
|
}
|
|
980
980
|
if (!(r > 0)) continue;
|
|
981
981
|
let i = (n / r - e.y0) * t;
|
|
@@ -1006,10 +1006,10 @@ function it() {
|
|
|
1006
1006
|
for (let { target: { targetLinks: t } } of e) t.sort(Y);
|
|
1007
1007
|
}
|
|
1008
1008
|
}
|
|
1009
|
-
function
|
|
1009
|
+
function O(e) {
|
|
1010
1010
|
if (u === void 0) for (let { sourceLinks: t, targetLinks: n } of e) t.sort(X), n.sort(Y);
|
|
1011
1011
|
}
|
|
1012
|
-
function
|
|
1012
|
+
function k(e, t) {
|
|
1013
1013
|
let n = e.y0 - (e.sourceLinks.length - 1) * o / 2;
|
|
1014
1014
|
for (let { target: r, width: i } of e.sourceLinks) {
|
|
1015
1015
|
if (r === t) break;
|
|
@@ -1021,7 +1021,7 @@ function it() {
|
|
|
1021
1021
|
}
|
|
1022
1022
|
return n;
|
|
1023
1023
|
}
|
|
1024
|
-
function
|
|
1024
|
+
function A(e, t) {
|
|
1025
1025
|
let n = t.y0 - (t.targetLinks.length - 1) * o / 2;
|
|
1026
1026
|
for (let { source: r, width: i } of t.targetLinks) {
|
|
1027
1027
|
if (r === e) break;
|
|
@@ -1035,10 +1035,10 @@ function it() {
|
|
|
1035
1035
|
}
|
|
1036
1036
|
return m;
|
|
1037
1037
|
}
|
|
1038
|
-
var
|
|
1038
|
+
var it = 4;
|
|
1039
1039
|
function at(e) {
|
|
1040
|
-
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) => t[e.layer].sort?.(e, n) : void 0, f = [[0, s +
|
|
1041
|
-
|
|
1040
|
+
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) => t[e.layer].sort?.(e, n) : void 0, f = [[0, s + it], [c.width, c.height - 2 * it]];
|
|
1041
|
+
rt().nodeId((e) => e.id).nodePadding(o).nodeWidth(i).linkSort((e, t) => e.dataFill && t.dataFill ? G(e, t) : e.dataFill ? 1 : -1).nodeSort(d).nodeAlign(u).extent(f).iterations(6)({
|
|
1042
1042
|
nodes: n,
|
|
1043
1043
|
links: r
|
|
1044
1044
|
});
|
|
@@ -1105,22 +1105,22 @@ var ot = {
|
|
|
1105
1105
|
}
|
|
1106
1106
|
};
|
|
1107
1107
|
function st(e) {
|
|
1108
|
-
e.component(
|
|
1108
|
+
e.component(j.Sankey, ot);
|
|
1109
1109
|
}
|
|
1110
|
-
var ct =
|
|
1111
|
-
let
|
|
1112
|
-
if (!p &&
|
|
1113
|
-
let t = e.dimensions.find((e) => e.dataItem.internalKey ===
|
|
1114
|
-
t && (p =
|
|
1110
|
+
var ct = h(), lt = m(({ vSpec: e, vTheme: t, data: r, elementSize: i, vizProperties: o }) => {
|
|
1111
|
+
let s = _(), [c] = (0, fe.useState)(() => new je()), l = t || a, u = y(), d = g(), p = u.targetDataItemId;
|
|
1112
|
+
if (!p && u.targetInternalKey) {
|
|
1113
|
+
let t = e.dimensions.find((e) => e.dataItem.internalKey === u.targetInternalKey);
|
|
1114
|
+
t && (p = f(t.dataItem));
|
|
1115
1115
|
}
|
|
1116
|
-
let
|
|
1117
|
-
...
|
|
1118
|
-
valuePickerMode: !!
|
|
1116
|
+
let m = {
|
|
1117
|
+
...o,
|
|
1118
|
+
valuePickerMode: !!u.activeKey,
|
|
1119
1119
|
valuePickerTargetDataItemId: p
|
|
1120
|
-
},
|
|
1121
|
-
return
|
|
1122
|
-
config:
|
|
1123
|
-
definition:
|
|
1120
|
+
}, h = c.compile(e, l, r, i, m, n.Sankey, s, d, ne());
|
|
1121
|
+
return h ? /* @__PURE__ */ (0, ct.jsx)(ee, {
|
|
1122
|
+
config: o,
|
|
1123
|
+
definition: h,
|
|
1124
1124
|
size: i,
|
|
1125
1125
|
vSpec: e,
|
|
1126
1126
|
escobarPlugins: [st]
|