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

Div widget overlapping after layout overhaul in 1.1.0 #8866

Open
pdmich opened this issue Apr 23, 2019 · 6 comments
Open

Div widget overlapping after layout overhaul in 1.1.0 #8866

pdmich opened this issue Apr 23, 2019 · 6 comments

Comments

@pdmich
Copy link

pdmich commented Apr 23, 2019

After new layout overhaul in bokeh version 1.1.0 Div widgets are not responding in the layout as expected.

Before version 1.1.0 - the layout looked like this:
image

Now the same layout looks like this:
image

If you force a different sizing mode other than fixed (e.g. 'stretch_both') then you at least avoid the overlapping, but the sizing still seems off. No matter what I put in the height and width when it's fixed, it doesn't seem to change size.
image

I'm on windows, using a Chrome browser.

Similar code snippet to what I'm using in my app:

div_header = Div(text="""
                    <h4><i>Stochastic Simulation Inputs</i></h4>""",
                                 style={
                                            'background-color': '#c8cfd6', 
                                            'outline': 'black solid thin',
                                            'text-align': 'center'
                                            }, height=15, width=610, 
                                 sizing_mode='stretch_both')

sim_duration = TextInput(title="Stochastic Simulation Length (hrs):", value="504", name='SimDuration')

layout = column(div_header, sim_duration)
show(layout)
@pdmich pdmich added the TRIAGE label Apr 23, 2019
@bryevdv
Copy link
Member

bryevdv commented Apr 23, 2019

@pmicheletty can you provide a complete example to run and test against and use to reproduce what you are seeing exactly?

cc @mattpap

@pdmich
Copy link
Author

pdmich commented Apr 23, 2019

@bryevdv sure. See the gist here

I put in two examples with different sizing modes.

@bryevdv
Copy link
Member

bryevdv commented Nov 4, 2022

Here is a complete MRE

from bokeh.models import Div, TextInput
from bokeh.layouts import column
from bokeh.io import show

div_header = Div(text="""
                    <h4><i>Stochastic Simulation Inputs</i></h4>""",
                                 styles={
                                            'background-color': '#c8cfd6',
                                            'outline': 'black solid thin',
                                            'text-align': 'center'
                                            }, height=15, width=610,
                                 sizing_mode='stretch_both')

sim_duration = TextInput(title="Stochastic Simulation Length (hrs):", value="504", name='SimDuration')

layout = column(div_header, sim_duration)
show(layout)

@mattpap
Copy link
Contributor

mattpap commented Nov 4, 2022

This needs a little bit of CSS tweaking. E.g. customizing flex basis for Div in FlexBox gives this:
image

@bryevdv
Copy link
Member

bryevdv commented Nov 4, 2022

Are you saying it can/should be closed, then?

@mattpap
Copy link
Contributor

mattpap commented Nov 4, 2022

No, it still needs fixes, but it isn't too far off.

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

No branches or pull requests

3 participants