This WordPress plugin houses custom, interactive Gutenberg blocks designed to help environmental researchers visualize geospatial datasets (like toxicity scores, facility emissions, and water violations) directly in WordPress posts.
To begin developing or extending blocks in this library:
- Prerequisites: Ensure you have Node.js (LTS version recommended) and a local WordPress development environment (e.g., LocalWP, DevKinsta, or Docker) installed.
- Install Dependencies: Open your terminal in the plugin directory (
wp-content/plugins/edgi-wp-block-core/) and run:npm install
We compile block assets using the @wordpress/scripts toolkit. The following scripts are configured:
- Start Dev Watcher: Automatically compiles code on save. Keep this running in a terminal during development:
npm run start
- Compile Production Build: Builds minimized, optimized production-ready assets:
npm run build
- Run Local Testing Server: Spins up a zero-dependency local static server on port
8080to test blocks in the sandbox:npm run serve
This plugin uses a PHP Glob-based Auto-Loader inside edgi-wp-block-core.php.
- The compiler searches the
src/folder for blocks, compiles their assets, and saves them tobuild/[block-slug]/. - The PHP loader automatically scans the
build/directory for subfolders containingblock.jsonand registers them with WordPress. - Result: Developers only write code inside
src/. There is no need to manually register blocks in PHP files.
Detailed guides are split into dedicated files inside the docs/ folder for readability:
- Gutenberg Block Development Guide: Step-by-step instructions on block scaffolding, folder structures, metadata rules, and importing shared utilities from
src/utils.js. - Local Sandbox Testing Guide: Details the high-speed local dev sandbox, CORS policies, dev-server configuration, and a testing checklist.
- Future Dashboard Decoupling Design: Architectural specifications for splitting single blocks into a decoupled multi-block dashboard system in the future.
- Block Slug:
congressional-report-cards - Features: Responsive light-themed US Map outlines. Zoom transitions on click, lazy-loading congressional district boundaries, interactive small-district helper buttons, Senator detail cards (2-column layout), and interactive offset hover tooltips with connecting dotted lines linking directly to PDF download sheets.
- Metadata spreadsheet format: See docs/block-development-guide.md for headers.
- Assets:
- Outlines:
assets/maps/us-states.json&assets/maps/cb_2025_us_cd119_5m.json - Default database metadata sheet:
assets/report-metadata.csv
- Outlines:
Copyright (C) 2026 Environmental Data and Governance Initiative (EDGI) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 3.0.
See the LICENSE file for details.