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

Adding resizable parameter to Viewable #6746

Open
philippjfr opened this issue Apr 17, 2024 · 2 comments
Open

Adding resizable parameter to Viewable #6746

philippjfr opened this issue Apr 17, 2024 · 2 comments
Labels
type: discussion Requiring community discussion

Comments

@philippjfr
Copy link
Member

philippjfr commented Apr 17, 2024

So I just had a user ask me whether it's possible to make a "Terminal component resizable" and the answer is yes, any component can easily be made resizable. I guess the question is, should this be exposed as a parameter so it is more easily discoverable?

Here is an example what you currently have to do:

pn.widgets.Terminal(
    "Welcome to the Panel Terminal!\nI'm based on xterm.js\n\n",
    options={"cursorBlink": True},
    min_height=300, sizing_mode='stretch_width',
    styles={"resize": "both", "overflow": "hidden"}
)

The alternative, I guess, is simply to find a good way to document this trick.

@philippjfr philippjfr added the type: discussion Requiring community discussion label Apr 17, 2024
@ahuang11
Copy link
Contributor

I think documenting it is best. I'm not sure it's fully compatible with all widgets (i.e. UX isn't great):

import panel as pn

pn.extension()

pn.widgets.RadioButtonGroup(
    options=["Biology", "Chemistry", "Physics"],
    value="Biology",
    sizing_mode="stretch_both",
    styles={"resize": "both", "overflow": "auto", "flex-wrap": "wrap", "display": "flex"},
)

First off, the resize draggable is all the way at the bottom right corner:

image

When it's resized smaller, it gets ugly scrollbars; ideally it'd wrap.

image

@philippjfr
Copy link
Member Author

Good point, it probably would work better with panes than widgets in general.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: discussion Requiring community discussion
Projects
None yet
Development

No branches or pull requests

2 participants