Skip to content

Commit 2ffb8f5

Browse files
committed
plan to remove mermaid specific visualization
1 parent 82cdb69 commit 2ffb8f5

5 files changed

Lines changed: 144 additions & 52 deletions

File tree

docs/visual_plan.md

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
# Homegrown Game Data Visualization Plan
2+
3+
## 1. Objective
4+
Replace the current Mermaid-based visualization with a homegrown, zero-dependency node-based and hierarchical representation of the game's data structure. This will improve flexibility, control, and alignment with the project's "Lattice" and "Graph" metaphors.
5+
6+
## 2. Removal of Mermaid
7+
The following Mermaid-specific artifacts will be removed:
8+
- `scripts/export_graph_mermaid.py`
9+
- `scripts/visualize_graph.py` (to be replaced)
10+
- `scripts/check_mermaid_integrity.py`
11+
- `scripts/generate_html_only.py`
12+
- `temp_graph.mmd`
13+
- References in `docs/content_web.md`
14+
- Any Mermaid CDN links or selectors in `scripts/test_render.js`
15+
16+
## 3. Data Source
17+
The definitive source of truth remains `Mythril.Blazor/wwwroot/data/content_graph.json`. This file is generated by `scripts/migrate_to_graph.py` from the individual JSON data files.
18+
19+
## 4. Visualization Architecture
20+
21+
### A. The Visualizer Engine (`scripts/visualize_v2.py`)
22+
A new Python script will:
23+
1. Load `content_graph.json`.
24+
2. Generate a single-file interactive HTML dashboard (`output/visual_dashboard.html`).
25+
3. Embed all necessary CSS and JavaScript (Vanilla) directly into the HTML to ensure portability.
26+
27+
### B. View Modes
28+
The dashboard will provide two distinct view modes:
29+
30+
#### 1. Node-Link Lattice View
31+
- **Technology**: SVG-based rendering.
32+
- **Layout**: A lightweight, custom Force-Directed Layout algorithm implemented in JavaScript.
33+
- **Interactions**:
34+
- **Draggable Nodes**: Move nodes to refine the layout.
35+
- **Zoom/Pan**: Standard SVG viewport manipulation.
36+
- **Hover Details**: Show metadata (description, requirements, rewards) in a sidebar or tooltip.
37+
- **Highlighting**: Hovering over a node highlights its immediate neighbors (dependencies and dependents).
38+
- **Styling**: Distinct colors and icons for different node types (Quest, Item, Ability, Cadence, Stat, Refinement).
39+
40+
#### 2. Hierarchical Progression View
41+
- **Technology**: HTML/CSS Grid-based "Indented Tree" or "Tiered Columns".
42+
- **Layout**:
43+
- Nodes are grouped by their "Depth" or "Tier" in the progression lattice.
44+
- Tier 0: Starting Quests/Items.
45+
- Tier N: Content unlocked by Tier N-1.
46+
- **Structure**:
47+
- Columns represent progression stages.
48+
- Rows represent categories (e.g., Combat, Crafting, Exploration).
49+
- **Functionality**: Clearly shows "what leads to what" without the visual clutter of a full graph.
50+
51+
## 5. Implementation Details
52+
53+
### Custom Layout Algorithm (Lattice-Link)
54+
A simple spring-embedder algorithm will be used:
55+
1. **Repulsion**: Nodes push away from each other.
56+
2. **Attraction**: Connected nodes pull toward each other (spring force).
57+
3. **Gravity**: All nodes are slightly pulled toward the center.
58+
4. **Iteration**: Run for ~300 frames on load to settle the graph, then allow manual adjustments.
59+
60+
### Hierarchical Sorting Logic
61+
1. Perform a Breadth-First Search (BFS) starting from "Root" nodes (e.g., `quest_prologue`).
62+
2. Assign a `depth` property to each node.
63+
3. Group nodes by `depth` and `type` for the Tiered View.
64+
65+
## 6. Styling & Aesthetics
66+
- **Theme**: Dark mode by default, matching the project's UI.
67+
- **Node Aesthetics**:
68+
- Quests: Hexagons
69+
- Items: Circles
70+
- Abilities: Rhombus
71+
- Cadences: Squares
72+
- **Edge Aesthetics**:
73+
- Directional arrows.
74+
- Color-coded edges: "Requires" (Red), "Unlocks" (Green), "Consumes" (Orange).
75+
76+
## 7. Timeline & Tasks
77+
1. **Scrub**: Remove all Mermaid code (scripts and docs).
78+
2. **Scaffold**: Create `scripts/visualize_v2.py` and the HTML template.
79+
3. **Engine**: Implement the JS force-directed layout and SVG renderer.
80+
4. **Hierarchy**: Implement the CSS-grid hierarchy generator.
81+
5. **Finalize**: Update `scripts/check_health.py` to use the new visualizer if applicable.
82+
83+
## 8. Verification
84+
- Validate that the generated HTML loads without console errors.
85+
- Confirm that all 130+ nodes from `content_graph.json` are present and correctly linked.
86+
- Ensure the visualization correctly reflects circular dependencies (if any) in the node-link view.

scripts/data/health_summary.json

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
2-
"is_healthy": true,
3-
"failure_count": 0,
2+
"is_healthy": false,
3+
"failure_count": 1,
44
"metrics": {
55
"monoliths": 0,
6-
"coverage": 78.33,
6+
"coverage": 79.62,
77
"mutation_score": 0.0,
88
"missing_tests": 0,
99
"key_violations": 0,
@@ -16,7 +16,13 @@
1616
"unsustainable": 0
1717
},
1818
"pending_feedback": 0,
19-
"test_passed": true
19+
"test_passed": false
2020
},
21-
"failures": []
21+
"failures": [
22+
{
23+
"category": "tests",
24+
"message": "dotnet test failed",
25+
"metadata": {}
26+
}
27+
]
2228
}

scripts/data/shield_coverage.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"schemaVersion": 1,
33
"label": "coverage",
4-
"message": "78.3%",
4+
"message": "79.6%",
55
"color": "green"
66
}

scripts/data/shield_tests.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"schemaVersion": 1,
33
"label": "tests",
4-
"message": "passed",
5-
"color": "brightgreen"
4+
"message": "failed",
5+
"color": "red"
66
}

simulation_report.md

Lines changed: 44 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Game Content Health Report
2-
Generated: 2026-04-17 13:55:03
2+
Generated: 2026-04-20 09:06:33
33

44
## 💀 Reachability Analysis
55
Total Quests Completed: 36
@@ -9,67 +9,67 @@ Routed Completion Time: 60.8m
99

1010
## ⚖️ Economic Sustainability
1111
### Sustainable Recurring Activities
12-
- Purify the Grove
13-
- Study Ancient Texts
14-
- Refine Lightning:Fire Shard->Lightning I
15-
- Refine Wood:Log->Herb
16-
- Archive Sifting
17-
- Hunt Sand-Sharks
18-
- Buy Potion
19-
- Refine Mixology:Herb->Potion
20-
- Tutorial Section
21-
- Scavenge Scrap
22-
- Shatter the Crystals
2312
- Refine Ice:Moonberry->Ice I
24-
- Chop Wood
25-
- Power the Forge
26-
- Mine Iron Ore
27-
- Refine Life:Ancient Bark->Cure I
28-
- Deep Sea Scavenge
29-
- High Altitude Survey
30-
- Harvest Sea-Life
31-
- Hunt Slimes
32-
- Refine Ice:Mana Leaf->Ice I
13+
- Refine Fire:Basic Gem->Fire I
14+
- Refine Scrap:Web->Gold
15+
- Gather Moonberries
16+
- Scavenge Scrap
3317
- Refine Earth:Crystal Shards->Earth I
18+
- Refine Ice:Mana Leaf->Ice I
3419
- Refine Fire:Iron Ore->Fire I
20+
- Archive Sifting
21+
- Refine Water:Blue Coral->Water I
3522
- Hunt Spiders
23+
- Tutorial Section
3624
- Sell Gem
37-
- Refine Scrap:Slime->Gold
38-
- Hunt Goblins
39-
- Refine Lightning:Ice Shard->Lightning I
40-
- Gather Moonberries
41-
- Refine Fire:Basic Gem->Fire I
42-
- Refine Water:Blue Coral->Water I
25+
- Chop Wood
26+
- High Altitude Survey
27+
- Mine Iron Ore
28+
- Buy Potion
4329
- Refine Haste:Lost Parchment->Haste I
30+
- Purify the Grove
31+
- Shatter the Crystals
32+
- Refine Mixology:Herb->Potion
33+
- Refine Life:Ancient Bark->Cure I
34+
- Hunt Sand-Sharks
35+
- Power the Forge
36+
- Refine Wood:Log->Herb
37+
- Hunt Goblins
38+
- Hunt Slimes
4439
- Hunt Bats
45-
- Refine Scrap:Web->Gold
40+
- Refine Lightning:Fire Shard->Lightning I
41+
- Refine Lightning:Ice Shard->Lightning I
42+
- Harvest Sea-Life
43+
- Refine Scrap:Slime->Gold
44+
- Deep Sea Scavenge
45+
- Study Ancient Texts
4646

4747
### Net Resource Rates (per second)
48-
- **Haste I**: 28.8024/s
49-
- **Water I**: 105.1123/s
50-
- **Gold**: 10114.0918/s
5148
- **Ice Shard**: 29.2769/s
52-
- **Water**: 52.5561/s
53-
- **Cure I**: 14.4012/s
54-
- **Ice I**: 57.6049/s
55-
- **Crystal Shards**: 8.6407/s
5649
- **Ancient Bark**: 7.2006/s
57-
- **Log**: 5.7605/s
50+
- **Earth I**: 28.8024/s
51+
- **Lost Parchment**: 3.8403/s
52+
- **Gold**: 10114.0918/s
53+
- **Fire Shard**: 30.7171/s
54+
- **Iron Ore**: 10.6547/s
5855
- **Lightning I**: 57.6049/s
5956
- **Mana Leaf**: 5.1294/s
57+
- **Basic Gem**: 83.5850/s
58+
- **Slime**: 26.9816/s
59+
- **Mythril Spark**: 0.4800/s
60+
- **Fire I**: 33.6028/s
61+
- **Cure I**: 14.4012/s
62+
- **Ice I**: 57.6049/s
63+
- **Crystal Shards**: 8.6407/s
6064
- **Potion**: 40.7979/s
65+
- **Water I**: 105.1123/s
6166
- **Leather**: 26.2781/s
67+
- **Haste I**: 28.8024/s
68+
- **Log**: 5.7605/s
69+
- **Water**: 52.5561/s
6270
- **Moonberry**: 20.5176/s
63-
- **Mythril Spark**: 0.4800/s
64-
- **Earth I**: 28.8024/s
6571
- **Sun-baked Scale**: 0.9601/s
66-
- **Basic Gem**: 83.5850/s
67-
- **Slime**: 26.9816/s
68-
- **Fire Shard**: 30.7171/s
6972
- **Herb**: 23.0419/s
70-
- **Fire I**: 33.6028/s
71-
- **Lost Parchment**: 3.8403/s
72-
- **Iron Ore**: 10.6547/s
7373

7474
## 🔄 Feedback Loops
7575
✅ No unbounded growth loops detected (approximation).

0 commit comments

Comments
 (0)