Overview
The WeaveStrokeNode class represents a multi-point continuous line or path on the Weave.js canvas. It is a versatile and essential node type for building tools like freehand drawing.
Built on top of Konva’s Shape class shape under the hood, the WeaveStrokeNode offers full control over the line’s geometry, style, and behavior—all synchronized in real time across users.
The class extends the WeaveNode class
TypeScript types
type WeaveNodeTransformerProperties = Konva.TransformerConfig;
type WeaveStrokeProperties = {
splineResolution: number; // Spline resolution
resamplingSpacing: number; // Spacing for resampling points
transform?: WeaveNodeTransformerProperties;
};
type WeaveStrokeNodeParams = {
config: Partial<WeaveStrokeProperties>;
};
type WeaveStrokePoint = {
x: number;
y: number;
pressure: number;
};
Parameters
For WeaveStrokeNodeParams:
| Property | Type | Required | Description |
|---|---|---|---|
|
|
Required |
Config parameters for the node. |
For WeaveStrokeNodeParams:
| Property | Type | Required | Default | Description |
|---|---|---|---|---|
|
|
|
Resolution of the interpolated spline to smooth the curve |