-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
to_plotly_json
does not handle np.array
properly
#4281
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
Comments
@ChiQiao - Hey! Whilst the Fixed code snippet:
Hopefully this fixes your issue! |
@itsluketwist Thanks for the information. Do you think this is the expected behavior (i.e., fulfilling the purpose of this method as |
@ChiQiao - agreed, this experience could be better. I've made a PR to hopefully make it so, and discuss the json usage with project maintainers. 😄 |
Awesome. As a side note, do you know the difference between the fig = go.Figure(go.Scatter(x=np.array([0, 0]), y=np.array([0, 1]), marker={"color": [0, np.nan]}))
json.loads(json.dumps(fig.to_plotly_json(), cls=PlotlyJSONEncoder)) == json.loads(fig.to_json()) # True |
@ChiQiao - I don't know the reason for the multiple very similar functions here, especially when there is also a You're right that the |
Closed by #4301 - thanks @itsluketwist 🎉 |
Code to reproduce the issue:
The text was updated successfully, but these errors were encountered: