-
-
Notifications
You must be signed in to change notification settings - Fork 67
/
Copy path2018-08-07-webgl_plotlyjs_index.html
30 lines (25 loc) · 1.29 KB
/
2018-08-07-webgl_plotlyjs_index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
---
description: Implement WebGL for increased speed, improved interactivity, and the
ability to plot even more data!
display_as: basic
language: plotly_js
layout: base
name: WebGL vs SVG
order: 14
permalink: javascript/webgl-vs-svg/
thumbnail: thumbnail/webgl.jpg
---
{% assign examples = site.posts | where:"language","plotly_js" | where:"suite","webgl-vs-svg"| sort: "order" %}
{% include posts/auto_examples.html examples=examples %}
<div>
<h3>
Multiple WebGL Contexts
</h3>
<p>
Most browsers have a limit of between 8 and 16 WebGL contexts per page. A Plotly WebGL-based figure may use multiple WebGL contexts, but generally you'll be able to render between 4 and 8 figures on one page.
If you exceed the browser limit on WebGL contexts, some figures won't render and you'll see an error. In the console in Chrome, for example, you'll see the error: "Too many active WebGL contexts. Oldest context will be lost".
If you encounter WebGL context limits when using WebGL-based figures, you can use [Virtual WebGL](https://github.com/greggman/virtual-webgl), which virtualizes a single WebGL context into multiple contexts.
To use it, add the following script on your page:
<pre><script src="https://unpkg.com/[email protected]/src/virtual-webgl.js"></script></pre>
</p>
</div>