Skip to content

Commit e3773b7

Browse files
committed
Improve graph visualizer contrast and fix layout scrolling
1 parent 3300582 commit e3773b7

2 files changed

Lines changed: 18 additions & 16 deletions

File tree

scripts/export_graph_mermaid.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ def generate_mermaid():
1313
lines = ["graph TD"]
1414

1515
# Define styles
16-
lines.append("classDef quest fill:#f9f,stroke:#333,stroke-width:2px;")
17-
lines.append("classDef location fill:#ccf,stroke:#333,stroke-width:2px;")
18-
lines.append("classDef cadence fill:#cfc,stroke:#333,stroke-width:2px;")
19-
lines.append("classDef root fill:#ff9,stroke:#333,stroke-width:4px;")
16+
lines.append("classDef quest fill:#4b0082,stroke:#f9f,stroke-width:2px,color:#fff;")
17+
lines.append("classDef location fill:#00008b,stroke:#ccf,stroke-width:2px,color:#fff;")
18+
lines.append("classDef cadence fill:#006400,stroke:#cfc,stroke-width:2px,color:#fff;")
19+
lines.append("classDef root fill:#8b8b00,stroke:#ff9,stroke-width:4px,color:#fff;")
2020

2121
# Filter for significant nodes to avoid clutter
2222
# Focus on Quests, Locations, Cadences

scripts/visualize_graph.py

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ def generate_html(mermaid_code):
1818
color: #c9d1d9;
1919
margin: 0;
2020
padding: 0;
21-
overflow: hidden;
2221
}}
2322
.header {{
2423
background-color: #161b22;
@@ -27,6 +26,9 @@ def generate_html(mermaid_code):
2726
display: flex;
2827
justify-content: space-between;
2928
align-items: center;
29+
position: sticky;
30+
top: 0;
31+
z-index: 100;
3032
}}
3133
.legend {{
3234
display: flex;
@@ -35,22 +37,21 @@ def generate_html(mermaid_code):
3537
}}
3638
.legend-item {{ display: flex; align-items: center; gap: 5px; }}
3739
.legend-box {{ width: 12px; height: 12px; border-radius: 2px; }}
38-
.quest-box {{ background-color: #f9f; border: 1px solid #333; }}
39-
.location-box {{ background-color: #ccf; border: 1px solid #333; }}
40-
.cadence-box {{ background-color: #cfc; border: 1px solid #333; }}
40+
.quest-box {{ background-color: #4b0082; border: 1px solid #f9f; }}
41+
.location-box {{ background-color: #00008b; border: 1px solid #ccf; }}
42+
.cadence-box {{ background-color: #006400; border: 1px solid #cfc; }}
4143
4244
#graph-container {{
43-
width: 100vw;
44-
height: calc(100vh - 60px);
45+
width: 100%;
4546
overflow: auto;
46-
padding: 20px;
47+
padding: 40px;
4748
box-sizing: border-box;
48-
display: flex;
49-
justify-content: center;
5049
}}
5150
5251
.mermaid {{
5352
background: #0d1117;
53+
display: block;
54+
margin: 0 auto;
5455
}}
5556
</style>
5657
</head>
@@ -66,9 +67,9 @@ def generate_html(mermaid_code):
6667
</div>
6768
</div>
6869
<div id="graph-container">
69-
<pre class="mermaid">
70+
<div class="mermaid">
7071
{mermaid_code}
71-
</pre>
72+
</div>
7273
</div>
7374
<script>
7475
mermaid.initialize({{
@@ -78,7 +79,8 @@ def generate_html(mermaid_code):
7879
flowchart: {{
7980
useMaxWidth: false,
8081
htmlLabels: true,
81-
curve: 'basis'
82+
curve: 'basis',
83+
padding: 50
8284
}}
8385
}});
8486
</script>

0 commit comments

Comments
 (0)