Flow Chart Maker is a simple R script that builds interactive flow charts using the VisNetwork
package. It takes as input an Excel file with at least three columns: id
, from
, and name
. Users can add as many extra columns as they wish, and the information in these columns will be displayed as a popup when hovering over a node in the flow chart. The script will output an interactive flow chart in html format which can be opened and explored in any standard web browser.
- Generates interactive flow charts from Excel files.
- Hovering the mouse over each node will reveal the additional information (one line per column in the excel file).
- Users can select specific nodes and visualize their ancestors/offspring.
To use the Flow Chart Maker script, you need to have R and RStudio installed on your system.
- Go to the CRAN R Project website.
- Download the appropriate version of R for your operating system.
- Follow the installation instructions provided on the website.
- Go to the RStudio website.
- Download the free version of RStudio for your operating system.
- Install RStudio by following the provided instructions.
The script automatically checks for the necessary packages and installs them if they are not already installed. If you get the following warning:
Warning in install.packages: unable to access index for repository http://cran.rstudio.com/src/contrib: cannot open URL
You might be behind a firewall that is preventing RStudio to access the CRAN repositories. As a workaround, you can change secure connection settings. Go to Tools -> Global Options -> Packages-> Management Tab-> Uncheck "Use secure download method for HTTP" However, if you prefer to mantain using HTTPS for downloading (recommended), please refer to this link.
-
Download the repository:
- Go to the GitHub repository page:
- Click on the green "Code" button.
- Select "Download ZIP".
- Extract the downloaded ZIP file to a directory on your computer.
-
Open the script in RStudio:
- Open RStudio.
- Go to
File -> Open File...
and navigate to the directory where you extracted the ZIP file. - Select the
Flow Chart Maker.R
script and open it.
-
Run the script:
-
Click on the scrip and press CTRL+A (CMD+A on MAC) to select the whole scritp.
-
Click on the "Run" button in RStudio to execute the script.
-
When you run the script, it will prompt you to select an Excel file. Ensure your Excel file has at least the following three columns:
- id: Unique identifier for each node. Can be numeric or a string. IDs must be unique for each row.
- from: Identifier of the node from which the current node originates. Must match an ID present in the id columns.
- name: Name or label of the node.
-
The HTML file containing the flow chart will be generated in the same directory as the input file.
-
OBS: In principle the script can be ran from the R GUI, without needing RStudio. However, currently it will not work if ran from terminal, as it requires a GUI environment.
-
Here is an example of how your input Excel file might look:
id | from | name | info |
---|---|---|---|
1 | Start | Starting node | |
2 | 1 | Step 1 | First step |
3 | 2 | Step 2 | Second step |
4 | 2 | Step 3 | Third step |
The flow chart then should look like this:
You can add as many columns as you wish, as long as id
, from
, and name
are present.
Gabriel H. Negreira
This project is licensed under the MIT License. See the LICENSE file for details.
Special thanks to the developers of the tidyverse
, stringr
, readr
, visNetwork
, and readxl
packages for providing the tools necessary for this script.