Skip to content

@putianyi888/vue3-plots


Defined in: geometry.ts:28

Abstract base class implemented by all built-in geometry shapes.

Use the type discriminator to narrow emitted shapes.

Example ​

ts
function handleShape(shape: AnyShape) {
  if (shape.type === 'rect') {
    console.log(shape.width)
  }
}

Extended by ​

Type Parameters ​

Type Parameter
TType extends ShapeType

Constructors ​

Constructor ​

new Shape<TType>(): Shape<TType>

Returns ​

Shape<TType>

Properties ​

PropertyModifierTypeDefined in
typeabstract readonlyTTypegeometry.ts:29

Methods ​

contains() ​

abstract contains(point): boolean

Defined in: geometry.ts:34

Checks whether a point is inside the shape.

Parameters ​

ParameterType
pointPoint

Returns ​

boolean


svgPath() ​

abstract svgPath(): string

Defined in: geometry.ts:39

Generates an SVG path string for the shape boundary.

Returns ​

string