微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

仪表板上的天气信息

如何解决仪表板上的天气信息

我需要在仪表板上添加天气信息。通常,标签$ iframe将用于此目的,但在仪表板中将无法使用。我使用了以下代码

 server <-shinyServer(function(input,output,session) {
 observe({
 input$btn
session$sendCustomMessage(type = "resetFileInputHandler","file1")  
})})
ui <-shinyUI(bootstrapPage(
dbHeader <- dashboardHeader(title = "",tags$li(a(href = '',icon(""),title = ""),class = "dropdown"),tags$li(a(href = 'https://www.redhat.com/en',img(src = '1.jpg',title = "redhat",height = "70px",style = "align:centre;"),style = "padding-top:5px; padding-bottom:5px;"),tags$li(a(href = 'https://ubuntu.com/',img(src = '2.png',title = "ubuntu",height = "70px"),(src = "https://forecast.io/embed/#lat=42.3583&lon=-71.0603&name=Boston"
                                    ),class = "dropdown")
),fileInput('file1','Choose File'),actionButton("btn","Trigger server to reset file   input"),tags$script('
 Shiny.addCustomMessageHandler("resetFileInputHandler",function(x) {      
    var id = "#" + x + "_progress";
    var idBar = id + " .bar";
    $(id).css("visibility","hidden");
    $(idBar).css("width","0%");
   });
  ')
  ))

预期输出

enter image description here

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。