@devgateway/dvz-ui-react 1.5.4 → 1.6.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.
- package/dist/cjs/common.css +1 -1
- package/dist/cjs/embeddable/chart/Bar.js +1 -1
- package/dist/cjs/embeddable/chart/Line.js +1 -1
- package/dist/cjs/embeddable/chart/Pie.js +1 -1
- package/dist/cjs/embeddable/chart/colors/ManualColors.js +1 -1
- package/dist/cjs/embeddable/chart/data/Bar.js +1 -1
- package/dist/cjs/embeddable/chart/index.js +1 -1
- package/dist/cjs/embeddable/common/colors/ManualColors.js +1 -1
- package/dist/cjs/embeddable/d3Map/BaseLayer.js +1 -1
- package/dist/cjs/embeddable/d3Map/DataLayer.js +1 -1
- package/dist/cjs/embeddable/filtered-posts/NoData.js +2 -2
- package/dist/cjs/embeddable/filtered-posts/index.js +1 -1
- package/dist/cjs/embeddable/filtered-posts/utils.js +1 -1
- package/dist/cjs/embeddable/posts-filter/CategoricalFilter.js +1 -0
- package/dist/cjs/embeddable/posts-filter/PostsFilterDropdown.js +1 -1
- package/dist/cjs/embeddable/posts-filter/YearFilter.js +1 -0
- package/dist/cjs/embeddable/posts-filter/index.js +1 -1
- package/dist/cjs/embeddable/posts-filters-reset-button/index.js +1 -1
- package/dist/cjs/embeddable/posts-pagination/index.js +1 -1
- package/dist/cjs/embeddable/reducers/data-api.js +1 -1
- package/dist/cjs/embeddable/reducers/data.js +1 -1
- package/dist/cjs/embeddable/reducers/embeddable-api.js +1 -1
- package/dist/cjs/embeddable/time-line/mobile.js +1 -1
- package/dist/cjs/embeddable/vertical-featuredtabs/index.js +2 -2
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/layout/Layout.js +1 -1
- package/dist/cjs/styles.css +1 -1
- package/dist/esm/common.css +1 -1
- package/dist/esm/embeddable/chart/Bar.js +253 -235
- package/dist/esm/embeddable/chart/Line.js +122 -121
- package/dist/esm/embeddable/chart/Pie.js +82 -81
- package/dist/esm/embeddable/chart/colors/ManualColors.js +33 -33
- package/dist/esm/embeddable/chart/data/Bar.js +18 -16
- package/dist/esm/embeddable/chart/index.js +298 -286
- package/dist/esm/embeddable/common/colors/ManualColors.js +22 -22
- package/dist/esm/embeddable/d3Map/BaseLayer.js +4 -1
- package/dist/esm/embeddable/d3Map/DataLayer.js +5 -1
- package/dist/esm/embeddable/filtered-posts/NoData.js +25 -18
- package/dist/esm/embeddable/filtered-posts/index.js +131 -89
- package/dist/esm/embeddable/filtered-posts/utils.js +3 -2
- package/dist/esm/embeddable/posts-filter/CategoricalFilter.js +72 -0
- package/dist/esm/embeddable/posts-filter/PostsFilterDropdown.js +106 -92
- package/dist/esm/embeddable/posts-filter/YearFilter.js +60 -0
- package/dist/esm/embeddable/posts-filter/index.js +160 -191
- package/dist/esm/embeddable/posts-filters-reset-button/index.js +21 -15
- package/dist/esm/embeddable/posts-pagination/index.js +36 -33
- package/dist/esm/embeddable/reducers/data-api.js +35 -35
- package/dist/esm/embeddable/reducers/data.js +116 -107
- package/dist/esm/embeddable/reducers/embeddable-api.js +8 -8
- package/dist/esm/embeddable/time-line/mobile.js +119 -118
- package/dist/esm/embeddable/vertical-featuredtabs/index.js +202 -131
- package/dist/esm/index.js +66 -64
- package/dist/esm/layout/Layout.js +8 -6
- package/dist/esm/styles.css +1 -1
- package/dist/types/dvz-ui/src/embeddable/chart/colors/ManualColors.d.ts +1 -1
- package/dist/types/dvz-ui/src/embeddable/filtered-posts/NoData.d.ts +1 -0
- package/dist/types/dvz-ui/src/embeddable/filtered-posts/index.d.ts +2 -1
- package/dist/types/dvz-ui/src/embeddable/filtered-posts/utils.d.ts +3 -0
- package/dist/types/dvz-ui/src/embeddable/posts-filter/CategoricalFilter.d.ts +9 -0
- package/dist/types/dvz-ui/src/embeddable/posts-filter/PostsFilterDropdown.d.ts +1 -0
- package/dist/types/dvz-ui/src/embeddable/posts-filter/YearFilter.d.ts +12 -0
- package/dist/types/dvz-ui/src/embeddable/posts-filter/index.d.ts +2 -0
- package/dist/types/dvz-ui/src/embeddable/reducers/data-api.d.ts +3 -1
- package/dist/types/dvz-ui/src/embeddable/reducers/data.d.ts +5 -0
- package/dist/types/dvz-ui/src/embeddable/time-line/mobile.d.ts +2 -1
- package/dist/types/dvz-ui/src/translations/af.json.d.ts +1 -2
- package/dist/types/dvz-ui/src/translations/am.json.d.ts +35 -35
- package/dist/types/dvz-ui/src/translations/index.d.ts +2 -1
- package/dist/types/dvz-ui/src/utils/data.d.ts +2 -0
- package/package.json +4 -3
|
@@ -1,87 +1,87 @@
|
|
|
1
|
-
import { jsx as a, jsxs as
|
|
2
|
-
import { useState as
|
|
1
|
+
import { jsx as a, jsxs as p, Fragment as L } from "react/jsx-runtime";
|
|
2
|
+
import { useState as l, useEffect as $ } from "react";
|
|
3
3
|
import { injectIntl as me } from "react-intl";
|
|
4
|
-
import { ResponsivePie as
|
|
5
|
-
import
|
|
4
|
+
import { ResponsivePie as pe } from "@nivo/pie";
|
|
5
|
+
import ue, { formatContent as he } from "./Tooltip.js";
|
|
6
6
|
import "@nivo/colors";
|
|
7
7
|
import "d3";
|
|
8
8
|
import { v4 as fe } from "uuid";
|
|
9
9
|
import ge from "../../layout/FlexWrapDetector.js";
|
|
10
10
|
const be = ({
|
|
11
11
|
legends: Le,
|
|
12
|
-
marginLeft:
|
|
12
|
+
marginLeft: j,
|
|
13
13
|
marginTop: x,
|
|
14
|
-
marginRight:
|
|
14
|
+
marginRight: w,
|
|
15
15
|
marginBottom: k,
|
|
16
|
-
options:
|
|
16
|
+
options: u,
|
|
17
17
|
intl: h,
|
|
18
18
|
format: f,
|
|
19
19
|
colors: xe,
|
|
20
20
|
groupMode: ke,
|
|
21
|
-
tooltipEnabled:
|
|
21
|
+
tooltipEnabled: B,
|
|
22
22
|
height: I,
|
|
23
23
|
showLegends: v,
|
|
24
|
-
legendPosition:
|
|
24
|
+
legendPosition: r,
|
|
25
25
|
tickRotation: ve,
|
|
26
26
|
tickColor: Ce,
|
|
27
|
-
tooltip:
|
|
27
|
+
tooltip: i,
|
|
28
28
|
startAngle: M,
|
|
29
29
|
endAngle: z,
|
|
30
30
|
legendLabel: C,
|
|
31
31
|
legendCheckBack: y,
|
|
32
|
-
legendLabelBack:
|
|
33
|
-
legendLabelColor:
|
|
34
|
-
centerLabel:
|
|
35
|
-
showArcLabels:
|
|
36
|
-
showArcLinkLabels:
|
|
37
|
-
slicePadding:
|
|
32
|
+
legendLabelBack: O,
|
|
33
|
+
legendLabelColor: V,
|
|
34
|
+
centerLabel: R,
|
|
35
|
+
showArcLabels: H,
|
|
36
|
+
showArcLinkLabels: E,
|
|
37
|
+
slicePadding: X,
|
|
38
38
|
colorGenerator: N,
|
|
39
|
-
centerLabelFontWeight:
|
|
40
|
-
centerLabelFontSize:
|
|
41
|
-
centerLabelXOffset:
|
|
42
|
-
centerLabelYOffset:
|
|
43
|
-
tooltipEnableMarkdown:
|
|
44
|
-
reverseLegend:
|
|
45
|
-
showPercentage:
|
|
39
|
+
centerLabelFontWeight: Y,
|
|
40
|
+
centerLabelFontSize: q,
|
|
41
|
+
centerLabelXOffset: J,
|
|
42
|
+
centerLabelYOffset: K,
|
|
43
|
+
tooltipEnableMarkdown: Q,
|
|
44
|
+
reverseLegend: U,
|
|
45
|
+
showPercentage: Z
|
|
46
46
|
}) => {
|
|
47
|
-
const [c,
|
|
47
|
+
const [c, _] = l([]), [G, P] = l(i), [o, ee] = l(u), [S, te] = l(50), [A, ae] = l(x), [ye, T] = l(0), [W, re] = l(k), d = o.data.sort((e, t) => e.position && t.position ? e.position - t.position : 0).map((e, t) => ({
|
|
48
48
|
color: N.getColor(e.id, e),
|
|
49
49
|
id: e.id,
|
|
50
50
|
label: e.label
|
|
51
51
|
}));
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
...
|
|
52
|
+
$(() => {
|
|
53
|
+
P(i), ee({
|
|
54
|
+
...u,
|
|
55
55
|
id: fe()
|
|
56
56
|
});
|
|
57
|
-
}, [
|
|
57
|
+
}, [i, u]), $(() => {
|
|
58
58
|
(() => {
|
|
59
|
-
const
|
|
60
|
-
|
|
59
|
+
const n = 5 * Math.max(d.length - 5, 0);
|
|
60
|
+
te(n);
|
|
61
61
|
})();
|
|
62
62
|
}, [d]);
|
|
63
63
|
const ne = {
|
|
64
64
|
bottom: `-${S}px`
|
|
65
|
-
},
|
|
65
|
+
}, oe = {
|
|
66
66
|
bottom: `-${S}px`,
|
|
67
67
|
gap: "0px"
|
|
68
|
-
},
|
|
68
|
+
}, le = (e) => {
|
|
69
69
|
const t = c.slice();
|
|
70
70
|
if (t.indexOf(e) > -1) {
|
|
71
|
-
const
|
|
72
|
-
t.splice(
|
|
71
|
+
const n = t.indexOf(e);
|
|
72
|
+
t.splice(n, 1);
|
|
73
73
|
} else
|
|
74
74
|
t.push(e);
|
|
75
|
-
|
|
76
|
-
},
|
|
77
|
-
if (!
|
|
75
|
+
_(t);
|
|
76
|
+
}, se = (e) => c ? e.filter((t) => c.indexOf(t.id) === -1) : e;
|
|
77
|
+
if (!o || !o.data)
|
|
78
78
|
return null;
|
|
79
|
-
const
|
|
80
|
-
top:
|
|
81
|
-
right:
|
|
82
|
-
bottom:
|
|
83
|
-
left:
|
|
84
|
-
},
|
|
79
|
+
const ie = {
|
|
80
|
+
top: A,
|
|
81
|
+
right: w,
|
|
82
|
+
bottom: W,
|
|
83
|
+
left: j
|
|
84
|
+
}, D = () => /* @__PURE__ */ a(L, { children: v && C && /* @__PURE__ */ a("div", { className: "legend item", children: /* @__PURE__ */ a("label", { className: "legend-title", children: C }) }) }), F = () => (U && d.reverse(), /* @__PURE__ */ a(L, { children: v && d.map((e) => /* @__PURE__ */ p("div", { className: "legend item", onClick: () => le(e.id), children: [
|
|
85
85
|
/* @__PURE__ */ a(
|
|
86
86
|
"input",
|
|
87
87
|
{
|
|
@@ -103,14 +103,14 @@ const be = ({
|
|
|
103
103
|
"label",
|
|
104
104
|
{
|
|
105
105
|
style: {
|
|
106
|
-
backgroundColor:
|
|
107
|
-
color:
|
|
106
|
+
backgroundColor: O == !0 ? e.color : "transparent",
|
|
107
|
+
color: V
|
|
108
108
|
},
|
|
109
109
|
children: e.label
|
|
110
110
|
}
|
|
111
111
|
)
|
|
112
112
|
] })) })), ce = (e) => {
|
|
113
|
-
const { centerX: t, centerY:
|
|
113
|
+
const { centerX: t, centerY: n } = e, s = R.split(/[\r\n]/g);
|
|
114
114
|
let m = 0;
|
|
115
115
|
return e.dataWithArc && (m = e.dataWithArc.reduce(
|
|
116
116
|
function(g, b) {
|
|
@@ -121,17 +121,17 @@ const be = ({
|
|
|
121
121
|
"text",
|
|
122
122
|
{
|
|
123
123
|
x: t,
|
|
124
|
-
y:
|
|
124
|
+
y: n,
|
|
125
125
|
textAnchor: "start",
|
|
126
126
|
dominantBaseline: "central",
|
|
127
|
-
children:
|
|
127
|
+
children: s.map((g, b) => /* @__PURE__ */ a(
|
|
128
128
|
"tspan",
|
|
129
129
|
{
|
|
130
|
-
x: t + parseInt(
|
|
131
|
-
y:
|
|
130
|
+
x: t + parseInt(J),
|
|
131
|
+
y: n + parseInt(K) + b * 20,
|
|
132
132
|
style: {
|
|
133
|
-
fontSize:
|
|
134
|
-
fontWeight:
|
|
133
|
+
fontSize: q + "px",
|
|
134
|
+
fontWeight: Y,
|
|
135
135
|
fill: "#000"
|
|
136
136
|
},
|
|
137
137
|
children: he(g, { totalValue: m }, h)
|
|
@@ -141,31 +141,31 @@ const be = ({
|
|
|
141
141
|
);
|
|
142
142
|
}, de = (e, t) => {
|
|
143
143
|
if (t) {
|
|
144
|
-
const
|
|
145
|
-
return e.map((
|
|
146
|
-
...
|
|
147
|
-
value:
|
|
144
|
+
const n = e.reduce((s, m) => s + m.value, 0);
|
|
145
|
+
return e.map((s) => ({
|
|
146
|
+
...s,
|
|
147
|
+
value: s.value / n * 100
|
|
148
148
|
}));
|
|
149
149
|
}
|
|
150
150
|
return e;
|
|
151
151
|
};
|
|
152
|
-
return /* @__PURE__ */ a("div", { style: { height: I }, className: "pie-chart", children:
|
|
152
|
+
return /* @__PURE__ */ a("div", { style: { height: I }, className: "pie-chart", children: o && o.data && o.data.length > 0 && /* @__PURE__ */ p(L, { children: [
|
|
153
153
|
/* @__PURE__ */ a(
|
|
154
|
-
|
|
154
|
+
pe,
|
|
155
155
|
{
|
|
156
|
-
data:
|
|
157
|
-
margin:
|
|
156
|
+
data: se(de(o.data, Z)),
|
|
157
|
+
margin: ie,
|
|
158
158
|
startAngle: M,
|
|
159
159
|
endAngle: z,
|
|
160
160
|
sortByValue: !0,
|
|
161
161
|
innerRadius: 0.7,
|
|
162
|
-
padAngle:
|
|
162
|
+
padAngle: X,
|
|
163
163
|
cornerRadius: 3,
|
|
164
164
|
colors: (e) => N.getColor(e.id, e.data),
|
|
165
165
|
borderWidth: 1,
|
|
166
166
|
borderColor: { from: "color", modifiers: [["brighter", "2"]] },
|
|
167
|
-
enableArcLabels:
|
|
168
|
-
enableArcLinkLabels:
|
|
167
|
+
enableArcLabels: H,
|
|
168
|
+
enableArcLinkLabels: E,
|
|
169
169
|
arcLabelsTextColor: "#333333",
|
|
170
170
|
arcLinkLabelsSkipAngle: 5,
|
|
171
171
|
arcLabelsSkipAngle: 15,
|
|
@@ -199,52 +199,53 @@ const be = ({
|
|
|
199
199
|
const t = e.datum.arc.angleDeg / 360 * 100;
|
|
200
200
|
e.datum.data.variables.valuePercent = t, e.datum.data.variables.category = e.datum.id;
|
|
201
201
|
}
|
|
202
|
-
return
|
|
203
|
-
|
|
202
|
+
return B && i && i.trim().length > 0 ? /* @__PURE__ */ a(
|
|
203
|
+
ue,
|
|
204
204
|
{
|
|
205
205
|
intl: h,
|
|
206
206
|
format: f,
|
|
207
207
|
d: e,
|
|
208
|
-
tooltip:
|
|
209
|
-
tooltipEnableMarkdown:
|
|
208
|
+
tooltip: G,
|
|
209
|
+
tooltipEnableMarkdown: Q
|
|
210
210
|
}
|
|
211
211
|
) : null;
|
|
212
212
|
}
|
|
213
213
|
},
|
|
214
|
-
|
|
214
|
+
o.id
|
|
215
215
|
),
|
|
216
|
-
(
|
|
216
|
+
(r === "top" || r === "bottom") && /* @__PURE__ */ a(
|
|
217
217
|
"div",
|
|
218
218
|
{
|
|
219
|
-
className: `legends container has-standard-12-font-size ${
|
|
220
|
-
|
|
221
|
-
|
|
219
|
+
className: `legends container has-standard-12-font-size ${r}`,
|
|
220
|
+
style: r === "top" ? { marginTop: `${A}px` } : r === "bottom" ? { marginBottom: `${W}px` } : {},
|
|
221
|
+
children: /* @__PURE__ */ p("div", { className: "legend-sections", children: [
|
|
222
|
+
/* @__PURE__ */ a("div", { className: "title-section", children: D() }),
|
|
222
223
|
/* @__PURE__ */ a(
|
|
223
224
|
ge,
|
|
224
225
|
{
|
|
225
226
|
onWrapChange: (e) => {
|
|
226
|
-
|
|
227
|
+
r === "top" ? (ae(x + e / 2 * 40), T(e)) : (re(k + e / 2 * 25), T(e));
|
|
227
228
|
},
|
|
228
229
|
className: "legends container has-standard-12-font-size items-section",
|
|
229
|
-
children:
|
|
230
|
+
children: F()
|
|
230
231
|
}
|
|
231
232
|
)
|
|
232
233
|
] })
|
|
233
234
|
}
|
|
234
235
|
),
|
|
235
|
-
(
|
|
236
|
+
(r === "right" || r === "left") && /* @__PURE__ */ p(
|
|
236
237
|
"div",
|
|
237
238
|
{
|
|
238
|
-
className: `legends container has-standard-12-font-size ${
|
|
239
|
-
style:
|
|
239
|
+
className: `legends container has-standard-12-font-size ${r}`,
|
|
240
|
+
style: r === "right" ? ne : oe,
|
|
240
241
|
children: [
|
|
241
|
-
|
|
242
|
-
|
|
242
|
+
D(),
|
|
243
|
+
F()
|
|
243
244
|
]
|
|
244
245
|
}
|
|
245
246
|
)
|
|
246
247
|
] }) });
|
|
247
|
-
},
|
|
248
|
+
}, we = me(be);
|
|
248
249
|
export {
|
|
249
|
-
|
|
250
|
+
we as default
|
|
250
251
|
};
|
|
@@ -1,54 +1,54 @@
|
|
|
1
|
-
import
|
|
2
|
-
class j extends
|
|
3
|
-
constructor(s,
|
|
4
|
-
if (super(
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
const
|
|
8
|
-
if (
|
|
1
|
+
import O from "./Colors.js";
|
|
2
|
+
class j extends O {
|
|
3
|
+
constructor(s, o, u, C, g, n, c, v, _, l = {}, f, y, b, i) {
|
|
4
|
+
if (super(u, C, g, v, _), this._manualColor = {}, this._manualColor[y] = l ? l.Overall : null, s != "csv") {
|
|
5
|
+
const d = (e) => {
|
|
6
|
+
h = [...n][e] ? [...n][e].items : [], l != null && l != null && Object.keys(l).forEach((a) => {
|
|
7
|
+
const t = h.filter((r) => r.code === a);
|
|
8
|
+
if (t.length > 0 && t[0].labels) {
|
|
9
9
|
let r;
|
|
10
|
-
|
|
10
|
+
f && (r = t[0].labels[f.toUpperCase()]), r ? this._manualColor[r] = l[a] : this._manualColor[t[0].value] = l[a];
|
|
11
11
|
}
|
|
12
12
|
});
|
|
13
|
-
}, x = (e) => e == null ? void 0 : e.map((
|
|
14
|
-
const r =
|
|
15
|
-
return
|
|
16
|
-
...
|
|
17
|
-
label: `${r} - ${
|
|
13
|
+
}, x = (e) => e == null ? void 0 : e.map((t) => {
|
|
14
|
+
const r = t.group.label;
|
|
15
|
+
return t.label.includes(r) ? t : {
|
|
16
|
+
...t,
|
|
17
|
+
label: `${r} - ${t.label}`
|
|
18
18
|
};
|
|
19
|
-
}),
|
|
19
|
+
}), I = () => {
|
|
20
20
|
var e;
|
|
21
|
-
return c && c.size > 0 ? c : ((e =
|
|
22
|
-
|
|
23
|
-
),
|
|
24
|
-
},
|
|
25
|
-
|
|
26
|
-
const a = [...
|
|
21
|
+
return c && c.size > 0 ? c : ((e = i == null ? void 0 : i.metadata) == null ? void 0 : e.measures.length) > 0 ? (i.metadata.measures = x(
|
|
22
|
+
i.metadata.measures
|
|
23
|
+
), i.metadata.measures) : [];
|
|
24
|
+
}, m = () => {
|
|
25
|
+
h = I(), Object.keys(l).forEach((e) => {
|
|
26
|
+
const a = [...h].filter((t) => t.value === e);
|
|
27
27
|
if (a.length > 0 && a[0].labels) {
|
|
28
|
-
const
|
|
29
|
-
b &&
|
|
28
|
+
const t = b[e];
|
|
29
|
+
b && t && (this._manualColor[t] = l[e]);
|
|
30
30
|
let r;
|
|
31
|
-
|
|
31
|
+
f && (r = a[0].labels[f.toUpperCase()]), r ? this._manualColor[r] = l[e] : this._manualColor[a[0].label] = l[e];
|
|
32
32
|
}
|
|
33
33
|
});
|
|
34
34
|
};
|
|
35
|
-
let
|
|
36
|
-
const
|
|
37
|
-
|
|
35
|
+
let h = [];
|
|
36
|
+
const p = o === "line" ? 1 : u === "index" ? 0 : 1;
|
|
37
|
+
n ? n.size == 1 && p == 1 ? _ == "measure" ? d(0) : m() : d(p) : m();
|
|
38
38
|
} else
|
|
39
|
-
this._manualColor =
|
|
39
|
+
this._manualColor = l && l[u] ? l[u] : {};
|
|
40
40
|
}
|
|
41
|
-
getColor(s,
|
|
41
|
+
getColor(s, o) {
|
|
42
42
|
if (this.colorBy === "index") {
|
|
43
|
-
const
|
|
44
|
-
return
|
|
43
|
+
const u = this._manualColor[s] || this._manualColor[o[this.indexBy]];
|
|
44
|
+
return u || "#555555";
|
|
45
45
|
}
|
|
46
|
-
return this.colorBy === "id" && this._manualColor[s] ? this._manualColor[s] : "#
|
|
46
|
+
return this.colorBy === "id" && this._manualColor[s] ? this._manualColor[s] : "#555555";
|
|
47
47
|
}
|
|
48
48
|
getColorByIndex(s) {
|
|
49
49
|
}
|
|
50
50
|
getColorByKey(s) {
|
|
51
|
-
return this._manualColor[s] ? this._manualColor[s] : "#
|
|
51
|
+
return this._manualColor[s] ? this._manualColor[s] : "#555555";
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
54
|
export {
|
|
@@ -9,14 +9,14 @@ const z = (a) => {
|
|
|
9
9
|
const j = U(t), A = /* @__PURE__ */ new Set(), M = /* @__PURE__ */ new Set();
|
|
10
10
|
let u = [], r;
|
|
11
11
|
if (t.metadata && t.metadata.measures) {
|
|
12
|
-
const y = t.metadata.measures.filter((o) => v.includes(o.value)).sort((o,
|
|
12
|
+
const y = t.metadata.measures.filter((o) => v.includes(o.value)).sort((o, b) => o.position != null && b.position != null && o.position != b.position ? o.position - b.position : 0);
|
|
13
13
|
u = [], r = "measure", A.add("measure");
|
|
14
14
|
const x = {};
|
|
15
15
|
Object.keys(t).forEach((o) => {
|
|
16
16
|
x[o] = t[o];
|
|
17
17
|
}), y.forEach((o) => {
|
|
18
|
-
const
|
|
19
|
-
|
|
18
|
+
const b = {}, p = O[o.value] || N(j[o.value], E);
|
|
19
|
+
b.type = "measure", b.measureFieldName = o.value, b.measure = p, b[p] = t[o.value], b.variables = x, u.push(b), M.add(p), C.add(j[o.value]);
|
|
20
20
|
}), n = {
|
|
21
21
|
categories: A,
|
|
22
22
|
indexBy: r,
|
|
@@ -62,7 +62,7 @@ const z = (a) => {
|
|
|
62
62
|
if (O && w.length == 1 && G(a), A.length == 0 && v)
|
|
63
63
|
t = z(a);
|
|
64
64
|
else if (v && v.children && A.length > 0) {
|
|
65
|
-
const r = U(v), y = q(v), x = /* @__PURE__ */ new Set(), o = /* @__PURE__ */ new Set(),
|
|
65
|
+
const r = U(v), y = q(v), x = /* @__PURE__ */ new Set(), o = /* @__PURE__ */ new Set(), b = /* @__PURE__ */ new Set(), p = [];
|
|
66
66
|
let B;
|
|
67
67
|
g && A.length == 1 && w.length > 0 ? (B = "measure", M.forEach((s) => {
|
|
68
68
|
const c = {};
|
|
@@ -73,8 +73,8 @@ const z = (a) => {
|
|
|
73
73
|
) || m.value, e = {};
|
|
74
74
|
Object.keys(m).forEach((i) => {
|
|
75
75
|
e[i] = m[i];
|
|
76
|
-
}), e[m.type] = m.value.toString(), c.variables = e, x.add(y[m.type]), c[f] = m[s.value],
|
|
77
|
-
}),
|
|
76
|
+
}), e[m.type] = m.value.toString(), c.variables = e, x.add(y[m.type]), c[f] = m[s.value], b.add(f);
|
|
77
|
+
}), p.push({ ...c });
|
|
78
78
|
})) : (v.children[0] && (B = v.children[0].type), v.children.forEach((s) => {
|
|
79
79
|
const c = {}, m = {};
|
|
80
80
|
m[s.type] = N(
|
|
@@ -84,11 +84,11 @@ const z = (a) => {
|
|
|
84
84
|
c[f] = s[f];
|
|
85
85
|
}), x.add(y[s.type]), c[s.type] = s.value.toString(), M.map((f) => {
|
|
86
86
|
const e = R[f.value] || N(r[f.value], n);
|
|
87
|
-
m[e] = s[f.value], o.add(r[f.value]),
|
|
88
|
-
}),
|
|
87
|
+
m[e] = s[f.value], o.add(r[f.value]), b.add(e);
|
|
88
|
+
}), p.push({ ...m, variables: c, parent_variables: c });
|
|
89
89
|
}));
|
|
90
|
-
const D = Array.from(
|
|
91
|
-
let S = j &&
|
|
90
|
+
const D = Array.from(b);
|
|
91
|
+
let S = j && p ? p.filter((s) => j.indexOf(s[B]) == -1) : p;
|
|
92
92
|
a.sort == "alphabetically" && (S = S.sort(
|
|
93
93
|
(s, c) => V(a.sortReverse, n, s[B], c[B])
|
|
94
94
|
)), a.sort == "date" && (S = S.sort(
|
|
@@ -126,7 +126,7 @@ const z = (a) => {
|
|
|
126
126
|
j = z(a);
|
|
127
127
|
else if (t && t.children && t.children.length > 0 && C.length > 0) {
|
|
128
128
|
U(t);
|
|
129
|
-
const u = q(t), r = v[0], y = /* @__PURE__ */ new Set(), x = /* @__PURE__ */ new Set(), o = [],
|
|
129
|
+
const u = q(t), r = v[0], y = /* @__PURE__ */ new Set(), x = /* @__PURE__ */ new Set(), o = [], b = [], p = t.children[0].type;
|
|
130
130
|
let B = 0, D, S;
|
|
131
131
|
t.children.forEach((e) => {
|
|
132
132
|
const i = { variables: {} };
|
|
@@ -144,7 +144,7 @@ const z = (a) => {
|
|
|
144
144
|
) || l.value;
|
|
145
145
|
D[e.type] = S, D[l.type] = h, Object.keys(l).forEach((d) => {
|
|
146
146
|
D[d] = l[d];
|
|
147
|
-
}), i.variables[h] = D, x.add(h), B += l[r],
|
|
147
|
+
}), i.variables[h] = D, x.add(h), B += l[r], b.push(l[r]), i[h] = l[r];
|
|
148
148
|
});
|
|
149
149
|
else {
|
|
150
150
|
const l = new Object();
|
|
@@ -154,16 +154,18 @@ const z = (a) => {
|
|
|
154
154
|
}
|
|
155
155
|
o.push(i);
|
|
156
156
|
});
|
|
157
|
-
const s = n.toUpperCase(), c = O == "id" ? o : o.filter((e) => E.indexOf(e[
|
|
157
|
+
const s = n.toUpperCase(), c = O == "id" ? o : o.filter((e) => E.indexOf(e[p]) == -1), m = Array.from(x);
|
|
158
158
|
a.sort == "alphabetically" ? c.sort(
|
|
159
|
-
(e, i) => V(a.sortReverse, n, e[
|
|
159
|
+
(e, i) => V(a.sortReverse, n, e[p], i[p])
|
|
160
160
|
) : a.sort == "date" ? c.sort(
|
|
161
|
-
(e, i) => _(a.sortReverse, e[
|
|
161
|
+
(e, i) => _(a.sortReverse, e[p], i[p])
|
|
162
162
|
) : a.sort == "values" ? c.sort((e, i) => {
|
|
163
|
+
debugger;
|
|
163
164
|
const l = m.map((d) => e[d]).filter((d) => d).reduce((d, K) => d + K), h = m.map((d) => i[d]).filter((d) => d).reduce((d, K) => d + K);
|
|
164
165
|
return console.log(m.map((d) => e[d])), l == null ? 1 : h == null ? -1 : T(a.sortReverse, l, h);
|
|
165
166
|
}) : c.sort((e, i) => {
|
|
166
167
|
const l = e[a.sort], h = i[a.sort];
|
|
168
|
+
debugger;
|
|
167
169
|
return l == null ? 1 : h == null ? -1 : T(a.sortReverse, l, h);
|
|
168
170
|
});
|
|
169
171
|
const f = [...x];
|
|
@@ -184,7 +186,7 @@ const z = (a) => {
|
|
|
184
186
|
}), j = {
|
|
185
187
|
metadata: t.metadata,
|
|
186
188
|
dimensionsMetadata: y,
|
|
187
|
-
indexBy:
|
|
189
|
+
indexBy: p,
|
|
188
190
|
keys: O == "index" ? f : f.filter((e) => E.indexOf(e) == -1),
|
|
189
191
|
data: c
|
|
190
192
|
};
|