cosname / recharts

An interface to ECharts
https://recharts.cosx.org
BSD 3-Clause "New" or "Revised" License
335 stars 149 forks source link

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

Open ldboyghg opened 8 years ago

ldboyghg commented 8 years ago

a

求指教

Lchiffon commented 7 years ago

可以贴下你的代码么?

Lchiffon commented 7 years ago

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

glfeng318 commented 7 years ago

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

Lchiffon commented 7 years ago

贴一下代码?

glfeng318 commented 7 years ago
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

Lchiffon commented 7 years ago

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


  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')
    }
  )