Open mys opened 6 years ago
I have found workaround which is brilliant and most efficient, because it updates only modified nodes/links and immediately.
.onNodeHover(node => {
node.__threeObj.parent <- (FromKapsule)
}
This is same as going through Graph.scene().children[(FromKapsule)]
FromKapsule children gives us access to all nodes and links in the Scene. I can modify chosen element (color, position or add new mesh) and it is saved and rendered without redrawing whole scene.
I will try to prepare Example how to use that because it could be an answer to some of questions (#26, #38, #39, #42, #61) where we deal with huge amount of data.
@mys I am very interested in this topic. I hope that there will be developments and examples in this regard. I also make use of this library with many nodes and links
@lucacinelli @rkalidhindi-tanium
https://rawgit.com/mys/3d-force-graph/node_modification/example/node-modification/index.html
This is what I was talking about. Without calling memory intensive state.sceneNeedsRepopulating
for all other objects.
Focusing at Highlight nodes/links (source) we can see that every
.onNodeHover
and.onLinkHover
sendsGraph.nodeRelSize(4); // trigger update of 3d objects in scene
to redraw the nodes/links. Looking at Chrome Task Manager every
nodeRelSize()
call grows RAM usage by a few megabytes. In my own visualization example I have hundreds of nodes and every call eats 50+ MB of RAM. I am using custom.nodeThreeObject
also. Is there any lighter call to update the nodes/links look?