Description Usage Arguments Note Author(s) References Examples
renderHeatMap() function helps render heat map charts into Shiny applications.
1 2 3 4 5 | renderHeatMap(div_id, data,
theme = "default",
show.tools = TRUE,
grid_left = "3%", grid_right = "4%", grid_top = "16%", grid_bottom = "3%",
running_in_shiny = TRUE)
|
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. |
grid_left |
Distance between grid component and the left side of the container. Default value is "3%". |
grid_right |
Distance between grid component and the right side of the container. Default value is "4%". |
grid_top |
Distance between grid component and the top side of the container. Default value is "16%". |
grid_bottom |
Distance between grid component and the bottom side of the container. Default value is "3%". |
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. |
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).
Xiaodong DENG
(ECharts library is authored by Baidu team)
https://github.com/ecomfe/echarts-wordcloud
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)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.