mirror of
https://github.com/oakbrad/dungeonchurch-oracle.git
synced 2026-02-18 19:52:32 -08:00
[MIRROR] Lore wiki visualizations with D3js
https://dungeon.church/wiki-visualizer
- JavaScript 96.5%
- Python 2.8%
- CSS 0.6%
| .github/workflows | ||
| data | ||
| scripts | ||
| static | ||
| .gitignore | ||
| README.md | ||
Oracle
This repo automates the creation of D3js visualizations based on Dungeon Church lore wiki data.
The result is deployed on GH pages.
Repository Structure
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)
Setup
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
Process
Download the Latest Database Dump
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.
Process Relationship Data
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.jsonin thedatadirectory - Save the orphaned nodes as
orphan_data.jsonin thedatadirectory - Drop the temporary database
Create Visualization
python scripts/create_viz.py
- Generate the visualization files in the
docsfolder using templates from thestaticfolder - The
docsfolder is not stored in the repository but is generated on-demand
Run the Complete Pipeline
python scripts/run_pipeline.py
- Download the latest database dump
- Process the dump to extract relationship data
- Clean up the dump file (unless
--keep-dumpis specified)
Options:
--outputor-o: Specify the output JSON file path--keep-dumpor-k: Keep the dump file after processing
Customizing the Visualization
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.pyto generate the updated visualization in thedocsfolder - Open
docs/index.htmlin your browser to preview the changes - Commit and push your changes to deploy them via GitHub Actions
Automated Updates
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 (
