@gen-epix/ui-client-casedb 4.2.0 → 4.3.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/_chunks/CaseInfoDialog.js +40 -39
- package/dist/_chunks/CaseInfoDialog.js.map +1 -1
- package/dist/_chunks/Dashboard.js +285 -286
- package/dist/_chunks/Dashboard.js.map +1 -1
- package/dist/_chunks/LineListWidget.js +138 -136
- package/dist/_chunks/LineListWidget.js.map +1 -1
- package/dist/_chunks/{chunk-BV7QT456.js → chunk-OB3PAWPO.js} +3 -3
- package/dist/_chunks/chunk-OB3PAWPO.js.map +1 -0
- package/dist/_chunks/yup.js +2 -2
- package/dist/_chunks/yup.js.map +1 -1
- package/dist/components/ui/HistogramWidget/index.js +161 -162
- package/dist/components/ui/HistogramWidget/index.js.map +1 -1
- package/dist/locale/en.json +6 -0
- package/dist/locale/nl.json +7 -1
- package/dist/pages/CasesDetailPage/index.js +1 -1
- package/dist/pages/ColsAdminPage/index.js +1 -1
- package/dist/pages/ConceptsAdminPage/index.js +1 -1
- package/dist/pages/DimsAdminPage/index.js +1 -1
- package/dist/pages/EventsDetailPage/index.js +1 -1
- package/dist/pages/OrganizationAccessCasePoliciesAdminPage/index.js +120 -86
- package/dist/pages/OrganizationAccessCasePoliciesAdminPage/index.js.map +1 -1
- package/dist/pages/RefColsAdminPage/index.js +1 -1
- package/dist/pages/RegionSetShapesAdminPage/index.js +1 -1
- package/dist/pages/RegionsAdminPage/index.js +1 -1
- package/dist/pages/UserEffectiveRightsAdminPage/index.js +1 -1
- package/dist/pages/UserEffectiveRightsTesterAdminPage/index.js +1 -1
- package/dist/routes/index.js +93 -91
- package/dist/routes/index.js.map +1 -1
- package/dist/setup/setup.js +2 -3
- package/dist/setup/setup.js.map +1 -1
- package/package.json +26 -26
- package/dist/_chunks/chunk-BV7QT456.js.map +0 -1
package/dist/_chunks/yup.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { appendErrors as e, get as t, set as n } from "react-hook-form";
|
|
2
|
-
//#region ../../node_modules/.pnpm/@hookform+resolvers@5.9.1_@sinclair+typebox@0.34.49_@standard-schema+spec@1.1.0_ajv@8.
|
|
2
|
+
//#region ../../node_modules/.pnpm/@hookform+resolvers@5.9.1_@sinclair+typebox@0.34.49_@standard-schema+spec@1.1.0_ajv@8.2_26d561451bcf52899bfb24d45cfb94ee/node_modules/@hookform/resolvers/dist/resolvers.mjs
|
|
3
3
|
var r = (e, n, r) => {
|
|
4
4
|
if (e && "reportValidity" in e) {
|
|
5
5
|
let i = t(r, n);
|
|
@@ -29,7 +29,7 @@ function s(e) {
|
|
|
29
29
|
return e.replace(/\[(\d+)]/g, ".$1").replace(/[[\]]/g, "");
|
|
30
30
|
}
|
|
31
31
|
//#endregion
|
|
32
|
-
//#region ../../node_modules/.pnpm/@hookform+resolvers@5.9.1_@sinclair+typebox@0.34.49_@standard-schema+spec@1.1.0_ajv@8.
|
|
32
|
+
//#region ../../node_modules/.pnpm/@hookform+resolvers@5.9.1_@sinclair+typebox@0.34.49_@standard-schema+spec@1.1.0_ajv@8.2_26d561451bcf52899bfb24d45cfb94ee/node_modules/@hookform/resolvers/yup/dist/yup.mjs
|
|
33
33
|
function c(t, n, r) {
|
|
34
34
|
return r === void 0 && (r = {}), function(o, s, c) {
|
|
35
35
|
try {
|
package/dist/_chunks/yup.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"yup.js","names":["e","o","r","s","e","t","r"],"sources":["../../../../node_modules/.pnpm/@hookform+resolvers@5.9.1_@sinclair+typebox@0.34.49_@standard-schema+spec@1.1.0_ajv@8.
|
|
1
|
+
{"version":3,"file":"yup.js","names":["e","o","r","s","e","t","r"],"sources":["../../../../node_modules/.pnpm/@hookform+resolvers@5.9.1_@sinclair+typebox@0.34.49_@standard-schema+spec@1.1.0_ajv@8.2_26d561451bcf52899bfb24d45cfb94ee/node_modules/@hookform/resolvers/dist/resolvers.mjs","../../../../node_modules/.pnpm/@hookform+resolvers@5.9.1_@sinclair+typebox@0.34.49_@standard-schema+spec@1.1.0_ajv@8.2_26d561451bcf52899bfb24d45cfb94ee/node_modules/@hookform/resolvers/yup/dist/yup.mjs"],"sourcesContent":["import{get as e,set as r}from\"react-hook-form\";const t=(r,t,s)=>{if(r&&\"reportValidity\"in r){const o=e(s,t);r.setCustomValidity(o&&o.message||\"\"),r.reportValidity()}},s=(e,r)=>{for(const s in r.fields){const o=r.fields[s];o&&o.ref&&\"reportValidity\"in o.ref?t(o.ref,s,e):o&&o.refs&&o.refs.forEach(r=>t(r,s,e))}},o=(t,o)=>{o.shouldUseNativeValidation&&s(t,o);const n={};for(const s in t){const f=e(o.fields,s),c=Object.assign(t[s]||{},{ref:f&&f.refs?f.refs[0]:f&&f.ref});if(i(o.names||Object.keys(t),s)){const t=Object.assign({},e(n,s));r(t,\"root\",c),r(n,s,t)}else r(n,s,c)}return n},i=(e,r)=>{const t=n(r).replace(/[.*+?^${}()|\\\\]/g,\"\\\\$&\");return e.some(e=>n(e).match(`^${t}\\\\.\\\\d+`))};function n(e){return e.replace(/\\[(\\d+)]/g,\".$1\").replace(/[[\\]]/g,\"\")}export{o as toNestErrors,s as validateFieldsNatively};\n//# sourceMappingURL=resolvers.mjs.map\n","import{validateFieldsNatively as e,toNestErrors as t}from\"@hookform/resolvers\";import{appendErrors as r}from\"react-hook-form\";function o(o,n,a){return void 0===a&&(a={}),function(s,i,c){try{return Promise.resolve(function(t,r){try{var u=(null!=n&&n.context&&\"development\"===process.env.NODE_ENV&&console.warn(\"You should not used the yup options context. Please, use the 'useForm' context object instead\"),Promise.resolve(o[\"sync\"===a.mode?\"validateSync\":\"validate\"](s,Object.assign({abortEarly:!1},n,{context:i}))).then(function(t){return c.shouldUseNativeValidation&&e({},c),{values:a.raw?Object.assign({},s):t,errors:{}}}))}catch(e){return r(e)}return u&&u.then?u.then(void 0,r):u}(0,function(e){if(!e.inner)throw e;return{values:{},errors:t((o=e,n=!c.shouldUseNativeValidation&&\"all\"===c.criteriaMode,(o.inner||[]).reduce(function(e,t){if(e[t.path]||(e[t.path]={message:t.message,type:t.type}),n){var o=e[t.path].types,a=o&&o[t.type];e[t.path]=r(t.path,n,e,t.type,a?[].concat(a,t.message):t.message)}return e},Object.create(null))),c)};var o,n}))}catch(e){return Promise.reject(e)}}}export{o as yupResolver};\n//# sourceMappingURL=yup.module.js.map\n"],"x_google_ignoreList":[0,1],"mappings":";;AAA+C,IAAM,KAAG,GAAE,GAAE,MAAI;CAAC,IAAG,KAAG,oBAAmB,GAAE;EAAC,IAAM,IAAEA,EAAE,GAAE,CAAC;EAAE,EAAE,kBAAkB,KAAG,EAAE,WAAS,EAAE,GAAE,EAAE,eAAe;CAAC;AAAC,GAAE,KAAG,GAAE,MAAI;CAAC,KAAI,IAAM,KAAK,EAAE,QAAO;EAAC,IAAM,IAAE,EAAE,OAAO;EAAG,KAAG,EAAE,OAAK,oBAAmB,EAAE,MAAI,EAAE,EAAE,KAAI,GAAE,CAAC,IAAE,KAAG,EAAE,QAAM,EAAE,KAAK,SAAQ,MAAG,EAAE,GAAE,GAAE,CAAC,CAAC;CAAC;AAAC,GAAEC,KAAG,GAAE,MAAI;CAAC,EAAE,6BAA2B,EAAE,GAAE,CAAC;CAAE,IAAM,IAAE,CAAC;CAAE,KAAI,IAAM,KAAK,GAAE;EAAC,IAAM,IAAED,EAAE,EAAE,QAAO,CAAC,GAAE,IAAE,OAAO,OAAO,EAAE,MAAI,CAAC,GAAE,EAAC,KAAI,KAAG,EAAE,OAAK,EAAE,KAAK,KAAG,KAAG,EAAE,IAAG,CAAC;EAAE,IAAG,EAAE,EAAE,SAAO,OAAO,KAAK,CAAC,GAAE,CAAC,GAAE;GAAC,IAAM,IAAE,OAAO,OAAO,CAAC,GAAEA,EAAE,GAAE,CAAC,CAAC;GAAE,EAAE,GAAE,QAAO,CAAC,GAAEE,EAAE,GAAE,GAAE,CAAC;EAAC,OAAM,EAAE,GAAE,G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C,EAAA,CAAG,OAAO,SAAS,GAAE,GAAE;MAAC,IAAG,EAAE,EAAE,UAAQ,EAAE,EAAE,QAAM;OAAC,SAAQ,EAAE;OAAQ,MAAK,EAAE;MAAI,IAAG,GAAE;OAAC,IAAI,IAAE,EAAE,EAAE,KAAK,CAAC,OAAM,IAAE,KAAG,EAAE,EAAE;OAAM,EAAE,EAAE,QAAMC,EAAE,EAAE,MAAK,GAAE,GAAE,EAAE,MAAK,IAAE,CAAC,CAAC,CAAC,OAAO,GAAE,EAAE,OAAO,IAAE,EAAE,OAAO;MAAC;MAAC,OAAO;KAAC,GAAE,OAAO,OAAO,IAAI,CAAC,IAAG,CAAC;IAAC;QAAM,GAAE;GAAC,CAAC,CAAC;EAAC,SAAO,GAAE;GAAC,OAAO,QAAQ,OAAO,CAAC;EAAC;CAAC;AAAC"}
|
|
@@ -3,193 +3,192 @@ import { t } from "../../../_chunks/intersection.js";
|
|
|
3
3
|
import { CaseUtil as n } from "../../../utils/CaseUtil/index.js";
|
|
4
4
|
import { t as r } from "../../../_chunks/round.js";
|
|
5
5
|
import { DashboardUtil as i } from "../../../utils/DashboardUtil/index.js";
|
|
6
|
-
import { HISTOGRAM_ALLOWED_COL_TYPES as
|
|
7
|
-
import { DASHBOARD_COMPONENT_NAME as
|
|
8
|
-
import { a as
|
|
9
|
-
import { t as
|
|
10
|
-
import { t as
|
|
11
|
-
import { ContextMenu as
|
|
12
|
-
import { WidgetUnavailable as
|
|
13
|
-
import { EventBusService as
|
|
14
|
-
import { t as
|
|
15
|
-
import { n as
|
|
16
|
-
import { t as
|
|
17
|
-
import { ConfigService as
|
|
18
|
-
import { ListItemIcon as
|
|
19
|
-
import { use as
|
|
20
|
-
import { useTranslation as
|
|
21
|
-
import
|
|
22
|
-
import { jsx as
|
|
23
|
-
import { Box as de } from "@mui/system";
|
|
6
|
+
import { HISTOGRAM_ALLOWED_COL_TYPES as ee, HistogramUtil as a } from "../../../utils/HistogramUtil/index.js";
|
|
7
|
+
import { DASHBOARD_COMPONENT_NAME as o } from "../../../constants/dashboard.js";
|
|
8
|
+
import { a as s, c, f as l, h as u, l as d, m as f, n as p, p as m, t as te } from "../../../_chunks/esm.js";
|
|
9
|
+
import { t as h } from "../../../_chunks/react.js";
|
|
10
|
+
import { t as g } from "../../../_chunks/dashboardStore.js";
|
|
11
|
+
import { ContextMenu as _ } from "../ContextMenu/index.js";
|
|
12
|
+
import { WidgetUnavailable as ne } from "../WidgetUnavailable/index.js";
|
|
13
|
+
import { EventBusService as v } from "../../../classes/services/EventBusService/index.js";
|
|
14
|
+
import { t as y } from "../../../_chunks/CaseDbDownloadUtil.js";
|
|
15
|
+
import { n as re } from "../../../_chunks/LegendaItem.js";
|
|
16
|
+
import { t as ie } from "../../../_chunks/Dashboard.js";
|
|
17
|
+
import { ConfigService as ae } from "@gen-epix/ui-client-common/classes/services/ConfigService";
|
|
18
|
+
import { Box as oe, ListItemIcon as se, ListItemText as ce, MenuItem as le, useTheme as ue } from "@mui/material";
|
|
19
|
+
import { use as b, useCallback as x, useEffect as S, useMemo as C, useRef as w, useState as T } from "react";
|
|
20
|
+
import { useTranslation as E } from "react-i18next";
|
|
21
|
+
import D from "@mui/icons-material/FilterAlt";
|
|
22
|
+
import { jsx as O, jsxs as k } from "react/jsx-runtime";
|
|
24
23
|
//#region src/components/ui/HistogramWidget/HistogramWidget.tsx
|
|
25
|
-
var
|
|
26
|
-
|
|
27
|
-
|
|
24
|
+
var de = /* @__PURE__ */ e(r(), 1), fe = /* @__PURE__ */ e(t(), 1);
|
|
25
|
+
l([
|
|
26
|
+
d,
|
|
27
|
+
s,
|
|
28
28
|
c,
|
|
29
|
-
|
|
30
|
-
m
|
|
29
|
+
p
|
|
31
30
|
]);
|
|
32
|
-
var
|
|
33
|
-
dispose:
|
|
34
|
-
getInstanceByDom:
|
|
35
|
-
init:
|
|
36
|
-
},
|
|
37
|
-
let { t: e } =
|
|
38
|
-
|
|
39
|
-
}, []),
|
|
40
|
-
|
|
31
|
+
var pe = {
|
|
32
|
+
dispose: m,
|
|
33
|
+
getInstanceByDom: f,
|
|
34
|
+
init: u
|
|
35
|
+
}, A = () => {
|
|
36
|
+
let { t: e } = E(), t = ue(), r = w(null), s = w(null), c = C(() => ({ nonce: ae.getInstance().config.nonce }), []), l = b(g), u = b(re), d = h(l, (e) => e.completeCaseType), f = h(l, (e) => e.sortedData), p = h(l, (e) => e.setFilterValues), m = h(l, (e) => e.updateWidgetData), A = h(l, (e) => e.getWidgetData(o.HISTOGRAM)), [j, M] = T(null), N = C(() => ee, []), P = C(() => a.getAllowedCols(d, N), [N, d]), [F, I] = T(A.colAId ? d?.cols[A.colAId] ?? null : null), [L, R] = T(A.colBId ? d?.cols[A.colBId] ?? null : null), [z, B] = T(null), me = x(() => {
|
|
37
|
+
B(null), M(null);
|
|
38
|
+
}, []), V = C(() => i.getCaseCount(f), [f]), H = C(() => a.getDefaultCols(P, d), [P, d]), U = P.length > 1 && H?.newColA && H?.newColB, W = U && F && L && V > 0, G = x((e, t) => {
|
|
39
|
+
I(e), R(t), m(o.HISTOGRAM, {
|
|
41
40
|
colAId: e.id,
|
|
42
41
|
colBId: t.id
|
|
43
42
|
});
|
|
44
|
-
}, [
|
|
45
|
-
|
|
46
|
-
if (
|
|
47
|
-
let { newColA: e, newColB: t } =
|
|
48
|
-
|
|
43
|
+
}, [m]);
|
|
44
|
+
S(() => {
|
|
45
|
+
if (F && L || !H) return;
|
|
46
|
+
let { newColA: e, newColB: t } = H;
|
|
47
|
+
I(e), R(t), m(o.HISTOGRAM, {
|
|
49
48
|
colAId: e.id,
|
|
50
49
|
colBId: t.id
|
|
51
50
|
});
|
|
52
51
|
}, [
|
|
52
|
+
F,
|
|
53
53
|
P,
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
h
|
|
54
|
+
L,
|
|
55
|
+
d,
|
|
56
|
+
H,
|
|
57
|
+
m
|
|
59
58
|
]);
|
|
60
|
-
let [
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
]),
|
|
65
|
-
|
|
66
|
-
|
|
59
|
+
let [K, q] = C(() => a.getConcepts(F, L, d), [
|
|
60
|
+
F,
|
|
61
|
+
L,
|
|
62
|
+
d
|
|
63
|
+
]), J = C(() => a.getSeries(F, L, d, f, K, q), [
|
|
64
|
+
F,
|
|
65
|
+
L,
|
|
66
|
+
d,
|
|
67
67
|
f,
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
if (!U) return !V || N.length < 2 ? e`No two compatible columns found to display a histogram.` : B ? J ? null : e`No cases found with valid values for the selected columns to display a histogram.` : e`No cases found.`;
|
|
68
|
+
K,
|
|
69
|
+
q
|
|
70
|
+
]), Y = C(() => a.getCaseCount(J), [J]), X = V - Y, he = X > 0 ? (0, de.default)(X / V * 100, 1) : 0, ge = C(() => {
|
|
71
|
+
if (!W) return !H || P.length < 2 ? e`No two compatible columns found to display a histogram.` : V ? Y ? null : e`No cases found with valid values for the selected columns to display a histogram.` : e`No cases found.`;
|
|
73
72
|
}, [
|
|
74
|
-
|
|
73
|
+
P.length,
|
|
74
|
+
H,
|
|
75
|
+
Y,
|
|
75
76
|
V,
|
|
76
|
-
|
|
77
|
-
B,
|
|
78
|
-
U,
|
|
77
|
+
W,
|
|
79
78
|
e
|
|
80
|
-
]),
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
]),
|
|
85
|
-
aCol:
|
|
86
|
-
bCol:
|
|
87
|
-
colors:
|
|
88
|
-
conceptsA:
|
|
89
|
-
conceptsB:
|
|
90
|
-
series:
|
|
79
|
+
]), Z = C(() => a.getColors(F, d, f), [
|
|
80
|
+
d,
|
|
81
|
+
F,
|
|
82
|
+
f
|
|
83
|
+
]), _e = x(() => W ? a.getChartOptions({
|
|
84
|
+
aCol: F,
|
|
85
|
+
bCol: L,
|
|
86
|
+
colors: Z,
|
|
87
|
+
conceptsA: K,
|
|
88
|
+
conceptsB: q,
|
|
89
|
+
series: J,
|
|
91
90
|
t: e,
|
|
92
91
|
theme: t
|
|
93
92
|
}) : null, [
|
|
94
|
-
|
|
95
|
-
|
|
93
|
+
W,
|
|
94
|
+
Z,
|
|
96
95
|
t,
|
|
97
|
-
K,
|
|
98
96
|
q,
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
97
|
+
J,
|
|
98
|
+
K,
|
|
99
|
+
F,
|
|
100
|
+
L,
|
|
102
101
|
e
|
|
103
|
-
]),
|
|
102
|
+
]), ve = C(() => {
|
|
104
103
|
let t;
|
|
105
|
-
if (t =
|
|
106
|
-
aColLabel:
|
|
107
|
-
bColLabel:
|
|
108
|
-
}) : e`Histogram`, !
|
|
104
|
+
if (t = F && L ? e("Histogram: {{aColLabel}} and {{bColLabel}}", {
|
|
105
|
+
aColLabel: F.label,
|
|
106
|
+
bColLabel: L.label
|
|
107
|
+
}) : e`Histogram`, !H?.newColA || !H?.newColB) return t;
|
|
109
108
|
let n = {
|
|
110
|
-
disabled: !
|
|
109
|
+
disabled: !U || P.length < 2,
|
|
111
110
|
items: [],
|
|
112
111
|
label: t
|
|
113
112
|
};
|
|
114
|
-
return
|
|
113
|
+
return P.forEach((t) => {
|
|
115
114
|
let r = {
|
|
116
|
-
active:
|
|
115
|
+
active: F?.id === t.id || void 0,
|
|
117
116
|
items: [],
|
|
118
117
|
label: e("Grouping: {{label}}", { label: t.label })
|
|
119
118
|
};
|
|
120
|
-
|
|
119
|
+
P.forEach((n) => {
|
|
121
120
|
t.id !== n.id && r.items.push({
|
|
122
|
-
active: (
|
|
121
|
+
active: (F?.id === t.id || void 0) && (L?.id === n.id || void 0),
|
|
123
122
|
callback: () => {
|
|
124
|
-
|
|
123
|
+
G(t, n);
|
|
125
124
|
},
|
|
126
125
|
label: e("X-Axis: {{label}}", { label: n.label })
|
|
127
126
|
});
|
|
128
127
|
}), n.items.push(r);
|
|
129
128
|
}), n;
|
|
130
129
|
}, [
|
|
130
|
+
F,
|
|
131
|
+
L,
|
|
132
|
+
U,
|
|
131
133
|
P,
|
|
132
|
-
|
|
133
|
-
H,
|
|
134
|
-
N,
|
|
135
|
-
V?.newColA,
|
|
136
|
-
V?.newColB,
|
|
134
|
+
H?.newColA,
|
|
135
|
+
H?.newColB,
|
|
137
136
|
e,
|
|
138
|
-
|
|
139
|
-
]), ye =
|
|
140
|
-
if (
|
|
137
|
+
G
|
|
138
|
+
]), ye = x((t) => {
|
|
139
|
+
if (s.current = t, !F || !L) return;
|
|
141
140
|
let n = t.getDom();
|
|
142
141
|
n?.setAttribute("aria-label", e("Histogram showing the number of cases for {{aColLabel}} and {{bColLabel}}", {
|
|
143
|
-
aColLabel:
|
|
144
|
-
bColLabel:
|
|
142
|
+
aColLabel: F?.label,
|
|
143
|
+
bColLabel: L?.label
|
|
145
144
|
})), n?.setAttribute("role", "img");
|
|
146
145
|
}, [
|
|
147
|
-
|
|
148
|
-
|
|
146
|
+
F,
|
|
147
|
+
L,
|
|
149
148
|
e
|
|
150
149
|
]);
|
|
151
|
-
|
|
150
|
+
S(() => {
|
|
152
151
|
let t = () => {
|
|
153
|
-
|
|
154
|
-
disabled: !
|
|
152
|
+
v.getInstance().emit("onDownloadOptionsChanged", {
|
|
153
|
+
disabled: !U,
|
|
155
154
|
items: [{
|
|
156
|
-
callback: () =>
|
|
157
|
-
disabled: !
|
|
155
|
+
callback: () => y.downloadEchartsImage(e`Histogram`, r.current.getEchartsInstance(), "png", d, e),
|
|
156
|
+
disabled: !W,
|
|
158
157
|
label: e`Save as PNG`
|
|
159
158
|
}, {
|
|
160
|
-
callback: () =>
|
|
161
|
-
disabled: !
|
|
159
|
+
callback: () => y.downloadEchartsImage(e`Histogram`, r.current.getEchartsInstance(), "jpeg", d, e),
|
|
160
|
+
disabled: !W,
|
|
162
161
|
label: e`Save as JPEG`
|
|
163
162
|
}],
|
|
164
|
-
zone:
|
|
163
|
+
zone: o.HISTOGRAM,
|
|
165
164
|
zoneLabel: e`Histogram`
|
|
166
165
|
});
|
|
167
166
|
};
|
|
168
167
|
t();
|
|
169
|
-
let n =
|
|
168
|
+
let n = v.getInstance();
|
|
170
169
|
return n.addEventListener("onDownloadOptionsRequested", t), () => {
|
|
171
170
|
n.emit("onDownloadOptionsChanged", {
|
|
172
171
|
items: null,
|
|
173
|
-
zone:
|
|
172
|
+
zone: o.HISTOGRAM,
|
|
174
173
|
zoneLabel: e`Histogram`
|
|
175
174
|
}), n.removeEventListener("onDownloadOptionsRequested", t);
|
|
176
175
|
};
|
|
177
176
|
}, [
|
|
178
|
-
|
|
177
|
+
d,
|
|
178
|
+
W,
|
|
179
179
|
U,
|
|
180
|
-
H,
|
|
181
180
|
e
|
|
182
181
|
]);
|
|
183
|
-
let Q =
|
|
184
|
-
|
|
182
|
+
let Q = x((e) => {
|
|
183
|
+
u.highlight({
|
|
185
184
|
caseIds: e,
|
|
186
|
-
origin:
|
|
185
|
+
origin: o.HISTOGRAM
|
|
187
186
|
});
|
|
188
|
-
}, [
|
|
187
|
+
}, [u]), be = C(() => {
|
|
189
188
|
let e = (e) => {
|
|
190
|
-
let t =
|
|
191
|
-
return t ?
|
|
192
|
-
let r = n.getRowValue(e.content,
|
|
189
|
+
let t = a.getColValuesFromPayload(e, K, q);
|
|
190
|
+
return t ? f.filter((e) => {
|
|
191
|
+
let r = n.getRowValue(e.content, F, d), i = n.getRowValue(e.content, L, d);
|
|
193
192
|
return t.a === r.raw && t.b === i.raw;
|
|
194
193
|
}).map((e) => e.id) : [];
|
|
195
194
|
};
|
|
@@ -205,7 +204,7 @@ var me = {
|
|
|
205
204
|
},
|
|
206
205
|
mouseup: (t) => {
|
|
207
206
|
let { event: n } = t;
|
|
208
|
-
|
|
207
|
+
M(a.getColValuesFromPayload(t, K, q)), B({
|
|
209
208
|
caseIds: e(t),
|
|
210
209
|
mouseEvent: n.event,
|
|
211
210
|
position: {
|
|
@@ -216,53 +215,53 @@ var me = {
|
|
|
216
215
|
}
|
|
217
216
|
};
|
|
218
217
|
}, [
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
G,
|
|
218
|
+
F,
|
|
219
|
+
L,
|
|
220
|
+
d,
|
|
223
221
|
K,
|
|
222
|
+
q,
|
|
224
223
|
Q,
|
|
225
|
-
|
|
226
|
-
]), $ =
|
|
227
|
-
!
|
|
228
|
-
[
|
|
229
|
-
[
|
|
224
|
+
f
|
|
225
|
+
]), $ = x(async (e) => {
|
|
226
|
+
!j || !F || !L || (await p({
|
|
227
|
+
[F.id]: [j.a],
|
|
228
|
+
[L.id]: [j.b]
|
|
230
229
|
}), e());
|
|
231
230
|
}, [
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
]), xe =
|
|
237
|
-
let n =
|
|
238
|
-
return !n || !r || !
|
|
231
|
+
F,
|
|
232
|
+
L,
|
|
233
|
+
j,
|
|
234
|
+
p
|
|
235
|
+
]), xe = x((t) => {
|
|
236
|
+
let n = K.find((e) => e.id === j?.a)?.name, r = q.find((e) => e.id === j?.b)?.name;
|
|
237
|
+
return !n || !r || !j ? null : /* @__PURE__ */ k(le, {
|
|
239
238
|
divider: !0,
|
|
240
239
|
onClick: async () => await $(t),
|
|
241
|
-
children: [/* @__PURE__ */
|
|
240
|
+
children: [/* @__PURE__ */ O(se, { children: /* @__PURE__ */ O(D, { fontSize: "small" }) }), /* @__PURE__ */ O(ce, { children: e("Filter (show only {{conceptALabel}} and {{conceptBLabel}})", {
|
|
242
241
|
conceptALabel: n,
|
|
243
242
|
conceptBLabel: r
|
|
244
243
|
}) })]
|
|
245
244
|
});
|
|
246
245
|
}, [
|
|
247
|
-
G,
|
|
248
246
|
K,
|
|
249
|
-
|
|
247
|
+
q,
|
|
248
|
+
j,
|
|
250
249
|
$,
|
|
251
250
|
e
|
|
252
251
|
]);
|
|
253
|
-
return
|
|
254
|
-
let e =
|
|
255
|
-
if (e.origin ===
|
|
256
|
-
let t =
|
|
252
|
+
return S(() => {
|
|
253
|
+
let e = u.highlightSubject.subscribe((e) => {
|
|
254
|
+
if (e.origin === o.HISTOGRAM) return;
|
|
255
|
+
let t = s.current;
|
|
257
256
|
if (!t) return;
|
|
258
257
|
if (!e?.caseIds?.length) {
|
|
259
258
|
t.dispatchAction({ type: "downplay" });
|
|
260
259
|
return;
|
|
261
260
|
}
|
|
262
261
|
let n = /* @__PURE__ */ new Map();
|
|
263
|
-
|
|
262
|
+
J?.forEach((t, r) => {
|
|
264
263
|
t.xCaseIds?.forEach((t, i) => {
|
|
265
|
-
if ((0,
|
|
264
|
+
if ((0, fe.default)(t, e.caseIds).length) {
|
|
266
265
|
let e = n.get(i) ?? /* @__PURE__ */ new Set();
|
|
267
266
|
e.add(r), n.set(i, e);
|
|
268
267
|
}
|
|
@@ -270,7 +269,7 @@ var me = {
|
|
|
270
269
|
}), t.dispatchAction({ type: "downplay" });
|
|
271
270
|
let r = [];
|
|
272
271
|
n.forEach((e, t) => {
|
|
273
|
-
if (e.size ===
|
|
272
|
+
if (e.size === J?.length) {
|
|
274
273
|
r.push({ dataIndex: t });
|
|
275
274
|
return;
|
|
276
275
|
}
|
|
@@ -290,44 +289,44 @@ var me = {
|
|
|
290
289
|
return () => {
|
|
291
290
|
e();
|
|
292
291
|
};
|
|
293
|
-
}, [
|
|
294
|
-
expandDisabled: !
|
|
295
|
-
title:
|
|
296
|
-
warningMessage:
|
|
297
|
-
missingCasesCount:
|
|
298
|
-
missingCasesPercentage:
|
|
292
|
+
}, [u, J]), /* @__PURE__ */ k(ie, {
|
|
293
|
+
expandDisabled: !U,
|
|
294
|
+
title: ve,
|
|
295
|
+
warningMessage: U && Y > 0 && X > 0 ? e("Missing cases: {{missingCasesCount}} ({{missingCasesPercentage}}%)", {
|
|
296
|
+
missingCasesCount: X,
|
|
297
|
+
missingCasesPercentage: he
|
|
299
298
|
}) : void 0,
|
|
300
|
-
widgetName:
|
|
301
|
-
children: [!
|
|
302
|
-
reason:
|
|
299
|
+
widgetName: o.HISTOGRAM,
|
|
300
|
+
children: [!U && /* @__PURE__ */ O(ne, {
|
|
301
|
+
reason: ge,
|
|
303
302
|
widgetLabel: e`histogram`
|
|
304
|
-
}),
|
|
303
|
+
}), U && /* @__PURE__ */ k(oe, {
|
|
305
304
|
sx: {
|
|
306
305
|
height: "100%",
|
|
307
306
|
position: "relative"
|
|
308
307
|
},
|
|
309
|
-
children: [
|
|
310
|
-
echarts:
|
|
308
|
+
children: [W && /* @__PURE__ */ O(te, {
|
|
309
|
+
echarts: pe,
|
|
311
310
|
notMerge: !0,
|
|
312
311
|
onChartReady: ye,
|
|
313
312
|
onEvents: be,
|
|
314
|
-
option:
|
|
315
|
-
opts:
|
|
313
|
+
option: _e(),
|
|
314
|
+
opts: c,
|
|
316
315
|
ref: r,
|
|
317
316
|
style: {
|
|
318
317
|
height: "100%",
|
|
319
318
|
position: "absolute",
|
|
320
319
|
width: "100%"
|
|
321
320
|
}
|
|
322
|
-
}), /* @__PURE__ */
|
|
323
|
-
config:
|
|
321
|
+
}), /* @__PURE__ */ O(_, {
|
|
322
|
+
config: z,
|
|
324
323
|
getExtraItems: xe,
|
|
325
|
-
onMenuClose:
|
|
324
|
+
onMenuClose: me
|
|
326
325
|
})]
|
|
327
326
|
})]
|
|
328
327
|
});
|
|
329
328
|
};
|
|
330
329
|
//#endregion
|
|
331
|
-
export {
|
|
330
|
+
export { A as HistogramWidget };
|
|
332
331
|
|
|
333
332
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../../src/components/ui/HistogramWidget/HistogramWidget.tsx"],"sourcesContent":["import { Box } from '@mui/system';\nimport type { ReactElement } from 'react';\nimport {\n use,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport type { EChartsType } from 'echarts';\nimport {\n LegendComponent,\n TooltipComponent,\n} from 'echarts/components';\nimport {\n dispose,\n getInstanceByDom,\n init,\n use as registerECharts,\n} from 'echarts/core';\nimport type { EChartsReactProps } from 'echarts-for-react';\nimport FilterAltIcon from '@mui/icons-material/FilterAlt';\nimport EChartsReact from 'echarts-for-react';\nimport type {\n CaseDbCol,\n CaseDbColType,\n} from '@gen-epix/api-casedb';\nimport type { MenuItemData } from '@gen-epix/ui-core-components/models/nestedMenu';\nimport { ConfigService } from '@gen-epix/ui-client-common/classes/services/ConfigService';\nimport { useStore } from 'zustand';\nimport { BarChart } from 'echarts/charts';\nimport { CanvasRenderer } from 'echarts/renderers';\nimport { useTranslation } from 'react-i18next';\nimport round from 'lodash/round';\nimport {\n ListItemIcon,\n ListItemText,\n MenuItem,\n useTheme,\n} from '@mui/material';\nimport intersection from 'lodash/intersection';\n\nimport { DASHBOARD_COMPONENT_NAME } from '../../../constants/dashboard';\nimport type { ContextMenuConfigWithPosition } from '../ContextMenu';\nimport { ContextMenu } from '../ContextMenu';\nimport { DashboardWidget } from '../Dashboard';\nimport { WidgetUnavailable } from '../WidgetUnavailable';\nimport { DashboardStoreContext } from '../../../stores/dashboardStore';\nimport { DashboardUtil } from '../../../utils/DashboardUtil';\nimport { EventBusService } from '../../../classes/services/EventBusService';\nimport { CaseDbDownloadUtil } from '../../../utils/CaseDbDownloadUtil';\nimport type { HistogramWidgetData } from '../../../models/dashboard';\nimport {\n HISTOGRAM_ALLOWED_COL_TYPES,\n HistogramUtil,\n} from '../../../utils/HistogramUtil';\nimport { DashboardContext } from '../Dashboard/context/DashboardContext';\nimport { CaseUtil } from '../../../utils/CaseUtil';\n\nregisterECharts([TooltipComponent, BarChart, LegendComponent, CanvasRenderer]);\n\nconst echartsCore = {\n dispose,\n getInstanceByDom,\n init,\n};\n\nexport const HistogramWidget = () => {\n const { t } = useTranslation();\n const theme = useTheme();\n const chartRef = useRef<EChartsReact>(null);\n const chartInstanceRef = useRef<EChartsType | null>(null);\n const echartsOpts = useMemo(() => ({\n nonce: ConfigService.getInstance().config.nonce,\n }), []);\n const dashboardStore = use(DashboardStoreContext);\n const dashboardContext = use(DashboardContext);\n const completeCaseType = useStore(dashboardStore, (state) => state.completeCaseType);\n const sortedData = useStore(dashboardStore, (state) => state.sortedData);\n const setFilterValues = useStore(dashboardStore, (state) => state.setFilterValues);\n const updateWidgetData = useStore(dashboardStore, (state) => state.updateWidgetData);\n const histogramWidgetData = useStore(dashboardStore, (state) => state.getWidgetData<HistogramWidgetData>(DASHBOARD_COMPONENT_NAME.HISTOGRAM));\n const [focussedColValues, setFocussedColValues] = useState<{ a: string; b: string }>(null);\n\n const allowedColTypes = useMemo<CaseDbColType[]>(() => {\n return HISTOGRAM_ALLOWED_COL_TYPES;\n }, []);\n\n const allowedCols = useMemo(() => {\n return HistogramUtil.getAllowedCols(completeCaseType, allowedColTypes);\n }, [allowedColTypes, completeCaseType]);\n\n const [aCol, setACol] = useState<CaseDbCol | null>(histogramWidgetData.colAId ? completeCaseType?.cols[histogramWidgetData.colAId] ?? null : null);\n const [bCol, setBCol] = useState<CaseDbCol | null>(histogramWidgetData.colBId ? completeCaseType?.cols[histogramWidgetData.colBId] ?? null : null);\n\n const [contextMenuConfig, setContextMenuConfig] = useState<ContextMenuConfigWithPosition | null>(null);\n\n const onEpiContextMenuClose = useCallback(() => {\n setContextMenuConfig(null);\n setFocussedColValues(null);\n }, []);\n\n const lineListCaseCount = useMemo(() => {\n return DashboardUtil.getCaseCount(sortedData);\n }, [sortedData]);\n\n const defaultCols = useMemo(() => {\n return HistogramUtil.getDefaultCols(allowedCols, completeCaseType);\n }, [allowedCols, completeCaseType]);\n\n\n const canShowWidget = allowedCols.length > 1 && defaultCols?.newColA && defaultCols?.newColB;\n const shouldShowGraph = canShowWidget && aCol && bCol && lineListCaseCount > 0;\n\n const onMenuItemClick = useCallback((x: CaseDbCol, y: CaseDbCol) => {\n setACol(x);\n setBCol(y);\n updateWidgetData(DASHBOARD_COMPONENT_NAME.HISTOGRAM, {\n colAId: x.id,\n colBId: y.id,\n });\n }, [updateWidgetData]);\n\n\n useEffect(() => {\n if (aCol && bCol) {\n return;\n }\n if (!defaultCols) {\n return;\n }\n const { newColA, newColB } = defaultCols;\n\n setACol(newColA);\n setBCol(newColB);\n\n updateWidgetData(DASHBOARD_COMPONENT_NAME.HISTOGRAM, {\n colAId: newColA.id,\n colBId: newColB.id,\n });\n }, [aCol, allowedCols, bCol, completeCaseType, defaultCols, updateWidgetData]);\n\n const [conceptsA, conceptsB] = useMemo(() => {\n return HistogramUtil.getConcepts(aCol, bCol, completeCaseType);\n }, [aCol, bCol, completeCaseType]);\n\n const series = useMemo(() => {\n return HistogramUtil.getSeries(aCol, bCol, completeCaseType, sortedData, conceptsA, conceptsB);\n }, [aCol, bCol, completeCaseType, sortedData, conceptsA, conceptsB]);\n\n const histogramCaseCount = useMemo(() => {\n return HistogramUtil.getCaseCount(series);\n }, [series]);\n\n const missingCasesCount = lineListCaseCount - histogramCaseCount;\n const missingCasesPercentage = missingCasesCount > 0 ? round(missingCasesCount / lineListCaseCount * 100, 1) : 0;\n\n const widgetUnavailableReason = useMemo<ReactElement | string>(() => {\n if (shouldShowGraph) {\n return;\n }\n if (!defaultCols || allowedCols.length < 2) {\n return t`No two compatible columns found to display a histogram.`;\n }\n if (!lineListCaseCount) {\n return t`No cases found.`;\n }\n if (!histogramCaseCount) {\n return t`No cases found with valid values for the selected columns to display a histogram.`;\n }\n return null;\n }, [allowedCols.length, defaultCols, histogramCaseCount, lineListCaseCount, shouldShowGraph, t]);\n\n const colors = useMemo(() => {\n return HistogramUtil.getColors(aCol, completeCaseType, sortedData);\n }, [completeCaseType, aCol, sortedData]);\n\n const getOptions = useCallback(() => {\n if (!shouldShowGraph) {\n return null;\n }\n\n return HistogramUtil.getChartOptions({\n aCol,\n bCol,\n colors,\n conceptsA,\n conceptsB,\n series,\n t,\n theme,\n });\n }, [shouldShowGraph, colors, theme, conceptsB, series, conceptsA, aCol, bCol, t]);\n\n const titleMenu = useMemo<MenuItemData | string>(() => {\n let label: string;\n if (aCol && bCol) {\n label = t('Histogram: {{aColLabel}} and {{bColLabel}}', { aColLabel: aCol.label, bColLabel: bCol.label });\n } else {\n label = t`Histogram`;\n }\n\n if (!defaultCols?.newColA || !defaultCols?.newColB) {\n return label;\n }\n\n const mainMenu: MenuItemData = {\n disabled: !canShowWidget || allowedCols.length < 2,\n items: [],\n label,\n };\n\n\n allowedCols.forEach(x => {\n const subMenu: MenuItemData = {\n active: aCol?.id === x.id || undefined,\n items: [],\n label: t('Grouping: {{label}}', { label: x.label }),\n };\n allowedCols.forEach(y => {\n if (x.id === y.id) {\n return;\n }\n subMenu.items.push({\n active: (aCol?.id === x.id || undefined) && (bCol?.id === y.id || undefined),\n callback: () => {\n onMenuItemClick(x, y);\n },\n label: t('X-Axis: {{label}}', { label: y.label }),\n });\n });\n mainMenu.items.push(subMenu);\n });\n\n\n return mainMenu;\n }, [aCol, bCol, canShowWidget, allowedCols, defaultCols?.newColA, defaultCols?.newColB, t, onMenuItemClick]);\n\n const onChartReady = useCallback((chart: EChartsType) => {\n chartInstanceRef.current = chart;\n if (!aCol || !bCol) {\n return;\n }\n const dom = chart.getDom();\n dom?.setAttribute('aria-label', t('Histogram showing the number of cases for {{aColLabel}} and {{bColLabel}}', { aColLabel: aCol?.label, bColLabel: bCol?.label }));\n dom?.setAttribute('role', 'img');\n }, [aCol, bCol, t]);\n\n\n useEffect(() => {\n const emitDownloadOptions = () => {\n EventBusService.getInstance().emit('onDownloadOptionsChanged', {\n disabled: !canShowWidget,\n items: [\n {\n callback: () => CaseDbDownloadUtil.downloadEchartsImage(t`Histogram`, chartRef.current.getEchartsInstance(), 'png', completeCaseType, t),\n disabled: !shouldShowGraph,\n label: t`Save as PNG`,\n },\n {\n callback: () => CaseDbDownloadUtil.downloadEchartsImage(t`Histogram`, chartRef.current.getEchartsInstance(), 'jpeg', completeCaseType, t),\n disabled: !shouldShowGraph,\n label: t`Save as JPEG`,\n },\n ],\n zone: DASHBOARD_COMPONENT_NAME.HISTOGRAM,\n zoneLabel: t`Histogram`,\n });\n };\n emitDownloadOptions();\n const eventBusManager = EventBusService.getInstance();\n eventBusManager.addEventListener('onDownloadOptionsRequested', emitDownloadOptions);\n return () => {\n eventBusManager.emit('onDownloadOptionsChanged', {\n items: null,\n zone: DASHBOARD_COMPONENT_NAME.HISTOGRAM,\n zoneLabel: t`Histogram`,\n });\n eventBusManager.removeEventListener('onDownloadOptionsRequested', emitDownloadOptions);\n };\n }, [completeCaseType, shouldShowGraph, canShowWidget, t]);\n\n const highlight = useCallback((caseIds: string[]) => {\n dashboardContext.highlight({\n caseIds,\n origin: DASHBOARD_COMPONENT_NAME.HISTOGRAM,\n });\n }, [dashboardContext]);\n\n const onEvents = useMemo<EChartsReactProps['onEvents']>(() => {\n\n const getCaseIdsFromPayload = (payload: unknown): string[] => {\n const colValues = HistogramUtil.getColValuesFromPayload(payload, conceptsA, conceptsB);\n if (!colValues) {\n return [];\n }\n const caseIds = sortedData.filter(caseDbCase => {\n const aValue = CaseUtil.getRowValue(caseDbCase.content, aCol, completeCaseType);\n const bValue = CaseUtil.getRowValue(caseDbCase.content, bCol, completeCaseType);\n return colValues.a === aValue.raw && colValues.b === bValue.raw;\n }).map(caseDbCase => caseDbCase.id);\n return caseIds;\n };\n\n return {\n globalout: () => {\n highlight([]);\n },\n mouseout: () => {\n highlight([]);\n },\n mouseover: (payload: unknown) => {\n highlight(getCaseIdsFromPayload(payload));\n },\n mouseup: (payload: unknown) => {\n const { event } = payload as { event: { event: MouseEvent } };\n setFocussedColValues(HistogramUtil.getColValuesFromPayload(payload, conceptsA, conceptsB));\n setContextMenuConfig({\n caseIds: getCaseIdsFromPayload(payload),\n mouseEvent: event.event,\n position: {\n left: (event.event).clientX,\n top: (event.event).clientY,\n },\n });\n },\n };\n }, [aCol, bCol, completeCaseType, conceptsA, conceptsB, highlight, sortedData]);\n\n const onShowOnlyFocussedColValuesMenuItemClick = useCallback(async (onMenuClose: () => void) => {\n if (!focussedColValues || !aCol || !bCol) {\n return;\n }\n await setFilterValues({\n [aCol.id]: [focussedColValues.a],\n [bCol.id]: [focussedColValues.b],\n });\n\n onMenuClose();\n }, [aCol, bCol, focussedColValues, setFilterValues]);\n\n const getEpiContextMenuExtraItems = useCallback((onMenuClose: () => void): ReactElement => {\n const conceptALabel = conceptsA.find(concept => concept.id === focussedColValues?.a)?.name;\n const conceptBLabel = conceptsB.find(concept => concept.id === focussedColValues?.b)?.name;\n if (!conceptALabel || !conceptBLabel) {\n return null;\n }\n if (!focussedColValues) {\n return null;\n }\n return (\n <MenuItem\n divider\n // eslint-disable-next-line @eslint-react/kit/jsx-no-bind\n onClick={async () => await onShowOnlyFocussedColValuesMenuItemClick(onMenuClose)}\n >\n <ListItemIcon>\n <FilterAltIcon fontSize={'small'} />\n </ListItemIcon>\n <ListItemText>\n {t('Filter (show only {{conceptALabel}} and {{conceptBLabel}})', { conceptALabel, conceptBLabel })}\n </ListItemText>\n </MenuItem>\n );\n }, [conceptsA, conceptsB, focussedColValues, onShowOnlyFocussedColValuesMenuItemClick, t]);\n\n useEffect(() => {\n const unsubscribe = dashboardContext.highlightSubject.subscribe((highlighting) => {\n if (highlighting.origin === DASHBOARD_COMPONENT_NAME.HISTOGRAM) {\n return;\n }\n const instance = chartInstanceRef.current;\n if (!instance) {\n return;\n }\n\n if (!highlighting?.caseIds?.length) {\n instance.dispatchAction({\n type: 'downplay',\n });\n return;\n }\n\n const highlightTargetsByDataIndex = new Map<number, Set<number>>();\n series?.forEach((serie, serieIndex) => {\n const castedSerie = serie as { data: unknown[]; xCaseIds: string[][] };\n castedSerie.xCaseIds?.forEach((caseIds: string[], dataIndex: number) => {\n if (intersection(caseIds, highlighting.caseIds).length) {\n const seriesIndices = highlightTargetsByDataIndex.get(dataIndex) ?? new Set<number>();\n seriesIndices.add(serieIndex);\n highlightTargetsByDataIndex.set(dataIndex, seriesIndices);\n }\n });\n });\n\n instance.dispatchAction({\n type: 'downplay',\n });\n\n const highlightBatch: Array<{ dataIndex: number; notBlur?: boolean; seriesIndex?: number }> = [];\n highlightTargetsByDataIndex.forEach((seriesIndices, dataIndex) => {\n if (seriesIndices.size === series?.length) {\n highlightBatch.push({\n dataIndex,\n });\n return;\n }\n\n seriesIndices.forEach((seriesIndex) => {\n highlightBatch.push({\n dataIndex,\n seriesIndex,\n });\n });\n });\n\n highlightBatch.forEach((target, index) => {\n if (index > 0) {\n target.notBlur = true;\n }\n });\n\n instance.dispatchAction({\n batch: highlightBatch,\n type: 'highlight',\n });\n });\n\n return () => {\n unsubscribe();\n };\n }, [dashboardContext, series]);\n\n return (\n <DashboardWidget\n expandDisabled={!canShowWidget}\n title={titleMenu}\n warningMessage={canShowWidget && histogramCaseCount > 0 && missingCasesCount > 0 ? t('Missing cases: {{missingCasesCount}} ({{missingCasesPercentage}}%)', { missingCasesCount, missingCasesPercentage }) : undefined}\n widgetName={DASHBOARD_COMPONENT_NAME.HISTOGRAM}\n >\n {!canShowWidget && (\n <WidgetUnavailable\n reason={widgetUnavailableReason}\n widgetLabel={t`histogram`}\n />\n )}\n {canShowWidget && (\n <Box\n sx={{\n height: '100%',\n position: 'relative',\n }}\n >\n {shouldShowGraph && (\n <EChartsReact\n echarts={echartsCore}\n notMerge\n onChartReady={onChartReady}\n onEvents={onEvents}\n option={getOptions()}\n opts={echartsOpts as unknown}\n ref={chartRef}\n style={{\n height: '100%',\n position: 'absolute',\n width: '100%',\n }}\n />\n )}\n <ContextMenu\n config={contextMenuConfig}\n getExtraItems={getEpiContextMenuExtraItems}\n onMenuClose={onEpiContextMenuClose}\n />\n </Box>\n )}\n </DashboardWidget>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AA4DA,EAAgB;CAAC;CAAkB;CAAU;CAAiB;AAAc,CAAC;AAE7E,IAAM,KAAc;CAClB;CACA;CACA;AACF,GAEa,UAAwB;CACnC,IAAM,EAAE,SAAM,GAAe,GACvB,IAAQ,GAAS,GACjB,IAAW,EAAqB,IAAI,GACpC,IAAmB,EAA2B,IAAI,GAClD,IAAc,SAAe,EACjC,OAAO,GAAc,YAAY,CAAC,CAAC,OAAO,MAC5C,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IACT;GACD,CAAA,GAEH,kBAAC,IAAD;IACE,QAAQ;IACR,eAAe;IACf,aAAa;GACd,CAAA,CACE;EAEQ,CAAA,CAAA;;AAErB"}
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../src/components/ui/HistogramWidget/HistogramWidget.tsx"],"sourcesContent":["import {\n Box,\n ListItemIcon,\n ListItemText,\n MenuItem,\n useTheme,\n} from '@mui/material';\nimport type { ReactElement } from 'react';\nimport {\n use,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport type { EChartsType } from 'echarts';\nimport {\n LegendComponent,\n TooltipComponent,\n} from 'echarts/components';\nimport {\n dispose,\n getInstanceByDom,\n init,\n use as registerECharts,\n} from 'echarts/core';\nimport type { EChartsReactProps } from 'echarts-for-react';\nimport FilterAltIcon from '@mui/icons-material/FilterAlt';\nimport EChartsReact from 'echarts-for-react';\nimport type {\n CaseDbCol,\n CaseDbColType,\n} from '@gen-epix/api-casedb';\nimport type { MenuItemData } from '@gen-epix/ui-core-components/models/nestedMenu';\nimport { ConfigService } from '@gen-epix/ui-client-common/classes/services/ConfigService';\nimport { useStore } from 'zustand';\nimport { BarChart } from 'echarts/charts';\nimport { CanvasRenderer } from 'echarts/renderers';\nimport { useTranslation } from 'react-i18next';\nimport round from 'lodash/round';\nimport intersection from 'lodash/intersection';\n\nimport { DASHBOARD_COMPONENT_NAME } from '../../../constants/dashboard';\nimport type { ContextMenuConfigWithPosition } from '../ContextMenu';\nimport { ContextMenu } from '../ContextMenu';\nimport { DashboardWidget } from '../Dashboard';\nimport { WidgetUnavailable } from '../WidgetUnavailable';\nimport { DashboardStoreContext } from '../../../stores/dashboardStore';\nimport { DashboardUtil } from '../../../utils/DashboardUtil';\nimport { EventBusService } from '../../../classes/services/EventBusService';\nimport { CaseDbDownloadUtil } from '../../../utils/CaseDbDownloadUtil';\nimport type { HistogramWidgetData } from '../../../models/dashboard';\nimport {\n HISTOGRAM_ALLOWED_COL_TYPES,\n HistogramUtil,\n} from '../../../utils/HistogramUtil';\nimport { DashboardContext } from '../Dashboard/context/DashboardContext';\nimport { CaseUtil } from '../../../utils/CaseUtil';\n\nregisterECharts([TooltipComponent, BarChart, LegendComponent, CanvasRenderer]);\n\nconst echartsCore = {\n dispose,\n getInstanceByDom,\n init,\n};\n\nexport const HistogramWidget = () => {\n const { t } = useTranslation();\n const theme = useTheme();\n const chartRef = useRef<EChartsReact>(null);\n const chartInstanceRef = useRef<EChartsType | null>(null);\n const echartsOpts = useMemo(() => ({\n nonce: ConfigService.getInstance().config.nonce,\n }), []);\n const dashboardStore = use(DashboardStoreContext);\n const dashboardContext = use(DashboardContext);\n const completeCaseType = useStore(dashboardStore, (state) => state.completeCaseType);\n const sortedData = useStore(dashboardStore, (state) => state.sortedData);\n const setFilterValues = useStore(dashboardStore, (state) => state.setFilterValues);\n const updateWidgetData = useStore(dashboardStore, (state) => state.updateWidgetData);\n const histogramWidgetData = useStore(dashboardStore, (state) => state.getWidgetData<HistogramWidgetData>(DASHBOARD_COMPONENT_NAME.HISTOGRAM));\n const [focussedColValues, setFocussedColValues] = useState<{ a: string; b: string }>(null);\n\n const allowedColTypes = useMemo<CaseDbColType[]>(() => {\n return HISTOGRAM_ALLOWED_COL_TYPES;\n }, []);\n\n const allowedCols = useMemo(() => {\n return HistogramUtil.getAllowedCols(completeCaseType, allowedColTypes);\n }, [allowedColTypes, completeCaseType]);\n\n const [aCol, setACol] = useState<CaseDbCol | null>(histogramWidgetData.colAId ? completeCaseType?.cols[histogramWidgetData.colAId] ?? null : null);\n const [bCol, setBCol] = useState<CaseDbCol | null>(histogramWidgetData.colBId ? completeCaseType?.cols[histogramWidgetData.colBId] ?? null : null);\n\n const [contextMenuConfig, setContextMenuConfig] = useState<ContextMenuConfigWithPosition | null>(null);\n\n const onEpiContextMenuClose = useCallback(() => {\n setContextMenuConfig(null);\n setFocussedColValues(null);\n }, []);\n\n const lineListCaseCount = useMemo(() => {\n return DashboardUtil.getCaseCount(sortedData);\n }, [sortedData]);\n\n const defaultCols = useMemo(() => {\n return HistogramUtil.getDefaultCols(allowedCols, completeCaseType);\n }, [allowedCols, completeCaseType]);\n\n\n const canShowWidget = allowedCols.length > 1 && defaultCols?.newColA && defaultCols?.newColB;\n const shouldShowGraph = canShowWidget && aCol && bCol && lineListCaseCount > 0;\n\n const onMenuItemClick = useCallback((x: CaseDbCol, y: CaseDbCol) => {\n setACol(x);\n setBCol(y);\n updateWidgetData(DASHBOARD_COMPONENT_NAME.HISTOGRAM, {\n colAId: x.id,\n colBId: y.id,\n });\n }, [updateWidgetData]);\n\n\n useEffect(() => {\n if (aCol && bCol) {\n return;\n }\n if (!defaultCols) {\n return;\n }\n const { newColA, newColB } = defaultCols;\n\n setACol(newColA);\n setBCol(newColB);\n\n updateWidgetData(DASHBOARD_COMPONENT_NAME.HISTOGRAM, {\n colAId: newColA.id,\n colBId: newColB.id,\n });\n }, [aCol, allowedCols, bCol, completeCaseType, defaultCols, updateWidgetData]);\n\n const [conceptsA, conceptsB] = useMemo(() => {\n return HistogramUtil.getConcepts(aCol, bCol, completeCaseType);\n }, [aCol, bCol, completeCaseType]);\n\n const series = useMemo(() => {\n return HistogramUtil.getSeries(aCol, bCol, completeCaseType, sortedData, conceptsA, conceptsB);\n }, [aCol, bCol, completeCaseType, sortedData, conceptsA, conceptsB]);\n\n const histogramCaseCount = useMemo(() => {\n return HistogramUtil.getCaseCount(series);\n }, [series]);\n\n const missingCasesCount = lineListCaseCount - histogramCaseCount;\n const missingCasesPercentage = missingCasesCount > 0 ? round(missingCasesCount / lineListCaseCount * 100, 1) : 0;\n\n const widgetUnavailableReason = useMemo<ReactElement | string>(() => {\n if (shouldShowGraph) {\n return;\n }\n if (!defaultCols || allowedCols.length < 2) {\n return t`No two compatible columns found to display a histogram.`;\n }\n if (!lineListCaseCount) {\n return t`No cases found.`;\n }\n if (!histogramCaseCount) {\n return t`No cases found with valid values for the selected columns to display a histogram.`;\n }\n return null;\n }, [allowedCols.length, defaultCols, histogramCaseCount, lineListCaseCount, shouldShowGraph, t]);\n\n const colors = useMemo(() => {\n return HistogramUtil.getColors(aCol, completeCaseType, sortedData);\n }, [completeCaseType, aCol, sortedData]);\n\n const getOptions = useCallback(() => {\n if (!shouldShowGraph) {\n return null;\n }\n\n return HistogramUtil.getChartOptions({\n aCol,\n bCol,\n colors,\n conceptsA,\n conceptsB,\n series,\n t,\n theme,\n });\n }, [shouldShowGraph, colors, theme, conceptsB, series, conceptsA, aCol, bCol, t]);\n\n const titleMenu = useMemo<MenuItemData | string>(() => {\n let label: string;\n if (aCol && bCol) {\n label = t('Histogram: {{aColLabel}} and {{bColLabel}}', { aColLabel: aCol.label, bColLabel: bCol.label });\n } else {\n label = t`Histogram`;\n }\n\n if (!defaultCols?.newColA || !defaultCols?.newColB) {\n return label;\n }\n\n const mainMenu: MenuItemData = {\n disabled: !canShowWidget || allowedCols.length < 2,\n items: [],\n label,\n };\n\n\n allowedCols.forEach(x => {\n const subMenu: MenuItemData = {\n active: aCol?.id === x.id || undefined,\n items: [],\n label: t('Grouping: {{label}}', { label: x.label }),\n };\n allowedCols.forEach(y => {\n if (x.id === y.id) {\n return;\n }\n subMenu.items.push({\n active: (aCol?.id === x.id || undefined) && (bCol?.id === y.id || undefined),\n callback: () => {\n onMenuItemClick(x, y);\n },\n label: t('X-Axis: {{label}}', { label: y.label }),\n });\n });\n mainMenu.items.push(subMenu);\n });\n\n\n return mainMenu;\n }, [aCol, bCol, canShowWidget, allowedCols, defaultCols?.newColA, defaultCols?.newColB, t, onMenuItemClick]);\n\n const onChartReady = useCallback((chart: EChartsType) => {\n chartInstanceRef.current = chart;\n if (!aCol || !bCol) {\n return;\n }\n const dom = chart.getDom();\n dom?.setAttribute('aria-label', t('Histogram showing the number of cases for {{aColLabel}} and {{bColLabel}}', { aColLabel: aCol?.label, bColLabel: bCol?.label }));\n dom?.setAttribute('role', 'img');\n }, [aCol, bCol, t]);\n\n\n useEffect(() => {\n const emitDownloadOptions = () => {\n EventBusService.getInstance().emit('onDownloadOptionsChanged', {\n disabled: !canShowWidget,\n items: [\n {\n callback: () => CaseDbDownloadUtil.downloadEchartsImage(t`Histogram`, chartRef.current.getEchartsInstance(), 'png', completeCaseType, t),\n disabled: !shouldShowGraph,\n label: t`Save as PNG`,\n },\n {\n callback: () => CaseDbDownloadUtil.downloadEchartsImage(t`Histogram`, chartRef.current.getEchartsInstance(), 'jpeg', completeCaseType, t),\n disabled: !shouldShowGraph,\n label: t`Save as JPEG`,\n },\n ],\n zone: DASHBOARD_COMPONENT_NAME.HISTOGRAM,\n zoneLabel: t`Histogram`,\n });\n };\n emitDownloadOptions();\n const eventBusManager = EventBusService.getInstance();\n eventBusManager.addEventListener('onDownloadOptionsRequested', emitDownloadOptions);\n return () => {\n eventBusManager.emit('onDownloadOptionsChanged', {\n items: null,\n zone: DASHBOARD_COMPONENT_NAME.HISTOGRAM,\n zoneLabel: t`Histogram`,\n });\n eventBusManager.removeEventListener('onDownloadOptionsRequested', emitDownloadOptions);\n };\n }, [completeCaseType, shouldShowGraph, canShowWidget, t]);\n\n const highlight = useCallback((caseIds: string[]) => {\n dashboardContext.highlight({\n caseIds,\n origin: DASHBOARD_COMPONENT_NAME.HISTOGRAM,\n });\n }, [dashboardContext]);\n\n const onEvents = useMemo<EChartsReactProps['onEvents']>(() => {\n\n const getCaseIdsFromPayload = (payload: unknown): string[] => {\n const colValues = HistogramUtil.getColValuesFromPayload(payload, conceptsA, conceptsB);\n if (!colValues) {\n return [];\n }\n const caseIds = sortedData.filter(caseDbCase => {\n const aValue = CaseUtil.getRowValue(caseDbCase.content, aCol, completeCaseType);\n const bValue = CaseUtil.getRowValue(caseDbCase.content, bCol, completeCaseType);\n return colValues.a === aValue.raw && colValues.b === bValue.raw;\n }).map(caseDbCase => caseDbCase.id);\n return caseIds;\n };\n\n return {\n globalout: () => {\n highlight([]);\n },\n mouseout: () => {\n highlight([]);\n },\n mouseover: (payload: unknown) => {\n highlight(getCaseIdsFromPayload(payload));\n },\n mouseup: (payload: unknown) => {\n const { event } = payload as { event: { event: MouseEvent } };\n setFocussedColValues(HistogramUtil.getColValuesFromPayload(payload, conceptsA, conceptsB));\n setContextMenuConfig({\n caseIds: getCaseIdsFromPayload(payload),\n mouseEvent: event.event,\n position: {\n left: (event.event).clientX,\n top: (event.event).clientY,\n },\n });\n },\n };\n }, [aCol, bCol, completeCaseType, conceptsA, conceptsB, highlight, sortedData]);\n\n const onShowOnlyFocussedColValuesMenuItemClick = useCallback(async (onMenuClose: () => void) => {\n if (!focussedColValues || !aCol || !bCol) {\n return;\n }\n await setFilterValues({\n [aCol.id]: [focussedColValues.a],\n [bCol.id]: [focussedColValues.b],\n });\n\n onMenuClose();\n }, [aCol, bCol, focussedColValues, setFilterValues]);\n\n const getEpiContextMenuExtraItems = useCallback((onMenuClose: () => void): ReactElement => {\n const conceptALabel = conceptsA.find(concept => concept.id === focussedColValues?.a)?.name;\n const conceptBLabel = conceptsB.find(concept => concept.id === focussedColValues?.b)?.name;\n if (!conceptALabel || !conceptBLabel) {\n return null;\n }\n if (!focussedColValues) {\n return null;\n }\n return (\n <MenuItem\n divider\n // eslint-disable-next-line @eslint-react/kit/jsx-no-bind\n onClick={async () => await onShowOnlyFocussedColValuesMenuItemClick(onMenuClose)}\n >\n <ListItemIcon>\n <FilterAltIcon fontSize={'small'} />\n </ListItemIcon>\n <ListItemText>\n {t('Filter (show only {{conceptALabel}} and {{conceptBLabel}})', { conceptALabel, conceptBLabel })}\n </ListItemText>\n </MenuItem>\n );\n }, [conceptsA, conceptsB, focussedColValues, onShowOnlyFocussedColValuesMenuItemClick, t]);\n\n useEffect(() => {\n const unsubscribe = dashboardContext.highlightSubject.subscribe((highlighting) => {\n if (highlighting.origin === DASHBOARD_COMPONENT_NAME.HISTOGRAM) {\n return;\n }\n const instance = chartInstanceRef.current;\n if (!instance) {\n return;\n }\n\n if (!highlighting?.caseIds?.length) {\n instance.dispatchAction({\n type: 'downplay',\n });\n return;\n }\n\n const highlightTargetsByDataIndex = new Map<number, Set<number>>();\n series?.forEach((serie, serieIndex) => {\n const castedSerie = serie as { data: unknown[]; xCaseIds: string[][] };\n castedSerie.xCaseIds?.forEach((caseIds: string[], dataIndex: number) => {\n if (intersection(caseIds, highlighting.caseIds).length) {\n const seriesIndices = highlightTargetsByDataIndex.get(dataIndex) ?? new Set<number>();\n seriesIndices.add(serieIndex);\n highlightTargetsByDataIndex.set(dataIndex, seriesIndices);\n }\n });\n });\n\n instance.dispatchAction({\n type: 'downplay',\n });\n\n const highlightBatch: Array<{ dataIndex: number; notBlur?: boolean; seriesIndex?: number }> = [];\n highlightTargetsByDataIndex.forEach((seriesIndices, dataIndex) => {\n if (seriesIndices.size === series?.length) {\n highlightBatch.push({\n dataIndex,\n });\n return;\n }\n\n seriesIndices.forEach((seriesIndex) => {\n highlightBatch.push({\n dataIndex,\n seriesIndex,\n });\n });\n });\n\n highlightBatch.forEach((target, index) => {\n if (index > 0) {\n target.notBlur = true;\n }\n });\n\n instance.dispatchAction({\n batch: highlightBatch,\n type: 'highlight',\n });\n });\n\n return () => {\n unsubscribe();\n };\n }, [dashboardContext, series]);\n\n return (\n <DashboardWidget\n expandDisabled={!canShowWidget}\n title={titleMenu}\n warningMessage={canShowWidget && histogramCaseCount > 0 && missingCasesCount > 0 ? t('Missing cases: {{missingCasesCount}} ({{missingCasesPercentage}}%)', { missingCasesCount, missingCasesPercentage }) : undefined}\n widgetName={DASHBOARD_COMPONENT_NAME.HISTOGRAM}\n >\n {!canShowWidget && (\n <WidgetUnavailable\n reason={widgetUnavailableReason}\n widgetLabel={t`histogram`}\n />\n )}\n {canShowWidget && (\n <Box\n sx={{\n height: '100%',\n position: 'relative',\n }}\n >\n {shouldShowGraph && (\n <EChartsReact\n echarts={echartsCore}\n notMerge\n onChartReady={onChartReady}\n onEvents={onEvents}\n option={getOptions()}\n opts={echartsOpts as unknown}\n ref={chartRef}\n style={{\n height: '100%',\n position: 'absolute',\n width: '100%',\n }}\n />\n )}\n <ContextMenu\n config={contextMenuConfig}\n getExtraItems={getEpiContextMenuExtraItems}\n onMenuClose={onEpiContextMenuClose}\n />\n </Box>\n )}\n </DashboardWidget>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AA4DA,EAAgB;CAAC;CAAkB;CAAU;CAAiB;AAAc,CAAC;AAE7E,IAAM,KAAc;CAClB;CACA;CACA;AACF,GAEa,UAAwB;CACnC,IAAM,EAAE,SAAM,EAAe,GACvB,IAAQ,GAAS,GACjB,IAAW,EAAqB,IAAI,GACpC,IAAmB,EAA2B,IAAI,GAClD,IAAc,SAAe,EACjC,OAAO,GAAc,YAAY,CAAC,CAAC,OAAO,MAC5C,IAAI,CAAC,CAAC,GACA,IAAiB,EAAI,CAAqB,GAC1C,IAAmB,EAAI,EAAgB,GACvC,IAAmB,EAAS,IAAiB,MAAU,EAAM,gBAAgB,GAC7E,IAAa,EAAS,IAAiB,MAAU,EAAM,UAAU,GACjE,IAAkB,EAAS,IAAiB,MAAU,EAAM,eAAe,GAC3E,IAAmB,EAAS,IAAiB,MAAU,EAAM,gBAAgB,GAC7E,IAAsB,EAAS,IAAiB,MAAU,EAAM,cAAmC,EAAyB,SAAS,CAAC,GACtI,CAAC,GAAmB,KAAwB,EAAmC,IAAI,GAEnF,IAAkB,QACf,IACN,CAAC,CAAC,GAEC,IAAc,QACX,EAAc,eAAe,GAAkB,CAAe,GACpE,CAAC,GAAiB,CAAgB,CAAC,GAEhC,CAAC,GAAM,KAAW,EAA2B,EAAoB,SAAS,GAAkB,KAAK,EAAoB,WAAW,OAAO,IAAI,GAC3I,CAAC,GAAM,KAAW,EAA2B,EAAoB,SAAS,GAAkB,KAAK,EAAoB,WAAW,OAAO,IAAI,GAE3I,CAAC,GAAmB,KAAwB,EAA+C,IAAI,GAE/F,KAAwB,QAAkB;EAE9C,AADA,EAAqB,IAAI,GACzB,EAAqB,IAAI;CAC3B,GAAG,CAAC,CAAC,GAEC,IAAoB,QACjB,EAAc,aAAa,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