Skip to content

feat(examples): add startup funding dashboard with funding round and industry insights. #745

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions examples/startup_funding_tracker/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# 🚀 Startup Funding Tracker with Preswald

This interactive dashboard visualizes startup funding data, offering insights into funding distribution across industries, funding rounds, and years.

## 🔧 Setup Instructions

1. **Add your data**
Place the `funding.csv` file inside the `data/` directory.

2. **Configure the data source**
Open the `preswald.toml` file and set the data source to point to your CSV.

3. **Run the dashboard**
Use the following command to start the app:
```bash
preswald run hello.py
21 changes: 21 additions & 0 deletions examples/startup_funding_tracker/data/funding.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
startup,round,amount_million,industry,year
Notion,Series B,50,Productivity,2019
Figma,Series C,100,Design,2020
Zapier,Series A,20,Automation,2016
Miro,Series D,250,Collaboration,2022
OpenAI,Series A,1000,AI,2023
Stripe,Series E,600,Fintech,2021
Linear,Seed,5,Developer Tools,2020
Runway,Series A,35,AI,2021
Replit,Series B,80,Developer Tools,2022
Anthropic,Series B,450,AI,2023
ClickUp,Series C,200,Productivity,2021
Vercel,Series B,150,Developer Tools,2022
Airtable,Series D,270,Collaboration,2020
Cohere,Series A,125,AI,2022
Plaid,Series C,425,Fintech,2019
Loom,Series B,60,Collaboration,2019
Coda,Series C,110,Productivity,2021
Runpod,Seed,2,Infrastructure,2023
Hugging Face,Series C,235,AI,2022
Segment,Series B,64,Data Tools,2017
70 changes: 70 additions & 0 deletions examples/startup_funding_tracker/hello.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
import pandas as pd
import plotly.express as px

from preswald import get_df, plotly, table, text


# Title & Intro
text("# 🚀 Startup Funding Tracker")
text("Visualize startup funding trends across industries and years.")

# Load data
df = get_df("startup_data")

# Show sample data
table(df)

# 📊 Summary statistics
df["amount_million"] = pd.to_numeric(df["amount_million"], errors="coerce")
total_funding = df["amount_million"].sum()
unique_startups = df["startup"].nunique()
years = f"{df['year'].min()} - {df['year'].max()}"

text(f"**Total Funding:** ${total_funding:,.2f}M")
text(f"**Unique Startups:** {unique_startups}")
text(f"**Years Covered:** {years}")

# 💼 Funding Amount by Industry
text("## 💼 Funding Amount by Industry")
df_industry = df.groupby("industry", as_index=False)["amount_million"].sum()
fig1 = px.bar(
df_industry,
x="industry",
y="amount_million",
color="industry",
title="Total Funding by Industry",
labels={"amount_million": "Funding (in $M)"},
color_discrete_sequence=px.colors.qualitative.Safe,
)
fig1.update_layout(template="plotly_white", title_x=0.5)
fig1.update_yaxes(tickprefix="$", separatethousands=True)
plotly(fig1)

# 📈 Funding Trends Over Time
text("## 📈 Funding Trends Over Time")
df_trend = df.groupby(["year", "industry"], as_index=False)["amount_million"].sum()
fig2 = px.line(
df_trend,
x="year",
y="amount_million",
color="industry",
markers=True,
title="Annual Funding by Industry",
labels={"amount_million": "Funding (in $M)"},
color_discrete_sequence=px.colors.qualitative.Safe,
)
fig2.update_layout(template="plotly_white", title_x=0.5)
fig2.update_yaxes(tickprefix="$", separatethousands=True)
plotly(fig2)

# 🌀 Funding Round Distribution
text("## 🌀 Funding Rounds Distribution")
fig3 = px.pie(
df,
names="round",
values="amount_million",
title="Distribution of Funding Rounds",
color_discrete_sequence=px.colors.qualitative.Safe,
)
fig3.update_traces(textinfo="percent+label")
plotly(fig3)
Binary file added examples/startup_funding_tracker/images/favicon.ico
Binary file not shown.
Binary file added examples/startup_funding_tracker/images/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 20 additions & 0 deletions examples/startup_funding_tracker/preswald.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
[project]
title = "Startup Funding Tracker"
version = "0.1.0"
port = 8501
slug = "startup-funding"
entrypoint = "hello.py"

[branding]
name = "Startup Funding Tracker"
logo = "images/logo.png"
favicon = "images/favicon.ico"
primaryColor = "#4CAF50"

[data.startup_data]
type = "csv"
path = "data/funding.csv"

[logging]
level = "INFO"
format = "%(asctime)s - %(name)s - %(levelname)s - %(message)s"
24 changes: 24 additions & 0 deletions examples/startup_funding_tracker/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[project]
name = "startup-tracker"
version = "0.1.0"
description = "A Preswald dashboard for startup funding insights"
requires-python = ">=3.8"
dependencies = [
"preswald==0.1.33",
"duckdb==1.1.3"
]

[tool.black]
line-length = 88
target-version = ['py38']

[tool.isort]
profile = "black"
multi_line_output = 3

[tool.hatch.build.targets.wheel]
packages = ["."]