Line
Draw a line on the canvas

The Line node represents a customizable straight or curved line on the canvas. Built on top of Konva’s Line, it supports features like multiple points, stroke color, width, dash patterns, and smoothing options.
Line Nodes are ideal for drawing connectors, paths, or annotations between elements. They can be static or interactive, and are often used in diagramming tools, flow editors, and visual programming interfaces.
Usage
Register the Node
Then register the node on the Weave class instance.
const instance = new Weave({
...
nodes: [
...,
new WeaveLineNode(),
]
})
Use the node
Once the node is registered you can use it on Actions or Plugins or even other Nodes.
We provide two actions:
- Pen Tool that allows users to add Line nodes, to the application by specifying all segments one-by-one (a line is a collection of points, and lines are rendered among them).
- Brush Tool that allows users to add Line nodes, to the application by free-hand (mouse or digital pencil).