async
- when enabled, the paper renders cells added to the graph through graph.resetCells()
or graph.addCells()
asynchronously.
This is very useful when you want to add a large number of cells into the graph. The rendering performance boost is significant and doesn't block the UI.
The option accepts either true
in which case default values are used or an object of the form
{ batchSize: <value> }
where you can specify the number of cells rendered in each animation frame (default is 50). Normally, the default batchSize
works great
but you might want to experiment with different values in case you encounter performance issues.
It is important to note that when asynchronous rendering is used, some of the cell views might not yet
be in the paper when you try to access them via the paper.findViewByModel()
, element.findView()
or link.findView()
methods.
What you should do in case you use async rendering is to wait for when the paper triggers the render:done
event.