Class: GraphData
Constructors
Constructor
new GraphData(
config):GraphData
Parameters
| Parameter | Type |
|---|---|
config | GraphConfigInterface |
Returns
GraphData
Properties
Accessors
pointsNumber
Get Signature
get pointsNumber():
number|undefined
Returns
number | undefined
defaultRgba
Get Signature
get defaultRgba(): [
number,number,number,number]
Parsed pointDefaultColor, cached between updates (updatePointColor
invalidates it, so config changes are picked up). Public so the draw pass can
feed it to the shaderâs pointDefaultColor uniform without re-parsing the
config color string every frame.
Returns
[number, number, number, number]
linksNumber
Get Signature
get linksNumber():
number|undefined
Returns
number | undefined
Methods
hasPointAbsenceChanged()
hasPointAbsenceChanged():
boolean
Reports whether any pointâs absence (NaN position) differs between the applied
positions and the pending input, over their shared length â i.e. whether the pending
update removes (real â NaN) or revives (NaN â real) a point. Slots beyond the
shared length donât count: a slot that enters already absent has nothing to fade,
and a dropped slot no longer exists.
Returns
boolean
isPointAbsent()
isPointAbsent(
index):boolean
Whether the point at index was removed (its position is NaN).
Parameters
| Parameter | Type |
|---|---|
index | number |
Returns
boolean
updatePoints()
updatePoints():
void
Returns
void
updatePointColor()
updatePointColor():
void
Updates the point colors based on the input data or default config value.
Returns
void
getResolvedPointColorChannel()
getResolvedPointColorChannel(
index,channel):number
Resolves one color channel of a point the way the draw shader does: a NaN
channel means the exit default (transparent) for an absent point, the
config default otherwise. The CPU mirror of the shader rule, for consumers
that read colors outside the GPU.
Parameters
| Parameter | Type |
|---|---|
index | number |
channel | number |
Returns
number
updatePointSize()
updatePointSize():
void
Updates the point sizes based on the input data or default config value.
Returns
void
getResolvedPointSize()
getResolvedPointSize(
index):number
Resolves a pointâs size the way the draw shader does: NaN means the exit
default (0) for an absent point, the config default otherwise. The CPU
mirror of the shader rule, for consumers that read sizes outside the GPU
(collision, hover ring, read-back).
Parameters
| Parameter | Type |
|---|---|
index | number |
Returns
number
updatePointShape()
updatePointShape():
void
Updates the point shapes based on the input data or default config value. Images are rendered above shapes.
Returns
void
updatePointImageIndices()
updatePointImageIndices():
void
Updates the point image indices based on the input data or default value (-1 for no image).
Returns
void
updatePointImageSizes()
updatePointImageSizes():
void
Updates the point image sizes based on the input data or default to point sizes.
Returns
void
updateLinks()
updateLinks():
void
Returns
void
updateLinkColor()
updateLinkColor():
void
Updates the link colors based on the input data or default config value.
Returns
void
updateLinkWidth()
updateLinkWidth():
void
Updates the link width based on the input data or default config value.
Returns
void
updateLinkStyles()
updateLinkStyles():
void
Updates the link styles (stroke patterns) based on the input data or default config value.
Returns
void
updateArrows()
updateArrows():
void
Updates the link arrows based on the input data or default config value.
Returns
void
updateLinkStrength()
updateLinkStrength():
void
Returns
void
updateClusters()
updateClusters():
void
Returns
void
update()
update():
void
Returns
void
getNeighboringPointIndices()
getNeighboringPointIndices(
pointIndices):number[]
Returns unique point indices that are neighbors of the given point(s) â i.e., connected by a link in either direction.
Parameters
| Parameter | Type | Description |
|---|---|---|
pointIndices | number | number[] | A single point index or an array of point indices. |
Returns
number[]
Array of neighboring point indices.
getConnectedLinkIndices()
getConnectedLinkIndices(
pointIndices):number[]
Returns unique link indices where both the source and target endpoints are within the given point(s). Only links fully contained in the set are returned.
Parameters
| Parameter | Type | Description |
|---|---|---|
pointIndices | number | number[] | A single point index or an array of point indices. |
Returns
number[]
Array of link indices connecting points within the provided set.
getConnectedPointIndices()
getConnectedPointIndices(
linkIndices):number[]
Returns unique point indices at the endpoints (source and target) of the given link(s).
Parameters
| Parameter | Type | Description |
|---|---|---|
linkIndices | number | number[] | A single link index or an array of link indices. |
Returns
number[]
Array of point indices at the ends of the provided links.