Layout, reroutes, and comments
Arrange a graph, bend wires, preserve the viewport, and keep comments tied to C#.
On this page
A useful graph keeps the path readable without pretending layout changes behavior. Move cards, bend wires, and leave comments where the next reader needs them.
The problem
Section titled “The problem”PlayerMotor.UpdateGrounded combines a loop, a comparison, and an early return. Automatic placement gives you a starting point, but the wire you care about may cross the loop body or disappear behind another card.
When to reach for it
Section titled “When to reach for it”Arrange a graph after you understand its path. Use the align actions to line several cards up on one edge or center. Use reroute knots to guide a long wire around cards. Use comment popups to keep source comments visible next to the node they explain. Use Auto layout when a manual arrangement has become harder to read than the default.
See it
Section titled “See it”Node positions, viewport center and zoom, reroute points, split reads, switch arm collapse state, and comment popup size are graph configuration. They persist in .rt.json; they are not another source language.
-
Drag a node to a clearer position. Move related pure nodes close to the statement that consumes them. The position is saved in the graph configuration file.
-
Select two or more nodes, right-click one of them, and choose an align action. Align Top, Align Bottom, Align Left, and Align Right move every selected node to the selection’s outermost edge on that side. Align Middle puts their vertical centers on one horizontal line, and Align Center puts their horizontal centers on one vertical line, each at the average of the selection’s centers. Each entry shows its shortcut, Shift with W, S, A, D, M, or C (⇧W and so on on macOS), so you can align the next selection without opening the menu. With fewer than two nodes selected the entries are disabled. Aligned positions are saved like a drag.
-
Pan and zoom until the active path fits your work area. The viewport persists with the method, so reopening returns to the same area.
-
Double-click a wire to add a reroute knot. Drag the knot until the wire clears nearby cards. The knot changes the route only; it adds no C#.
-
Right-click the knot and choose Remove Reroute when the bend no longer helps.
-
Alt-click a wire to break it. You can also right-click the wire and choose Break Link. Breaking a semantic data or exec connection creates a draft when that connection affects source.
-
Open a node’s comment popup. Source comments appear as markers and post-it surfaces. Edit the comment, then use Compile to round-trip the text to source. Popup size and placement stay in graph configuration.
-
Click Auto layout to reset the active graph to its automatic arrangement. The action clears manual positions and user reroutes for that graph and can be undone during the session.
What it writes
Section titled “What it writes”A comment popup can draft a source comment such as:
// Reverse only when the enemy is still moving past this boundary.if (position.x <= _leftBoundX && _direction < 0){ _direction = 1;}Moving cards, aligning them, changing the viewport, and adding reroute knots do not alter that C#. They update the method’s .rt.json graph configuration.
When it goes wrong
Section titled “When it goes wrong”When it goes wrong
| Symptom | Check | Fix |
|---|---|---|
| A reroute knot is gone after reopening. | Confirm the graph configuration storage scope and that the method was allowed to save layout. | Choose the intended storage scope, add the knot again, and leave the graph normally. |
| Auto layout removed a carefully bent wire. | Auto layout clears user-authored reroutes with manual positions. | Undo during the current session, or rebuild the presentation after the reset. |
| A comment changed on the graph but not in C#. | Look for the Previewing your changes panel. | Press Compile to write the comment draft to source. |
| The align entries are disabled, or Shift+A does nothing. | Count the selected nodes, and check whether a text field has keyboard focus. | Select at least two nodes, click empty canvas to leave the text field, then align again. |
- Shortcuts: use the fast gestures for graph editing.
- Graph configuration files: choose where layout state lives.
- Preview and Compile: separate drafts from saved source.