Skip to content
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

Add GridSpec layout [doc-build] #338

Merged
merged 13 commits into from Mar 28, 2019
Merged

Add GridSpec layout [doc-build] #338

merged 13 commits into from Mar 28, 2019

Conversation

philippjfr
Copy link
Member

@philippjfr philippjfr commented Mar 27, 2019

Implements a GridSpec layout based on the new GridBox model in bokeh. It works quite differently from the previous approach, you no longer have to declare the number of cols and rows, you simply declare a size (or sizing_mode='stretch_both') and then start filling the grid:

Screen Shot 2019-03-27 at 6 53 39 PM

Screen Shot 2019-03-27 at 6 53 55 PM

Supersedes #31

@jbednar
Copy link
Member

@jbednar jbednar commented Mar 27, 2019

Seems very cool! We should have a demo example using this approach, with some numeric readouts and other things that aren't plots, as in the various dashboards you find if you search for "dashboard" images.

@philippjfr
Copy link
Member Author

@philippjfr philippjfr commented Mar 28, 2019

Here's a more complex example:

Screen Shot 2019-03-28 at 4 27 21 AM

and here's an error when trying to assign to a region of the grid that's already occupied:

IndexError: Specified region overlaps with the following existing object(s) in the grid:

    (0, 0): HTML(str, background='#FF0000')

    (1, 0): HTML(str, background='#00FF00')

    (1, 1): VTK(str, camera={'position': [-21.49009035...})

The following shows a view of the grid (empty: 0, occupied: 1, overlapping: 2):

[[2 2 2]
 [2 2 2]
 [2 2 2]
 [1 1 0]
 [1 1 1]]

@jbednar
Copy link
Member

@jbednar jbednar commented Mar 28, 2019

Is there a simple way to center content in each grid cell's region, both vertically and horizontally? Presumably no one would want A, B, C, D to be in the upper left like that.

@philippjfr
Copy link
Member Author

@philippjfr philippjfr commented Mar 28, 2019

Is there a simple way to center content in each grid cell's region, both vertically and horizontally?

There is probably some combination of CSS that will do it, worth looking into but not tied up with this PR.

@philippjfr philippjfr changed the title Add GridSpec model Add GridSpec layout [doc-build] Mar 28, 2019
@codecov-io
Copy link

@codecov-io codecov-io commented Mar 28, 2019

Codecov Report

Merging #338 into master will decrease coverage by 0.16%.
The diff coverage is 83.83%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #338      +/-   ##
==========================================
- Coverage   87.05%   86.89%   -0.17%     
==========================================
  Files          88       88              
  Lines        7263     7540     +277     
==========================================
+ Hits         6323     6552     +229     
- Misses        940      988      +48
Impacted Files Coverage Δ
setup.py 0% <ø> (ø) ⬆️
panel/__init__.py 100% <100%> (ø) ⬆️
panel/tests/test_layout.py 100% <100%> (ø) ⬆️
panel/pane/image.py 75.89% <30.76%> (-6.11%) ⬇️
panel/pane/markup.py 90.58% <50%> (-3.17%) ⬇️
panel/layout.py 89.35% <78.82%> (-7.06%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update cb87c98...8e2cf11. Read the comment docs.

@philippjfr philippjfr merged commit ad38437 into master Mar 28, 2019
3 checks passed
@philippjfr philippjfr deleted the new_gridspec branch Sep 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants