posit-dev / py-shinywidgets

Render ipywidgets inside a PyShiny app
MIT License
41 stars 2 forks source link

height argument to output_widget does nothing #106

Closed jacksimpsoncartesian closed 10 months ago

jacksimpsoncartesian commented 10 months ago

Description

Within a shiny app, setting the height argument in output_widget doesn't actually change the height

What I Did

This code works, but shiny does not modify the height of the widget

output_widget("map", width='800px', height='100px'),
cpsievert commented 10 months ago

Currently you need to also use the ipywidgets layout API, which effectively sizes the contents of the output_widget() container. So, if you prefer to control sizing through fixed sizes in output_widget(), consider setting layout.height = "100%" (and layout.width = "100%" if need be).

Here's an actual example with ipyleaflet

jacksimpsoncartesian commented 10 months ago

Thanks so much!

jacksimpsoncartesian commented 10 months ago

Works perfectly