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

Use auto-generated Bokeh API to provide help and ranges for bokeh style options #1820

Open
jbednar opened this issue Aug 23, 2017 · 4 comments
Labels
type: docs Related to the documentation and examples type: feature A major new feature

Comments

@jbednar
Copy link
Member

jbednar commented Aug 23, 2017

Now that Bokeh publishes an API specification, we should be able to use that to validate and document style option values, which would be a great help to the users.

@jlstevens jlstevens added type: docs Related to the documentation and examples type: feature A major new feature labels Aug 23, 2017
@philippjfr
Copy link
Member

philippjfr commented Feb 21, 2018

I've been thinking about this a bit recently and I think I'd really like to go ahead with this, especially in the context of #2354 and the recent addition of the options method. The main benefits of those PRs (apart from the simpler API) is that they complain early and loudly when an option is incorrect. Currently we only validate against the list of options not their values but as this issue says, the bokeh API spec should actually make it reasonably easy to validate the values as well.

I'd therefore like to propose that plotting classes should be able to provide a validator interface (as a classmethod), which can be used by the options system to validate the supplied values. This would likely just take the form of a registry on each plot which maps options to the corresponding plot parameter or bokeh property spec and a classmethod that checks that the value conforms to the specified parameter or property spec. Together with the .options method I believe this can hugely improve the user experience.

@jbednar
Copy link
Member Author

jbednar commented Feb 21, 2018

Sounds great. As a user, I am desperate to have this!

@jlstevens
Copy link
Contributor

I think this is a great idea though ideally we would have one system that would also work with matplotlib.

@jbednar
Copy link
Member Author

jbednar commented Feb 23, 2018

There might be a way to traverse matplotlib's help or docs to extract that information, but it's probably easiest to start with Bokeh given that we know it's available in a machine-readable form already, and we can add mpl later once the bokeh version gets settled.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: docs Related to the documentation and examples type: feature A major new feature
Projects
None yet
Development

No branches or pull requests

3 participants