Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ldboyghg opened this issue Nov 18, 2016 · 6 comments

Comments

@ldboyghg
Copy link

a

求指教

@Lchiffon
Copy link
Member

可以贴下你的代码么?

@Lchiffon
Copy link
Member

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
Copy link

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

@Lchiffon
Copy link
Member

贴一下代码?

@glfeng318
Copy link

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
Copy link
Member

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


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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants