Skip to content

Class: GraphLayer

Defined in: layers/graph.ts:87

A node-link graph: edges as line segments, nodes as round points.

Implements

Constructors

Constructor

ts
new GraphLayer(gl, opts): GraphLayer;

Defined in: layers/graph.ts:110

Parameters

ParameterType
glWebGL2RenderingContext
optsGraphOptions

Returns

GraphLayer

Properties

colorCss

ts
readonly colorCss: string;

Defined in: layers/graph.ts:90


id

ts
readonly id: string;

Defined in: layers/graph.ts:88

Implementation of

Layer.id


name

ts
readonly name: string;

Defined in: layers/graph.ts:89


yAxis

ts
readonly yAxis: string;

Defined in: layers/graph.ts:91

The y axis this layer is bound to.

Implementation of

Layer.yAxis

Methods

bounds()

ts
bounds(): 
  | {
  x: Range;
  y: Range;
}
  | null;

Defined in: layers/graph.ts:203

Data-space bounds of this layer, for autoscaling. null if empty.

Returns

| { x: Range; y: Range; } | null

Implementation of

Layer.bounds


dispose()

ts
dispose(): void;

Defined in: layers/graph.ts:228

Returns

void

Implementation of

Layer.dispose


draw()

ts
draw(state): void;

Defined in: layers/graph.ts:208

Parameters

ParameterType
stateDrawState

Returns

void

Implementation of

Layer.draw


setData()

ts
setData(data): void;

Defined in: layers/graph.ts:185

Replace nodes and edges (for streaming). When x/y are omitted, node positions are recomputed with the package's force layout from the edges.

Parameters

ParameterType
dataGraphData

Returns

void

MIT licensed. WebGL2 required.