Functions
Const buildShape
- buildShape(shape: string, id: string, r: number): (string | { cx: number; cy: number; id: string; r: string | number })[] | (string | { height: string | number; id: string; width: string | number; x: string | number; y: string | number })[]
Parameters
shape: string
id: string
r: number
Returns (string | { cx: number; cy: number; id: string; r: string | number })[] | (string | { height: string | number; id: string; width: string | number; x: string | number; y: string | number })[]
Const buildSymbol
- buildSymbol(group: any[], shape: string, size: number): string
Parameters
group: any[]
shape: string
size: number
Returns string
Const packedPoints
- packedPoints(pts: ArrayLike<number>, shape: string, size?: number, attribs?: any, ...body: any[]): any[]
Parameters
pts: ArrayLike<number>
shape: string
Default value size: number = 1
Optional attribs: any
Rest ...body: any[]
Returns any[]
Const points
- points(pts: Iterable<Vec2Like>, shape: string, size?: number, attribs?: any, ...body: any[]): any[]
Parameters
shape: string
Default value size: number = 1
Optional attribs: any
Rest ...body: any[]
Returns any[]
Similar to points, but takes points from a single large flat buffer of coordinates with arbitrary striding.
In addition to
shape
andsize
, the following attribs can be used to define the index range and strides:start
- start index (default: 0)num
- number of points (default: buffer length/2)cstride
- component stride (default: 1)estride
- element stride (default: 2)