Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Implement AppLayout widget #2333
Request for review
This PR implements specialised layouts based on GridBox widget (using CSS Grid specification).
These are three reusable layouts:
Example of usage:
import ipywidgets as widgets app = widgets.TwoByTwoLayout(top_left=widgets.Button(), top_right=widgets.Button(), bottom_left=widgets.Button(), bottom_right=widgets.Button()) display(app)
These template widgets are implemented in
@maartenbreddels Thanks for spotting this! The problem seems to be related to the way the size is calculated, i.e. height=100% does not include the margins, so the "Bottom right" button overflows.
I created a minimal example in HTML/CSS reproducing this problem: https://jsfiddle.net/j6xv45sn/
The solution is to set height of the button to 'auto'. I will update the examples.
maartenbreddels left a comment
Looking good, found a minor issue with 'merge'.
For the bqplot example, I think this behaves better:
max_slider = FloatSlider(min=0, max=10, description="Max: ", layout=Layout(width='300px', height='20px')) min_slider = FloatSlider(min=-1, max=10, description="Min: ", layout=Layout(width='300px', height='20px'))