Skip to content

Update graph based on the latest mathlib and Implement a 3D version of math kingdom#14

Open
lhyundeadsoul wants to merge 5 commits into
Crispher:mainfrom
lhyundeadsoul:main
Open

Update graph based on the latest mathlib and Implement a 3D version of math kingdom#14
lhyundeadsoul wants to merge 5 commits into
Crispher:mainfrom
lhyundeadsoul:main

Conversation

@lhyundeadsoul

Copy link
Copy Markdown

inspired by your 2D implementation, did a 3D verison to immerse yourself into the math kingdom.

the Z-axis is design to represent the abstract level of a concept.

lhyundeadsoul and others added 5 commits July 4, 2026 20:14
add gragh data generation script
Regenerate release/data/import_graph.txt from the current mathlib4
(v4.32.0-rc1), growing from 3763 to 8244 modules. The newer
`lake exe graph` export emits isolated-node declaration lines
("X" [shape=ellipse];) for sink nodes, which the old parser choked on;
gen_graph.py now handles both line forms.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
New, independent data pipeline (kingdom/regions.yaml,
kingdom/tier_overrides.yaml, script/gen_kingdom.py) that maps mathlib4's
import graph onto mountains (topic regions) with two elevation scales:
a heuristic macro_tier approximating abstraction level within a region
(unification breadth + reverse PageRank, quantile-binned, with a manual
override file for later curation), and micro_elevation for local
dependency depth. Category theory is modeled as a shared summit layer
floating above the other mountains. Regions are laid out with a
golden-angle spiral packing so mountains never overlap. Full format
documented in kingdom/schema.md, including known heuristic limitations.
Output data lives in kingdom/data/kingdom_data.json and is fully
decoupled from any renderer.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
gen_kingdom.py now pulls each module's own /-! ... -/ doc-string
straight out of the local mathlib4 checkout (title + intro paragraph,
truncated), plus a deterministic mathlib4_docs URL. 96% of the 8244
nodes get a title, 83% get a summary; both are real source content,
not generated. Documented in kingdom/schema.md.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
kingdom/viewer/index.html is a single self-contained page (Three.js and
the full kingdom dataset inlined, no network access needed) rendering
the mountains as a progressively-disclosed 3D scene: collapsed tier
platforms by default, click-to-expand detail, search, and a click-to-
highlight explorer for a concept's direct dependencies.

Replaces the separate per-folder run.sh/run.bat (which was a source of
confusion -- easy to launch the wrong one) with a single pair of
scripts at the repo root that take a 2d/3d argument and dispatch to
either the bgfx explorer or the 3D viewer, opening the latter in an
app-mode browser window when Edge/Chrome is available.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@lhyundeadsoul

Copy link
Copy Markdown
Author

This is the final result.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant