panel icon indicating copy to clipboard operation
panel copied to clipboard

JSON Pane does not align nicely with widgets

Open MarcSkovMadsen opened this issue 3 years ago • 1 comments

Panel: 0.13.1

image

import panel as pn

pn.extension(sizing_mode="stretch_width")

pn.widgets.TextInput(value="Hello World", name="Input").servable()
pn.pane.JSON(object={"key": "value"}).servable()

It is friction that the user has to figure out how to align these them selves.

The above is just an example. The wish is that the JSON pane aligns nicely for fixed and stretch_width sizing_modes as well as in Column and Row layouts.

Workaround: margin=(10,10)

image

import panel as pn

pn.extension(sizing_mode="stretch_width")

pn.widgets.TextInput(value="Hello World", name="Input").servable()
pn.pane.JSON(object={"key": "value"}, margin=(10,10)).servable()

MarcSkovMadsen avatar Jul 31 '22 06:07 MarcSkovMadsen

Basically this is true of all panes, since widgets have a default margin of (5, 10) but (almost) all panes have a default margin of 5. Would have to decide whether to unify this.

philippjfr avatar Aug 14 '22 23:08 philippjfr