Provides an interactive interface for visualizing geographical data relevant to the MINE-DD project, including pathogen distribution, risk factors, and demographic analysis through both point data and raster overlays.
This project is the dashboard component for MINE-DD, an initiative by the Netherlands eScience Center. Its primary purpose is to serve and visualize data on an interactive map for mining-related data analysis.
The dashboard provides an interactive interface for visualizing geographical data relevant to the MINE-DD project, including pathogen distribution, risk factors, and demographic analysis through both point data and raster overlays.
Data updated: 1 Sep. 2025
The application is built using the following technologies:
# Clone the repository
git clone https://github.com/escience/mine-dd.git
cd mine-dd/dashboard
# Start all services (frontend + chat backend)
docker compose up -d
š Open your browser and visit http://localhost:4000
The development environment includes:
# View service logs
docker compose logs -f
# View logs for specific service
docker compose logs -f frontend
docker compose logs -f chat-backend
# Stop all services
docker compose down
# Rebuild and restart services
docker compose up -d --build
# Stop and remove all containers, networks, and volumes
docker compose down -v
app/
āāā src/
ā āāā lib/
ā ā āāā components/
ā ā ā āāā Map/ # Map system (modular components)
ā ā ā ā āāā components/ # Sub-components
ā ā ā ā āāā store/ # Map-specific state
ā ā ā ā āāā utils/ # Map utilities
ā ā ā āāā ui/ # Reusable UI components
ā ā āāā stores/ # Global state management (.store.svelte.ts)
ā ā āāā utils/ # General utilities
ā āāā routes/ # SvelteKit pages and layouts
āāā static/
ā āāā data/ # Static data files
ā āāā 01_Points/ # CSV point data
ā āāā cogs/ # Cloud Optimized GeoTIFFs
āāā migrations/ # Database migrations
The Map system is highly modular:
Map.svelte
- Main container orchestrating all map functionalityMapCore.svelte
- MapLibre instance managementMapControls.svelte
- Zoom, rotation, and 3D controlsMapSidebar.svelte
- Filter and layer controlsMapLegend.svelte
- Data visualization legendRasterLayerManager.svelte
- COG layer managementVisualizationTypeSelector.svelte
- Visualization mode switcherThe system supports multiple visualization modes:
dots
- Simple point markerspie
- Pie charts at locations3d-bars
- 3D extruded barsheatmap
- Heat map visualizationhexbin
- Hexagonal binning# Navigate to app directory
cd app
# Install dependencies
bun install
# Start development server
bun run dev # Runs at localhost:5173
# Type checking
bun run check # Svelte-kit sync + type check
# Linting and formatting
bun run lint # ESLint + Prettier check
bun run format # Auto-format code
# Building for production
bun run build # Generate static site
The repository includes a script for processing raster maps into Cloud Optimized GeoTIFFs (COGs) suitable for web visualization.
# Install GDAL on macOS using Homebrew
brew install gdal
# Install GDAL on Ubuntu/Debian
sudo apt-get install gdal-bin python3-gdal
Place your raster files (.tif) in the data/02_Rasters
directory. You can organize them in subdirectories if desired.
Run the conversion script:
bash process_rasters.sh
The script will:
Processed files will be available in the data/cogs
directory, maintaining the same subdirectory structure as the input.
The script can be modified to adjust:
INPUT_DIR
and OUTPUT_DIR
variables-t_srs
parameter in the gdalwarp
command-r
parameter (options include: nearest, bilinear, cubic, cubicspline)gdal_translate
commandany
type - use unknown
or specific typesbun run format
before committingsm:
, md:
, lg:
, xl:
)grid-rows-[auto_auto_1fr]
All shared state uses Svelte 5 runes in .store.svelte.ts
files:
// stores/example.store.svelte.ts
let state = $state({ data: null, loading: false });
let derived = $derived(state.data?.length > 0);
export const exampleStore = {
get state() { return state; },
get derived() { return derived; },
async fetchData() {
state.loading = true;
// API call logic
state.loading = false;
}
};
<script lang="ts">
interface Props {
children?: import('svelte').Snippet;
data: DataType;
optional?: string;
}
let { children, data, optional = 'default' }: Props = $props();
let localState = $state(false);
let computed = $derived(data.length > 0);
$effect(() => {
// React to changes
console.log('Data changed:', data);
});
</script>
<!-- Conditional rendering with snippets -->
{#if children}
{@render children()}
{/if}
COG files are processed client-side directly from Cloudflare R2:
// Load COG from R2
const tiff = await GeoTIFF.fromUrl(cogUrl);
const image = await tiff.getImage();
const data = await image.readRasters();
// Process and render to canvas
const canvas = document.createElement('canvas');
// Apply colormap...
// Add to map as image source
map.addSource(sourceId, {
type: 'image',
url: canvas.toDataURL('image/png'),
coordinates: bounds
});
Filters automatically trigger relevant raster layers based on:
# MapTiler API key for map styles
VITE_MAPTILER_KEY=your_maptiler_key
# Cloudflare R2 bucket URL for COG storage
VITE_R2_BUCKET_URL=https://pub-6e8836a7d8be4fd1adc1317bb416ad75.r2.dev
# Optional base path for deployment
BASE_PATH=/optional-path
Mining the past to protect the future Diarrheal disease burden in a climate-uncertain future