Skip to content

Commit 2773bbf

Browse files
authored
Update readme (#17)
* Simple README * Update README * Update
1 parent 239bd0b commit 2773bbf

File tree

2 files changed

+41
-1
lines changed

2 files changed

+41
-1
lines changed

README.md

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,44 @@
22

33
Plugin to bqplot powered by WebGL.
44

5-
**This is an early draft and shouldn't be used yet.**
5+
## Requirements
6+
7+
You need bqplot 0.13
8+
9+
```bash
10+
pip install --pre bqplot
11+
```
12+
13+
## Usage
14+
15+
bqplot-gl provides marks that make use of WebGL for the rendering, providing better performances.
16+
17+
Those marks have the same APIs as their equivalent in bqplot.
18+
19+
```python
20+
from bqplot import *
21+
from bqplot_gl import LinesGL, ScatterGL
22+
23+
import numpy as np
24+
import pandas as pd
25+
26+
n_points = 150_000
27+
28+
np.random.seed(0)
29+
y = np.cumsum(np.random.randn(n_points)) + 100.
30+
31+
sc_x = LinearScale()
32+
sc_y = LinearScale()
33+
34+
scatter = ScatterGL(
35+
x=np.arange(len(y)), y=y,
36+
default_size=1,
37+
scales={'x': sc_x, 'y': sc_y}
38+
)
39+
ax_x = Axis(scale=sc_x, label='Index')
40+
ax_y = Axis(scale=sc_y, orientation='vertical', label='Points')
41+
42+
Figure(marks=[scatter], axes=[ax_x, ax_y], title='Scatter powered by WebGL')
43+
```
44+
45+
[bqplot-gl](https://github.com/bqplot/bqplot-gl/assets/21197331/55b88909-3120-41b6-a3ad-494850407bc7)

bqplot-gl.webm

2.08 MB
Binary file not shown.

0 commit comments

Comments
 (0)