PolygonalSelectionRegion
PolygonalSelectionRegion
is a component for selecting polygonal regions. The polygon geometry is represented by the g.Polygon.
The region can be drawn by the user using the pointer device or programmatically.
It extends the SelectionRegion.
constructorβ
constructor(options?: PolygonalRegion.Options);
It implements all the options from the SelectionRegion and adds the following options:
thresholdβ
[optional] The threshold for simplifying the polygonal region. The higher the threshold, the more simplified (fewer points) the polygonal region will be. Default is 1
.
const region = new PolygonalRegion({
paper,
threshold: 0.5,
});
Typesβ
Optionsβ
The extended SelectionRegion
options.
interface Options extends SelectionRegion.Options<g.Polygon> {
threshold?: number;
}
Polygonβ
Represents the polygon geometry.
type Polygon = g.Polygon;