Use add_composite plotting API #470
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The
tessellate()method can sometimes returnpyvista.MultiBlockdatasets with thousands of blocks. The internal plotting API here calls that method, often adding each returned element to the plotter with its own actors, mappers, lookup tables, etc -- this has significant performance implications when leveraging the Trame-based client rendering viewer as the scene graph then has tens of thousands of elements which have to be synchronized anytime something changes (e.g., edge visibility).It is far more performant to use a single actor via PyVista's
add_composite()plotting API to reduce the scene graph size. See https://docs.pyvista.org/api/plotting/_autosummary/pyvista.Plotter.add_composite.html#add-compositeI made further optimizations upstream in PyVista also to improve the responsiveness of camera controls: pyvista/pyvista#4223
pyvista/pyvista#4223 and this PR should resolve the performance issue seen with Trame that @RobPasMue brought to my attention