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

HoloViews/Bokeh aspect not being respected, and different behavior with fast template #5343

Open
droumis opened this issue Jul 28, 2023 · 2 comments

Comments

@droumis
Copy link
Member

droumis commented Jul 28, 2023

ALL software version info

versions
Python : 3.9.16 | packaged by conda-forge | (main, Feb 1 2023, 21:38:11) [Clang 14.0.6 ] Operating system : macOS-13.4.1-arm64-arm-64bit holoviews : 1.17.0

bokeh : 3.2.1
colorcet : 3.0.1
cudf : -
dask : 2023.7.1
datashader : 0.15.1
geoviews : -
hvplot : 0.8.4
ibis : -
IPython : 8.14.0
jupyter_bokeh : -
jupyterlab : 4.0.3
matplotlib : 3.7.2
networkx : 3.1
notebook : 7.0.0
numba : 0.57.1
numpy : 1.24.4
pandas : 2.0.3
panel : 1.2.1
param : 1.13.0
PIL : 10.0.0
plotly : -
pyarrow : 12.0.1
scipy : 1.11.1
skimage : 0.21.0
spatialpandas : -
streamz : -
xarray : 2023.7.0

Description of expected behavior and the observed behavior

Setting a holoviews/bokeh plot to be responsive with a set aspect should fill the available space to the extent that it maintains the aspect ratio.

Additionally, when aspect is set, there is a different behavior during the use of the 'fast' template for served apps: all other templates (or no template) fill the available height and width (see images below), whereas the use of the 'fast' template stretches only the width.

@philippjfr 's summary:

  • Explicit sizing_mode not respected if child has scaling sizing mode
    • For example a Bokeh/HoloViews plot with aspect forces a scaling sizing mode on the container.
  • Fast template does not implement correct CSS for scaling sizing modes

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

import numpy as np
import holoviews as hv; hv.extension('bokeh')
import panel as pn; pn.extension(template='fast')

data = np.random.rand(10, 10)
image = hv.Image(data).opts(aspect=1.5, responsive=True)

panel = pn.Column(image, min_height=100).servable() 

Stack traceback and/or browser JavaScript console output

Screenshots or screencasts of the bug in action

1. Using fast template: only width is stretched (but not respecting aspect)
image

2. Using any other template (or no template): both height and width are stretched (but not respecting aspect)
image

@droumis droumis added the TRIAGE Default label for untriaged issues label Jul 28, 2023
@droumis droumis moved this to Todo in CZI R5 neuro Jul 28, 2023
@philippjfr
Copy link
Member

Looks like a similar issue to #5054. Can you confirm if it's the same and close if it is?

@droumis
Copy link
Member Author

droumis commented Sep 18, 2023

The part of aspect not being respected in general does look similar, but it remains an additional issue that things are broken in a unique way with the fast template. So I think this should probably stay open

@philippjfr philippjfr added type: bug and removed TRIAGE Default label for untriaged issues labels Dec 6, 2023
@droumis droumis removed this from CZI R5 neuro Jan 1, 2024
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

2 participants