-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Update plotly.js version to 2.29.0 + add Plotly.py docs examples #4476
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
Merged
Merged
Changes from 9 commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
8c9fa2d
update plotly.js version
LiamConnors 378f9aa
Add sankey node alignment
LiamConnors 1107450
Update sankey-diagram.md
LiamConnors 7e4a258
Update sankey-diagram.md
LiamConnors df37b81
update information on stadia maps
LiamConnors 6b65f2e
Update mapbox-layers.md
LiamConnors 41129d7
Update sankey-diagram.md
LiamConnors 8f27923
Update webgl-vs-svg.md
LiamConnors c167bec
Merge branch 'master' into update-plotly-js-2-28-0
LiamConnors 80ce7b5
Update doc/python/webgl-vs-svg.md
LiamConnors 2fc83f8
Update webgl-vs-svg.md
LiamConnors 9b473aa
Update webgl-vs-svg.md
LiamConnors a747e57
Update webgl-vs-svg.md
LiamConnors 92ac8f9
Update doc/python/webgl-vs-svg.md
LiamConnors b4fb94a
update Plotly.js to 2.29.0
LiamConnors 94b8eac
add rounded bar examples
LiamConnors 2011af8
add hover link example
LiamConnors 07e2837
Update sankey-diagram.md
LiamConnors 13681af
add autotickangles example
LiamConnors 6303360
Update CHANGELOG.md
LiamConnors 85bd194
fix version
LiamConnors 316a2fd
Merge branch 'master' into update-plotly-js-2-28-0
LiamConnors 5d0a984
update plotly.js version
LiamConnors File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,10 +5,10 @@ jupyter: | |
text_representation: | ||
extension: .md | ||
format_name: markdown | ||
format_version: '1.1' | ||
jupytext_version: 1.1.7 | ||
format_version: '1.3' | ||
jupytext_version: 1.14.6 | ||
kernelspec: | ||
display_name: Python 3 | ||
display_name: Python 3 (ipykernel) | ||
language: python | ||
name: python3 | ||
language_info: | ||
|
@@ -20,20 +20,21 @@ jupyter: | |
name: python | ||
nbconvert_exporter: python | ||
pygments_lexer: ipython3 | ||
version: 3.6.5 | ||
version: 3.10.11 | ||
plotly: | ||
description: Using WebGL for increased speed, improved interactivity, and | ||
the ability to plot even more data! | ||
description: Using WebGL for increased speed, improved interactivity, and the | ||
ability to plot even more data! | ||
display_as: basic | ||
language: python | ||
layout: base | ||
name: WebGL vs SVG | ||
order: 14 | ||
permalink: python/webgl-vs-svg/ | ||
thumbnail: thumbnail/webgl.jpg | ||
redirect_from: python/compare-webgl-svg/ | ||
thumbnail: thumbnail/webgl.jpg | ||
--- | ||
|
||
<!-- #region --> | ||
### SVG and canvas/WebGL: two browser capabilities for rendering | ||
|
||
`plotly` figures are rendered by web browsers, which broadly speaking have two families of capabilities for rendering graphics: the SVG API which supports vector rendering, and the Canvas API which supports raster rendering, and can exploit GPU hardware acceleration via a browser technology known as WebGL. Each `plotly` trace type is primarily rendered with either SVG or WebGL, although WebGL-powered traces also use some SVG. The following trace types use WebGL for part or all of the rendering: | ||
|
@@ -58,6 +59,15 @@ In addition to the above limitations, the WebGL-powered version of certain SVG-p | |
* Range breaks on time-series axes are not yet supported | ||
* Axis range heuristics may differ | ||
|
||
### Multiple WebGL Contexts | ||
|
||
*New in 5.19* | ||
|
||
If you encounter WebGL context limits when rendering many WebGL-based figures on one page, you can use [Virtual WebGL](https://github.com/greggman/virtual-webgl). | ||
LiamConnors marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
To use it, in the environment where your Plotly figures are being rendered, load the Virtual WebGL script, "https://unpkg.com/[email protected]/src/virtual-webgl.js", for example, using a `<script>` tag. | ||
|
||
alexcjohnson marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
### WebGL for Scatter Performance | ||
|
||
In the examples below we show that it is possible to represent up to around a million points with WebGL-enabled traces. | ||
|
@@ -71,6 +81,7 @@ The `rendermode` argument to supported Plotly Express functions (e.g. `scatter` | |
> **Note** The default `rendermode` is `"auto"`, in which case Plotly Express will automatically set `rendermode="webgl"` if the input data is more than 1,000 rows long. If WebGL acceleration is *not* desired in this case, `rendermode` can be forced to `"svg"` for vectorized, if slower, rendering. | ||
|
||
Here is an example that creates a 100,000 point scatter plot using Plotly Express with WebGL rendering explicitly enabled. | ||
<!-- #endregion --> | ||
|
||
```python | ||
import plotly.express as px | ||
|
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.