我使用ggplot2绘制了一幅图片,并希望在shinyApp中用svgPanZoom包显示它。但圣器已经消失了。有人知道为什么吗?您可以运行以下代码以获得详细信息:
library(shiny)
library(svglite)
library(svgPanZoom)
library(ggplot2)
data<-data.frame(x=1:10,y=1:10)
ui <- shinyUI(bootstrapPage(
svgPanZoomOutput(outputId = "main_plot")
))
server = shinyServer(function(input, output) {
output$main_plot <- renderSvgPanZoom({
p <- ggplot(data, aes(x = x, y = y)) + geom_point()
svgPanZoom(p, controlIconsEnabled = T)
})
})
shinyApp(ui,server)发布于 2018-04-27 05:54:27
我相信你也需要加入svglite
library("svglite")然后将svgPanZoom调用替换为
svgPanZoom(
svglite:::inlineSVG(
show(p)
),
controlIconsEnabled = T
)https://stackoverflow.com/questions/50055111
复制相似问题