@milaboratories/graph-maker 1.1.154 → 1.1.156
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/GraphMaker/constantsCommon.d.ts +2 -0
- package/dist/GraphMaker/constantsCommon.d.ts.map +1 -1
- package/dist/GraphMaker/constantsCommon.js +29 -27
- package/dist/GraphMaker/constantsCommon.js.map +1 -1
- package/dist/GraphMaker/forms/AxesSettingsForm/HeatmapAxesSettingsForm.vue.d.ts.map +1 -1
- package/dist/GraphMaker/forms/AxesSettingsForm/HeatmapAxesSettingsForm.vue.js +215 -148
- package/dist/GraphMaker/forms/AxesSettingsForm/HeatmapAxesSettingsForm.vue.js.map +1 -1
- package/dist/GraphMaker/store.d.ts.map +1 -1
- package/dist/GraphMaker/store.js +59 -57
- package/dist/GraphMaker/store.js.map +1 -1
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeDendroSettings.d.ts +5 -0
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeDendroSettings.d.ts.map +1 -1
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeDiscreteSettings.d.ts +1 -0
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeDiscreteSettings.d.ts.map +1 -1
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeHeatmapSettings.d.ts +5 -0
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeHeatmapSettings.d.ts.map +1 -1
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeHeatmapSettings.js +24 -24
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeHeatmapSettings.js.map +1 -1
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeScatterplotSettings.d.ts +2 -0
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeScatterplotSettings.d.ts.map +1 -1
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeScatterplotUmapSettings.d.ts +2 -0
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeScatterplotUmapSettings.d.ts.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/MiPlots.js +22 -22
- package/dist/node_modules/@milaboratories/miplots4/dist/dendro/ChartRenderer.js +160 -156
- package/dist/node_modules/@milaboratories/miplots4/dist/dendro/ChartRenderer.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/dendro/DendroSettingsImpl.js +31 -27
- package/dist/node_modules/@milaboratories/miplots4/dist/dendro/DendroSettingsImpl.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/dendro/components/Chart.js +53 -53
- package/dist/node_modules/@milaboratories/miplots4/dist/dendro/components/Chart.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/dendro/getHierarchyData.js +30 -24
- package/dist/node_modules/@milaboratories/miplots4/dist/dendro/getHierarchyData.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/dendro/index.js +78 -77
- package/dist/node_modules/@milaboratories/miplots4/dist/dendro/index.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/ChartRenderer.js +267 -258
- package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/ChartRenderer.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/HeatmapSettingsImpl.js +59 -54
- package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/HeatmapSettingsImpl.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/components/Chart.js +91 -89
- package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/components/Chart.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/components/ChartsGroup.js +17 -17
- package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/getCells.js +98 -87
- package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/getCells.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/index.js +98 -76
- package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/index.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/utils/calculateCaptionTails.js +57 -57
- package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/utils/calculateCaptionTails.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/types/common.js +52 -51
- package/dist/node_modules/@milaboratories/miplots4/dist/types/common.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/types/dendro.js +13 -8
- package/dist/node_modules/@milaboratories/miplots4/dist/types/dendro.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/types/discrete.js +5 -5
- package/dist/node_modules/@milaboratories/miplots4/dist/types/heatmap.js +19 -11
- package/dist/node_modules/@milaboratories/miplots4/dist/types/heatmap.js.map +1 -1
- package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/ComponentController.js +6 -6
- package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/ComponentController.js.map +1 -1
- package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/ControllerBase.js +94 -91
- package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/ControllerBase.js.map +1 -1
- package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/controllersByChartType/heatmap.js +2 -2
- package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/controllersByChartType/heatmap.js.map +1 -1
- package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/controllersByChartType/scatterplot-umap.js +50 -49
- package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/controllersByChartType/scatterplot-umap.js.map +1 -1
- package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/controllersByChartType/scatterplot.js +15 -14
- package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/controllersByChartType/scatterplot.js.map +1 -1
- package/package.json +3 -3
|
@@ -1,52 +1,58 @@
|
|
|
1
|
-
import { l as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
function
|
|
5
|
-
|
|
6
|
-
const
|
|
1
|
+
import { l as m } from "../node_modules/lodash/lodash.js";
|
|
2
|
+
import g from "../node_modules/d3-hierarchy/src/stratify.js";
|
|
3
|
+
import H from "../node_modules/d3-array/src/max.js";
|
|
4
|
+
function x(a, r) {
|
|
5
|
+
a.sort((u, l) => {
|
|
6
|
+
const d = u.leaves().reduce((n, i) => Math.min(n, i.data.rawIndexes[0]), 1 / 0), t = l.leaves().reduce((n, i) => Math.min(n, i.data.rawIndexes[0]), 1 / 0);
|
|
7
|
+
return r === "indexAsc" ? d - t : t - d;
|
|
8
|
+
});
|
|
9
|
+
}
|
|
10
|
+
function F(a, r, u, l, d, t, n = !1) {
|
|
11
|
+
const i = m.groupBy(a.rowIndexes, (e) => a.getColumnValue(r, e)), o = Object.keys(i).map((e) => {
|
|
12
|
+
const c = i[e], p = c[0], f = a.getColumnValue(u, p), b = d ? m.uniq(c.map((C) => a.getColumnValue(d, C))).join(", ") : null, y = l ? Number(a.getColumnValue(l, p)) : 1;
|
|
7
13
|
return {
|
|
8
14
|
id: String(e),
|
|
9
|
-
parentId:
|
|
10
|
-
label:
|
|
11
|
-
height:
|
|
15
|
+
parentId: f === null ? null : String(f),
|
|
16
|
+
label: b,
|
|
17
|
+
height: y,
|
|
12
18
|
isFake: !1,
|
|
13
19
|
rawIndexes: c
|
|
14
20
|
// save source row data to avoid any modifications
|
|
15
21
|
};
|
|
16
|
-
}),
|
|
17
|
-
if (!
|
|
18
|
-
return
|
|
19
|
-
const
|
|
22
|
+
}), s = g().id((e) => e.id).parentId((e) => e.parentId)(o);
|
|
23
|
+
if (!n)
|
|
24
|
+
return t && x(s, t), s;
|
|
25
|
+
const I = new Set(s.leaves().map((e) => e.id)), w = o.filter((e) => !I.has(e.id)).map((e) => ({
|
|
20
26
|
id: `${e.id}_extra`,
|
|
21
27
|
parentId: e.id,
|
|
22
28
|
height: 0,
|
|
23
29
|
label: null,
|
|
24
30
|
isFake: !0,
|
|
25
31
|
rawIndexes: e.rawIndexes
|
|
26
|
-
})),
|
|
27
|
-
return
|
|
32
|
+
})), k = o.concat(w), h = g().id((e) => e.id).parentId((e) => e.parentId)(k);
|
|
33
|
+
return t && x(h, t), h;
|
|
28
34
|
}
|
|
29
|
-
function
|
|
35
|
+
function N(a, r, u = !1) {
|
|
30
36
|
a.data.height = 0;
|
|
31
|
-
function
|
|
37
|
+
function l(n) {
|
|
32
38
|
return n.data.height;
|
|
33
39
|
}
|
|
34
40
|
function d(n) {
|
|
35
|
-
return
|
|
41
|
+
return l(n) + (n.children ? H(n.children, d) : 0);
|
|
36
42
|
}
|
|
37
|
-
function
|
|
38
|
-
n.y = !n.children && u ? r : (
|
|
43
|
+
function t(n, i, o) {
|
|
44
|
+
n.y = !n.children && u ? r : (i += l(n)) * o, n.children && n.children.forEach((s) => t(s, i, o));
|
|
39
45
|
}
|
|
40
|
-
|
|
46
|
+
t(a, 0, r / d(a));
|
|
41
47
|
}
|
|
42
|
-
function
|
|
48
|
+
function S(a) {
|
|
43
49
|
a.descendants().forEach((r) => {
|
|
44
50
|
!r.children && r.data.isFake && r.parent && (r.parent.x = r.x);
|
|
45
51
|
});
|
|
46
52
|
}
|
|
47
53
|
export {
|
|
48
54
|
F as getHierarchy,
|
|
49
|
-
|
|
50
|
-
|
|
55
|
+
N as updateLinksHeight,
|
|
56
|
+
S as updateNodesHorizontalPosition
|
|
51
57
|
};
|
|
52
58
|
//# sourceMappingURL=getHierarchyData.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getHierarchyData.js","sources":["../../../../../../node_modules/@milaboratories/miplots4/src/dendro/getHierarchyData.ts"],"sourcesContent":["import { max as d3max } from 'd3-array';\nimport { type HierarchyPointNode, stratify } from 'd3-hierarchy';\nimport { groupBy, uniq } from 'lodash';\nimport type { DataFrame } from '../DataFrame';\n\nexport type TreeNodeData = {\n id: string;\n parentId: string | null;\n height: number;\n label: string | null;\n isFake: boolean; // true for additional nodes for mode with all nodes used as leaves\n rawIndexes: number[];\n};\n\nexport function getHierarchy(\n dataFrame: DataFrame,\n idKey: string,\n parentIdKey: string,\n heightIdKey: string | null,\n labelIdKey: string | null,\n useAllNodesAsLeaves = false\n) {\n const groupedByNodeId = groupBy(dataFrame.rowIndexes, idx => dataFrame.getColumnValue(idKey, idx));\n const uniqueKeys = Object.keys(groupedByNodeId);\n\n const uniqueNodeRows: TreeNodeData[] = uniqueKeys\n .map((key) => {\n const indexes = groupedByNodeId[key];\n const first = indexes[0]; // some values must be the same for every row with the same NodeId, we can take them from any row of group\n const parentId = dataFrame.getColumnValue(parentIdKey, first);\n const label = labelIdKey ? uniq(indexes.map(idx => dataFrame.getColumnValue(labelIdKey, idx))).join(', ') : null;\n const height = heightIdKey ? Number(dataFrame.getColumnValue(heightIdKey, first)) : 1;\n return ({\n id: String(key),\n parentId: parentId === null ? null : String(parentId),\n label,\n height,\n isFake: false,\n rawIndexes: indexes, // save source row data to avoid any modifications\n } as TreeNodeData);\n });\n const tree = stratify<TreeNodeData>()\n .id(d => d.id)\n .parentId(d => d.parentId)(uniqueNodeRows);\n if (!useAllNodesAsLeaves) {\n return tree;\n }\n // for tree layout with every node aligned by side rows\n const leavesIdSet = new Set(tree.leaves().map(node => node.id));\n const noLeafRows = uniqueNodeRows.filter(row => !leavesIdSet.has(row.id));\n const extraRows = noLeafRows.map(row => ({\n id: `${row.id}_extra`,\n parentId: row.id,\n height: 0,\n label: null,\n isFake: true,\n rawIndexes: row.rawIndexes,\n }));\n const expandedRows = uniqueNodeRows.concat(extraRows);\n
|
|
1
|
+
{"version":3,"file":"getHierarchyData.js","sources":["../../../../../../node_modules/@milaboratories/miplots4/src/dendro/getHierarchyData.ts"],"sourcesContent":["import { max as d3max } from 'd3-array';\nimport type { HierarchyNode } from 'd3-hierarchy';\nimport { type HierarchyPointNode, stratify } from 'd3-hierarchy';\nimport { groupBy, uniq } from 'lodash';\nimport type { DataFrame } from '../DataFrame';\nimport type { DendroSettingsImpl } from './DendroSettingsImpl';\n\nexport type TreeNodeData = {\n id: string;\n parentId: string | null;\n height: number;\n label: string | null;\n isFake: boolean; // true for additional nodes for mode with all nodes used as leaves\n rawIndexes: number[];\n};\n\n// make first leaves with first index in data\nfunction sortTree(tree: HierarchyNode<TreeNodeData>, direction: 'indexAsc' | 'indexDesc') {\n tree.sort((a, b) => {\n const aMinIdx = a.leaves().reduce((res, leaf) => Math.min(res, leaf.data.rawIndexes[0]), Infinity);\n const bMinIdx = b.leaves().reduce((res, leaf) => Math.min(res, leaf.data.rawIndexes[0]), Infinity);\n return direction === 'indexAsc' ? aMinIdx - bMinIdx : bMinIdx - aMinIdx;\n });\n}\n\nexport function getHierarchy(\n dataFrame: DataFrame,\n idKey: string,\n parentIdKey: string,\n heightIdKey: string | null,\n labelIdKey: string | null,\n leavesOrder: DendroSettingsImpl['leavesOrder'],\n useAllNodesAsLeaves = false\n) {\n const groupedByNodeId = groupBy(dataFrame.rowIndexes, idx => dataFrame.getColumnValue(idKey, idx));\n const uniqueKeys = Object.keys(groupedByNodeId);\n\n const uniqueNodeRows: TreeNodeData[] = uniqueKeys\n .map((key) => {\n const indexes = groupedByNodeId[key];\n const first = indexes[0]; // some values must be the same for every row with the same NodeId, we can take them from any row of group\n const parentId = dataFrame.getColumnValue(parentIdKey, first);\n const label = labelIdKey ? uniq(indexes.map(idx => dataFrame.getColumnValue(labelIdKey, idx))).join(', ') : null;\n const height = heightIdKey ? Number(dataFrame.getColumnValue(heightIdKey, first)) : 1;\n return ({\n id: String(key),\n parentId: parentId === null ? null : String(parentId),\n label,\n height,\n isFake: false,\n rawIndexes: indexes, // save source row data to avoid any modifications\n } as TreeNodeData);\n });\n const tree = stratify<TreeNodeData>()\n .id(d => d.id)\n .parentId(d => d.parentId)(uniqueNodeRows);\n if (!useAllNodesAsLeaves) {\n if (leavesOrder) {\n sortTree(tree, leavesOrder);\n }\n return tree;\n }\n // for tree layout with every node aligned by side rows\n const leavesIdSet = new Set(tree.leaves().map(node => node.id));\n const noLeafRows = uniqueNodeRows.filter(row => !leavesIdSet.has(row.id));\n const extraRows = noLeafRows.map(row => ({\n id: `${row.id}_extra`,\n parentId: row.id,\n height: 0,\n label: null,\n isFake: true,\n rawIndexes: row.rawIndexes,\n }));\n const expandedRows = uniqueNodeRows.concat(extraRows);\n const expandedTree = stratify<TreeNodeData>()\n .id(d => d.id)\n .parentId(d => d.parentId)(expandedRows);\n if (leavesOrder) {\n sortTree(expandedTree, leavesOrder);\n }\n return expandedTree;\n}\n\nexport function updateLinksHeight(root: HierarchyPointNode<TreeNodeData>, chartHeight: number, alignLeavesToLine = false) {\n root.data.height = 0;\n function heightGetter(d: HierarchyPointNode<TreeNodeData>) {\n return d.data.height;\n }\n\n function maxLength(d: HierarchyPointNode<TreeNodeData>): number {\n return heightGetter(d) + (d.children ? (d3max(d.children, maxLength) as number) : 0);\n }\n\n function setHeight(d: HierarchyPointNode<TreeNodeData>, y0: number, k: number) {\n d.y = !d.children && alignLeavesToLine ? chartHeight : (y0 += heightGetter(d)) * k;\n if (d.children) {\n d.children.forEach(d => setHeight(d, y0, k));\n }\n }\n\n setHeight(root, 0, chartHeight / maxLength(root));\n}\n\nexport function updateNodesHorizontalPosition(root: HierarchyPointNode<TreeNodeData>) {\n root.descendants().forEach((d: HierarchyPointNode<TreeNodeData>) => {\n if (!d.children && d.data.isFake && d.parent) {\n d.parent.x = d.x;\n }\n });\n}\n"],"names":["sortTree","tree","direction","a","b","aMinIdx","res","leaf","bMinIdx","getHierarchy","dataFrame","idKey","parentIdKey","heightIdKey","labelIdKey","leavesOrder","useAllNodesAsLeaves","groupedByNodeId","groupBy","idx","uniqueNodeRows","key","indexes","first","parentId","label","uniq","height","stratify","d","leavesIdSet","node","extraRows","row","expandedRows","expandedTree","updateLinksHeight","root","chartHeight","alignLeavesToLine","heightGetter","maxLength","d3max","setHeight","y0","k","updateNodesHorizontalPosition"],"mappings":";;;AAiBA,SAASA,EAASC,GAAmCC,GAAqC;AACtFD,EAAAA,EAAK,KAAK,CAACE,GAAGC,MAAM;AAChB,UAAMC,IAAUF,EAAE,OAAA,EAAS,OAAO,CAACG,GAAKC,MAAS,KAAK,IAAID,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_google_ignoreList":[0]}
|
|
@@ -1,41 +1,41 @@
|
|
|
1
|
-
import { l as
|
|
2
|
-
import { renderToString as
|
|
3
|
-
import { undefined as
|
|
4
|
-
import { AbstractChart as
|
|
5
|
-
import
|
|
6
|
-
import { USER_UPDATE_EVENT as
|
|
7
|
-
import { DendroSettingsImpl as
|
|
8
|
-
import { getHeatmapData as
|
|
9
|
-
import { getHierarchy as
|
|
10
|
-
var R = Object.defineProperty,
|
|
1
|
+
import { l as E } from "../node_modules/lodash/lodash.js";
|
|
2
|
+
import { renderToString as S } from "../node_modules/react-dom/server.browser.js";
|
|
3
|
+
import { undefined as b } from "../node_modules/zod/lib/index.js";
|
|
4
|
+
import { AbstractChart as A } from "../AbstractChart.js";
|
|
5
|
+
import _ from "./ChartRenderer.js";
|
|
6
|
+
import { USER_UPDATE_EVENT as w } from "./constants.js";
|
|
7
|
+
import { DendroSettingsImpl as C } from "./DendroSettingsImpl.js";
|
|
8
|
+
import { getHeatmapData as L } from "./getHeatmapData.js";
|
|
9
|
+
import { getHierarchy as N } from "./getHierarchyData.js";
|
|
10
|
+
var R = Object.defineProperty, I = (i, e, t) => e in i ? R(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t, v = (i, e, t) => I(i, typeof e != "symbol" ? e + "" : e, t);
|
|
11
11
|
function g(i) {
|
|
12
12
|
return typeof i != "object" ? !1 : "valuesMap" in i;
|
|
13
13
|
}
|
|
14
|
-
function
|
|
15
|
-
const { nodeColor: t, nodeShape:
|
|
14
|
+
function D(i, e) {
|
|
15
|
+
const { nodeColor: t, nodeShape: r, lineColor: n } = e, d = [t, r, n].filter(
|
|
16
16
|
g
|
|
17
17
|
);
|
|
18
|
-
return
|
|
19
|
-
const { columnName:
|
|
20
|
-
(
|
|
21
|
-
),
|
|
22
|
-
return g(t) &&
|
|
23
|
-
|
|
24
|
-
})), g(
|
|
25
|
-
|
|
26
|
-
})), g(
|
|
27
|
-
|
|
28
|
-
})), l
|
|
29
|
-
values:
|
|
30
|
-
usedAes: [...
|
|
31
|
-
aesMap:
|
|
32
|
-
labels:
|
|
33
|
-
},
|
|
18
|
+
return E.uniqBy(d, (o) => o.columnName.value).reduce((o, m) => {
|
|
19
|
+
const { columnName: l } = m, s = i.getColumnCategories(l.value, !1), p = (a) => String(
|
|
20
|
+
(l.valueLabels ? i.getColumnValue(l.valueLabels, i.getColumnCategoryRowIndex(l.value, a)) : b) ?? a
|
|
21
|
+
), h = /* @__PURE__ */ new Set(), u = s.reduce((a, c) => (a[c] || (a[c] = {}), a), {});
|
|
22
|
+
return g(t) && l.value === t.columnName.value && (h.add("dotFill"), s.forEach((a) => {
|
|
23
|
+
u[a].dotFill = t.valuesMap[a];
|
|
24
|
+
})), g(r) && l.value === r.columnName.value && (h.add("dotShape"), s.forEach((a) => {
|
|
25
|
+
u[a].dotShape = r.valuesMap[a];
|
|
26
|
+
})), g(n) && l.value === n.columnName.value && (h.add("lineColor"), s.forEach((a) => {
|
|
27
|
+
u[a].lineColor = n.valuesMap[a];
|
|
28
|
+
})), o[l.value] = {
|
|
29
|
+
values: s.sort(),
|
|
30
|
+
usedAes: [...h],
|
|
31
|
+
aesMap: u,
|
|
32
|
+
labels: s.reduce((a, c) => (a[c] = p(c), a), {})
|
|
33
|
+
}, o;
|
|
34
34
|
}, {});
|
|
35
35
|
}
|
|
36
|
-
class
|
|
37
|
-
constructor(e, t,
|
|
38
|
-
super(e, t), v(this, "settings"), v(this, "onClick", () =>
|
|
36
|
+
class F extends A {
|
|
37
|
+
constructor(e, t, r) {
|
|
38
|
+
super(e, t), v(this, "settings"), v(this, "onClick", () => b), v(this, "chartRenderer", new _()), v(this, "calculatedData", null), this.settings = new C(t), r && (this.onClick = r[0]);
|
|
39
39
|
}
|
|
40
40
|
mount(e) {
|
|
41
41
|
try {
|
|
@@ -49,54 +49,55 @@ class z extends S {
|
|
|
49
49
|
}
|
|
50
50
|
updateSettingsAndData(e, t) {
|
|
51
51
|
try {
|
|
52
|
-
const
|
|
53
|
-
this.settings = new
|
|
54
|
-
} catch (
|
|
55
|
-
this.hasError = !0,
|
|
52
|
+
const r = this.settings, n = this.data;
|
|
53
|
+
this.settings = new C(t), this.data = e, this._needUpdateCalculatedDataBySettings(r, this.settings) || this._needUpdateCalculatedDataByData(n, this.data) ? this._updateData() : this._updateAesInData(), this._updateChart(), this.hasError = !1;
|
|
54
|
+
} catch (r) {
|
|
55
|
+
this.hasError = !0, r instanceof Error && (this.chartRenderer.renderError(r.message), console.error(r));
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
58
|
updateChartState(e, t) {
|
|
59
59
|
if (document) {
|
|
60
|
-
const
|
|
61
|
-
document.dispatchEvent(
|
|
60
|
+
const r = new CustomEvent(w, { detail: { [e]: t } });
|
|
61
|
+
document.dispatchEvent(r);
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
64
|
export() {
|
|
65
|
-
return this._updateChart(),
|
|
65
|
+
return this._updateChart(), S(this.chartRenderer.component);
|
|
66
66
|
}
|
|
67
67
|
_needUpdateCalculatedDataBySettings(e, t) {
|
|
68
|
-
var
|
|
69
|
-
const { mode:
|
|
70
|
-
function u
|
|
71
|
-
return
|
|
68
|
+
var r, n;
|
|
69
|
+
const { mode: d, id: o, parentId: m, heatmapAnnotation: l, heatmapAxis: s, heatmapGroup: p } = t;
|
|
70
|
+
function h(u, a) {
|
|
71
|
+
return u.length !== a.length || u.some((c, f) => c.value !== a[f].value);
|
|
72
72
|
}
|
|
73
|
-
return e.mode !==
|
|
73
|
+
return e.mode !== d || e.id.value !== o.value || e.parentId.value !== m.value || ((r = e.heatmapAnnotation) == null ? void 0 : r.value) !== (l == null ? void 0 : l.value) || ((n = e.heatmapAxis) == null ? void 0 : n.value) !== (s == null ? void 0 : s.value) || h(e.heatmapGroup, p);
|
|
74
74
|
}
|
|
75
75
|
_needUpdateCalculatedDataByData(e, t) {
|
|
76
|
-
const
|
|
77
|
-
return e.id !== t.id ||
|
|
78
|
-
var
|
|
79
|
-
return e.data[
|
|
76
|
+
const r = Object.keys(e.data), n = Object.keys(t.data);
|
|
77
|
+
return e.id !== t.id || r.length !== n.length || r.some((d) => {
|
|
78
|
+
var o;
|
|
79
|
+
return e.data[d].length !== ((o = t.data[d]) == null ? void 0 : o.length);
|
|
80
80
|
});
|
|
81
81
|
}
|
|
82
82
|
_updateData() {
|
|
83
|
-
const { mode: e, id: t, parentId:
|
|
83
|
+
const { mode: e, id: t, parentId: r, aes: n, heatmapAnnotation: d, heatmapAxis: o, heatmapGroup: m, heatmapSettings: l, height: s, labels: p, leavesOrder: h } = this.settings, u = s != null && s.value ? this.data.getColumn(s.value).some((y) => Number(y) > 0) : !1, a = N(
|
|
84
84
|
this.data,
|
|
85
85
|
t.value,
|
|
86
|
-
|
|
87
|
-
(
|
|
88
|
-
|
|
86
|
+
r.value,
|
|
87
|
+
u ? (s == null ? void 0 : s.value) ?? null : null,
|
|
88
|
+
p.valueLabels ?? p.value ?? null,
|
|
89
|
+
h,
|
|
89
90
|
e === "useAllNodesAsLeaves"
|
|
90
|
-
),
|
|
91
|
+
), c = L(this.data, l.valueType, d, o, m, t, a), f = D(this.data, n);
|
|
91
92
|
this.calculatedData = {
|
|
92
93
|
chartSizes: this.chartRenderer.chartSizes,
|
|
93
|
-
hierarchy:
|
|
94
|
-
heatmapData:
|
|
95
|
-
legendLabels:
|
|
94
|
+
hierarchy: a,
|
|
95
|
+
heatmapData: c,
|
|
96
|
+
legendLabels: f
|
|
96
97
|
};
|
|
97
98
|
}
|
|
98
99
|
_updateAesInData() {
|
|
99
|
-
this.calculatedData && (this.calculatedData.legendLabels =
|
|
100
|
+
this.calculatedData && (this.calculatedData.legendLabels = D(this.data, this.settings.aes));
|
|
100
101
|
}
|
|
101
102
|
_updateChart() {
|
|
102
103
|
if (!this.calculatedData)
|
|
@@ -104,41 +105,41 @@ class z extends S {
|
|
|
104
105
|
const {
|
|
105
106
|
heatmapAnnotation: e,
|
|
106
107
|
chartSettings: t,
|
|
107
|
-
connectionType:
|
|
108
|
-
edgeInheritance:
|
|
109
|
-
rootPosition:
|
|
110
|
-
showNodes:
|
|
111
|
-
showEdges:
|
|
112
|
-
showLeavesLabels:
|
|
113
|
-
showNodesLabels:
|
|
114
|
-
aes:
|
|
115
|
-
labels:
|
|
116
|
-
heatmapSettings:
|
|
117
|
-
leavesMode:
|
|
108
|
+
connectionType: r,
|
|
109
|
+
edgeInheritance: n,
|
|
110
|
+
rootPosition: d,
|
|
111
|
+
showNodes: o,
|
|
112
|
+
showEdges: m,
|
|
113
|
+
showLeavesLabels: l,
|
|
114
|
+
showNodesLabels: s,
|
|
115
|
+
aes: p,
|
|
116
|
+
labels: h,
|
|
117
|
+
heatmapSettings: u,
|
|
118
|
+
leavesMode: a
|
|
118
119
|
} = this.settings;
|
|
119
120
|
this.chartRenderer.render(
|
|
120
121
|
this.data,
|
|
121
122
|
t,
|
|
122
123
|
this.calculatedData.hierarchy,
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
s,
|
|
126
|
-
l,
|
|
127
|
-
p,
|
|
124
|
+
r,
|
|
125
|
+
d,
|
|
128
126
|
n,
|
|
129
127
|
o,
|
|
130
|
-
|
|
131
|
-
|
|
128
|
+
m,
|
|
129
|
+
l,
|
|
130
|
+
s,
|
|
131
|
+
p,
|
|
132
|
+
h,
|
|
132
133
|
e,
|
|
133
134
|
this.calculatedData.heatmapData,
|
|
134
|
-
|
|
135
|
+
u,
|
|
135
136
|
this.calculatedData.legendLabels,
|
|
136
|
-
|
|
137
|
+
a,
|
|
137
138
|
this.onClick
|
|
138
139
|
);
|
|
139
140
|
}
|
|
140
141
|
}
|
|
141
142
|
export {
|
|
142
|
-
|
|
143
|
+
F as ChartDendro
|
|
143
144
|
};
|
|
144
145
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../../node_modules/@milaboratories/miplots4/src/dendro/index.ts"],"sourcesContent":["import type { HierarchyNode } from 'd3-hierarchy';\nimport { uniqBy } from 'lodash';\nimport { renderToString } from 'react-dom/server';\nimport { undefined } from 'zod';\nimport { AbstractChart } from '../AbstractChart';\nimport type { DataFrame } from '../DataFrame';\nimport type {\n AesItem,\n AesRecord,\n CategoricalAesFromColumn,\n Category,\n ClickEventData,\n ColumnName,\n ContinuousAesFromColumn,\n DendroEventHandlers,\n DendroLegendInfo,\n DendroSettings,\n LineShape,\n PointShape\n} from '../types';\nimport ChartRenderer from './ChartRenderer';\nimport type { ChartSizes } from './components/types';\nimport { USER_UPDATE_EVENT } from './constants';\nimport { DendroSettingsImpl } from './DendroSettingsImpl';\nimport type { HeatmapData } from './getHeatmapData';\nimport { getHeatmapData } from './getHeatmapData';\nimport type { TreeNodeData } from './getHierarchyData';\nimport { getHierarchy } from './getHierarchyData';\n\nfunction isCategoricalAes<InputType extends string | number | PointShape | LineShape>(\n item: InputType | CategoricalAesFromColumn<InputType> | ContinuousAesFromColumn<InputType>\n): item is CategoricalAesFromColumn<InputType> {\n if (typeof item !== 'object') {\n return false;\n }\n return 'valuesMap' in item;\n}\nfunction getLegendLabelsMap(data: DataFrame, aes: DendroSettingsImpl['aes']): DendroLegendInfo {\n const {nodeColor, nodeShape, lineColor} = aes;\n const aesGrouping: CategoricalAesFromColumn<string | PointShape>[] = [nodeColor, nodeShape, lineColor].filter(\n isCategoricalAes\n );\n const uniqueColumns = uniqBy(aesGrouping, item => item.columnName.value);\n return uniqueColumns.reduce((res: DendroLegendInfo, item) => {\n const {columnName} = item;\n const categories = data.getColumnCategories(columnName.value, false);\n const getValueLabel = (category: Category) => String(\n (columnName.valueLabels\n ? data.getColumnValue(columnName.valueLabels, data.getColumnCategoryRowIndex(columnName.value, category))\n : undefined\n ) ?? category\n );\n\n const usedAes = new Set<keyof AesItem>();\n const aesMap: AesRecord = categories.reduce((res: AesRecord, category) => {\n if (!res[category]) {\n res[category] = {} as AesItem;\n }\n return res;\n }, {});\n if (isCategoricalAes(nodeColor) && columnName.value === nodeColor.columnName.value) {\n usedAes.add('dotFill');\n categories.forEach(category => {\n aesMap[category]['dotFill'] = nodeColor.valuesMap[category];\n });\n }\n if (isCategoricalAes(nodeShape) && columnName.value === nodeShape.columnName.value) {\n usedAes.add('dotShape');\n categories.forEach(category => {\n aesMap[category]['dotShape'] = nodeShape.valuesMap[category];\n });\n }\n if (isCategoricalAes(lineColor) && columnName.value === lineColor.columnName.value) {\n usedAes.add('lineColor');\n categories.forEach(category => {\n aesMap[category]['lineColor'] = lineColor.valuesMap[category];\n });\n }\n res[columnName.value] = {\n values: categories.sort(),\n usedAes: [...usedAes],\n aesMap,\n labels: categories.reduce((res: Record<string, string>, category) => {\n res[category] = getValueLabel(category);\n return res;\n }, {}),\n };\n return res;\n }, {});\n}\n\nexport class ChartDendro extends AbstractChart {\n settings: DendroSettingsImpl;\n onClick: (data: ClickEventData) => void = () => undefined;\n chartRenderer = new ChartRenderer();\n\n calculatedData: {\n chartSizes: ChartSizes;\n hierarchy: HierarchyNode<TreeNodeData>;\n heatmapData: HeatmapData | null;\n legendLabels: DendroLegendInfo;\n } | null = null;\n\n constructor(data: DataFrame, settings: DendroSettings, eventHandlers?: DendroEventHandlers) {\n super(data, settings);\n\n this.settings = new DendroSettingsImpl(settings);\n if (eventHandlers) {\n this.onClick = eventHandlers[0];\n }\n }\n\n mount(node: HTMLElement) {\n try {\n this.chartRenderer.init(node);\n this._updateData();\n this._updateChart();\n this.hasError = false;\n } catch (err) {\n this.hasError = true;\n if (err instanceof Error) {\n this.chartRenderer.renderError(err.message as string);\n console.error(err);\n }\n }\n }\n\n unmount() {\n this.chartRenderer.clear();\n }\n\n updateSettingsAndData(data: DataFrame, settings: DendroSettings) {\n try {\n const previousSettings = this.settings;\n const previousData = this.data;\n this.settings = new DendroSettingsImpl(settings);\n this.data = data;\n if (\n this._needUpdateCalculatedDataBySettings(previousSettings, this.settings) ||\n this._needUpdateCalculatedDataByData(previousData, this.data)\n ) {\n this._updateData();\n } else {\n this._updateAesInData();\n }\n this._updateChart();\n this.hasError = false;\n } catch (err) {\n this.hasError = true;\n if (err instanceof Error) {\n this.chartRenderer.renderError(err.message as string);\n console.error(err);\n }\n }\n }\n\n updateChartState(field: string, value: unknown) {\n if (document) {\n const event = new CustomEvent(USER_UPDATE_EVENT, {detail: {[field]: value}});\n document.dispatchEvent(event);\n }\n }\n\n export(): string {\n this._updateChart();\n return renderToString(this.chartRenderer.component);\n }\n\n _needUpdateCalculatedDataBySettings(prevSettings: DendroSettingsImpl, settings: DendroSettingsImpl) {\n const {mode, id, parentId, heatmapAnnotation, heatmapAxis, heatmapGroup} = settings;\n\n function compareColumnGroups(columns1: ColumnName[], columns2: ColumnName[]) {\n return (\n columns1.length !== columns2.length ||\n columns1.some((column, idx) => column.value !== columns2[idx].value)\n );\n }\n\n return (\n prevSettings.mode !== mode ||\n prevSettings.id.value !== id.value ||\n prevSettings.parentId.value !== parentId.value ||\n prevSettings.heatmapAnnotation?.value !== heatmapAnnotation?.value ||\n prevSettings.heatmapAxis?.value !== heatmapAxis?.value ||\n compareColumnGroups(prevSettings.heatmapGroup, heatmapGroup)\n );\n }\n\n _needUpdateCalculatedDataByData(prevData: DataFrame, data: DataFrame) {\n const prevKeys = Object.keys(prevData.data);\n const keys = Object.keys(data.data);\n return (\n prevData.id !== data.id ||\n prevKeys.length !== keys.length ||\n prevKeys.some(key => prevData.data[key].length !== data.data[key]?.length)\n );\n }\n\n _updateData() {\n const {mode, id, parentId, aes, heatmapAnnotation, heatmapAxis, heatmapGroup, heatmapSettings, height, labels} = this.settings;\n const hierarchy = getHierarchy(\n this.data,\n id.value,\n parentId.value,\n height?.value ?? null,\n labels.valueLabels ?? labels.value ?? null,\n mode === 'useAllNodesAsLeaves'\n );\n const heatmapData = getHeatmapData(this.data, heatmapSettings.valueType, heatmapAnnotation, heatmapAxis, heatmapGroup, id, hierarchy);\n\n const legendLabels = getLegendLabelsMap(this.data, aes);\n\n this.calculatedData = {\n chartSizes: this.chartRenderer.chartSizes,\n hierarchy,\n heatmapData,\n legendLabels,\n };\n }\n\n _updateAesInData() {\n if (!this.calculatedData) {\n return;\n }\n this.calculatedData.legendLabels = getLegendLabelsMap(this.data, this.settings.aes);\n }\n\n _updateChart() {\n if (!this.calculatedData) {\n return;\n }\n const {\n heatmapAnnotation,\n chartSettings,\n connectionType,\n edgeInheritance,\n rootPosition,\n showNodes,\n showEdges,\n showLeavesLabels,\n showNodesLabels,\n aes,\n labels,\n heatmapSettings,\n leavesMode\n } = this.settings;\n\n this.chartRenderer.render(\n this.data,\n chartSettings,\n this.calculatedData.hierarchy,\n connectionType,\n rootPosition,\n edgeInheritance,\n showNodes,\n showEdges,\n showLeavesLabels,\n showNodesLabels,\n aes,\n labels,\n heatmapAnnotation,\n this.calculatedData.heatmapData,\n heatmapSettings,\n this.calculatedData.legendLabels,\n leavesMode,\n this.onClick\n );\n }\n}\n"],"names":["isCategoricalAes","item","getLegendLabelsMap","data","aes","nodeColor","nodeShape","lineColor","aesGrouping","uniqBy","res","columnName","categories","getValueLabel","category","undefined","usedAes","aesMap","ChartDendro","AbstractChart","settings","eventHandlers","__publicField","ChartRenderer","DendroSettingsImpl","node","err","previousSettings","previousData","field","value","event","USER_UPDATE_EVENT","renderToString","prevSettings","mode","id","parentId","heatmapAnnotation","heatmapAxis","heatmapGroup","compareColumnGroups","columns1","columns2","column","idx","_a","_b","prevData","prevKeys","keys","c","key","heatmapSettings","height","labels","hierarchy","getHierarchy","heatmapData","getHeatmapData","legendLabels","chartSettings","connectionType","edgeInheritance","rootPosition","showNodes","showEdges","showLeavesLabels","showNodesLabels","leavesMode"],"mappings":";;;;;;;;;;AA6BA,SAASA,EACLC,GAC2C;AAC3C,SAAI,OAAOA,KAAS,WACT,KAEJ,eAAeA;AAC1B;AACA,SAASC,EAAmBC,GAAiBC,GAAkD;AAC3F,QAAM,EAAC,WAAAC,GAAW,WAAAC,GAAW,WAAAC,EAAAA,IAAaH,GACpCI,IAA+D,CAACH,GAAWC,GAAWC,CAAS,EAAE;AAAA,IACnG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AA,MACAC;AAAAA,MACAC;AAAAA,MACAC;AAAAA,MACAhE;AAAAA,MACAmD;AAAAA,MACAjB;AAAAA,MACA,KAAK,eAAe;AAAA,MACpBe;AAAAA,MACA,KAAK,eAAe;AAAA,MACpBgB;AAAAA,MACA,KAAK;AAAA,IAAA;AAAA,EAEb;AACJ;","x_google_ignoreList":[0]}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../../node_modules/@milaboratories/miplots4/src/dendro/index.ts"],"sourcesContent":["import type { HierarchyNode } from 'd3-hierarchy';\nimport { uniqBy } from 'lodash';\nimport { renderToString } from 'react-dom/server';\nimport { undefined } from 'zod';\nimport { AbstractChart } from '../AbstractChart';\nimport type { DataFrame } from '../DataFrame';\nimport type {\n AesItem,\n AesRecord,\n CategoricalAesFromColumn,\n Category,\n ClickEventData,\n ColumnName,\n ContinuousAesFromColumn,\n DendroEventHandlers,\n DendroLegendInfo,\n DendroSettings,\n LineShape,\n PointShape\n} from '../types';\nimport ChartRenderer from './ChartRenderer';\nimport type { ChartSizes } from './components/types';\nimport { USER_UPDATE_EVENT } from './constants';\nimport { DendroSettingsImpl } from './DendroSettingsImpl';\nimport type { HeatmapData } from './getHeatmapData';\nimport { getHeatmapData } from './getHeatmapData';\nimport type { TreeNodeData } from './getHierarchyData';\nimport { getHierarchy } from './getHierarchyData';\n\nfunction isCategoricalAes<InputType extends string | number | PointShape | LineShape>(\n item: InputType | CategoricalAesFromColumn<InputType> | ContinuousAesFromColumn<InputType>\n): item is CategoricalAesFromColumn<InputType> {\n if (typeof item !== 'object') {\n return false;\n }\n return 'valuesMap' in item;\n}\nfunction getLegendLabelsMap(data: DataFrame, aes: DendroSettingsImpl['aes']): DendroLegendInfo {\n const {nodeColor, nodeShape, lineColor} = aes;\n const aesGrouping: CategoricalAesFromColumn<string | PointShape>[] = [nodeColor, nodeShape, lineColor].filter(\n isCategoricalAes\n );\n const uniqueColumns = uniqBy(aesGrouping, item => item.columnName.value);\n return uniqueColumns.reduce((res: DendroLegendInfo, item) => {\n const {columnName} = item;\n const categories = data.getColumnCategories(columnName.value, false);\n const getValueLabel = (category: Category) => String(\n (columnName.valueLabels\n ? data.getColumnValue(columnName.valueLabels, data.getColumnCategoryRowIndex(columnName.value, category))\n : undefined\n ) ?? category\n );\n\n const usedAes = new Set<keyof AesItem>();\n const aesMap: AesRecord = categories.reduce((res: AesRecord, category) => {\n if (!res[category]) {\n res[category] = {} as AesItem;\n }\n return res;\n }, {});\n if (isCategoricalAes(nodeColor) && columnName.value === nodeColor.columnName.value) {\n usedAes.add('dotFill');\n categories.forEach(category => {\n aesMap[category]['dotFill'] = nodeColor.valuesMap[category];\n });\n }\n if (isCategoricalAes(nodeShape) && columnName.value === nodeShape.columnName.value) {\n usedAes.add('dotShape');\n categories.forEach(category => {\n aesMap[category]['dotShape'] = nodeShape.valuesMap[category];\n });\n }\n if (isCategoricalAes(lineColor) && columnName.value === lineColor.columnName.value) {\n usedAes.add('lineColor');\n categories.forEach(category => {\n aesMap[category]['lineColor'] = lineColor.valuesMap[category];\n });\n }\n res[columnName.value] = {\n values: categories.sort(),\n usedAes: [...usedAes],\n aesMap,\n labels: categories.reduce((res: Record<string, string>, category) => {\n res[category] = getValueLabel(category);\n return res;\n }, {}),\n };\n return res;\n }, {});\n}\n\nexport class ChartDendro extends AbstractChart {\n settings: DendroSettingsImpl;\n onClick: (data: ClickEventData) => void = () => undefined;\n chartRenderer = new ChartRenderer();\n\n calculatedData: {\n chartSizes: ChartSizes;\n hierarchy: HierarchyNode<TreeNodeData>;\n heatmapData: HeatmapData | null;\n legendLabels: DendroLegendInfo;\n } | null = null;\n\n constructor(data: DataFrame, settings: DendroSettings, eventHandlers?: DendroEventHandlers) {\n super(data, settings);\n\n this.settings = new DendroSettingsImpl(settings);\n if (eventHandlers) {\n this.onClick = eventHandlers[0];\n }\n }\n\n mount(node: HTMLElement) {\n try {\n this.chartRenderer.init(node);\n this._updateData();\n this._updateChart();\n this.hasError = false;\n } catch (err) {\n this.hasError = true;\n if (err instanceof Error) {\n this.chartRenderer.renderError(err.message as string);\n console.error(err);\n }\n }\n }\n\n unmount() {\n this.chartRenderer.clear();\n }\n\n updateSettingsAndData(data: DataFrame, settings: DendroSettings) {\n try {\n const previousSettings = this.settings;\n const previousData = this.data;\n this.settings = new DendroSettingsImpl(settings);\n this.data = data;\n if (\n this._needUpdateCalculatedDataBySettings(previousSettings, this.settings) ||\n this._needUpdateCalculatedDataByData(previousData, this.data)\n ) {\n this._updateData();\n } else {\n this._updateAesInData();\n }\n this._updateChart();\n this.hasError = false;\n } catch (err) {\n this.hasError = true;\n if (err instanceof Error) {\n this.chartRenderer.renderError(err.message as string);\n console.error(err);\n }\n }\n }\n\n updateChartState(field: string, value: unknown) {\n if (document) {\n const event = new CustomEvent(USER_UPDATE_EVENT, {detail: {[field]: value}});\n document.dispatchEvent(event);\n }\n }\n\n export(): string {\n this._updateChart();\n return renderToString(this.chartRenderer.component);\n }\n\n _needUpdateCalculatedDataBySettings(prevSettings: DendroSettingsImpl, settings: DendroSettingsImpl) {\n const {mode, id, parentId, heatmapAnnotation, heatmapAxis, heatmapGroup} = settings;\n\n function compareColumnGroups(columns1: ColumnName[], columns2: ColumnName[]) {\n return (\n columns1.length !== columns2.length ||\n columns1.some((column, idx) => column.value !== columns2[idx].value)\n );\n }\n\n return (\n prevSettings.mode !== mode ||\n prevSettings.id.value !== id.value ||\n prevSettings.parentId.value !== parentId.value ||\n prevSettings.heatmapAnnotation?.value !== heatmapAnnotation?.value ||\n prevSettings.heatmapAxis?.value !== heatmapAxis?.value ||\n compareColumnGroups(prevSettings.heatmapGroup, heatmapGroup)\n );\n }\n\n _needUpdateCalculatedDataByData(prevData: DataFrame, data: DataFrame) {\n const prevKeys = Object.keys(prevData.data);\n const keys = Object.keys(data.data);\n return (\n prevData.id !== data.id ||\n prevKeys.length !== keys.length ||\n prevKeys.some(key => prevData.data[key].length !== data.data[key]?.length)\n );\n }\n\n _updateData() {\n const {mode, id, parentId, aes, heatmapAnnotation, heatmapAxis, heatmapGroup, heatmapSettings, height, labels, leavesOrder} = this.settings;\n const useDistances = height?.value ? this.data.getColumn(height.value).some(v => Number(v) > 0) : false;\n\n const hierarchy = getHierarchy(\n this.data,\n id.value,\n parentId.value,\n useDistances ? height?.value ?? null : null,\n labels.valueLabels ?? labels.value ?? null,\n leavesOrder,\n mode === 'useAllNodesAsLeaves'\n );\n\n const heatmapData = getHeatmapData(this.data, heatmapSettings.valueType, heatmapAnnotation, heatmapAxis, heatmapGroup, id, hierarchy);\n\n const legendLabels = getLegendLabelsMap(this.data, aes);\n\n this.calculatedData = {\n chartSizes: this.chartRenderer.chartSizes,\n hierarchy,\n heatmapData,\n legendLabels\n };\n }\n\n _updateAesInData() {\n if (!this.calculatedData) {\n return;\n }\n this.calculatedData.legendLabels = getLegendLabelsMap(this.data, this.settings.aes);\n }\n\n _updateChart() {\n if (!this.calculatedData) {\n return;\n }\n const {\n heatmapAnnotation,\n chartSettings,\n connectionType,\n edgeInheritance,\n rootPosition,\n showNodes,\n showEdges,\n showLeavesLabels,\n showNodesLabels,\n aes,\n labels,\n heatmapSettings,\n leavesMode\n } = this.settings;\n\n this.chartRenderer.render(\n this.data,\n chartSettings,\n this.calculatedData.hierarchy,\n connectionType,\n rootPosition,\n edgeInheritance,\n showNodes,\n showEdges,\n showLeavesLabels,\n showNodesLabels,\n aes,\n labels,\n heatmapAnnotation,\n this.calculatedData.heatmapData,\n heatmapSettings,\n this.calculatedData.legendLabels,\n leavesMode,\n this.onClick\n );\n }\n}\n"],"names":["isCategoricalAes","item","getLegendLabelsMap","data","aes","nodeColor","nodeShape","lineColor","aesGrouping","uniqBy","res","columnName","categories","getValueLabel","category","undefined","usedAes","aesMap","ChartDendro","AbstractChart","settings","eventHandlers","__publicField","ChartRenderer","DendroSettingsImpl","node","err","previousSettings","previousData","field","value","event","USER_UPDATE_EVENT","renderToString","prevSettings","mode","id","parentId","heatmapAnnotation","heatmapAxis","heatmapGroup","compareColumnGroups","columns1","columns2","column","idx","_a","_b","prevData","prevKeys","keys","c","key","heatmapSettings","height","labels","leavesOrder","useDistances","v","hierarchy","getHierarchy","heatmapData","getHeatmapData","legendLabels","chartSettings","connectionType","edgeInheritance","rootPosition","showNodes","showEdges","showLeavesLabels","showNodesLabels","leavesMode"],"mappings":";;;;;;;;;;AA6BA,SAASA,EACLC,GAC2C;AAC3C,SAAI,OAAOA,KAAS,WACT,KAEJ,eAAeA;AAC1B;AACA,SAASC,EAAmBC,GAAiBC,GAAkD;AAC3F,QAAM,EAAC,WAAAC,GAAW,WAAAC,GAAW,WAAAC,EAAAA,IAAaH,GACpCI,IAA+D,CAACH,GAAWC,GAAWC,CAAS,EAAE;AAAA,IACnGP;AAAAA,EAAA;AAGJ,SADsBS,EAAAA,OAAOD,GAAa,CAAAP,MAAQA,EAAK,WAAW,KAAK,EAClD,OAAO,CAACS,GAAuBT,MAAS;AACzD,UAAM,EAAC,YAAAU,EAAAA,IAAcV,GACfW,IAAaT,EAAK,oBAAoBQ,EAAW,OAAO,EAAK,GAC7DE,IAAgB,CAACC,MAAuB;AAAA,OACzCH,EAAW,cACNR,EAAK,eAAeQ,EAAW,aAAaR,EAAK,0BAA0BQ,EAAW,OAAOG,CAAQ,CAAC,IACtGC,MACDD;AAAAA,IAAA,GAGHE,wBAAc,IAAA,GACdC,IAAoBL,EAAW,OAAO,CAACF,GAAgBI,OACpDJ,EAAII,CAAQ,MACbJ,EAAII,CAAQ,IAAI,CAAA,IAEbJ,IACR,EAAE;AACL,WAAIV,EAAiBK,CAAS,KAAKM,EAAW,UAAUN,EAAU,WAAW,UACzEW,EAAQ,IAAI,SAAS,GACrBJ,EAAW,QAAQ,CAAAE,MAAY;AAC3BG,MAAAA,EAAOH,CAAQ,EAAE,UAAaT,EAAU,UAAUS,CAAQ;AAAA,IAC9D,CAAC,IAEDd,EAAiBM,CAAS,KAAKK,EAAW,UAAUL,EAAU,WAAW,UACzEU,EAAQ,IAAI,UAAU,GACtBJ,EAAW,QAA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