Node / Lines Connectors · guide
Lines & connectors — overview
Current Apexify.js 6.0.0 documentation for Lines & connectors — overview.
lib-next exposes three related surfaces:
| Surface | ApexPainter API | Best for |
|---|---|---|
| Styled connector segments | await painter.path2d.custom(options, canvasBuffer) | Straight or lightly smoothed segments between startCoordinates / endCoordinates, gradients, dashes, arrows, markers, image textures (CustomOptions). |
| Vector geometry | painter.path2d.create(commands), await painter.path2d.draw(buffer, path, options?) | Exact PathCommand[] shapes (arcs, Béziers, rounded rects, stars, arrows), shared fill/stroke/transform (Path2DDrawOptions). |
| Hit testing | await painter.detect.path(…), .region, .anyRegion, .distance | Path2D / PathCommand[] / HitRegion primitives — same command vocabulary as create where type: 'path'. |
Types CustomOptions, PathCommand, Path2DDrawOptions, HitRegion, HitDetectionOptions export from apexify.js.
How they relate
path2d.customrasterises polylines built perCustomOptionsrow (custom-lines.ts). It does not emit a reusablePath2Dfor hit-testing; for picks you typically model the same geometry withdetect.region(rect,polygon,path) or rebuildPathCommand[].path2d.drawcompositesPath2Donto an existingcanvasBuffer(path is painted above existing pixels).detect.pathrebuildsPath2Dfrom commands when needed and callsisPointInPath/isPointInStrokeon an internal scratch canvas.
Scenes
SceneCreator accepts type: 'path' (path, options?: Path2DDrawOptions) and type: 'customLines' (lines — CustomOptions | CustomOptions[]) — same behaviour as path2d.draw / path2d.custom on a shared context.
Guide map
| # | Topic |
|---|---|
| 1 | Custom lines API |
| 2 | lineStyle & path |
| 3 | Arrows, markers, patterns & textures |
| 4 | Path2D create / draw |
| 5 | Hit testing |
Minimal examples
Custom segment
SOURCEtypescript
typescript
Path2D stroke + fill
SOURCEtypescript
typescript