plotly.py icon indicating copy to clipboard operation
plotly.py copied to clipboard

Use plotly.js `base64` API to store and pass typed arrays declared by numpy, pandas, etc.

Open archmoj opened this issue 2 years ago • 3 comments

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_spec function to use for converting numpy arrays to the "typed array spec" type that plotly.js expects when receiving base64 encoded arrays.
  • Updates the validate_coerce function of the DataArrayValidator class to base64 encode numpy arrays and store them in the "typed array spec" format (by calling to_typed_array_spec)
  • Adds thorough testing to validators
  • Adds performance (size and speed) tests

archmoj avatar Dec 21 '23 23:12 archmoj

(Closed and reopened to kick CI)

marthacryan avatar Aug 30 '24 17:08 marthacryan

@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!

archmoj avatar Oct 15 '24 20:10 archmoj

thank you everyone

gvwilson avatar Oct 15 '24 20:10 gvwilson

Should this work for SVG render mode too? (render_mode="svg" in px.line)

alippai avatar Mar 20 '25 15:03 alippai

cc @marthacryan @emilykl for an answer

gvwilson avatar Mar 20 '25 15:03 gvwilson