You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/python/webgl-vs-svg.md
+9-13Lines changed: 9 additions & 13 deletions
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ jupyter:
6
6
extension: .md
7
7
format_name: markdown
8
8
format_version: '1.3'
9
-
jupytext_version: 1.16.3
9
+
jupytext_version: 1.16.4
10
10
kernelspec:
11
11
display_name: Python 3 (ipykernel)
12
12
language: python
@@ -20,9 +20,9 @@ jupyter:
20
20
name: python
21
21
nbconvert_exporter: python
22
22
pygments_lexer: ipython3
23
-
version: 3.10.0
23
+
version: 3.11.10
24
24
plotly:
25
-
description: Using WebGL and NumPy arrays for increased speed, improved interactivity,
25
+
description: Using WebGL and NumPy and Pandas for increased speed, improved interactivity,
26
26
and the ability to plot even more data!
27
27
display_as: basic
28
28
language: python
@@ -34,19 +34,15 @@ jupyter:
34
34
thumbnail: thumbnail/webgl.jpg
35
35
---
36
36
37
-
In some examples in the documentation, you'll see figures created using data structures that are native to Python, such as lists and tuples, and which use trace types that render as SVGs.
38
-
39
-
This will work fine for many use cases, but may not provide optimal performance with larger datasets.
40
-
41
-
For improved performance, consider using WebGL-based traces and NumPy arrays.
37
+
For improved performance, consider using WebGL-based traces and Pandas or NumPy objects.
42
38
43
39
<!-- #region -->
44
40
## WebGL
45
41
46
-
`plotly` figures are rendered by web browsers, which broadly speaking have two families of capabilities for rendering graphics:
42
+
`plotly` figures are rendered by web browsers, which broadly speaking have two families of capabilities for rendering graphics:
47
43
48
-
- The SVG API, which supports vector rendering
49
-
- The Canvas API, which supports raster rendering, and can exploit GPU hardware acceleration via a browser technology known as WebGL.
44
+
- The SVG API, which supports vector rendering
45
+
- The Canvas API, which supports raster rendering, and can exploit GPU hardware acceleration via a browser technology known as WebGL.
50
46
51
47
52
48
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:
@@ -212,15 +208,15 @@ fig.show()
212
208
213
209
See https://plotly.com/python/reference/scattergl/ for more information and chart attribute options!
214
210
215
-
## NumPy Arrays
211
+
## Pandas and NumPy for Improved Performance
216
212
217
213
Improve the performance of generating Plotly figures that use a large number of data points by using NumPy arrays and other objects that can be converted to NumPy arrays, such as Pandas Series and Index objects.
218
214
219
215
Plotly.py uses Plotly.js for rendering, which supports typed arrays. In Plotly.py, NumPy array and NumPy-convertible arrays are base64 encoded before being passed to Plotly.js for rendering.
220
216
221
217
### Arrays and Data Types Supported
222
218
223
-
The following types of array objects in Python are supported:
219
+
The following types of objects in Python are supported for improved performance:
224
220
225
221
- Numpy `numpy.ndarray` objects.
226
222
- Pandas Index, `pandas.Index`, or Series, `pandas.Series`, objects.
0 commit comments