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

Add option to use virtual-webgl for handling multiple WebGL contexts #6784

Merged
merged 5 commits into from
Dec 8, 2023

Conversation

archmoj
Copy link
Contributor

@archmoj archmoj commented Nov 14, 2023

@plotly/plotly_js

Resolves #2333 for parcoords, gl2d, gl3d and mapbox subplots thanks to @greggman's great work on https://github.com/greggman/virtual-webgl

TODOs:

  • Fix case of scattergl.mode='line' not initially show lines
  • Add documentation, users need to include following script on their page before other scripts:
<script src="https://unpkg.com/browse/virtual-webgl@1.0.6/src/virtual-webgl.js"></script>

@@ -73,6 +73,7 @@
"@plotly/d3": "3.8.1",
"@plotly/d3-sankey": "0.7.2",
"@plotly/d3-sankey-circular": "0.33.1",
"@plotly/mapbox-gl": "v1.13.4",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Main fix was here: plotly/mapbox-gl-js@71e2cfc

@alexcjohnson
Copy link
Collaborator

@archmoj this looks great, really nice work! No comments, other than as discussed let's try to skirt the only-lines issue by adding mock markers - either tiny and matching the line color, or maybe they can be specified as transparent... or maybe there's a way to add markers that doesn't require them to match the input arrays at all, and we can just add a single marker at some point that we know won't affect anything? However you come up with to do it, make sure it doesn't impact autorange.

Copy link
Collaborator

@alexcjohnson alexcjohnson left a comment

Choose a reason for hiding this comment

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

Excellent, you found a way to fix lines-only that doesn't involve the phantom markers hack 🎉

💃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature something new
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Using a shared webgl context across graph divs (e.g for dashboard apps)?
2 participants