串扰中未出现“进行选择”框

时间:2018-09-02 07:22:04

标签: r shiny dt r-leaflet

在运行闪亮的应用程序时,双击图标后才会出现“进行选择”框。此后,如果您调整大小,它将再次消失。我已经在Firefox和Chrome中尝试过此操作。

这是我正在使用的代码:

library(crosstalk)
library(leaflet)
library(DT)
library(shiny)

ui <- fluidPage(
  fluidRow(
    column(6, leafletOutput('cmap',height=600, width='100%')),
    column(6, dataTableOutput('cmapTable'))
  )
)

server <- function(input, output, session) {
  sDraft <- SharedData$new(df)

  output$cmap <- renderLeaflet({
    leaflet(sDraft) %>% addTiles() %>%
      addMarkers(lng = ~lon, lat=~lat)
    })

  output$cmapTable <- renderDataTable({
    datatable(sDraft, options = list(scrollX = TRUE),filter='top')
  },server = FALSE)
}

shinyApp(ui, server)

以下是df数据:

structure(list(mmsi = c(538004533L, 538004534L, 538004536L, 538005117L, 
538005118L, 538005120L), Name = c("STI GARNET", "STI TOPAZ", 
"STI ONYX", "STI LE ROCHER", "STI FONTVIEILLE", "STI VILLE"), 
    Dwt = c(51840L, 51840L, 49990L, 49990L, 49990L, 49990L), 
    lat = c(25.0050144, 11.213192, 1.26014328, 13.41435, 32.3204, 
    5.7550416), lon = c(55.05124, 121.773193, 103.914574, -18.28864, 
    -117.113571, 81.47743)), row.names = c(NA, -6L), class = c("grouped_df", 
"tbl_df", "tbl", "data.frame"), vars = "mmsi", drop = TRUE, indices = list(
    0L, 1L, 2L, 3L, 4L, 5L), group_sizes = c(1L, 1L, 1L, 1L, 
1L, 1L), biggest_group_size = 1L, labels = structure(list(mmsi = c(538004533L, 
538004534L, 538004536L, 538005117L, 538005118L, 538005120L)), row.names = c(NA, 
-6L), class = "data.frame", vars = "mmsi", drop = TRUE))

我正在使用MacBook Pro(macOS High Sierra版本10.13.6)。

0 个答案:

没有答案