Usage and installation of shinyPie

This is the repository for the Shiny application presented in “shinyPie: make pie chart in R with shiny .


Use shinyPie online

shinyPie is deployed at http://150.109.59.144:3838/shinyPie/ for online use.
shinyPie is idle until you activate it by accessing the URLs.
So, it may take some time when you access this URL for the first time.
Once it was activated, shinyPie could be used smoothly and easily.


Launch shinyPie directly from R

User can choose to run shinyPie installed on local computers (Windows, Mac or Linux) for a more preferable experience.

Step 1: Install R and RStudio

Before running the app you will need to have R and RStudio installed (tested with R 3.5.0 and RStudio 1.1.419).
Please check CRAN (https://cran.r-project.org/) for the installation of R.
Please check https://www.rstudio.com/ for the installation of RStudio.

Step 2: Install the R Shiny package and other packages required by shinyPie

Start an R session using RStudio and run these lines:

# try an http CRAN mirror if https CRAN mirror doesn't work
install.packages("shiny")
install.packages("data.table")
install.packages("shinythemes")
install.packages("shinyBS")
install.packages("plotrix")

Step 3: Start the app

Start an R session using RStudioun these lines:

shiny::runGitHub("SHINYPIE", "qiuyv")  

Deploy shinyPie on local or web Linux server

Step 1: Install R

Please check CRAN (https://cran.r-project.org/) for the installation of R.

Step 2: Install the R Shiny package and other packages required by shinyPie

Start an R session and run these lines in R:

# try an http CRAN mirror if https CRAN mirror doesn't work  
install.packages("shiny")
install.packages("data.table")
install.packages("shinythemes")
install.packages("shinyBS")
install.packages("plotrix")

For more information, please check the following pages:
https://cran.r-project.org/web/packages/shiny/index.html
https://github.com/rstudio/shiny
https://shiny.rstudio.com/

Step 3: Install Shiny-Server

Please check the following pages for the installation of shiny-server.
https://www.rstudio.com/products/shiny/download-server/
https://github.com/rstudio/shiny-server/wiki/Building-Shiny-Server-from-Source

Step 4: Upload files of shinyPie

Put the directory containing the code and data of shinyPie to /srv/shiny-server.

Step 5: Configure shiny server (/etc/shiny-server/shiny-server.conf)

# Define the user to spawn R Shiny processes
run_as shiny;

# Define a top-level server which will listen on a port
server {  
  # Use port 3838  
  listen 3838;  
  # Define the location available at the base URL  
  location /shinyPie {  
    # Directory containing the code and data of shinyPie  
    app_dir /srv/shiny-server/shinyPie;  
    # Directory to store the log files  
    log_dir /var/log/shiny-server;  
  }  
}  

Step 6: Change the owner of the shinyPie directory

$ chown -R shiny /srv/shiny-server/shinyPie  

Step 7: Start Shiny-Server

$ start shiny-server  

Now, the shinyPie app is available at http://IPAddressOfTheServer:3838/shinyPie/.

Application_instruction.utf8.md

使用说明

1.pie2D

1.1 点击Browse上传本地数据,数据的格式应符合下列要求。

数据应只有两列且两列生物顺序是固定的,列名是可以选择的。.
第一列: 数据种类。 第二列: 百分比。

数据的格式应该和下面一样。

 chr    percent
chr1    30
chr2    20
chr3    10
chr4    15
chr5    25

1.2 点击Go运行这个应用,就会出来饼图。

1.3 数据颜色

数据颜色是让饼图之间数据不单调,变得明显。用于渲染数据的颜色,可以由应用程序随机分配,也可以由用户指定。默认情况下,将使用shinypie指定的颜色。若要自定义数据的一种颜色,用户应给每个数据选择颜色。

1.4 标题

用户可根据自己的爱好命名饼图

1.5 列数

列数是数据有几列,用户可凭自己的爱好通过改变[1,10]中的一个整数,1为一个数值单位,来调整数据排成几列。

2.pie3D

2.1 点击Browse上传本地数据,数据的格式应符合下列要求。

数据应只有两列且两列生物顺序是固定的,列名是可以选择的。.
第一列: 数据种类。 第二列: 百分比。

数据的格式应该和下面一样。

 chr    percent
chr1    30
chr2    20
chr3    10
chr4    15
chr5    25

2.2 点击Go运行这个应用,就会出来饼图。

2.3 数据颜色

数据颜色是让饼图之间数据不单调,变得明显。用于渲染数据的颜色,可以由应用程序随机分配,也可以由用户指定。默认情况下,将使用shinypie指定的颜色。若要自定义数据的一种颜色,用户应给每个数据选择颜色。

2.4 标题

用户可根据自己的爱好命名饼图

2.5 爆裂度

爆裂度是饼图之间饼块的距离,可通过改变[0,1]中的一个十进制数,0.2为一个数值单位,用于调整饼块之间的距离。

2.6 半径

半径是控制饼图大小,可改变[0,1]中的一个十进制数,0.1为一个数值单位,用于调整饼图的半径。

2.7 标签大小

标签大小是每个数据在饼图中呈现的大小,可通过改变[0,1.5]中的一个十进制数,0.1为一个数值单位,用于调整数据在图中的大小。

2.8 倾斜度

倾斜度是改变饼图在背景中的倾斜情况,可通过改变[0,1]中的一个十进制数,0.1为一个数值单位,用于调整饼图的倾斜度。

2.9 列数

列数是数据有几列,用户可凭自己的爱好通过改变[1,10]中的一个整数,1为一个数值单位,来调整数据排成几列。

3.下载

在完成饼图编辑之后,可以将饼图下载到本地,本应用程序提供了两种下载文件,分别是pdf和svg文件格式,用户可根据喜好选择下载。

Software references

  1. R Development Core Team. R: A Language and Environment for Statistical Computing. R Foundation for Statistical Computing, Vienna (2013)
  2. RStudio and Inc. shiny: Web Application Framework for R. R package version 0.5.0 (2013)
  3. Neuwirth, E. RColorBrewer: ColorBrewer palettes. R package version 1.0-5. (2011)
  4. Matt Dowle and Arun Srinivasan.data.table: Extension of ‘data.frame’.R package version 1.12.2(2019)
  5. Jim Lemon and Ben Bolker.plotrix: Various Plotting Functions.R package version 3.7-5(2019)
  6. Winston Chang and RStudio.shinythemes: Themes for Shiny.R package version 1.1.2(2018)
  7. Eric Bailey.shinyBS: Twitter Bootstrap Components for Shiny.R package version 0.61(2015)

Further references

This application was created by Wen Yao and Yu Qiu. Please send bugs and feature requests to Wen Yao and Yu Qiu. This application uses the shiny package from RStudio.