recharts icon indicating copy to clipboard operation
recharts copied to clipboard

用eMap函数的时候,地图显示不完整,在linux ,shiny环境中

Open ldboyghg opened this issue 8 years ago • 6 comments

a

求指教

ldboyghg avatar Nov 18 '16 10:11 ldboyghg

可以贴下你的代码么?

Lchiffon avatar Nov 21 '16 03:11 Lchiffon

It seems good so far~

runApp(list(
  ui = bootstrapPage(
    numericInput('n', 'Number of obs', 100),
    eChartOutput('plot')
  ),
  server = function(input, output) {
    mapData <- head(mapTestData_chs, 5)
    map = eMap(mapData, namevar=~stdName, datavar = ~val1 + val2)
    output$plot <- renderEChart({ map})
  }
))

image

Lchiffon avatar Nov 21 '16 05:11 Lchiffon

同样碰到,在RStudio里正常,但是在shiny里就不正常

glfeng318 avatar Dec 19 '16 06:12 glfeng318

贴一下代码?

Lchiffon avatar Dec 19 '16 08:12 Lchiffon

library(shiny)
library(shinydashboard)

testUI <- function(id) {
  ns <- NS(id)
  
  tagList(
    fluidRow(
      valueBoxOutput(ns('box1'), width = 6),
      valueBoxOutput(ns('box2'), width = 6)
    ),
    fluidRow(
      box(title = 'title',
          width = '6',
          eChartOutput(ns('op_map'))
      )
    )
  )
}

test <- function(input, output, session) {
  output$box1 <- renderValueBox(valueBox(12345, 'test1'))
  output$box2 <- renderValueBox(valueBox(54321, 'test2'))
  output$plot_map <- renderEChart({ eMap(mapTestData_chs, namevar=~name, datavar = ~value)})
}

shinyApp(
  ui =dashboardPage(
    header = dashboardHeader(),
    sidebar = dashboardSidebar(),
    body = dashboardBody(
      testUI('moduletest')
    )
  ),
  server = function(input, output) {
    callModule(module = test, id = 'moduletest')
  }
)

shiny module

glfeng318 avatar Dec 19 '16 09:12 glfeng318

有几个小地方调了一下, 没有问题啊


  library(shiny)
  library(shinydashboard)
  
  testUI <- function(id) {
    ns <- NS(id)
    
    tagList(
      fluidRow(
        valueBoxOutput(ns('box1'), width = 6),
        valueBoxOutput(ns('box2'), width = 6)
      ),
      fluidRow(
        box(title = 'title',
            width = '6',
            eChartOutput(ns('plot_map'))
        )
      )
    )
  }
  
  test <- function(input, output, session) {
    output$box1 <- renderValueBox(valueBox(12345, 'test1'))
    output$box2 <- renderValueBox(valueBox(54321, 'test2'))
    output$plot_map <- renderEChart({ eMap(mapTestData_chs, namevar=~stdName, datavar = ~val1)})
  }
  
  shinyApp(
    ui =dashboardPage(
      header = dashboardHeader(),
      sidebar = dashboardSidebar(),
      body = dashboardBody(
        testUI('moduletest')
      )
    ),
    server = function(input, output) {
      callModule(module = test, id = 'moduletest')
    }
  )

Lchiffon avatar Mar 13 '17 03:03 Lchiffon