1
私は数秒ごとに更新される1つのggplotしか持たない小さな光沢のあるアプリをやっています。それは動作しますが、点滅は少し迷惑です。私は誰かがそれをいかに滑らかにするかについての考えを持っているのだろうかと思います。例:光るRアプリで点滅するggplot
library(shiny)
library(ggplot2)
server <- shinyServer(function(input, output, session) {
output$showplot <- renderPlot({
grid <- expand.grid(1:3,1:3)
nums <- rbinom(9,1,0.5)
g <- ggplot(grid,aes(Var1,Var2)) +
geom_tile(aes(fill = nums),colour="black") +
guides(fill = FALSE) +
theme(axis.title.x=element_blank(), axis.text.x=element_blank(), axis.ticks.x=element_blank()) +
theme(axis.title.y=element_blank(), axis.text.y=element_blank(), axis.ticks.y=element_blank()) +
theme(aspect.ratio=1)
print(g)
invalidateLater(1000,session)
})
})
ui <- shinyUI(fluidPage(
sidebarLayout(
sidebarPanel(
),
mainPanel(
h5("Plot blinking"),
plotOutput("showplot")
)
)
))
runApp(list(ui = ui, server = server))
私は同様の質問を探しまわっている間、提供ソリューションはFluidPageの最初の項目として
tags$style(type="text/css",
".recalculating {opacity: 1.0;}"),
を追加されたことを追加する必要があります。これは私の場合にはうまくいかないようです。
あなたはどのオペレーティングシステムとWebブラウザを使用していますか?私は、RStudio 0.99.491、Chrome 52.0.2743.116、またはFirefox ESR 45.3.0のDebian 8マシンのプロットでは、 "点滅"していません。 (R 3.31、ggplot2_2.2.1、shiny_0.13.0) – Peter
ああ、私はそれについて考えなかった。ウィンドウ10、Firefox 48.0、ggplot2_2.1.0 shiny_0.12.2、Rバージョン3.2.2。 firefoxでは点滅しますが、Chrome 52.0.2743.116では点滅しません。 Hmn –