Invalidate Later in Shiny

狂风中的少年 提交于 2020-01-02 07:17:09

问题


I am using

invalidateLater(5000, session)

in my Shiny code and it is working. Every 5 seconds I have a query that is refreshed and a plot is updated. BUT the screen and plots go GRAY every 5 seconds so it looks like the page is dead while the updating occurs. Is there a way to make ONLY the plots update and have the page avoid looking like it's dead?

@JOhn - THank you here is my ui.r

shinyUI(pageWithSidebar(
  headerPanel("tst"),
  sidebarPanel(
    sliderInput("n", "Number of plots", value=2, min=1, max=7),
    width = 2
  ),
  mainPanel(
    # This is the dynamic UI for the plots
    uiOutput("plots")

  )
))

Thank you.


回答1:


The issue is that when something is being updated, the default .css gives it a class of .recalculating and that is what makes it look gray. You can fix this by putting

tags$style(type="text/css",
  ".recalculating { opacity: 1.0; }"
)

in your ui.r or putting the equivalent in you .css ifyou are using one. Obviously, if you know CSS you can experiment with other ideas as well.



来源:https://stackoverflow.com/questions/28094844/invalidate-later-in-shiny

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