posit-dev / positron

Positron, a next-generation data science IDE
Other
1.54k stars 43 forks source link

R: Respect HTML widget requested height #1743

Open jmcphers opened 8 months ago

jmcphers commented 8 months ago

HTML Widgets for R can request a particular height; it is passed as the height argument to the viewer function.

https://github.com/ramnathv/htmlwidgets/blob/7c5594a10bdd74d8f4ece178d31ae97c4592c351/R/htmlwidgets.R#L9-L19

We are currently ignoring this argument.

https://github.com/posit-dev/amalthea/blob/2fdb09ca13dd0ff86cdaf0a75dac8b3c07acea7d/crates/ark/src/modules/public/viewer.R#L8

However, we should respect the height in some way if we can. In particular, a height of maximize is a hint that we should display the widget in our Viewer tab (which is full height by default) rather than Plots (which is not).

jmcphers commented 8 months ago

We may also be able to size the Viewer and/or Plots panes if there are other panes in their panel.

jmcphers commented 4 months ago

RC, since a number of HTML widgets are not plots and look exceedingly dumb in the Plots pane.