Skip to content

feat: Migrate from Flask to Streamlit#223

Open
cegme wants to merge 2 commits into
mainfrom
streamlit
Open

feat: Migrate from Flask to Streamlit#223
cegme wants to merge 2 commits into
mainfrom
streamlit

Conversation

@cegme

@cegme cegme commented Feb 20, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Replace Flask/D3.js web app with Streamlit for browser-based visualization
  • Add Plotly visualizations (heatmaps, scatter plots, bar charts)
  • Migrate from requirements.txt to uv/pyproject.toml for dependency management
  • Convert README from RST to Markdown

Changes

New Streamlit App (streamlit_app/)

  • app.py - Main entry point
  • pages/1_Data_Config.py - Data loading and metadata configuration
  • pages/2_Visualize.py - Trend visualization, detection, and ranking
  • components/ - Plotly visualization components (heatmap, scatterplot, barchart)
  • utils/ - State management and data helpers

Features

  • Load sample datasets from data/ folder or upload CSV
  • Load saved projects with pre-computed trends
  • Interactive metadata editing with variable types and roles
  • Data augmentation (quantile binning, DPGMM clustering, intersectional variables)
  • Distance matrix heatmaps with click-to-view details
  • Scatter plots with aggregate and subgroup regression lines
  • Simpson's Paradox detection with configurable thresholds
  • Result ranking by various aggregation methods

Dependencies

  • Added: streamlit, plotly, loguru
  • Removed: flask, pandoc

How to Run

uv pip install -e .
uv run python -m streamlit run streamlit_app/app.py

Test Plan

  • Load a sample dataset (e.g., iris.csv)
  • Configure variable roles (independent, dependent, splitby)
  • Compute trends and view heatmaps
  • Click heatmap cells to see detail views
  • Test Simpson's Paradox detection
  • Test ranking functionality
  • Save and reload a project

- Replace Flask app with Streamlit multi-page application
- Add Plotly visualizations (heatmaps, scatter plots, bar charts)
- Add interactive data configuration with metadata editing
- Add Simpson's Paradox detection with configurable thresholds
- Add trend ranking functionality
- Update dependencies to use uv/pyproject.toml
- Remove requirements.txt in favor of pyproject.toml
- Convert README from RST to Markdown
- Add sample dataset selector for easy testing

Run with: uv run python -m streamlit run streamlit_app/app.py
@cegme cegme requested a review from Shine226 February 20, 2026 16:49
- Add auto-assign button to automatically set roles based on variable types
- Continuous variables assigned as independent/dependent
- Categorical/binary/ordinal variables assigned as splitby
- Add validation warnings when roles don't match variable types
- Show info message when required roles are missing
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant