Skip to content

Commit 7068560

Browse files
committed
Precompute reduction graph layout with ELK
1 parent 8df8ac0 commit 7068560

10 files changed

Lines changed: 894 additions & 517 deletions

.github/workflows/docs.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ jobs:
2222

2323
- uses: dtolnay/rust-toolchain@stable
2424

25+
- uses: actions/setup-node@v4
26+
with:
27+
node-version: '22'
28+
cache: npm
29+
2530
- name: Install mdBook
2631
run: |
2732
mkdir -p "$HOME/bin"
@@ -33,11 +38,15 @@ jobs:
3338
curl -sSL https://github.com/typst/typst/releases/download/v0.14.0/typst-x86_64-unknown-linux-musl.tar.xz | tar -xJ
3439
mv typst-x86_64-unknown-linux-musl/typst "$HOME/bin/"
3540
41+
- name: Install Node dependencies
42+
run: npm ci
43+
3644
- name: Generate data
3745
run: |
3846
cargo run --features "example-db" --example export_examples
3947
cargo run --example export_petersen_mapping
4048
cargo run --example export_graph
49+
node scripts/generate_reduction_graph_layout.js
4150
cargo run --example export_schemas
4251
cargo run --example export_module_graph
4352

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ Thumbs.db
6464
*.tmp
6565
*.temp
6666

67+
node_modules/
68+
6769
# mdBook output
6870
book/
6971

@@ -86,6 +88,8 @@ claude-output.log
8688
.worktrees/
8789
.worktree/
8890
*.json
91+
!package.json
92+
!package-lock.json
8993
.claude/worktrees/
9094
docs/test-reports/
9195
docs/superpowers/

Makefile

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,13 @@ fmt-check:
8484
clippy:
8585
cargo clippy --all-targets --features ilp-highs -- -D warnings
8686

87+
node_modules/elkjs/package.json: package.json package-lock.json
88+
npm ci
89+
8790
# Build mdBook documentation
88-
doc:
91+
doc: node_modules/elkjs/package.json
8992
cargo run --example export_graph
93+
node scripts/generate_reduction_graph_layout.js
9094
cargo run --example export_schemas
9195
cargo run --example export_module_graph
9296
bash scripts/generate_doc_snippets.sh target/release/pred
@@ -107,9 +111,11 @@ diagrams:
107111
done
108112

109113
# Build and serve mdBook with API docs
110-
mdbook:
114+
mdbook: node_modules/elkjs/package.json
111115
@echo "Exporting graph..."
112116
@cargo run --example export_graph 2>&1 | tail -1
117+
@echo "Generating graph layout..."
118+
@node scripts/generate_reduction_graph_layout.js 2>&1 | tail -1
113119
@echo "Exporting schemas..."
114120
@cargo run --example export_schemas 2>&1 | tail -1
115121
@echo "Exporting module graph..."

docs/src/introduction.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44

55
## Reduction Graph
66

7-
<script src="https://unpkg.com/elkjs@0.9.3/lib/elk.bundled.js"></script>
8-
<script src="https://unpkg.com/cytoscape-elk@2.2.0/dist/cytoscape-elk.js"></script>
97
<script src="https://unpkg.com/cytoscape-svg@0.4.0/cytoscape-svg.js"></script>
108

119
<div id="cy-search">

0 commit comments

Comments
 (0)