Update the node size of the expanded node
This commit is contained in:
parent
ebd73a54b9
commit
2ed5cdce5e
1 changed files with 11 additions and 0 deletions
|
|
@ -685,6 +685,17 @@ const useLightrangeGraph = () => {
|
||||||
// Update sizes for all nodes with discarded edges
|
// Update sizes for all nodes with discarded edges
|
||||||
updateNodeSizes(sigmaGraph, nodesWithDiscardedEdges, minDegree, maxDegree);
|
updateNodeSizes(sigmaGraph, nodesWithDiscardedEdges, minDegree, maxDegree);
|
||||||
|
|
||||||
|
if (sigmaGraph.hasNode(nodeId)) {
|
||||||
|
const finalDegree = sigmaGraph.degree(nodeId);
|
||||||
|
const limitedDegree = Math.min(finalDegree, maxDegree + 1);
|
||||||
|
const newSize = Math.round(
|
||||||
|
Constants.minNodeSize + scale * Math.pow((limitedDegree - minDegree) / range, 0.5)
|
||||||
|
);
|
||||||
|
sigmaGraph.setNodeAttribute(nodeId, 'size', newSize);
|
||||||
|
nodeToExpand.size = newSize;
|
||||||
|
nodeToExpand.degree = finalDegree;
|
||||||
|
}
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Error expanding node:', error);
|
console.error('Error expanding node:', error);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue