Line
A Line draws a straight line between two points.
Example
Usage
ts
import {
createLine,
} from '@ripl/core';
const line = createLine({
strokeStyle: '#3a86ff',
lineWidth: 2,
x1: 50,
y1: 50,
x2: 250,
y2: 200,
});Properties
| Property | Type | Required | Description |
|---|---|---|---|
x1 | number | Yes | Start X coordinate |
y1 | number | Yes | Start Y coordinate |
x2 | number | Yes | End X coordinate |
y2 | number | Yes | End Y coordinate |
Plus all Element style properties and Shape options.
TIP
Lines are stroked by default. Set strokeStyle to see the line — fillStyle alone won't produce a visible result.