the-graph
the-graph copied to clipboard
non-dom events: find nearest target
To make the-graph more usable, I think we need to move away from dom events on specific SVG elements, and move towards a system with one listener for the whole element that returns the closest compatible target item to a pointer. This will enable:
- Moving away from SVG to all-canvas rendering #67
- When selecting an edge, you won't have to exactly hit the edge element. Even with the wider transparent edge on top, as we have now, alpha feedback suggests it can be hard to hit the one you want. On touch screens, as you move your finger the closest edge could have an intermediate highlight, showing "you will select this edge if you release now." Projecting a point onto a Bézier curve demo
- When making a new edge, your connection will be made to the closest compatible port, and get feedback as you are dragging. Ports can jump out to latch on to your edge, like magsafe. paper.js method
- And maybe even draw an X to delete #21 and other gestures.
Related: #114