Interface: Topology

CPU-side graph and geometry used to build network render buffers.

Remarks

vertexCoords and polylinePoints are interleaved coordinate pairs. Flat and tilt projections accept arbitrary x, y coordinates. Globe projection is available when coordinates fit geographic longitude and latitude bounds.

polylineStart is an offset table into polylinePoints. It must contain edgeCount + 1 entries, begin at 0, stay monotonic, and end at the number of polyline points. Straight edges with no bend points can use a zero-filled table.

Example

const topology: Topology = {
  vertexCount: 3,
  vertexCoords: new Float32Array([-96, 30, -95, 31, -94, 30]),
  edges: new Uint32Array([0, 1, 1, 2]),
  polylineStart: new Uint32Array([0, 0, 0]),
};

Properties

Property

Modifier

Type

Description

edges

readonly

Uint32Array

Edge endpoint vertex indices stored as [from0, to0, from1, to1, ...]. Remarks Every endpoint index must be less than Topology.vertexCount.

polylinePoints?

readonly

Float32Array<ArrayBufferLike>

Optional intermediate x, y or lon, lat points, two f32 values per point. Remarks These are bend points only. Edge endpoints still come from Topology.edges and Topology.vertexCoords.

polylineStart

readonly

Uint32Array

Edge-to-polyline offset table with edgeCount + 1 entries. The first entry must be 0, entries must be monotonic, and the terminal entry must equal the number of points in polylinePoints.

vertexCoords?

readonly

Float32Array<ArrayBufferLike>

Optional x, y or lon, lat coordinates, two f32 values per vertex. Remarks Omit this field to use a generated unit-ring layout.

vertexCount

readonly

number

Number of logical graph vertices.