R svgPanZoom within shinyApp display different in the Web and Rstudio

本小妞迷上赌 提交于 2019-12-06 11:57:47

Finally, I try the package "SVGAnnotation" and fortunately solved the problem.

I had a similar problem, and fixed it very easily. Here are the snippets from ui.R:

svgPanZoomOutput(outputId = "betaPlot", height = "800px")

and server.R

p = ggplot(blah blah)

    svgPanZoom(
  svglite::stringSVG(print(p), standalone = F),
  controlIconsEnabled = T, viewBox = FALSE
)

It's the viewBox = FALSE that you need for an external browser, and you need to adjust the height of the graph in ui.R otherwise the controls don't show.

Load library(svglite) and library(svgPanZoom), obviously

Well, it worked for me anyway

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!