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

Type should be validated instead of defaulting to scatter #2730

Closed
tbitai opened this issue Jun 13, 2018 · 2 comments
Closed

Type should be validated instead of defaulting to scatter #2730

tbitai opened this issue Jun 13, 2018 · 2 comments

Comments

@tbitai
Copy link

tbitai commented Jun 13, 2018

Currently if a plot type is invalid, it will default to 'scatter' instead of throwing an error. This is quite misleading if one uses a partial bundle and doesn't realize that the type they want to use is not in that partial.

Example: https://jsfiddle.net/tbitai/uahw2ycd/ This will be incorrectly rendered as a scatter plot, since the 'surface' type is not contained in the basic bundle.

@etpinard
Copy link
Contributor

etpinard commented Jun 13, 2018

We don't throw errors on bad attribute values anywhere in our code. So this would be a first. You may have a point that defaulting to scatter in partial or custom bundles isn't ideal. I'd recommend using Plotly.validate (see https://jsfiddle.net/uahw2ycd/28/ for an example) before calling newPlot.

Related #1741

@tbitai
Copy link
Author

tbitai commented Jun 14, 2018

Thank you! Closing this, since #1741 addresses the same issue more generally.

@tbitai tbitai closed this as completed Jun 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants