Skip to content
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

Update readme #17

Merged
merged 3 commits into from
Jul 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 41 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,44 @@

Plugin to bqplot powered by WebGL.

**This is an early draft and shouldn't be used yet.**
## Requirements

You need bqplot 0.13

```bash
pip install --pre bqplot
```

## Usage

bqplot-gl provides marks that make use of WebGL for the rendering, providing better performances.

Those marks have the same APIs as their equivalent in bqplot.

```python
from bqplot import *
from bqplot_gl import LinesGL, ScatterGL

import numpy as np
import pandas as pd

n_points = 150_000

np.random.seed(0)
y = np.cumsum(np.random.randn(n_points)) + 100.

sc_x = LinearScale()
sc_y = LinearScale()

scatter = ScatterGL(
x=np.arange(len(y)), y=y,
default_size=1,
scales={'x': sc_x, 'y': sc_y}
)
ax_x = Axis(scale=sc_x, label='Index')
ax_y = Axis(scale=sc_y, orientation='vertical', label='Points')

Figure(marks=[scatter], axes=[ax_x, ax_y], title='Scatter powered by WebGL')
```

[bqplot-gl](https://github.com/bqplot/bqplot-gl/assets/21197331/55b88909-3120-41b6-a3ad-494850407bc7)
Binary file added bqplot-gl.webm
Binary file not shown.