Skip to content

fortune9/interactive_plot

Repository files navigation

Interactive Plot

An interactive Shiny application that allows users to create and customize various types of plots using their own data.

Features

  • Upload CSV data files
  • Create different types of plots:
    • Scatter plots
    • Bar plots
    • Box plots
  • Customize plot appearance:
    • Point size and shape (for scatter plots)
    • Colors
    • Titles and labels
  • Dynamic interface that updates based on plot type
  • Error handling and user feedback

Installation

  1. Make sure you have R installed on your system
  2. Install the required R packages:
install.packages(c("shiny", "ggplot2", "tidyverse"))

Running the App

  1. Clone this repository
  2. Open R or RStudio
  3. Set your working directory to the project folder
  4. Run the following command:
shiny::runApp()

Usage

  1. Upload your CSV file using the file input in the sidebar
  2. Select the type of plot you want to create
  3. Choose the variables for your plot axes
  4. Customize the appearance using the available options
  5. The plot will update automatically as you make changes

Data Format

Your CSV file should be properly formatted with headers. The app can handle both numeric and categorical data, but make sure to use appropriate variables for different plot types:

  • Scatter plots: Typically use numeric variables for both axes
  • Bar plots: Can use categorical variables for x-axis and optional numeric variables for y-axis
  • Box plots: Use categorical variables for groups and numeric variables for values

Development

The application is structured as follows:

  • app.R: Main application file
  • ui.R: User interface definition
  • server.R: Server logic
  • www/: Static files (CSS, JavaScript)
  • data/: Sample data files

Deployment

Using shinyapps.io

  1. Create an account on shinyapps.io
  2. Get your account credentials (Account Name, Token, and Secret)
  3. Add these credentials to your GitHub repository secrets:
    • SHINYAPPS_USER: Your shinyapps.io account name
    • SHINYAPPS_TOKEN: Your shinyapps.io token
    • SHINYAPPS_SECRET: Your shinyapps.io secret

The app will automatically deploy to shinyapps.io when changes are pushed to the main branch.

Using Docker

To run the app using Docker:

  1. Build the Docker image:
docker build -t interactive-plot .
  1. Run the container:
docker run -p 3838:3838 interactive-plot
  1. Access the app at http://localhost:3838

License

This project is licensed under the terms of the included LICENSE file.

About

A shiny app to allow users to plot interactively

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published