dgrtwo / knowledgerepo

R Interface to AirBnb's Knowledge Repository
Other
28 stars 4 forks source link

Feature request: srcdoc iframe htmlwidget to embed plotly #4

Open dgrtwo opened 5 years ago

dgrtwo commented 5 years ago

I haven't been able to embed plotly in the document, partly because the knowledgerepo includes an incompatible version of JQuery.

A possible solution would be a function that wraps an htmlwidget (like a result of ggplotly) and turns it into an iframe with a srcdoc containing that HTML, and with the necessary JavaScript headers included.

dgrtwo commented 5 years ago

Likely approach, where p is the widget:

htmltools::tags$iframe(srcdoc = repr::repr_html(p), width = "100%", height = "300px")