Lchiffon / REmap

create a map by R
255 stars 128 forks source link

shinydashboard中如何展示REmap?DT::dataTableOutput一起用显示空白? #29

Open maliang1202 opened 6 years ago

maliang1202 commented 6 years ago

你好,请问:

UI: tabItems( tabItem(tabName = "wifi_01_company", tabsetPanel(type = "tabs",

height = "100%", width = "100%",

            tabPanel("行为轨迹",
                     icon = icon("tag"),
                     #REmapOutput("track_train"),
                     hr(),
                     #DT::dataTableOutput('tab_hot_train'),
                     hr()
            ),

Server: output$track_train <- renderREmap( remapB( center = BJU, zoom = 9, color = "grassgreen", markLineData = markLine_data, markPointData = markPointData, markLineTheme = markLine_Control, markPointTheme = markPointTheme, geoData = gdata )) 在上述代码中无法显示地图,且影响界面的其它组件使用,请问如何解决呢?

代码在如下情况下能够正常展示地图: body <- dashboardBody( tabsetPanel(type = "tabs", tabPanel("行为轨迹",icon = icon("tag"), REmapOutput("track_train"), hr()

DT::dataTableOutput('tab_hot_train')

           )))
Lchiffon commented 6 years ago

能给段可执行代码么? 后面说的那个应该是正常情况

maliang1202 commented 6 years ago

代码:https://github.com/maliang1202/Learn/blob/master/shinydashboard

maliang1202 commented 6 years ago

@Lchiffon 请专家帮忙看看,谢谢。

Lchiffon commented 6 years ago

和这个 https://github.com/rstudio/shinydashboard/issues/251 类似?

Lchiffon commented 6 years ago

好像是一些和shinydashboard的冲突

Lchiffon commented 6 years ago

明白了 Echarts.js和adminLTE.js都会使用$来作为一个调用的接口, 产生了冲突, 在JS层面产生了冲突, 所以不能同时使用

除了把它用htmlwidgets重写掉之外, 我想不出有什么解决的方法...

maliang1202 commented 6 years ago

@Lchiffon 非常感谢 :+1:

englianhu commented 2 years ago

echarts4r被RStudio幕后工作人员修改人为篡改,导致在rmarkdown无法正常显示~

明白了 Echarts.js和adminLTE.js都会使用$来作为一个调用的接口, 产生了冲突, 在JS层面产生了冲突, 所以不能同时使用 除了把它用htmlwidgets重写掉之外, 我想不出有什么解决的方法...

这个REmap也一样,可否瞧瞧?怎么修正htmlwidgets呢?

(1) 提示信息~

prefer_conflicts('xxx$xxx', 'Echarts.js')
prefer_conflicts('xxx$xxx', 'adminLTE.js')

或者 (2)在htmlwidgets程序包函数中添加条件式调用~

if(xxx == 'echarts.js') { 
   xxxxx
} else if(xxx == 'adminLTE.js') {
   xxxxx
}

https://user-images.githubusercontent.com/7227582/161288371-000ca42c-818d-4e00-9f77-e3186a0f1459.mp4

shinyWidgets::prettyRadioButtons也一样...


相关文章:

englianhu commented 2 years ago

明白了 Echarts.js和adminLTE.js都会使用$来作为一个调用的接口, 产生了冲突, 在JS层面产生了冲突, 所以不能同时使用

除了把它用htmlwidgets重写掉之外, 我想不出有什么解决的方法...

如果是需要地图,可以通过MapBoxSimpleMapsOpenStreetMap 下载,不过韦经度得修改~

You can use the map_data function from the {ggplot2} package to pull data for maps at different levels (“usa,” “state,” “world,” “county”). The data you pull give locations of the borders of geographic polygons like states and counties. For example, you can get the polygon location data for U.S. states by running the following code

引用:Mastering Software Development in R - 4.3 Mapping

map_data 有许多地方的地方名称信息不完整,需要标签地点名称~

maps程序包或者Adding Data Points to world map in R有完整的数据~

参考文献