-
-
Notifications
You must be signed in to change notification settings - Fork 404
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
Explicitly specifying backend for options #803
Comments
Philipp suggests a syntax more like mpl:(linewidth=5 facecolor='red') bokeh:(line_width=5 fill_color='red') to separate them more cleanly. |
This would definitely need updates to the opts magic parser. At that point, I would just send the keywords to the option tree or custom tree according to the specified backend. As a result, this could be implemented in a way that doesn't involve filtering at all. Everything would be fairly easy to implement except for upgrading the parser which is hard. |
Ok. Also, an additional benefit of this approach is that it lets users clarify which backend the option is meant for, even if it's unambiguous to HoloViews. E.g. which one takes line_width and which one takes linewidth? I'll never be able to remember that. :-) And then it could be error-checked for that particular backend's supported options. |
Right, there's another benefit to this. Currently if you've enabled one backend but switch to another for one cell using the output cell magic then the tab-completion mechanism will return the wrong options, |
All great suggestions! As much as I would love all this, I am also acutely aware that implementing the parser and corresponding tab completion would be quite an undertaking... |
I'm still hoping simply registering them like this will work:
Probably overly optimistic. |
In addition to the backend-hinted keywords, you have two possibilities with respect to unhinted keywords:
This is orthogonal to supporting the hints - I just want to enumerate the possible behaviors. |
We are now only missing a way of doing so via the magics, since #2306 was merged you can now explicitly declare the backend when using |
Since we are now trying to switch away from the magics and adding any further complexity to the magics has proved to be incredibly tricky I'm going to close this as completed. |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
As of PR #802 , it's easy to switch backends, because the style options supplied are first filtered so that each backend only gets the options that are valid for it. However, some backends may use the same name for options with different meanings, e.g. one could accept a width in pixels, while the other may use a width in data coordinates. In other cases, people may want to set even the same setting differently depending on the backend, to work well with the default behavior of that backend (such as the different background colors between the mpl and bokeh backends).
For both those cases, it would be great if style options could have a backend specified optionally, as in "mpl:width=5 bokeh:width=200", or some other similar syntax.
The text was updated successfully, but these errors were encountered: