|
1 | 1 | # FHL Dashboard |
2 | 2 |
|
3 | | -This is an [Observable Framework](https://observablehq.com/framework/) app. To install the required dependencies, run: |
| 3 | +A comprehensive Fantasy Hockey League (FHL) management dashboard built with [Observable Framework](https://observablehq.com/framework/). This application provides interactive visualizations for team standings, player statistics, roster management, and team comparisons. |
4 | 4 |
|
5 | | -``` |
| 5 | +## Quick Start |
| 6 | + |
| 7 | +Install dependencies and start the development server: |
| 8 | + |
| 9 | +```bash |
6 | 10 | npm install |
| 11 | +npm run dev |
7 | 12 | ``` |
8 | 13 |
|
9 | | -Then, to start the local preview server, run: |
| 14 | +Then visit <http://localhost:3000> to preview your app. |
| 15 | + |
| 16 | +## Project Overview |
| 17 | + |
| 18 | +The FHL Dashboard consists of seven main sections: |
| 19 | + |
| 20 | +- **Team Standings** - Division-based standings and overall team rankings |
| 21 | +- **Team Information** - Team details, cash, salaries, and roster summaries |
| 22 | +- **Team Statistics** (Players) - Individual player performance and fantasy statistics |
| 23 | +- **Team Roster** - Period-specific roster management and player assignments |
| 24 | +- **Overall Stats** - Cumulative statistics across all periods |
| 25 | +- **Compare Teams** - Head-to-head team performance comparison |
| 26 | +- **Stats Visualizations** - Interactive charts and graphs |
| 27 | + |
| 28 | +## Project Structure |
| 29 | + |
| 30 | +``` |
| 31 | +. |
| 32 | +├─ src/ |
| 33 | +│ ├─ components/ |
| 34 | +│ │ └─ loadfiles.js # shared data utilities and stat calculations |
| 35 | +│ ├─ data/ |
| 36 | +│ │ ├─ *.json.js # data loaders (transform CSV to JSON) |
| 37 | +│ │ └─ static/ |
| 38 | +│ │ ├─ *.csv # raw team/player data |
| 39 | +│ │ ├─ stats/ # period-specific stats (stats_p01.csv - stats_p25.csv) |
| 40 | +│ │ └─ rosters/ # period-specific rosters (rosters_p01.csv - rosters_p25.csv) |
| 41 | +│ ├─ *.md # dashboard pages |
| 42 | +│ └─ index.md # home page |
| 43 | +├─ fhlgetstats.sh # fetch stats for specific period |
| 44 | +├─ fhlgetplayerinfo.sh # update player information |
| 45 | +├─ fhlgetplayoffstats.sh # fetch playoff statistics |
| 46 | +└─ observablehq.config.js # app configuration and navigation |
| 47 | +``` |
| 48 | + |
| 49 | +**`src`** - Source root containing all dashboard pages (Markdown files), data loaders, and shared components. |
| 50 | + |
| 51 | +**`src/components/loadfiles.js`** - Core utilities for data parsing, stat calculations (D-Stat, G-Stat, Toughness), position mapping, age calculations, and period management. |
| 52 | + |
| 53 | +**`src/data/`** - Data loaders that transform CSV files into structured JSON, plus static CSV files organized by periods. |
| 54 | + |
| 55 | +**`observablehq.config.js`** - App configuration defining the seven main navigation sections and page routing. |
| 56 | + |
| 57 | +## FHL Data Concepts |
| 58 | + |
| 59 | +### Periods |
| 60 | +FHL operates in numbered periods (P01, P02, etc.) representing scoring periods throughout the season. Currently supports periods 1-25. |
| 61 | + |
| 62 | +### Fantasy Statistics |
| 63 | +- **D-Stat**: `blocks + takeaways - giveaways + (toi / divisor)` where divisor = 20 for defensemen, 30 for forwards |
| 64 | +- **G-Stat**: `2*wins + ties + 2*shutouts + 0.15*shots_against - goals_against` |
| 65 | +- **Toughness**: `pim + hits` |
| 66 | + |
| 67 | +### Position Mapping |
| 68 | +- NHL positions (C, LW, RW, etc.) are mapped to simplified positions: F (Forward), D (Defense), G (Goalie) |
| 69 | +- Age calculations use September 15 cutoff date for the current season |
| 70 | + |
| 71 | +## Data Management |
| 72 | + |
| 73 | +### Updating Stats |
| 74 | +```bash |
| 75 | +# Update stats for specific period (e.g., period 5) |
| 76 | +./fhlgetstats.sh 05 |
| 77 | + |
| 78 | +# Update player information |
| 79 | +./fhlgetplayerinfo.sh |
| 80 | + |
| 81 | +# Update playoff stats |
| 82 | +./fhlgetplayoffstats.sh |
10 | 83 |
|
| 84 | +# Clear data cache and rebuild |
| 85 | +npm run clean && npm run dev |
11 | 86 | ``` |
| 87 | + |
| 88 | +### Data Dependencies |
| 89 | +- Requires external Node.js scripts in separate `FHL-Stat-Scripts` directory |
| 90 | +- Stats are fetched from external sources and processed into CSV format |
| 91 | +- Data loaders transform CSV files into structured JSON for the framework |
| 92 | + |
| 93 | +## Command Reference |
| 94 | + |
| 95 | +| Command | Description | |
| 96 | +| -------------------- | -------------------------------------------------------- | |
| 97 | +| `npm install` | Install or reinstall dependencies | |
| 98 | +| `npm run dev` | Start local preview server | |
| 99 | +| `npm run build` | Build your static site, generating `./dist` | |
| 100 | +| `npm run deploy` | Deploy your app to Observable Cloud | |
| 101 | +| `npm run clean` | Clear the local data loader cache | |
| 102 | +| `npm run observable` | Run commands like `observable help` | |
| 103 | +| `./fhlgetstats.sh ##`| Update stats for specific period number | |
| 104 | +| `./fhlgetplayerinfo.sh` | Update player information | |
| 105 | +| `./fhlgetplayoffstats.sh` | Update playoff statistics | |
| 106 | + |
| 107 | +## Technical Stack |
| 108 | + |
| 109 | +- **Framework**: Observable Framework |
| 110 | +- **Data Processing**: d3-dsv for CSV parsing, strip-bom for file encoding |
| 111 | +- **Visualization**: Built-in Observable Framework components and D3.js |
| 112 | +- **Deployment**: Observable Cloud |
| 113 | + |
| 114 | +For more information about Observable Framework, see <https://observablehq.com/framework/getting-started>.# FHL Dashboard |
| 115 | + |
| 116 | +A comprehensive Fantasy Hockey League (FHL) management dashboard built with [Observable Framework](https://observablehq.com/framework/). This application provides interactive visualizations for team standings, player statistics, roster management, and team comparisons. |
| 117 | + |
| 118 | +## Quick Start |
| 119 | + |
| 120 | +Install dependencies and start the development server: |
| 121 | + |
| 122 | +```bash |
| 123 | +npm install |
12 | 124 | npm run dev |
13 | 125 | ``` |
14 | 126 |
|
15 | 127 | Then visit <http://localhost:3000> to preview your app. |
16 | 128 |
|
17 | | -For more, see <https://observablehq.com/framework/getting-started>. |
18 | | - |
19 | 129 | ## Project structure |
20 | 130 |
|
21 | 131 | A typical Framework project looks like this: |
@@ -47,13 +157,61 @@ A typical Framework project looks like this: |
47 | 157 |
|
48 | 158 | **`observablehq.config.js`** - This is the [app configuration](https://observablehq.com/framework/config) file, such as the pages and sections in the sidebar navigation, and the app’s title. |
49 | 159 |
|
50 | | -## Command reference |
| 160 | +## FHL Data Concepts |
| 161 | + |
| 162 | +### Periods |
| 163 | +FHL operates in numbered periods (P01, P02, etc.) representing scoring periods throughout the season. Currently supports periods 1-25. |
| 164 | + |
| 165 | +### Fantasy Statistics |
| 166 | +- **D-Stat**: `blocks + takeaways - giveaways + (toi / divisor)` where divisor = 20 for defensemen, 30 for forwards |
| 167 | +- **G-Stat**: `2*wins + ties + 2*shutouts + 0.15*shots_against - goals_against` |
| 168 | +- **Toughness**: `pim + hits` |
| 169 | + |
| 170 | +### Position Mapping |
| 171 | +- NHL positions (C, LW, RW, etc.) are mapped to simplified positions: F (Forward), D (Defense), G (Goalie) |
| 172 | +- Age calculations use September 15 cutoff date for the current season |
| 173 | + |
| 174 | +## Data Management |
| 175 | + |
| 176 | +### Updating Stats |
| 177 | +```bash |
| 178 | +# Update stats for specific period (e.g., period 5) |
| 179 | +./fhlgetstats.sh 05 |
| 180 | + |
| 181 | +# Update player information |
| 182 | +./fhlgetplayerinfo.sh |
| 183 | + |
| 184 | +# Update playoff stats |
| 185 | +./fhlgetplayoffstats.sh |
| 186 | + |
| 187 | +# Clear data cache and rebuild |
| 188 | +npm run clean && npm run dev |
| 189 | +``` |
| 190 | + |
| 191 | +### Data Dependencies |
| 192 | +- Requires external Node.js scripts in separate `FHL-Stat-Scripts` directory |
| 193 | +- Stats are fetched from external sources and processed into CSV format |
| 194 | +- Data loaders transform CSV files into structured JSON for the framework |
| 195 | + |
| 196 | +## Command Reference |
51 | 197 |
|
52 | | -| Command | Description | |
53 | | -| ----------------- | -------------------------------------------------------- | |
54 | | -| `npm install` | Install or reinstall dependencies | |
| 198 | +| Command | Description | |
| 199 | +| -------------------- | -------------------------------------------------------- | |
| 200 | +| `npm install` | Install or reinstall dependencies | |
55 | 201 | | `npm run dev` | Start local preview server | |
56 | | -| `npm run build` | Build your static site, generating `./dist` | |
57 | | -| `npm run deploy` | Deploy your app to Observable | |
58 | | -| `npm run clean` | Clear the local data loader cache | |
59 | | -| `npm run observable` | Run commands like `observable help` | |
| 202 | +| `npm run build` | Build your static site, generating `./dist` | |
| 203 | +| `npm run deploy` | Deploy your app to Observable Cloud | |
| 204 | +| `npm run clean` | Clear the local data loader cache | |
| 205 | +| `npm run observable` | Run commands like `observable help` | |
| 206 | +| `./fhlgetstats.sh ##`| Update stats for specific period number | |
| 207 | +| `./fhlgetplayerinfo.sh` | Update player information | |
| 208 | +| `./fhlgetplayoffstats.sh` | Update playoff statistics | |
| 209 | + |
| 210 | +## Technical Stack |
| 211 | + |
| 212 | +- **Framework**: Observable Framework |
| 213 | +- **Data Processing**: d3-dsv for CSV parsing, strip-bom for file encoding |
| 214 | +- **Visualization**: Built-in Observable Framework components and D3.js |
| 215 | +- **Deployment**: Observable Cloud |
| 216 | + |
| 217 | +For more information about Observable Framework, see <https://observablehq.com/framework/getting-started>. |
0 commit comments