CoolFace
Apppublic

flowers4algernon/hf-project-peacock

sourceHugging Faceupdated 11mo agoView on Hugging Face
1likes
App README

Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference

๐Ÿ“Š Shiny Demographic & Persona Dashboard

This repository contains a Shiny web application for visualizing demographic data, personas, and related analytics. The app provides an interactive interface for exploring key indicators, visual summaries, and downloadable reports through a clean and responsive UI.


๐Ÿš€ Features

  • โ€”Interactive Landing Page: Navigate between demographics, persona insights, and additional visual modules.
  • โ€”Dynamic Visualizations: Interactive plots, tables, and UI elements built using Shiny reactive programming.
  • โ€”Custom Styling: A clean, professional look powered by styles.css, including hover effects, responsive layouts, and consistent theming.
  • โ€”Downloadable Data: Export tables and plots using download buttons styled with .down class.
  • โ€”Modular Structure: Each component (Demographics, Persona, etc.) is modularized for maintainability.

๐Ÿงฉ Repository Structure

.
โ”œโ”€โ”€ global.R              # Loads libraries, global variables, and data sources
โ”œโ”€โ”€ ui.R                  # Defines the main UI layout and navigation
โ”œโ”€โ”€ server.R              # Contains server logic and reactivity
โ”œโ”€โ”€ demographicsPageNew.R # Module for demographics data and visualizations
โ”œโ”€โ”€ personaPage.R         # Module for persona-level insights
โ”œโ”€โ”€ styles.css            # Custom CSS for styling the UI
โ””โ”€โ”€ README.md             # Documentation (this file)

โš™๏ธ Installation & Setup

Prerequisites

  • โ€”R โ‰ฅ 4.1
  • โ€”Shiny โ‰ฅ 1.7
  • โ€”Recommended packages:
r
  install.packages(c(
    "shiny", "tidyverse", "plotly", "DT", "shinythemes",
    "shinydashboard", "readr", "dplyr", "ggplot2"
  ))

Running the App

Clone the repository and run:

r
# In R console
library(shiny)
runApp("path/to/this/repo")

Or directly from within RStudio:

r
shiny::runApp()

๐ŸŽจ UI & Styling

The styles.css file defines consistent design rules across the app:

  • โ€”.landing-page-box, .landing-page-icon: hover-enabled cards with icons
  • โ€”.depr-text-box: styled informational boxes
  • โ€”.down: custom buttons for downloads
  • โ€”.navbar, .well, .definitionbox: styled navigation and layout elements

๐Ÿง  Modules Overview

ModuleFileDescription
DemographicsdemographicsPageNew.RDisplays demographic data summaries and charts
PersonapersonaPage.RVisualizes personas and behavioral patterns
Globalglobal.RDefines global variables, functions, and loads data
Server/UIserver.R / ui.RCore Shiny logic and layout definition

๐Ÿ“ Data Inputs

You can connect the app to your data by updating the data loading section in global.R. Ensure CSVs or APIs used are accessible in your environment.


๐Ÿงช Development Notes

  • โ€”CSS errors are suppressed in Shiny using:
css
  .shiny-output-error { visibility: hidden; }
  .shiny-output-error:before { visibility: hidden; }
  • โ€”Follows modular design principles โ€” easy to extend with new pages.
  • โ€”Supports deployment on shinyapps.io or internal Shiny Server.

๐Ÿ™Œ Acknowledgments

  • โ€”Built with โค๏ธ using R Shiny.
  • โ€”Inspired by public health and demographic visualization dashboards.