-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* initial commit for heat map * Furnished for heat map
- Loading branch information
Showing
6 changed files
with
206 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
library(shiny) | ||
library(ECharts2Shiny) | ||
|
||
dat_1 <- volcano | ||
|
||
dat_2 <- volcano | ||
row.names(dat_2) <- 1:dim(dat_2)[1] | ||
colnames(dat_2) <- 1:dim(dat_2)[2] | ||
|
||
shinyServer(function(input, output) { | ||
|
||
# Call functions from ECharts2Shiny to render charts | ||
renderHeatMap(div_id = "test_1", | ||
data = dat_1) | ||
|
||
renderHeatMap(div_id = "test_2", theme = "macarons", | ||
data = dat_2) | ||
|
||
} | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
library(shiny) | ||
library(ECharts2Shiny) | ||
|
||
shinyUI(fluidPage( | ||
|
||
# We HAVE TO to load the ECharts javascript library in advance | ||
loadEChartsLibrary(), | ||
loadEChartsTheme("macarons"), | ||
|
||
h3("To Give A Matrix without Row Names or Column Names", align = "center"), | ||
tags$div(id="test_1", style="width:100%;height:400px;"), | ||
deliverChart(div_id = "test_1"), | ||
|
||
h3("To Give A Matrix with Row Names & Column Names", align = "center"), | ||
tags$div(id="test_2", style="width:100%;height:400px;"), | ||
deliverChart(div_id = "test_2") | ||
|
||
) | ||
) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
\name{renderHeatMap} | ||
\alias{renderHeatMap} | ||
\title{ | ||
Render Heat Map Plotted by ECharts into Shiny Applications | ||
} | ||
\description{ | ||
renderHeatMap() function helps render heat map charts into Shiny applications. | ||
} | ||
\usage{ | ||
renderHeatMap(div_id, data, | ||
theme = "default", | ||
show.tools = TRUE, | ||
running_in_shiny = TRUE) | ||
} | ||
%- maybe also 'usage' for other objects documented here. | ||
\arguments{ | ||
\item{div_id}{ | ||
The division id users specified for this chart. The division will be specified in ui.R. | ||
} | ||
\item{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. If row names or column names are assigned to the matrix, the names will be the axis label. Otherwise, the axis label will be empty. | ||
} | ||
\item{theme}{ | ||
Which ECharts theme to use. Valid values include "default", "roma", "infographic", "macarons", "vintage", "shine". | ||
} | ||
\item{show.tools}{ | ||
If display the tool bar. The default value is TRUE. | ||
} | ||
\item{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. | ||
} | ||
} | ||
\references{ | ||
https://github.com/ecomfe/echarts-wordcloud | ||
} | ||
\author{ | ||
Xiaodong DENG | ||
(ECharts library is authored by Baidu team) | ||
} | ||
\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). | ||
} | ||
\examples{ | ||
# please refer to vignettes or /example folder on GitHub homepage for the practical examples | ||
renderHeatMap("test", data = volcano, running_in_shiny = FALSE) | ||
} | ||