Skip to content

feat: Add graph memory access API, use correct node_sizes for node layout#44

Merged
mitchmindtree merged 2 commits intonannou-org:mainfrom
mitchmindtree:node-sizes
Jan 19, 2026
Merged

feat: Add graph memory access API, use correct node_sizes for node layout#44
mitchmindtree merged 2 commits intonannou-org:mainfrom
mitchmindtree:node-sizes

Conversation

@mitchmindtree
Copy link
Member

Expose node_sizes() method on GraphTempMemory and add with_graph_memory() function for efficient access to graph state. The function provides a closure-based API that avoids cloning data and automatically creates default memory if none exists.

We now use the new API to correctly retrieve node sizes during layout in the demo. Previously we attempted to use area_rect, however it turns out this is only generated for Area widgets in egui, and so for the nodes it always returned None, resulting in the fallback node size for layout.

Expose `node_sizes()` method on `GraphTempMemory` and add
`with_graph_memory()` function for efficient access to graph state.
The function provides a closure-based API that avoids cloning data
and automatically creates default memory if none exists.

We now use the new API to correctly retrieve node sizes during layout
in the demo. Previously we attempted to use `area_rect`, however it
turns out this is only generated for `Area` widgets in egui, and so for
the nodes it always returned `None`, resulting in the fallback node size
for layout.
@mitchmindtree mitchmindtree self-assigned this Jan 19, 2026
@mitchmindtree mitchmindtree merged commit 5d88652 into nannou-org:main Jan 19, 2026
7 checks passed
@mitchmindtree mitchmindtree deleted the node-sizes branch January 19, 2026 07:58
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