jacomyal / sigma.js

A JavaScript library aimed at visualizing graphs of thousands of nodes and edges
https://www.sigmajs.org/
MIT License
11.3k stars 1.59k forks source link

Question: How does canvas renderer handle changes? #964

Closed s0md3v closed 6 years ago

s0md3v commented 6 years ago

While looking for a way to optimize canvas's performance while handling large data, I stumbled upon an article which suggests to render only the differences instead of re-rendering the whole scene.

Can you please tell me which approach does sigma use when we do s.refresh();?

Yomguithereal commented 6 years ago

Hello @s0md3v. There is no way not to render the whole scene each time the graph changes or when you move the camera when rendering graph so unfortunately this kind of optimizations are not really possible. The optimizations used by sigma however are quadtrees and frustum culling.