feat(graph): network click → selectedNode + toggle on repeat

This commit is contained in:
Дмитрий
2026-05-15 06:24:06 +03:00
parent d2fa107d11
commit b9917a90d4
+7 -1
View File
@@ -1321,10 +1321,16 @@ function showEdgeLegend(edgeId) {
network.on('click', params => {
if (params.nodes.length === 1) {
showNodeLegend(params.nodes[0]);
const id = params.nodes[0];
HIGHLIGHT.setSelectedNode(id);
HIGHLIGHT.applyHighlight();
// Right panel still shows details of the clicked node (last-clicked, even after toggle-off)
showNodeLegend(id);
} else if (params.edges.length === 1) {
showEdgeLegend(params.edges[0]);
} else if (params.nodes.length === 0 && params.edges.length === 0) {
HIGHLIGHT.state.selectedNode = null;
HIGHLIGHT.applyHighlight();
document.getElementById('legend-panel').classList.remove('visible');
}
});