Skip to content

Sketch2: add line#72270

Open
bencodeorg wants to merge 13 commits intostagingfrom
ben/sketch2-line-as-edge
Open

Sketch2: add line#72270
bencodeorg wants to merge 13 commits intostagingfrom
ben/sketch2-line-as-edge

Conversation

@bencodeorg
Copy link
Copy Markdown
Contributor

@bencodeorg bencodeorg commented Apr 21, 2026

Implements a line as an edge that connects two "ghost nodes".

As an alternative, I went down the path of implementing this as a "custom node" (very rough): https://github.com/code-dot-org/code-dot-org/compare/ben/sketch2-line

I think implementing it as an edge makes sense longer term because we'll be able tap into the built-in goodness that React Flow includes for "lines" as part of its edge implementation.

Their docs (linked below) also mention the idea ("What about an “edge” not connected to any nodes at all?") of an edge with no nodes (ie, what we're trying to do), so that seems like a reasonable standard approach.

Links

Testing story

Tested manually (see video above).

Follow-up work

  • Center drag handles on edges of the line. This was trickier than I expected and I wanted to get a V0 out, so punted for now.
  • Add support for arrow heads, colors, thicknesses, etc.
  • Would be nice to have a drag target on the center of the edge, although that might be tricky.

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