@@ -0,0 +1 @@
|
||||
{"anonymousId":"8aa41dce-bd0b-40af-96a3-de949fffe712","traits":{"projectCreated":"2026-05-21T05:40:13.247Z"}}
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"version": "1.0",
|
||||
"customFormats": []
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
.evidence/template
|
||||
.svelte-kit
|
||||
build
|
||||
node_modules
|
||||
.DS_Store
|
||||
static/data
|
||||
*.options.yaml
|
||||
.vscode/settings.json
|
||||
.env
|
||||
.evidence/meta
|
||||
@@ -0,0 +1,3 @@
|
||||
loglevel=error
|
||||
audit=false
|
||||
fund=false
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"recommendations": [
|
||||
"evidence.evidence-vscode"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
# Evidence Template Project
|
||||
|
||||
## Using Codespaces
|
||||
|
||||
If you are using this template in Codespaces, click the `Start Evidence` button in the bottom status bar. This will install dependencies and open a preview of your project in your browser - you should get a popup prompting you to open in browser.
|
||||
|
||||
Or you can use the following commands to get started:
|
||||
|
||||
```bash
|
||||
npm install
|
||||
npm run sources
|
||||
npm run dev -- --host 0.0.0.0
|
||||
```
|
||||
|
||||
See [the CLI docs](https://docs.evidence.dev/cli/) for more command information.
|
||||
|
||||
**Note:** Codespaces is much faster on the Desktop app. After the Codespace has booted, select the hamburger menu → Open in VS Code Desktop.
|
||||
|
||||
## Get Started from VS Code
|
||||
|
||||
The easiest way to get started is using the [VS Code Extension](https://marketplace.visualstudio.com/items?itemName=Evidence.evidence-vscode):
|
||||
|
||||
|
||||
|
||||
1. Install the extension from the VS Code Marketplace
|
||||
2. Open the Command Palette (Ctrl/Cmd + Shift + P) and enter `Evidence: New Evidence Project`
|
||||
3. Click `Start Evidence` in the bottom status bar
|
||||
|
||||
## Get Started using the CLI
|
||||
|
||||
```bash
|
||||
npx degit evidence-dev/template my-project
|
||||
cd my-project
|
||||
npm install
|
||||
npm run sources
|
||||
npm run dev
|
||||
```
|
||||
|
||||
Check out the docs for [alternative install methods](https://docs.evidence.dev/getting-started/install-evidence) including Docker, Github Codespaces, and alongside dbt.
|
||||
|
||||
|
||||
|
||||
## Learning More
|
||||
|
||||
- [Docs](https://docs.evidence.dev/)
|
||||
- [Github](https://github.com/evidence-dev/evidence)
|
||||
- [Slack Community](https://slack.evidence.dev/)
|
||||
- [Evidence Home Page](https://www.evidence.dev)
|
||||
@@ -0,0 +1,81 @@
|
||||
appearance:
|
||||
default: system
|
||||
switcher: true
|
||||
|
||||
theme:
|
||||
colorPalettes:
|
||||
default:
|
||||
light:
|
||||
- "#236aa4"
|
||||
- "#45a1bf"
|
||||
- "#a5cdee"
|
||||
- "#8dacbf"
|
||||
- "#85c7c6"
|
||||
- "#d2c6ac"
|
||||
- "#f4b548"
|
||||
- "#8f3d56"
|
||||
- "#71b9f4"
|
||||
- "#46a485"
|
||||
dark:
|
||||
- "#236aa4"
|
||||
- "#45a1bf"
|
||||
- "#a5cdee"
|
||||
- "#8dacbf"
|
||||
- "#85c7c6"
|
||||
- "#d2c6ac"
|
||||
- "#f4b548"
|
||||
- "#8f3d56"
|
||||
- "#71b9f4"
|
||||
- "#46a485"
|
||||
colorScales:
|
||||
default:
|
||||
light:
|
||||
- "#ADD8E6"
|
||||
- "#00008B"
|
||||
dark:
|
||||
- "#ADD8E6"
|
||||
- "#00008B"
|
||||
colors:
|
||||
primary:
|
||||
light: "#2563eb"
|
||||
dark: "#3b82f6"
|
||||
accent:
|
||||
light: "#c2410c"
|
||||
dark: "#fdba74"
|
||||
base:
|
||||
light: "#ffffff"
|
||||
dark: "#09090b"
|
||||
info:
|
||||
light: "#0284c7"
|
||||
dark: "#38bdf8"
|
||||
positive:
|
||||
light: "#16a34a"
|
||||
dark: "#4ade80"
|
||||
warning:
|
||||
light: "#f8c900"
|
||||
dark: "#fbbf24"
|
||||
negative:
|
||||
light: "#dc2626"
|
||||
dark: "#f87171"
|
||||
|
||||
plugins:
|
||||
components:
|
||||
# This loads all of evidence's core charts and UI components
|
||||
# You probably don't want to edit this dependency unless you know what you are doing
|
||||
"@evidence-dev/core-components": {}
|
||||
|
||||
datasources:
|
||||
# You can add additional datasources here by adding npm packages.
|
||||
# Make to also add them to `package.json`.
|
||||
"@evidence-dev/bigquery": { }
|
||||
"@evidence-dev/csv": { }
|
||||
"@evidence-dev/databricks": { }
|
||||
"@evidence-dev/duckdb": { }
|
||||
"@evidence-dev/mssql": { }
|
||||
"@evidence-dev/mysql": { }
|
||||
"@evidence-dev/postgres": { }
|
||||
"@evidence-dev/source-javascript": { }
|
||||
"@evidence-dev/snowflake": { }
|
||||
"@evidence-dev/sqlite": { }
|
||||
"@evidence-dev/trino": { }
|
||||
"@evidence-dev/motherduck": { }
|
||||
Generated
+17662
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,41 @@
|
||||
{
|
||||
"name": "my-evidence-project",
|
||||
"version": "0.0.1",
|
||||
"scripts": {
|
||||
"build": "evidence build",
|
||||
"build:strict": "evidence build:strict",
|
||||
"dev": "evidence dev --open /",
|
||||
"test": "evidence build",
|
||||
"sources": "evidence sources",
|
||||
"sources:strict": "evidence sources --strict",
|
||||
"preview": "evidence preview"
|
||||
},
|
||||
"engines": {
|
||||
"npm": ">=7.0.0",
|
||||
"node": ">=18.0.0"
|
||||
},
|
||||
"type": "module",
|
||||
"dependencies": {
|
||||
"@evidence-dev/bigquery": "^2.0.12",
|
||||
"@evidence-dev/core-components": "^5.4.2",
|
||||
"@evidence-dev/csv": "^1.0.16",
|
||||
"@evidence-dev/databricks": "^1.0.10",
|
||||
"@evidence-dev/duckdb": "^2.0.1",
|
||||
"@evidence-dev/evidence": "^40.1.8",
|
||||
"@evidence-dev/motherduck": "^1.0.6",
|
||||
"@evidence-dev/mssql": "^1.1.4",
|
||||
"@evidence-dev/mysql": "^1.1.6",
|
||||
"@evidence-dev/postgres": "^1.0.10",
|
||||
"@evidence-dev/snowflake": "^1.2.4",
|
||||
"@evidence-dev/source-javascript": "^0.0.3",
|
||||
"@evidence-dev/sqlite": "^2.0.9",
|
||||
"@evidence-dev/trino": "^1.0.11"
|
||||
},
|
||||
"overrides": {
|
||||
"jsonwebtoken": "9.0.0",
|
||||
"trim@<0.0.3": ">0.0.3",
|
||||
"sqlite3": "5.1.5",
|
||||
"axios": "^1.7.4",
|
||||
"vitest": "^3.2.6"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,182 @@
|
||||
---
|
||||
title: NBA Analytics Dashboard
|
||||
---
|
||||
|
||||
```sql games
|
||||
select * from nba.games
|
||||
```
|
||||
|
||||
```sql season_summary
|
||||
select * from nba.season_summary
|
||||
```
|
||||
|
||||
```sql competitiveness
|
||||
select * from nba.competitiveness
|
||||
```
|
||||
|
||||
```sql home_advantage
|
||||
select * from nba.home_advantage
|
||||
```
|
||||
|
||||
```sql top_scorers
|
||||
select * from nba.top_scorers
|
||||
```
|
||||
|
||||
```sql pace_and_scoring
|
||||
select * from nba.pace_and_scoring
|
||||
```
|
||||
|
||||
```sql team_ratings
|
||||
select * from nba.team_ratings
|
||||
```
|
||||
|
||||
```sql play_styles
|
||||
select * from nba.play_styles
|
||||
```
|
||||
|
||||
```sql player_impact
|
||||
select * from nba.player_impact
|
||||
```
|
||||
|
||||
```sql game_drama
|
||||
select * from nba.game_drama
|
||||
```
|
||||
|
||||
```sql usage_efficiency
|
||||
select * from nba.usage_efficiency
|
||||
```
|
||||
|
||||
# 🏀 NBA Analytics
|
||||
|
||||
<BigValue data={season_summary} value=total_games title="Total Games" />
|
||||
<BigValue data={season_summary} value=avg_total_points title="Avg Points/Game" />
|
||||
<BigValue data={season_summary} value=overtime_games title="OT Games" />
|
||||
<BigValue data={season_summary} value=avg_margin title="Avg Margin" />
|
||||
|
||||
---
|
||||
|
||||
## League Evolution: Pace & Scoring
|
||||
|
||||
<LineChart
|
||||
data={pace_and_scoring}
|
||||
x=season
|
||||
y={['avg_total_points', 'avg_pace']}
|
||||
y2=avg_efg_pct
|
||||
title="How the NBA Has Changed: Points, Pace & Efficiency"
|
||||
yAxisTitle="Points / Pace"
|
||||
y2AxisTitle="eFG%"
|
||||
/>
|
||||
|
||||
## Game Drama Over Time
|
||||
|
||||
<AreaChart
|
||||
data={game_drama}
|
||||
x=season
|
||||
y={['clutch_pct', 'blowout_pct', 'ot_pct']}
|
||||
title="% of Games: Clutch (≤5pt margin) vs Blowouts (20+) vs Overtime"
|
||||
yAxisTitle="% of Games"
|
||||
/>
|
||||
|
||||
---
|
||||
|
||||
## Current Season: Team Power Rankings
|
||||
|
||||
<BarChart
|
||||
data={team_ratings}
|
||||
x=team
|
||||
y=avg_net_rating
|
||||
title="Net Rating by Team (Current Season)"
|
||||
swapXY=true
|
||||
colorPalette={['#dc2626', '#dc2626', '#dc2626', '#dc2626', '#dc2626', '#f97316', '#f97316', '#f97316', '#f97316', '#f97316', '#6b7280', '#6b7280', '#6b7280', '#6b7280', '#6b7280', '#6b7280', '#6b7280', '#6b7280', '#6b7280', '#6b7280', '#22c55e', '#22c55e', '#22c55e', '#22c55e', '#22c55e', '#16a34a', '#16a34a', '#16a34a', '#16a34a', '#16a34a']}
|
||||
/>
|
||||
|
||||
<DataTable data={team_ratings} rows=30>
|
||||
<Column id=team title="Team" />
|
||||
<Column id=wins title="W" />
|
||||
<Column id=games title="GP" />
|
||||
<Column id=win_pct title="Win%" />
|
||||
<Column id=avg_off_rating title="ORtg" />
|
||||
<Column id=avg_def_rating title="DRtg" />
|
||||
<Column id=avg_net_rating title="Net" contentType=colorscale colorScale=RdYlGn />
|
||||
<Column id=avg_pace title="Pace" />
|
||||
</DataTable>
|
||||
|
||||
## Shot Selection Style & Winning
|
||||
|
||||
<BarChart
|
||||
data={play_styles}
|
||||
x=shot_selection_style
|
||||
y={['win_pct', 'avg_off_rating']}
|
||||
y2=avg_off_rating
|
||||
title="Does Three-Point Shooting Win Games?"
|
||||
yAxisTitle="Win %"
|
||||
y2AxisTitle="Off Rating"
|
||||
/>
|
||||
|
||||
---
|
||||
|
||||
## Player Impact: Usage vs Efficiency
|
||||
|
||||
<ScatterPlot
|
||||
data={usage_efficiency}
|
||||
x=usage
|
||||
y=efficiency
|
||||
size=ppg
|
||||
tooltipTitle=player_name
|
||||
title="Usage Rate vs True Shooting % (bubble size = PPG)"
|
||||
xAxisTitle="Usage Rate %"
|
||||
yAxisTitle="True Shooting %"
|
||||
/>
|
||||
|
||||
## Top 30 Players by Box Plus/Minus (Current Season)
|
||||
|
||||
<DataTable data={player_impact} rows=30>
|
||||
<Column id=player_name title="Player" />
|
||||
<Column id=team title="Team" />
|
||||
<Column id=games title="GP" />
|
||||
<Column id=ppg title="PPG" />
|
||||
<Column id=apg title="APG" />
|
||||
<Column id=rpg title="RPG" />
|
||||
<Column id=avg_bpm title="BPM" contentType=colorscale colorScale=RdYlGn />
|
||||
<Column id=avg_usage title="USG%" />
|
||||
<Column id=ts_pct title="TS%" />
|
||||
<Column id=double_doubles title="DD" />
|
||||
<Column id=triple_doubles title="TD" />
|
||||
</DataTable>
|
||||
|
||||
<BarChart
|
||||
data={player_impact}
|
||||
x=player_name
|
||||
y=avg_bpm
|
||||
title="Box Plus/Minus Leaders"
|
||||
swapXY=true
|
||||
/>
|
||||
|
||||
---
|
||||
|
||||
## Home Court Advantage Trend
|
||||
|
||||
<LineChart
|
||||
data={home_advantage}
|
||||
x=season_display
|
||||
y=home_win_pct
|
||||
title="Home Team Win % by Season"
|
||||
yAxisTitle="Win %"
|
||||
yMin=40
|
||||
yMax=70
|
||||
markers=true
|
||||
/>
|
||||
|
||||
## Recent Games
|
||||
|
||||
<DataTable data={games} rows=20>
|
||||
<Column id=game_date title="Date" />
|
||||
<Column id=home_team title="Home" />
|
||||
<Column id=visitor_team title="Away" />
|
||||
<Column id=home_points title="H Pts" />
|
||||
<Column id=visitor_points title="A Pts" />
|
||||
<Column id=winning_team title="Winner" />
|
||||
<Column id=point_differential title="Margin" />
|
||||
<Column id=game_competitiveness_tier title="Type" />
|
||||
<Column id=is_overtime title="OT" />
|
||||
</DataTable>
|
||||
@@ -0,0 +1,6 @@
|
||||
select
|
||||
game_competitiveness_tier,
|
||||
count(*) as games
|
||||
from main_marts.fct_game_results
|
||||
group by game_competitiveness_tier
|
||||
order by games desc
|
||||
@@ -0,0 +1,4 @@
|
||||
name: nba
|
||||
type: duckdb
|
||||
options:
|
||||
filename: dbt_nba.duckdb
|
||||
@@ -0,0 +1,8 @@
|
||||
select
|
||||
season_start_year || '-' || substr(cast(season_start_year + 1 as varchar), 3, 2) as season,
|
||||
round(100.0 * sum(case when is_overtime then 1 else 0 end) / count(*), 1) as ot_pct,
|
||||
round(100.0 * sum(case when point_differential <= 5 then 1 else 0 end) / count(*), 1) as clutch_pct,
|
||||
round(100.0 * sum(case when point_differential >= 20 then 1 else 0 end) / count(*), 1) as blowout_pct
|
||||
from main_intermediate.int_games_enriched
|
||||
group by season_start_year
|
||||
order by season_start_year
|
||||
@@ -0,0 +1,18 @@
|
||||
select
|
||||
g.game_date,
|
||||
g.home_points,
|
||||
g.visitor_points,
|
||||
g.total_points,
|
||||
g.point_differential,
|
||||
g.is_overtime,
|
||||
g.is_playoff,
|
||||
g.game_competitiveness_tier,
|
||||
g.is_home_team_winner,
|
||||
ht.team_abbr as home_team,
|
||||
vt.team_abbr as visitor_team,
|
||||
wt.team_abbr as winning_team
|
||||
from main_marts.fct_game_results g
|
||||
left join main_marts.dim_teams ht on g.home_team_key = ht.team_key
|
||||
left join main_marts.dim_teams vt on g.visitor_team_key = vt.team_key
|
||||
left join main_marts.dim_teams wt on g.winning_team_key = wt.team_key
|
||||
order by g.game_date desc
|
||||
@@ -0,0 +1,9 @@
|
||||
select
|
||||
s.season_display,
|
||||
count(*) as total_games,
|
||||
sum(case when g.is_home_team_winner then 1 else 0 end) as home_wins,
|
||||
round(100.0 * sum(case when g.is_home_team_winner then 1 else 0 end) / count(*), 1) as home_win_pct
|
||||
from main_marts.fct_game_results g
|
||||
left join main_marts.dim_seasons s on g.season_key = s.season_key
|
||||
group by s.season_display
|
||||
order by s.season_display
|
||||
@@ -0,0 +1,10 @@
|
||||
select
|
||||
season_start_year || '-' || substr(cast(season_start_year + 1 as varchar), 3, 2) as season,
|
||||
round(avg(matchup_pace), 1) as avg_pace,
|
||||
round(avg(total_points), 1) as avg_total_points,
|
||||
round(avg(home_effective_fg_pct + visitor_effective_fg_pct) / 2 * 100, 1) as avg_efg_pct,
|
||||
round(avg(point_differential), 1) as avg_margin,
|
||||
count(*) as games
|
||||
from main_intermediate.int_games_enriched
|
||||
group by season_start_year
|
||||
order by season_start_year
|
||||
@@ -0,0 +1,9 @@
|
||||
select
|
||||
shot_selection_style,
|
||||
count(*) as games,
|
||||
round(avg(case when game_result = 'W' then 1.0 else 0.0 end) * 100, 1) as win_pct,
|
||||
round(avg(offensive_rating), 1) as avg_off_rating
|
||||
from main_intermediate.int_team_performance
|
||||
where season_start_year = (select max(season_start_year) from main_intermediate.int_team_performance)
|
||||
group by shot_selection_style
|
||||
order by avg_off_rating desc
|
||||
@@ -0,0 +1,20 @@
|
||||
select
|
||||
player_name,
|
||||
team,
|
||||
count(*) as games,
|
||||
round(avg(points), 1) as ppg,
|
||||
round(avg(assists), 1) as apg,
|
||||
round(avg(total_rebounds), 1) as rpg,
|
||||
round(avg(box_plus_minus), 2) as avg_bpm,
|
||||
round(avg(usage_pct), 1) as avg_usage,
|
||||
round(avg(true_shooting_pct) * 100, 1) as ts_pct,
|
||||
round(avg(net_rating), 1) as avg_net_rating,
|
||||
sum(case when is_double_double then 1 else 0 end) as double_doubles,
|
||||
sum(case when is_triple_double then 1 else 0 end) as triple_doubles
|
||||
from main_intermediate.int_player_performance
|
||||
where season_start_year = (select max(season_start_year) from main_intermediate.int_player_performance)
|
||||
and minutes_played >= 20
|
||||
group by player_name, team
|
||||
having count(*) >= 20
|
||||
order by avg_bpm desc
|
||||
limit 30
|
||||
@@ -0,0 +1,11 @@
|
||||
select
|
||||
s.season_display,
|
||||
count(*) as total_games,
|
||||
sum(case when g.is_overtime then 1 else 0 end) as overtime_games,
|
||||
sum(case when g.is_playoff then 1 else 0 end) as playoff_games,
|
||||
round(avg(g.total_points), 1) as avg_total_points,
|
||||
round(avg(g.point_differential), 1) as avg_margin
|
||||
from main_marts.fct_game_results g
|
||||
left join main_marts.dim_seasons s on g.season_key = s.season_key
|
||||
group by s.season_display
|
||||
order by s.season_display desc
|
||||
@@ -0,0 +1,14 @@
|
||||
select
|
||||
team,
|
||||
count(*) as games,
|
||||
sum(case when game_result = 'W' then 1 else 0 end) as wins,
|
||||
round(100.0 * sum(case when game_result = 'W' then 1 else 0 end) / count(*), 1) as win_pct,
|
||||
round(avg(offensive_rating), 1) as avg_off_rating,
|
||||
round(avg(defensive_rating), 1) as avg_def_rating,
|
||||
round(avg(net_rating), 1) as avg_net_rating,
|
||||
round(avg(pace), 1) as avg_pace,
|
||||
round(avg(effective_fg_pct) * 100, 1) as avg_efg_pct
|
||||
from main_intermediate.int_team_performance
|
||||
where season_start_year = (select max(season_start_year) from main_intermediate.int_team_performance)
|
||||
group by team
|
||||
order by avg_net_rating desc
|
||||
@@ -0,0 +1,13 @@
|
||||
select
|
||||
p.player_name,
|
||||
count(*) as games_played,
|
||||
round(avg(ps.points), 1) as ppg,
|
||||
round(avg(ps.total_rebounds), 1) as rpg,
|
||||
round(avg(ps.assists), 1) as apg,
|
||||
round(avg(ps.true_shooting_pct) * 100, 1) as ts_pct
|
||||
from main_marts.fct_player_game_stats ps
|
||||
left join main_marts.dim_players p on ps.player_key = p.player_key
|
||||
group by p.player_name
|
||||
having count(*) >= 50
|
||||
order by ppg desc
|
||||
limit 20
|
||||
@@ -0,0 +1,13 @@
|
||||
select
|
||||
player_name,
|
||||
team,
|
||||
count(*) as games,
|
||||
round(avg(usage_pct), 1) as usage,
|
||||
round(avg(true_shooting_pct) * 100, 1) as efficiency,
|
||||
round(avg(points), 1) as ppg
|
||||
from main_intermediate.int_player_performance
|
||||
where season_start_year = (select max(season_start_year) from main_intermediate.int_player_performance)
|
||||
and minutes_played >= 20
|
||||
group by player_name, team
|
||||
having count(*) >= 20
|
||||
order by usage desc
|
||||
Reference in New Issue
Block a user