You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
export obsidian writes empty graph.canvas (32 bytes) on a populated graph #1324
graphify export obsidian writes 1,679 markdown notes correctly, but the companion graph.canvas file is always 32 bytes of empty JSON:
{
"nodes": [],
"edges": []
}
This happens regardless of graph size — the underlying graph.json has 1,708 nodes and 3,173 links, and the markdown notes contain valid [[wikilinks]], but none of that data is reflected in the Canvas.
Repro
graphify .# full pipeline on any non-trivial repo
graphify export obsidian
cat graphify-out/obsidian/graph.canvas
# → {"nodes": [], "edges": []}
Re-running graphify export obsidian after deleting the canvas file produces the same empty output. Deterministic.
Environment
graphify 0.8.39 (installed via pip to ~/.local/bin/graphify)
graph.canvas should contain Canvas nodes (one per markdown note, with x/y positions and a file reference to the .md path) and Canvas edges built from the graph's links, so opening the vault and double-clicking graph.canvas shows the spatial cluster layout.
Workaround
Obsidian's built-in Graph View (Ctrl/Cmd+G) renders fine because it reads the [[wikilinks]] inside each note — those are written correctly. Only the pre-positioned Canvas board is broken.
Notes
graph.html (force-directed view from graph.json) works correctly on the same graph
The 32-byte size hints the canvas writer is producing the empty shell before the node-emission loop runs (or the loop has a guard that always evaluates false)
Root cause:to_canvas built cards/edges solely by iterating the communities dict (export.py), while to_obsidian iterates G.nodes() directly. When communities is empty - which happens on --no-cluster builds and whenever there's no .graphify_analysis.json sidecar and every node's community is null - the canvas loops produced nothing and it wrote the empty {"nodes": [], "edges": []} shell, which serializes to exactly 32 bytes. That's why the notes and wikilinks were fine but only the canvas was empty.
Fix: when communities is empty on a populated graph, fall back to one synthetic community containing every node, so the canvas always reflects the graph.
Verified: reproduced the 32-byte empty canvas with community: null nodes + no sidecar; after the fix the same graph yields a populated canvas (e.g. 1573 bytes, 5 nodes, 5 edges via export obsidian on a --no-cluster build). Regression test added (test_to_canvas_no_communities_still_populates); full suite green (2113 passed).
Activity
Populate Obsidian canvas when no community data is present (#1324)
safishamsi commentedon Jun 17, 2026
Fixed in
9c8bd4d(branch v8).Root cause:
to_canvasbuilt cards/edges solely by iterating thecommunitiesdict (export.py), whileto_obsidianiteratesG.nodes()directly. Whencommunitiesis empty - which happens on--no-clusterbuilds and whenever there's no.graphify_analysis.jsonsidecar and every node'scommunityis null - the canvas loops produced nothing and it wrote the empty{"nodes": [], "edges": []}shell, which serializes to exactly 32 bytes. That's why the notes and wikilinks were fine but only the canvas was empty.Fix: when
communitiesis empty on a populated graph, fall back to one synthetic community containing every node, so the canvas always reflects the graph.Verified: reproduced the 32-byte empty canvas with
community: nullnodes + no sidecar; after the fix the same graph yields a populated canvas (e.g. 1573 bytes, 5 nodes, 5 edges viaexport obsidianon a--no-clusterbuild). Regression test added (test_to_canvas_no_communities_still_populates); full suite green (2113 passed).Document this session's fixes in changelog and add JSON-truncation tr…
Populate Obsidian canvas when no community data is present (Graphify-…
Document this session's fixes in changelog and add JSON-truncation tr…