小编Jam*_*ssy的帖子

在 R Shiny 标题中制作图像超链接

我一直在尝试将图像输出超链接到网站,但我在仔细阅读有关堆栈溢出的其他问题时遇到了麻烦

svg 带有闪亮的可点击链接 - 不可点击

http://www.invisiblecompany.com/shiny%20parts/archives/2004/11/clickable-logo.php

http://www.leahkalamakis.com/add-an-image-to-your-sidebar-make-it-clickable/

标签不起作用

服务器文件

library(shiny)
library(png)


server <- shinyServer(function(input, output) { 

output$image1 <- renderImage({
  width<- "100%"
  height<- "100%"
list(src = "www/logo.png",
     contentType = "image/png",
     width = width,
     height = height,
)

}, deleteFile = FALSE)
output$text1 <- renderText({ "please help make the image hyperlinked"     })


})
Run Code Online (Sandbox Code Playgroud)

用户界面

library(shiny)



ui <- shinyUI(pageWithSidebar(
 titlePanel(imageOutput("image1")),

sidebarPanel(
  helpText(   a("Click Here for the Source Code on Github!",         href="https://github.com/Bohdan-Khomtchouk/Microscope",target="_blank"))

 ),
 mainPanel(
tabsetPanel(


  tabPanel("Instructions",textOutput("text1"))
))
))
Run Code Online (Sandbox Code Playgroud)

你可以用你想要的任何东西替换 logo.png 我认为超链接在服务器的列表中。

html r hyperlink shiny

5
推荐指数
1
解决办法
5145
查看次数

为什么webshot不能使用R闪亮的传单?

首先关闭webshot在这个背景下没有工作webshot("google.com")webshot("www.google.com")我得到:

        env: node\r: No such file or directory
        Error in webshot("google.com") : webshot.js returned failure value: 127
Run Code Online (Sandbox Code Playgroud)

所以这不适用于传单代码

    staters <<-    
   readOGR(dsn="cb_2015_us_county_20m",layer="cb_2015_us_county_20m")
  getMap<-function()({

leaflet(staters) %>%
  addPolygons( stroke = T, fillOpacity =.7, smoothFactor = 0, color = "black",
               weight = .5, fill = T, fillColor = "red"
  )
output$downloadMap <- downloadHandler(
filename = function() { paste(input$chooseStates, '.png', sep='') },
content = function(file) {
  # temporarily switch to the temp dir, in case you do not have write
  # permission to the current …
Run Code Online (Sandbox Code Playgroud)

r leaflet shiny

5
推荐指数
1
解决办法
582
查看次数

如何解绑 git 包?

我刚刚通过电子邮件收到了一个 Git 包。我如何解开它才能阅读它?我在使用 unbundle 命令时遇到问题。我试过了

git unbundle *bundle name* 
Run Code Online (Sandbox Code Playgroud)

但这给了我一个奇怪的代码

eae0b00697e53cd87c871143051673f3ee413148  
Run Code Online (Sandbox Code Playgroud)

和 refs/heads/master

git bundle git-bundle

5
推荐指数
1
解决办法
5431
查看次数

在Facebook Messenger发送位置

试图从我的机器人向用户发送位置?这是允许的吗?如果是,我的代码出了什么问题,我的JSON格式是正确的,我得到了

error:  { message: '(#100) Unsupported attachment type',
    type: 'OAuthException', 
    code: 100,
    error_subcode: 2018046,
    fbtrace_id: 'CObB3+0fgMw' }
Run Code Online (Sandbox Code Playgroud)

如果有人能够提供背景,那就太好了

function sendLocationMessage(sender,event){
    let messageData={
         attachment: {
            "type": "location",
            "payload": {
              "coordinates":{
                 "lat": event.message.attachments[0].payload.coordinates.lat,
                 "long": event.message.attachments[0].payload.coordinates.long
    }    }
}
    }
     request({
        url: 'https://graph.facebook.com/v2.6/me/messages',
        qs: {access_token:token},
        method: 'POST',
        json: {
            recipient: {id:sender},
            message: messageData,
        }
    }, function(error, response, body) {
        if (error) {
            console.log('Error sending messages: ', error)
        } else if (response.body.error) {
            console.log('Error: ', response.body.error)
        }
    })
}
Run Code Online (Sandbox Code Playgroud)

facebook bots facebook-messenger

1
推荐指数
1
解决办法
3203
查看次数

标签 统计

r ×2

shiny ×2

bots ×1

bundle ×1

facebook ×1

facebook-messenger ×1

git ×1

git-bundle ×1

html ×1

hyperlink ×1

leaflet ×1