react-force-graph icon indicating copy to clipboard operation
react-force-graph copied to clipboard

Performance Optimization when rendering more than 12k elements

Open nirmal495 opened this issue 6 years ago • 5 comments

Hi,

I am trying to render 5k nodes and 7k links using the 3d force graph. The performance significantly drops after 7k elements are rendered. Tried adding nodes dynamically but the same thing happens. Is there any option to extract more performance for drawing large graphs?

nirmal495 avatar Sep 09 '20 08:09 nirmal495

I am interested in this as well . We have to build in 15k elements and was hoping if there are any other suggestions for optimizations we can do to reduce lags when one has so many elements .

  1. During loading
  2. During interactions etc.

Please do let us know

Leothorn avatar Sep 15 '20 07:09 Leothorn

There are various performance calibrations that can be used to ease the rendering of larger graphs. Some of the more common ones are:

  • Bypass the build-in animation phase of the graph, and jump directly into the final state instead. You can do this with warmupTicks={100} (change value to taste) and cooldownTicks={0}.
  • Simplify the geometry of nodes and links by not using custom complex shapes (nodeThreeObject or linkThreeObject) and possibly lowering the sphere's resolution (nodeResolution).
  • Pre-filter the data to decrease the quantity of elements to render, if at all possible. Or alternatively group nodes into larger elements whose hierarchy can be extended on demand, similar to this example: click to collapse/expand nodes.

vasturiano avatar Sep 20 '20 05:09 vasturiano

Thanks. That helped a lot. I was already collapsing the nodes so the initial render was fast. Simplified the nodeThreeObject geometry which improved the performance quite a bit.

nirmal495 avatar Sep 21 '20 11:09 nirmal495

@nirmal495 #202 may also be helpful. cheers!

diragb avatar Sep 22 '20 14:09 diragb

@diragb Thanks for the link to issue. Some of the snaps look amazing.

nirmal495 avatar Sep 22 '20 15:09 nirmal495