AutoGraph is an intelligent data analysis platform that automatically converts raw datasets into interactive, optimal visual dashboards. It removes the need for manual data cleaning, column type identification, and chart selection by utilizing a rule-based inference engine.
The application utilizes a decoupled, modern architecture:
- Framework: Next.js (React)
- Styling: Vanilla CSS (specifically targeting an Apple-style, "glassmorphism" aesthetic)
- Data Visualization UI: Plotly.js (via
react-plotly.js)
- Framework: FastAPI (Python)
- Data Manipulation: Pandas & NumPy
- Chart Generation: Plotly Express (Python)
- Server: Uvicorn
When a user interacts with the AutoGraph application, data flows through the following pipeline:
- Upload Phase: User securely submits a file (
.csv,.xlsx, or.json) via the drag-and-drop Next.js frontend. - Ingestion & Parsing: FastAPI catches the upload stream, loads the data into isolated memory (using
io.BytesIO), and converts it into a universally operable PandasDataFrame. - Data Cleaning (
services/data_processing.py):- Empty or NA-exclusive columns are automatically dropped.
- Rows containing missing data are trimmed for visualization accuracy (while safely returning the original set if the trimming is considered too destructive).
- Type Detection (
detect_column_types):- The engine iterates through the dataframe's headers and logically deduces the contextual type of each column.
- Available internal typings match to:
time-series,numerical,categorical, ortext.
- Intelligent Chart Engine (
services/chart_engine.py):- The backend runs a matching algorithm against the detected data types to pair column combinations with their optimal visualization counterparts.
- Frontend Rendition: Plotly figures are serialized to JSON and delivered back to the React UI, which renders fully interactive, responsive charts.
The core brain of AutoGraph is its ability to map abstract data types to visual charts. The engine supports the following chart heuristics out of the box:
- Line Chart (Trend Analysis): Automatically generated if the dataset contains both a
time-seriescolumn and at least onenumericalcolumn. - Bar Chart (Comparative Total): Selected when a dataset contains a
categoricalgrouping and anumericalcolumn. Limits to the top 10 categories to avoid visual clutter. - Donut Chart (Part-to-Whole): Instantiated if a standalone
categoricaldemographic is detected, breaking down its internal proportions. - Scatter Plot (Correlation Analysis): Deployed if the engine spots at least 2 distinct
numericalcolumns, useful for identifying relationships between separate metrics. - Distribution Histogram: Generated to analyze the spread, frequency, and density of a primary
numericalcolumn.
Standard health check.
Returns: {"status": "ok", "message": "AutoGraph API is running"}
The primary endpoint for file processing.
- Form Data:
file(UploadFile object) - Accepted Formats:
text/csv,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/json
Response Structure (JSON):
{
"filename": "sales_data.csv",
"summary": {
"original_rows": 1000,
"columns": 5,
"dropped_na_rows": 12,
"final_rows": 988
},
"columns": {
"Date": "time-series",
"Revenue": "numerical",
"Region": "categorical"
},
"charts": [
{
"title": "Revenue Trend",
"explanation": "Line chart selected because 'Date' acts as a logical timeline for 'Revenue'.",
"plotly_data": {
// ... Plotly JSON figure schema
}
}
]
}