Skip to content

Commit 77d7aa3

Browse files
committed
Update webgl-vs-svg.md
1 parent c895f10 commit 77d7aa3

File tree

1 file changed

+9
-13
lines changed

1 file changed

+9
-13
lines changed

doc/python/webgl-vs-svg.md

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ jupyter:
66
extension: .md
77
format_name: markdown
88
format_version: '1.3'
9-
jupytext_version: 1.16.3
9+
jupytext_version: 1.16.4
1010
kernelspec:
1111
display_name: Python 3 (ipykernel)
1212
language: python
@@ -20,9 +20,9 @@ jupyter:
2020
name: python
2121
nbconvert_exporter: python
2222
pygments_lexer: ipython3
23-
version: 3.10.0
23+
version: 3.11.10
2424
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,
2626
and the ability to plot even more data!
2727
display_as: basic
2828
language: python
@@ -34,19 +34,15 @@ jupyter:
3434
thumbnail: thumbnail/webgl.jpg
3535
---
3636

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.
4238

4339
<!-- #region -->
4440
## WebGL
4541

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:
4743

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.
5046

5147

5248
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()
212208

213209
See https://plotly.com/python/reference/scattergl/ for more information and chart attribute options!
214210

215-
## NumPy Arrays
211+
## Pandas and NumPy for Improved Performance
216212

217213
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.
218214

219215
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.
220216

221217
### Arrays and Data Types Supported
222218

223-
The following types of array objects in Python are supported:
219+
The following types of objects in Python are supported for improved performance:
224220

225221
- Numpy `numpy.ndarray` objects.
226222
- Pandas Index, `pandas.Index`, or Series, `pandas.Series`, objects.

0 commit comments

Comments
 (0)