renderHeatMap: Render Heat Map Plotted by ECharts into Shiny Applications

Description Usage Arguments Note Author(s) References Examples

View source: R/heat_map.R

Description

renderHeatMap() function helps render heat map charts into Shiny applications.

Usage

1
2
3
4
renderHeatMap(div_id, data,
              theme = "default",
              show.tools = TRUE,
              running_in_shiny = TRUE)

Arguments

div_id

The division id users specified for this chart. The division will be specified in ui.R.

data

The data input must be a matrix containing numeric or integer values. Users can choose to have or not have row names or columns names.

From version 2.10, the data input (matrix) must be with row names and column names.

theme

Which ECharts theme to use. Valid values include "default", "roma", "infographic", "macarons", "vintage", "shine", "caravan", "dark-digerati", "jazz", and "london".

show.tools

If display the tool bar. The default value is TRUE.

running_in_shiny

If we're actually running this in a Shiny library, or we're simply doing testing. Default valus is "TRUE". If "FALSE", the function will print what it's supposed to evaluate.

Note

Users need to state the division for the chart first, with tags$div() function of Shiny packages. Please note that the division id must keep unique (duplicated division id will cause error).

Author(s)

Xiaodong DENG

(ECharts library is authored by Baidu team)

References

https://github.com/ecomfe/echarts-wordcloud

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
if (interactive()) {
  library(shiny)
  library(ECharts2Shiny)


  # Server function -------------------------------------------
  server <- function(input, output) {
    dat <- volcano
    row.names(dat) <- 1:dim(dat)[1]
    colnames(dat) <- 1:dim(dat)[2]

    renderHeatMap(div_id = "test",
                  data = dat)
  }

  # UI layout -------------------------------------------------
  ui <- fluidPage(
    # We MUST load the ECharts javascript library in advance
    loadEChartsLibrary(),

    tags$div(id="test", style="width:50%;height:400px;"),
    deliverChart(div_id = "test")
  )

  # Run the application --------------------------------------
  shinyApp(ui = ui, server = server)
}

ECharts2Shiny documentation built on May 20, 2017, 2:19 a.m.

Search within the ECharts2Shiny package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

Please suggest features or report bugs in the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.