Skip to main content

Points

Points are dots that can be rendered at a location (x, y). They are the simplest display element and can be styled with different colors and sizes.

import { InteractivePoint } from '@wangyaoshen/locus-interaction';

const point = new InteractivePoint({
position: [250, 150],
color: '#E91E63',
radius: 8,
});

Multiple Points

Render multiple points at different locations:

const points = [
{ position: [100, 100], color: '#E91E63' },
{ position: [200, 150], color: '#2196F3' },
{ position: [300, 100], color: '#4CAF50' },
].map(config => new InteractivePoint({
...config,
radius: 8,
}));

Styling

Points can be customized with various visual properties:

const styledPoint = new InteractivePoint({
position: [250, 150],
color: '#9C27B0',
radius: 12,
strokeColor: '#7B1FA2',
strokeWidth: 2,
opacity: 0.8,
});

Props

NameTypeDefaultDescription
positionVector2[0, 0]Point position [x, y]
colorstring'#E91E63'Fill color
radiusnumber8Point radius
strokeColorstring-Stroke color
strokeWidthnumber0Stroke width
opacitynumber1Opacity (0-1)