jmosbacher/pydantic-panel

sizing_mode="stretch_width" does not work

MarcSkovMadsen opened this issue · 3 comments

I almost always use sizing_mode="stretch_width". But I can see its not supported.

image

import pydantic


class SomeModel(pydantic.BaseModel):
   name: str
   value: float

import panel as pn

import pydantic_panel as pp

pn.extension()

pn.panel(SomeModel, sizing_mode="stretch_width")

widget = pn.panel(SomeModel)
layout = pn.Column(widget, widget.json)
layout.servable()

Workaround

Adding pn.extension(sizing_mode="stretch_width") makes it work

image

Please note I added a request to get the margin of the JSON pane adjusted. See holoviz/panel#3736

Yeah I still havent decided on a strategy for propagating sizing options down to sub widgets.
Some sub widgets are naturally larger then others and also depends on whether the subwidgets are in a Row-like container or Column-like. SO I'm expecting it to be not trivial to do right.
Suggestions are very welcome, although probably wont have time to implement in very near future.