Repository navigation
A product's node and frame with their ports on the top and the bottom when the flow runs down - #287
Merged
Merged
Conversation
…bottom when the flow runs down `stockNode` takes `direction: 'DOWN'`: the node's inputs are on its top edge and its outputs on the bottom edge of its body, each in a column as wide as its name, the columns of an edge centred. The names are in rows in the body (`NODE_PORT_ROWS`), the inputs' under the header and the outputs' over the bottom edge, and the lines between the two. The type under the node goes to its end, clear of the edges that leave from its middle. `framePin` takes the direction too: an input on the top of the frame and an output on the bottom, named beside its wire, in a row `settleFrames` keeps under the band or over the bottom line, the pins of an edge as far apart as the widest name. The client centres a top or bottom port's name in its column, takes a press on it inward from its edge, and draws a node's lines above the row of its outputs' names. `verticalPortSide` reads the side; anchors and routers still take such a port by its direction. Claude-Session: https://claude.ai/code/session_011UYzzShRuBLgefHUrAbqya
- A port name in its column stays there when the server places the labels again (`placePortLabel`): centred on its dot, an input's under the header, an output's over the bottom edge. - The layout keeps a top or bottom port's side (`portOptions`). - A frame that grows keeps its bottom pins on its bottom line (`growGroupsToFit`), and a frame opened again puts each top or bottom pin on its line where its route crossed it (`restoreGroupGeometry`). - A node with no output keeps no row at its bottom, so its lines and its type sit where any node has them. - `PortLabelEstimate` has its comment back. - The anchors and rerouters still route across: written down where the side is read (`verticalPortSide`). Claude-Session: https://claude.ai/code/session_011UYzzShRuBLgefHUrAbqya
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
mlir-viewer draws top to bottom (DOWN) as well as left to right, and since 8.9 its operations are Dialogram's stock node, whose ports stayed on the left and the right under DOWN. This puts them on the top and the bottom, as mlir drew them before 8.9.
Server
stockNodetakesdirection: 'DOWN'(transform(doc, { oneNode, flowDown }), taken only withoneNode). The inputs sit on the top edge and the outputs on the bottom edge of the body, each in a column as wide as its name, with the columns of an edge centred.NODE_PORT_ROWS): the inputs' under the header, the outputs' over the bottom edge. What the node says and its lines are drawn between the two rows.framePin(..., 'DOWN')puts an input on the top of the frame and an output on the bottom, each named beside its wire.settleFrameskeeps a row for these names under the band or over the bottom line, spaces the pins on an edge at least the widest name apart, and lets the layout place them whether or not an edge reaches them.Client
text-anchor, since the stocktextrule centres every text).verticalPortSidereads the side. Anchors and routers still take such a port by its direction, asnormalizePortSidedoes not name it.Cost. Left to right is unchanged. On 8,000 operations drawn top to bottom in mlir-viewer, the first build is about 50 ms slower (best of 8: about 600 → 655 ms in a benchmark of the bundled build). That is the new geometry, mostly
mkPortand the column widths. A redraw from mlir's cache costs the same as before.Also read by the platform: placing the port names again on a submit (
placePortLabel), the layout's port side (portOptions), a frame that grows (growGroupsToFit) and a frame opened again (restoreGroupGeometry) keep a top or bottom port where it is.Known limits.
portsSurroundingdoes not reach those pins; it was tried.Tests:
stock-node.test.ts(sides, columns, rows, width, unchanged left to right, a whole graph not drawn so, frame pins and their room, names placed again, the layout's sides, no bottom row without an output, a frame grown and opened again),ports-down.test.ts(the client's hit area, names, frame pin names, lines and type rendered through the views).npm test,npm run typecheckandscripts/check-neutrality.shpass.https://claude.ai/code/session_011UYzzShRuBLgefHUrAbqya