allow plotly.js to accept numpy buffers
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 18.3k
- Forks
- 2k
- Avg merge
- 2d 12h
- Merged PRs (30d)
- 28
Description
If we allowed all GL plot types to accept numpy buffers for plot x/y/z data, then the Python library could optionally avoid JSON serialization of array data, like @maartenbreddels does in his brillant project ipyvolume:
https://github.com/maartenbreddels/ipyvolume/blob/master/ipyvolume/serialize.py#L95
Here is the deserialization on the JS side:
https://github.com/maartenbreddels/ipyvolume/blob/master/js/src/serialize.js#L16
Plotly.js has all of these incredible WebGL figures for scientific computing, but their potential in Python, R, MATLAB, etc is limited by the JSON serialization step.
In a similar vein, it seems like all GL types should be able to accept Float32Array's directly instead of untyped JS arrays. Currently, it looks like only the Plotly trace type pointcloud accepts Float32Array's:
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by comparing the referenced ipyvolume serialize.py and js/src/serialize.js implementations, then inspect Plotly.js's existing pointcloud Float32Array handling and the GL trace entry points. The issue names no Plotly.js files or tests; done would require an agreed scope for supported GL traces, buffer deserialization, and verification that array data avoids JSON serialization.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- computer-graphics, data-visualization
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100