Flourish Embed Block
Embed Flourish charts and maps in WordPress
★ 0stars
579composer installs
0forks
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/humanmade/hm-flourish-embed-block/archive/refs/heads/main.zipAlso on Packagist as humanmade/hm-flourish-block:
composer require humanmade/hm-flourish-blockFrom the readme
Flourish Block
A WordPress block plugin for embedding Flourish data visualizations.
Setup
1. Install dependencies:
2. Build the block:
3. For development with automatic rebuilds:
Project Structure
- src/index.js - Main entry point, registers the block with the editor
- src/style.scss - Frontend styles for the block
- src/editor.scss - Editor-only styles
- inc/blocks.php - PHP block registration and render callback
- inc/namespace.php - Plugin namespace and hook setup
- build/ - Compiled assets (generated by npm build)
How It Works
- The block is registered as a dynamic block, meaning it's rendered server-side by PHP
- The editor shows a placeholder since save() = null
- The Flourish embed script is registered and enqueued only once via wpregisterscript() and wpenqueuescript() to avoid duplicates
- The render callback outputs the Flourish embed HTML with the specified visualization ID
Read the full README on GitHub →