You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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.
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.
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.
The text was updated successfully, but these errors were encountered: