createLinePath
import { createLinePath, Path } from "@pibbl/core";LinePathOptions is accepted by createLinePath(options): Path2D, which creates a fresh path from
finite numeric coordinate pairs and optional closePath. It is pure, and does
not attach paint, events, or caching.
<Path style={{ d: createLinePath({ coords: [ [0, 0], [80, 40], [160, 0], ], }), stroke: "#2563eb", }}/>Try the Line live example.
API details from source
Section titled “API details from source”
Creates a Canvas Path2D for line geometry from validated options.
createLinePath: (options: Readonly<LinePathOptions>) => Path2DRelated API: createLinePath, LinePathOptions.
Parameters
Section titled “Parameters”options— Ordered vertices and whether to close the path. See LinePathOptions.
Returns
Section titled “Returns”A native Canvas path containing the line.
See also
Section titled “See also”View source — packages/core/src/lib/geometry/line.ts:23
Implementation guidance for agents
Section titled “Implementation guidance for agents”Read the Drawing, layout, and effects companion for ownership, adaptation, failure modes, and verification. Agent start provides the version-selection workflow.
Complete minimal examples
Section titled “Complete minimal examples”- Line and SVG paths: Construct a polyline and an SVG path from authored coordinates. Plain source
Documentation version
Section titled “Documentation version”Documentation built with @pibbl/core 0.0.2, revision 2dccb19. ALPHA — NOT FOR PRODUCTION USE.