Line
Draw a straight line between two points with color, thickness, and solid, dashed, or dotted styles
Props
Prop
Details
colorstringDefault:
#ffffffThe color of the line
colorstringDefault: #ffffffThe color of the line
pointA{x: number, y: number}Default:
{"x":0.2,"y":0.5}The start point of the line
pointA{x: number, y: number}Default: {"x":0.2,"y":0.5}The start point of the line
pointB{x: number, y: number}Default:
{"x":0.8,"y":0.5}The end point of the line
pointB{x: number, y: number}Default: {"x":0.8,"y":0.5}The end point of the line
thicknessnumberDefault:
0.01The thickness of the line. A value of one (1) matches the canvas height.
thicknessnumberDefault: 0.01The thickness of the line. A value of one (1) matches the canvas height.
style"solid" | "dashed" | "dotted"Default:
solidThe line style: solid, dashed, or dotted. Dashes and dots are spaced to land exactly on both endpoints.
style"solid" | "dashed" | "dotted"Default: solidThe line style: solid, dashed, or dotted. Dashes and dots are spaced to land exactly on both endpoints.
dashLengthnumberDefault:
0.05The length of each dash, including its caps
dashLengthnumberDefault: 0.05The length of each dash, including its caps
gapLengthnumberDefault:
0.025The gap between dashes, or the spacing between dots
gapLengthnumberDefault: 0.025The gap between dashes, or the spacing between dots
capStart"square" | "rounded"Default:
roundedCap shape at the start of the line (point A). Rounded caps center on the endpoint; square caps end flat exactly at it. Also shapes the A-facing end of each dash and dot.
capStart"square" | "rounded"Default: roundedCap shape at the start of the line (point A). Rounded caps center on the endpoint; square caps end flat exactly at it. Also shapes the A-facing end of each dash and dot.
capEnd"square" | "rounded"Default:
roundedCap shape at the end of the line (point B). Rounded caps center on the endpoint; square caps end flat exactly at it. Also shapes the B-facing end of each dash and dot.
capEnd"square" | "rounded"Default: roundedCap shape at the end of the line (point B). Rounded caps center on the endpoint; square caps end flat exactly at it. Also shapes the B-facing end of each dash and dot.