Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plotly plotting performance #524

Merged
merged 3 commits into from
Apr 29, 2022
Merged

Plotly plotting performance #524

merged 3 commits into from
Apr 29, 2022

Conversation

Alexboiboi
Copy link
Member

@Alexboiboi Alexboiboi commented Apr 28, 2022

Description

When plotting a large number of objects (>500). The plotly plottting backend starts to struggle rendering all the objects. When displaying a large collection of similar objects within a collection it is possible to group and merge the similar traces into a much smaller number of traces. This drastically improves browser rendering performance. In this PR, a method is implemented to group and merge traces based on criteria such as ("legendgroup", "line", "marker", "colorscale", ...).
Of Course, this only applies if the object are displayed within a Collection and are not unpacked in the show function, since otherwise every object gets it's own legend entry and therefore its own trace, which would prevent merging.

Open topics

More performance increase could be achieved on the construction of the object on python side though.
Since there is no API change and it is also not really a new feature this could be merged and released as a patch (e.g. 4.0.1) @OrtnerMichael what do you think

  • update changelog (+date)

Example

It can still take some time to create and merge the objects (approx 10sec in this case), but the rendering of more than 5000 merged cuboids is almost instantaneous.
image

Sorry, something went wrong.

Boisselet Alexandre (IFAT DC ATV SC D TE2) added 2 commits April 25, 2022 18:14
Copy link
Member

@OrtnerMichael OrtnerMichael left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good to me

@OrtnerMichael OrtnerMichael merged commit 55db47c into main Apr 29, 2022
@Alexboiboi Alexboiboi deleted the plotly-mesh-performance branch May 1, 2022 19:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants