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

Column breaks holoviews aspect + responsive #5054

Open
douglas-raillard-arm opened this issue Jun 6, 2023 · 3 comments
Open

Column breaks holoviews aspect + responsive #5054

douglas-raillard-arm opened this issue Jun 6, 2023 · 3 comments
Milestone

Comments

@douglas-raillard-arm
Copy link
Contributor

ALL software version info

panel: 1.1.0
pandas: 2.0.1
holoviews: 1.16.1
bokeh: 3.1.1
firefox: 113.0.2 (64-bit)

Description of expected behavior and the observed behavior

When a holoviews Curve is using aspect=1 and responsive=True, wrapping that in a Column breaks the sizing.

Complete, minimal, self-contained example code that reproduces the issue

import panel as pn
import holoviews as hv
hv.extension('bokeh')

pn.Column(
    hv.Curve([1,2]).options(aspect=1, responsive=True)
)

Screenshots or screencasts of the bug in action

The aspect ratio is clearly not 1. If the Column layer is removed, the plot scales to the max available width, and the height matches that responsively so that the aspect ratio is respected. Column breaks that:
image

@philippjfr
Copy link
Member

@mattpap This one is confounding me a bit, it seems like Bokeh completely ignores the aspect_ratio of a figure if it is in a responsive container:

from bokeh.models import Column
from bokeh.plotting import figure

p = figure(sizing_mode='scale_both', aspect_ratio=1)

p.line([1, 2, 3], [1, 2, 3])

Column(children=[Column(children=[p], sizing_mode='scale_both')], height=400, width=800)

@mattpap
Copy link
Collaborator

mattpap commented Jun 8, 2023

It's a side effect of CSS aspect-ratio being very low priority, which means that a single width/height related CSS property will override it. This can be made to work (ish) if we strip most of bokeh's CSS layout. Again, I need to think about this and experiment we other setups, but I don't have high hopes for this. I think that ultimately aspect ratio will work best in canvas layouts, where we can set priorities ourselves.

@philippjfr
Copy link
Member

That seems like a pretty big problem, canvas layouts will very commonly be laid out inside a CSS layout and things shouldn't break depending on how you compose things.

@philippjfr philippjfr modified the milestones: v1.1.1, v1.2.0 Jun 22, 2023
@philippjfr philippjfr modified the milestones: v1.2.0, v1.2.1 Jul 10, 2023
@philippjfr philippjfr modified the milestones: v1.2.1, v1.2.2 Jul 25, 2023
@hoxbro hoxbro modified the milestones: v1.2.2, v1.2.3 Sep 4, 2023
@philippjfr philippjfr modified the milestones: v1.2.3, v1.2.4 Sep 18, 2023
@philippjfr philippjfr modified the milestones: v1.2.4, v1.3.0 Oct 9, 2023
@philippjfr philippjfr modified the milestones: v1.3.0, v1.3.1 Oct 23, 2023
@philippjfr philippjfr modified the milestones: v1.3.1, v1.3.2 Oct 31, 2023
@philippjfr philippjfr modified the milestones: v1.3.2, v1.4.0 Nov 22, 2023
@philippjfr philippjfr modified the milestones: v1.4.0, v1.4.x Mar 13, 2024
@philippjfr philippjfr modified the milestones: v1.5.x, v1.6.0 Jan 20, 2025
@philippjfr philippjfr modified the milestones: v1.6.0, v1.6.1 Jan 25, 2025
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

No branches or pull requests

4 participants