-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.prompt
51 lines (41 loc) · 2.01 KB
/
.prompt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# GRID Stat Portal Project
### Project Overview
This is a web application for visualizing thousands of statistical indicators through interactive maps, charts, and data tables. Features include instant search, up-to-date values, and data downloads.
### Technical Stack
- Framework: Astro.js + React
- UI: Tailwind + shadcn/ui
- Data Visualization: D3.js
- Maps:
- d3-geo for projections and path generation
- @fxi/d3-geo-zoom for interactive map navigation
- Search: Meilisearch
- Testing: Vitest
### Data Structure
- Indicators contain metadata and time series data. Example in ./sample/indicator_example.json
- Geographic Entities Mapping:
- The TopoJSON world map uses ISO3 codes as feature IDs (d.id, not d.properties.id)
- API returns geo_entity_id which is mapped to ISO3 using src/lib/utils/geo_entities.json
- The geo_entities.json file contains a comprehensive mapping of all available codes
- Data includes measure_scale property for visualization type. Allowed measure scales are defined in src/lib/utils/visualization_scales.ts
- Temporal data spans multiple years. Tables aggregate data by geographic entities and display the oldest and most recent values
### API Information
1. Meilisearch:
- Endpoint: https://api-search.unepgrid.ch
- Index format: statistical_{language}
- Facets: collections.name, keywords
- Sample: sample/meilisearch_value_example.json
2. V2 API:
- Endpoint: https://api.unepgrid.ch/stats/v2
- Data endpoint: /indicators/{id}/data
- Sample: ./sample/indicator_example.json
### Development Principles
#### Code Quality Standards
- Leverage existing D3 methods and functionality where available
- Follow functional programming principles for data transformations
- Ensure proper type safety and error handling
- Write comprehensive documentation for complex logic
- Use meaningful variable names and clear function signatures
- Implement proper unit tests for statistical functions
#### Known Issues
1. Proportional Symbol Issues:
- Legend symbols do not match actual sizes on map