Skip to content
This repository has been archived by the owner on Nov 28, 2019. It is now read-only.

Laying out multiple widgets next to each other #42

Open
philippjfr opened this issue Apr 20, 2017 · 3 comments
Open

Laying out multiple widgets next to each other #42

philippjfr opened this issue Apr 20, 2017 · 3 comments

Comments

@philippjfr
Copy link
Member

Often you want to group widgets together and lay the widget boxes out. This be best encapsulated as multiple parameterized classes. It would be great if paramnb.Widgets accepted a list of parameterized classes/instances and provided some options for specifying layout of the corresponding widget boxes and display parameters.

@jbednar
Copy link
Member

jbednar commented Apr 21, 2017

Previously we've used the Jupyter Dashboards notebook extension to do such layout, so that each group of widgets can control some different region of the page (one set of widgets above one plot, another above a different one, another as a bunch of global settings, etc.). This works well in both notebook and dashboard form, because the widgets can then be associated with the particular cell they apply to in the notebook, and then the whole set of plots and widgets can be assembled into a dashboard whose layout is controlled by the notebook extension, not the code in the notebook.

Here, it sounds like you are proposing laying out the entire thing within one notebook cell, or at least doing complicated layouts within that cell, and possibly then combining the result of several such cells into an overall dashboard using the notebook extension. That capability would certainly be useful, but we should try to be very clear about how we are expecting it to be used, and what it is not expected to do, to avoid having to solve general layout issues of the sort that Bokeh's kiwi addresses.

@jbednar
Copy link
Member

jbednar commented Apr 21, 2017

This notebook from the Shaolin project discusses related ideas. I was able to run it using the datashader examples environment then conda installing networkx, pip installing 'planarity', git cloning the shaolin repo, and doing python setup.py develop inside that repo.

Some highlights of possible changes to ParamNB that might be related to what's in Shaolin:

  • Allowing multiple classes per Widgets instance? (proposed by @philippjfr above)
  • Allowing multiple Widgets calls to be combined into one cell (laid out alongside)? E.g. a HoloViews-style + operator, like: Widgets() + cols(Widgets()+Widgets(),1) (though cols isn't even yet available for hv, just proposed)
  • Making individual widgets accessible after Widgets() creation, to allow options to be changed on them per parameter. (Presumably by supporting [] or .attribute access by parameter name.)
  • Allowing multiple callbacks in the same Widgets class
  • Possible layout specification language? If we had such a thing, should consider whether it could be shared (at least by copy-paste) with holoviews; see related HoloViews issue. Note that the HoloViews issue has only two digits in its number, while current issues have four, so you can tell this is a longstanding request!

@Guillemdb
Copy link

Guillemdb commented Apr 21, 2017

I have removed the non crucial dependencies used for the shaolin examples. Now it only need pandas, numpy and ipywidgets.

Now it should be also possible to install it using pip install shaolin.

Later today I will upload an example of how it can be used with datashader if you are interested.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants