plotly.py
plotly.py copied to clipboard
Use plotly.js `base64` API to store and pass typed arrays declared by numpy, pandas, etc.
This PR make use of this plotly.js PR and changes the default behavior to pass numpy arrays as plotly.js base64 spec.
Code Changes
- Adds
to_typed_array_specfunction to use for converting numpy arrays to the "typed array spec" type that plotly.js expects when receiving base64 encoded arrays. - Updates the
validate_coercefunction of theDataArrayValidatorclass to base64 encode numpy arrays and store them in the "typed array spec" format (by callingto_typed_array_spec) - Adds thorough testing to validators
- Adds performance (size and speed) tests
(Closed and reopened to kick CI)
@marthacryan Please resolve the conflicts with master; then merge master into this branch. Then you may possibly copy the version of tests from master into this branch to see if any tests need any adjustments. Thank you!
thank you everyone
Should this work for SVG render mode too? (render_mode="svg" in px.line)
cc @marthacryan @emilykl for an answer