-
-
Notifications
You must be signed in to change notification settings - Fork 403
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
Testing the bokeh Elements tutorial and matching the original #334
Comments
I forgot to mention you'll need data = [('one',8),('two', 10), ('three', 16), ('four', 8), ('five', 4), ('six', 1)]
bars = hv.Bars(data, kdims=[hv.Dimension('Car occupants', values='initial')], vdims=['Count'])
bars + bars[['one', 'two', 'three']] |
I've already added a version of the Elements Tutorial using Bokeh. Do still need to get bokeh testing working though. |
Ah, yes... I see that commit fro 19 hours ago. :-) Though it would be good if it were made as similar to the original tutorial as possible (e.g the issue above). What do you think about effectively calling the output magic to switch backends when using |
Ok, I changed the title of the issue. I'm sure you are already aware of some of the following problems but they are worth listing here anyway:
In general, I think the tutorials should be as similar to each other as possible.. |
I would definitely be in favor of this, with the last JS set loaded determining the default backend. Maybe this is already the behavior? In general I agree with Jean-Luc's comments above; making a full Bokeh version (with stubs where required) would make it be clearest about what's supported and what's not (and would spur us to support whatever isn't. There should also probably be a fairly short tutorial somewhere that's specific to Bokeh, describing and demonstrating what's available in that backend that's not available elsewhere (brushing, linking, callbacks?). |
These Elements could probably be supported fairly easily:
These can't:
I've got a notebook for that, I'll do some minor tidying but it's almost ready to go. |
I'd urge you to make the change of having notebook_extension(bokeh=True) switch to Bokeh automatically very soon, so that it goes into the next minor release. That way we can simplify our user instructions, when telling people about the Bokeh support. |
Yes, this makes sense. Definitely something we'll have for 1.4.1. |
Agreed, it should simply load extensions for all available backends by default. For matplotlib that's a no-op but the plotly backend prototype has something similar. |
That sounds useful to me (based on whether imports work or not, I presume?). Then if you supply an explicit list of 'resources' we should obey that. It would mean that holoviews javascript wouldn't be included by default as soon as anything is set. E.g for initializing holoviews and bokeh only (even if something else is available) you would use: notebook_extension(holoviews=True, bokeh=True) |
Hmm; we may not be agreeing here. Why include more than one backend initialization by default? I would have thought that as a user, if I type:
I would get support for the default backend (currently matplotlib), and that if I type:
I would only get Bokeh support, and that if I type:
I would get support for both bokeh and matplotlib and make matplotlib the default (which I'd expect from the left to right order, even if Python won't actually respect that :-), and that if I type:
I'd get support for all three, with plotly as the default, falling back to matplotlib when that Element type isn't supported by Plotly, then falling back to bokeh for anything not supported by matplotlib. I'm not saying that it has to be like this, or that it's reasonable to be like this, it's just how I would expect it to behave: no support for backends I'm not using and may never have heard of, no need to explicitly specify any backend using %output later, and a list of preferred backends, in order. |
The idea of setting up fallbacks in this way is one Philipp and I have toyed with but we aren't completely convinced this is exactly the behavior we want. As it would also require some refactoring, this suggestion is something to think about after 1.4.1 is released. For now what I have done (PR #374) is update notebook_extension(bokeh=True, matplotlib=True) But now you can pass kwargs which is shorter and preserves the order: notebook_extension('bokeh', 'matplotlib') In this case, BokehJS would be loaded and the matplotlib backend would remain active. Specified the other way round and the bokeh backend would be automatically activated. |
Looks good to me! |
Are we going to try to implement the suggestion in #445 (backend icons) before we release 1.4.2? |
I will also note that although the Bokeh Elements tutorial has been updated to be like original matplotlib one, part of this issue was about testing Bokeh plots, something that is not yet in place. |
I think most of these changes have been implemented except for the suggestion in #455 which I think is a good idea. For this reason, I'll leave this issue open and reassign the milestone to v1.5. |
We are now testing the bokeh element tutorial at least in Python 2. I think that addresses all the suggestions in this PR. In future we'll be splitting up the Element tutorial into individual examples so I'll close this issue now. |
Do we have an issue to record something related we discussed: a page with thumbnails for all the elements (linking to the right place in the tutorials) and a toggle to switch between matplotlib/bokeh? |
Just noticed missing Arrow support for bokeh in that Elements tutorial. scene * hv.Text(0, 0.2, 'Adult\npenguins') + scene * hv.Arrow(0,-0.1, 'Baby penguin', 'v')
|
Right; as discussed in #1196 that's the only non-3D Element not yet supported by the Bokeh backend. |
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. |
I think it would be great to just copy the current Elements tutorial, set
hv.notebook_extension(bokeh=True)
at the top and make it available on the website (the tutorials could then be calledElements [matplotlib]
andElements [bokeh]
. This would achieve a few things:The main issues I can see are:
The text was updated successfully, but these errors were encountered: