This repo automates the creation of D3js visualizations based on Dungeon Church lore wiki data.
The result is deployed on GH pages.
data/
- Contains the graph data JSON filegraph_data.json
- Main graph data with connected nodes- Contains nodes (articles) and links (relationships between articles)
- Each link includes metadata about the relationship:
creation_time
- When the relationship was createddirection
- Whether the relationship is unidirectional or bidirectional
orphan_data.json
- Orphaned nodes (nodes with 0 connections)
scripts/
- Python scripts for data processing and visualization generationstatic/
- Static templates for the visualization (HTML, CSS, JS)docs/
- Generated files for GitHub Pages deployment (created by scripts, not stored in the repository)
Outline database nightly backups are stored in a private S3 bucket:
DUNGEONCHURCH_S3_URL=<pre-authenticated request URL for OCI Object Storage>
DUNGEONCHURCH_S3_NAMESPACE=<OCI namespace>
DUNGEONCHURCH_S3_BUCKET=<OCI bucket name>
The 5E rules collection in the wiki can be included or excluded in the visualization with:
EXCLUDE_5E=true
For future Outline integration:
OUTLINE_API_TOKEN=xxx
OUTLINE_URL=https://lore.dungeon.church/api
python scripts/download_latest_dump.py
This will download the latest PostgreSQL dump file from OCI S3 compatible storage and save it to the data
directory.
python scripts/process_relationships.py <path_to_dump_file>
- Restore the PostgreSQL dump file to a temporary database
- Extract document relationship data
- Identify and remove orphaned nodes (nodes with 0 connections)
- Save the main graph data as
graph_data.json
in thedata
directory - Save the orphaned nodes as
orphan_data.json
in thedata
directory - Drop the temporary database
python scripts/create_viz.py
- Generate the visualization files in the
docs
folder using templates from thestatic
folder - The
docs
folder is not stored in the repository but is generated on-demand
python scripts/run_pipeline.py
- Download the latest database dump
- Process the dump to extract relationship data
- Clean up the dump file (unless
--keep-dump
is specified)
Options:
--output
or-o
: Specify the output JSON file path--keep-dump
or-k
: Keep the dump file after processing
The visualization can be customized by editing the files in the static
folder:
static/index.html
- The main HTML templatestatic/css/styles.css
- The CSS styles for the visualizationstatic/js/visualization.js
- The JavaScript code for the D3.js visualization
After making changes to these files, you can:
- Run
python scripts/create_viz.py
to generate the updated visualization in thedocs
folder - Open
docs/index.html
in your browser to preview the changes - Commit and push your changes to deploy them via GitHub Actions
This repository includes GitHub Actions workflows that:
- Run the data pipeline daily at midnight UTC (and can be triggered manually)
- Rebuild and deploy the visualization when changes are made to:
- The graph data (
data/graph_data.json
) - The static templates (
static/*
) - The visualization script (
scripts/create_viz.py
)
- The graph data (