juba / robservable

Observable notebooks as R htmlwidgets
https://juba.github.io/robservable/
163 stars 11 forks source link

Size of animation chart won't get reduced in Xaringan #43

Closed dataning closed 3 years ago

dataning commented 3 years ago

Hi,

I have been trying the package and really love it! One thing I'm trying is to reduce the height of the COVID-19 animation chart when I put it into my Xaringan slide - I thought I could make it smaller in the slide. It didn't shrink when I changed the height parameter. Strange. I tried the Voronoi Map and it did shrink the height of the map when I changed the parameter of height.

Any ideas on how to make the animation chart smaller in R Markdown? Many thanks!

juba commented 3 years ago

Hi,

I didn't try it directly so it may not work, but changing the height parameter only changes the output div height, but the height of the chart itself is controlled in the Observable notebook by a custom chart_height setting :

https://observablehq.com/@juba/bar-chart-race#sec_settings

So you could try to change its value in the input argument, something like input(..., chart_height = 400).

Let me know if it doesn't work.

dataning commented 3 years ago

Thanks it worked!