Shiny 在给定图像坐标的图像上绘制项目符号/圆

Shiny 在给定图像坐标的图像上绘制项目符号/圆,shiny,shinydashboard,shinyjs,shiny-reactivity,shinyapps,Shiny,Shinydashboard,Shinyjs,Shiny Reactivity,Shinyapps,嗨,我有一个R闪亮的应用程序显示图像。我想根据图像坐标在图像上画一个项目符号/圆圈。图像坐标是从一个数据帧读取的,我想在其中迭代每一行,绘制,然后删除为每次迭代绘制的坐标 我现在有类似的东西 #UI UI <- function(id) { fluidPage( useShinyjs(), fluidRow( column(width=12, box(title='Select', width = NULL, closable = TRUE,

嗨,我有一个R闪亮的应用程序显示图像。我想根据图像坐标在图像上画一个项目符号/圆圈。图像坐标是从一个数据帧读取的,我想在其中迭代每一行,绘制,然后删除为每次迭代绘制的坐标

我现在有类似的东西

#UI
UI <- function(id) {
fluidPage(
useShinyjs(),

fluidRow(
  column(width=12,
         box(title='Select', width = NULL, closable = TRUE,
                 actionButton("draw", "draw"))
  )),

fluidRow(width=7,
         align="center",
         box(title='Draw', width=7, height = NULL,
             imageOutput("sample")
             )
         )
  )
}
#server
Server <-function(input, output, session) {
 useShinyjs()

#loop to iterate over every x,y coordinate value in data frame
 for(i in 1:nrow(data))
{
    x = data[i,1]
    y = data[i,2]
    #how do I draw these coordinates values on the below displayed image and clear 
    #the drawn figures every iteration something like addCircles() and clearShapes() in 
    #leafletProxy() used for drawing figures on maps
}
 observeEvent(input$draw, {
 output$sample<--renderImage({
 list(src = "www/data/test.png",
      contentType = 'image/png',
      width = 700,
      height = 400)
  }, deleteFile = FALSE
  )
 }
#用户界面
用户界面