--- layout: posts title: Api - PointGraph Class ---

A graph of items which may be located on the same points.

Type parameters

Hierarchy

Index

Constructors

constructor

Properties

graph

graph: object

Map of unique points by x, then y, to a point id. This will remain intact even after merging.

Type declaration

  • [x: number]: object
    • [y: number]: number

index

index: object

Index of points by id.

Type declaration

insertedCount

insertedCount: number

Number of points inserted

merged

merged: object

Map of point ids which once existed but have been merged into another id due to close proximity.

Type declaration

  • [pointId: number]: number

values

values: T[]

List of values inserted at points.

Methods

forEachPoint

  • forEachPoint(cb: function): void

getElementAtPoint

getIdOfPoint

  • getIdOfPoint(p: IPoint): number

insertValue

  • insertValue(value: T): number

insertValueIdAtPoint

  • insertValueIdAtPoint(valueId: number, p: IPoint): object

mergeNearestSinglePoints

  • mergeNearestSinglePoints(withinDistance: number): void
  • Finds all points which have only one value associated. Then, merge to the nearest other point within this set. Call this after inserting values.

    Parameters

    • withinDistance: number

      Distance to consider points equal.

    Returns void

mergePoints

  • mergePoints(withinDistance: number): void

reset

  • reset(): void

Generated using TypeDoc