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

Image not scaling dynamically #1777

Closed
johnzeringue opened this issue Nov 12, 2020 · 3 comments · Fixed by #1789
Closed

Image not scaling dynamically #1777

johnzeringue opened this issue Nov 12, 2020 · 3 comments · Fixed by #1789
Labels
type: bug Something isn't correct or isn't working

Comments

@johnzeringue
Copy link

ALL software version info

Python 3.9.0

bokeh==2.2.3
notebook==5.7.9
panel==0.10.1

macOS Catalina 10.15.7

Chrome 85.0.4183.121

Description of expected behavior and the observed behavior

Expected

I should be able to scale image up and down dynamically in Jupyter Notebook and using the standalone server.

Observed

In the notebook, I'm able to scale up and down <= 300 width. I can't make the image larger than 300 pixels wide.

Using the standalone server, it looks like it scales just once (either up or down) and then gets stuck.

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

import panel as pn

def panel_logo(width=300):
    # also happens with .jpg
    return pn.panel("https://panel.holoviz.org/_static/logo_stacked.png", width=width)

pn.interact(panel_logo)
@philippjfr philippjfr added the type: bug Something isn't correct or isn't working label Nov 12, 2020
@jbednar
Copy link
Member

jbednar commented Nov 12, 2020

I can reproduce in Jupyter:

image
image
image

@jbednar
Copy link
Member

jbednar commented Nov 12, 2020

If I increase the initial width to 1000 it works up to 1000, so this seems like the same issue as for the Bokeh layout of a single-digit number, where there's no room left for the number to increase in size.

@johnzeringue
Copy link
Author

It's probably worth adding that in the original use case, I was changing the URL too. Not sure if that makes it different from the single-digit number case layout-wise.

Using this code

import panel as pn

logo_urls = {
    "panel": "https://panel.holoviz.org/_static/logo_stacked.png",
    "hvplot": "https://hvplot.holoviz.org/assets/hvplot-wm.png",
}

def panel_logo(logo="panel", width=300):
    return pn.panel(logo_urls[logo], width=width)

pn.interact(panel_logo, logo=logo_urls.keys())

You have the case

  1. Load default (Panel logo, width 300)
  2. Change width to 600 (no change in image size)
  3. Change logo to hvPlot (image width is 600!)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't correct or isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants