Node / Lines Connectors · guide
Arrows, markers, dash presets & textures
Current Apexify.js 6.0.0 documentation for Arrows, markers, dash presets & textures.
Helpers live in lib-next/path/advanced-lines.ts and are invoked from custom-lines.ts after the main stroke for each CustomOptions row.
Arrows (arrow)
drawArrow translates to (x,y), rotates by segment angle, draws a triangular head:
filled—fillStyle = coloroutline—strokeStyle,lineWidth = 2
Angles derive from atan2(end.y - start.y, end.x - start.x) where start respects singleLine chaining (previous row end).
Markers (markers)
getPointOnLinePath walks straight segments (currently only [start, end] pair per row) and interpolates position clamped [0,1].
drawMarker shapes:
| Shape | Drawing |
|---|---|
circle | Filled arc (radius = size/2) |
square | fillRect centred |
diamond | Four lineTo polygon |
arrow | Up-pointing triangle |
Markers paint above the connector stroke.
Dash presets (pattern)
type | setLineDash |
|---|---|
dots | [2, 4] |
dashes | [10, 5] |
custom | segments array (must be non-empty) |
When pattern is present lineDash from lineStyle is skipped.
Image texture (texture)
texture?: string | Buffer
applyLineTexture resolves sources:
| Input | Resolution |
|---|---|
Buffer | loadImage(buffer) |
http… URL | loadImage(url) |
| Else filesystem path | path.join(process.cwd(), texture) + fs.readFileSync |
On success strokeStyle = ctx.createPattern(image, 'repeat'). Errors console.error and leave prior strokeStyle.