Legislator election visualization (Vue 3 + D3). Deployable to GitHub Pages.
- Demo:
https://kevin7261.github.io/legislator-election-24/ - Repo:
https://github.com/kevin7261/legislator-election-24
- Visualization with Vue 3 and D3.js
- Tunable settings and responsive layout
- Correct base path for static hosting:
'/legislator-election-24/' - Data decoupled under
public/data/
- Vue 3, Vue Router, Pinia
- D3.js (drawing, transforms, zoom)
- Bootstrap 5, Font Awesome
- Grid stats:
public/data/geojson/grid_with_weighted_angle_stats_500m.geojson - Boundary:
public/data/geojson/臺北市區界圖_20220915.geojson
src/
├─ tabs/
│ └─ MapTab.vue # map + arrow rendering
├─ stores/
│ ├─ dataStore.js # visualization flags/data
│ └─ defineStore.js # settings
├─ router/
│ └─ index.js # base: '/legislator-election-24/'
└─ main.js
public/
└─ data/
└─ geojson/
vue.config.js # publicPath: '/legislator-election-24/'
Requirements: Node.js 16+, npm 7+
git clone https://github.com/kevin7261/legislator-election-24.git
cd legislator-election-24
npm install
npm run serveDev URL: http://localhost:8080/legislator-election-24/
npm run build # outputs dist/
npm run deploy # publish to GitHub Pages via gh-pagesKeep publicPath and router base aligned with the repo name.
npm run lint
npm run lint:fix
npm run prettier
npm run formatMIT