-
Notifications
You must be signed in to change notification settings - Fork 76
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
vbox behaves like hbox #198
Comments
Sad news. The hbox, vbox code was cobbled together quickly and without a deep understanding of IPywidgets layout system, so it's a bit of a shambles. If anyone wants to have a bash at cleaning it up, it would be great, and I'd try to help. Having said that, this may just be some minor compatibility issue with IPywidgets 7 - I notice I'm getting errors in the javascript console. Alternately, you could try https://github.com/JuliaGizmos/InteractNext.jl (follow the install instructions there), it uses We're really hoping to get WebIO/InteractNext to a proper release before the end of the year. Unfortunately, it seems we've been a bit swamped with other stuff recently. |
I have found a hack for this problem. in Interact/src/IJulia/setup.jl, replace widget_class(::Box) = "Box" with widget_class(b::Box) = b.vert ? "VBox" : "Box" This fixes the issue at hand, but a deeper problem remains. The issue is that none of the attributes which Interact.jl are trying to pass to ipywigets FlexBox are actually registered by ipywidgets. I have not really been able to figure out precisely how Interact.jl deals with the python objects, but I think that I know where the problem lies. Interact.jl creates an ipywidget statedict(l::Layout) = begin
state = Dict{Symbol, Any}(:display => "flex", :align_items => "stretch")
l.box.vert && (state[:flex_flow] = "column")
state
end The resulting viewdict(b::Box) = begin
Dict{Symbol, Any}(:layout => "IPY_MODEL_"*widget_comms[b.layout].id)
end Hovewer, I do not think that this is done properly. If I replace this function with a dummy viewdict(b::Box) = begin
Dict{Symbol, Any}()
end or viewdict(b::Box) = begin
Dict{Symbol, Any}(:layout=>"dummy")
end it does not alter the behaviour at all. In python one would write import ipywidgets as widgets
from IPython.display import display
s = widgets.IntSlider(description="my slider")
my_layout_object = widgets.Layout(display="flex", align_items="stretch", flex_flow="column")
box = widgets.Box([s,s,s], layout=my_layout_object)
display(box) and I believe that the point of failure for Interact.jl lies in the |
Fixed by #201, closing. |
For some reason, vbox() has started outputting a row (not column) of widgets.
This is now the same behaviour as hbox():
Combinations of
hbox( vbox(), vbox() )
used to generate nice arrays of widgets, but now it just generates a long horizontal line.I am guessing that this may be related to #197.
This is happening for me on a mac, using ipywidgets 7.0.1.
The text was updated successfully, but these errors were encountered: