Closed philippjfr closed 5 years ago
I'd like to vote for adding a "tight" option for the widgets. E.g. if we take this example from https://github.com/ioam/holoviews/issues/882:
it just makes me feel bad to look at it, when it could look like this mockup:
I.e., an option that makes us pack each widget into a single line, shrinking whatever is necessary to make it fit with the label. Sure, this won't always work, with long labels, and maybe shouldn't be the default, but clearly we don't always need to be using so much space that it dwarfs the actual plot!
I just want to add that we have a plan to improve the javascript code, with a general WidgetManager that is widget-agnostic (in terms of how it looks and library used), allowing multiple possible widget libraries to be used in Javascript.
If we ever get round to completing this planned refactor, you could (for instance) use standard HTML widgets (i.e a HTML form) instead of the default JQueryUI widgets shown above. This would hopefully make it easier to implement fancier widgets and nicer layouts.
Sounds good. On a second look, I realize that I wasn't being ambitious enough. It should really look like:
That would be usable.
@jbednar Nice mockup! And I agree that is what we should be aiming for.
Looks really nice! This will make it much easier for me.
Any update on this? I'd like to move the position of any sliders/dropdowns. I'm a new user to Holoviews and this is one of the first things I ran into.
@stsievert
This is still a feature we are very intent on implementing!
As it stands, we just need a chunk of time to implement it, ideally with some experienced JavaScript help. The other thing we will want to keep in mind is support for JupyterLab: if we get a chance to refactor our widget system to make it more extensible and flexible, we will want to make sure it will also work right with JupyterLab.
@philippjfr and I discussed our plans for widgets and arrived at the same design we consider years ago (see the wiki page though I haven't updated it yet). Edit: I've looked through it and the plan is unchanged!
The core idea is that streams are powerful and everything should be streams. Streams can update plots in response to events and what we are missing are independent widget components that can generate stream events in response to user interaction.
Widgets need to be JS objects (not templated) associated with any widgeting library (bokeh, datgui, JQueryUI, native HTML5 widgets) that have a consistent API to talk to a generic WidgetManager
class (in JS) that handles the stream aspect. These JS widgets need to have methods to set state (e.g range and allowable values on slider widgets) as well as a way of registering callbacks to respond to user events when they occur.
HoloMaps would be a special case handled by the widget manager: from the perspective of the widget, it is sending a stream event and from the perspective of the plot it is receiving new data in response to a stream event. What is different is the bit in the middle: instead of talking to a live Python process, the WidgetManager
just looks up the data associated with the requested key/stream value from the static HTML document and returns it, no communication with Python needed.
There is a lot more to this and this is just an outline to restart the discussion: the vision is to have composable, independent components that generate stream events (just like LinkedStreams
do with bokeh) that appear as widgets to the user using whatever implementation/widget library you wish.
One more idea for the widget layout is it's position. I just got a case where I want my dropdown widget of holomap to be at the bottom - but it seems to be impossible right now... Another way to look at this is being able to group widgets and then assign positions and order to a groups. Just think how this would change the mockups above... For example, I would put the sliders at the bottom, but checkboxes on the side (or vice versa).
Just trying to link up the widget related issues. I think #2178 and #673 are also related.
Discussion in https://github.com/ioam/holoviews/issues/70 indicated that we should aim to improve the customizability of the widget layout. The original request by @basnijholt was:
philippjfr:
jlstevens:
In summary there is currently very little customizability of the layout of the widgets. We are committed to improving the widgets until we or someone else can come up with a way to integrate static widgets with the IPython widgets API, however neither of us currently has time to devote to Javascript development. We would however be happy to provide input and guidance if someone wants to submit a pull request for improvements.
Known issues:
Possibilities to consider: