PolyLine
A polyline is an open line segment formed by connecting multiple points, created by clicking multiple times to add nodes.
Drawing Method
Click multiple times to complete drawing:
- Click on the canvas to add the first point
- Continue clicking to add more nodes
- Move mouse to preview the next line segment in real-time
- Press
Enterto confirm and complete drawing, or pressEscto cancel - Press
Backspaceto delete the last point
You can hold the space key to pan the canvas while drawing.
Editing
After selecting a polyline, it enters edit mode:
- Drag vertices to adjust the polyline shape
- Midpoint controls with a plus sign are displayed between adjacent vertices. Click a midpoint to insert a new vertex at that position
- Double-click a vertex to delete it (polyline must keep at least 2 vertices)
- Use
ShapeOptions.enableEditAddMidPointto control whether midpoints are displayed - Use
ShapeOptions.enableEditDropPointto control whether double-click to delete vertex is enabled
Data
ts
export interface PolyLineData extends ShapeData {
shapeName: 'polyline'
points: number[]
}