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
to_canvas(): group box sizing uses ceil(sqrt(n)) columns but node placement hardcodes 3 #1452
to_canvas() in graphify/export.py computes each community's group-box width from a ceil(sqrt(n))-column grid, but the node-placement loop that fills that box hardcodes exactly 3 columns. For any community larger than ~9-12 members, the box is sized for a roughly-square grid while the actual node cards render as a narrow 3-wide column that wraps far past the box's intended height — producing a tall, mostly-empty box with a cramped 3-wide strip of nodes squeezed into one side.
Environment
graphifyy 0.8.47 (current PyPI/pipx, confirmed via pyproject.toml on main)
macOS (but this is a pure layout-math bug, not platform-specific)
Relevant code
graphify/export.py, to_canvas():
Box sizing (line ~1169) explicitly targets a ceil(sqrt(n))-column layout:
(note: h here is already inconsistently using /3, not sqrt(n), while w uses sqrt(n) — the two dimensions don't even agree with each other on an assumed column count.)
Node placement (line ~1238) hardcodes 3 columns regardless of n:
graphify .# any repo with a community of ~20+ members
graphify export obsidian
# open graphify-out/obsidian/graph.canvas in Obsidian's Canvas viewer
A community with, say, 25 members gets a box width sized for ceil(sqrt(25)) = 5 columns (1100px wide), but the node cards are placed 3-per-row, occupying only ~600px of that 1100px width and wrapping into 9 rows instead of the 5 the box height was sized for. The visual result is a wide, half-empty box with a narrow, tall stack of cards on the left edge.
Impact
Purely cosmetic (no data loss), but it makes the canvas effectively unreadable for any non-trivial community — which is the primary use case for export obsidian's canvas output (visually browsing graph structure). Communities over ~12 members render as illegible, wrapped 3-wide strips inside oversized boxes.
Suggested fix
Compute the column count once per community and reuse it for both box sizing and placement, e.g.:
and use that same inner_cols value in both the w/h box-sizing calc and the placement loop, rather than recomputing sqrt(n) in one place and hardcoding 3 in the other.
Fixed on v8 in 7278e24 (via #1459, thanks @TPAteeq). Community node cards now lay out in the same ceil(sqrt(n))-column grid the group box is sized for, so they fill the box instead of wrapping into a narrow strip. Will ship in the next release.
Activity
fix(export): lay out canvas node cards in the box's sqrt(n)-column gr…
safishamsi commentedon Jun 25, 2026
Fixed on
v8in 7278e24 (via #1459, thanks @TPAteeq). Community node cards now lay out in the sameceil(sqrt(n))-column grid the group box is sized for, so they fill the box instead of wrapping into a narrow strip. Will ship in the next release.release: 0.8.50
fix(export): lay out canvas node cards in the box's sqrt(n)-column gr…
release: 0.8.50