JavaScript & React libraryAPI Generated Docs

Class: CosmographDataManager

Constructors

Constructor

new CosmographDataManager(_): CosmographDataManager

Parameters

ParameterType
_ICosmographInternalApi

Returns

CosmographDataManager

Accessors

dataUploadPromise

Get Signature

get dataUploadPromise(): Promise<void> | null

Returns

Promise<void> | null

Methods

dataReady()

dataReady(): Promise<void>

Returns

Promise<void>


updateGraphData()

updateGraphData(pointsChanged, linksChanged, config, updateVersion?): Promise<boolean>

Parameters

ParameterType
pointsChangedboolean
linksChangedboolean
configCosmographConfig
updateVersion?number

Returns

Promise<boolean>


addPoints()

addPoints(points): Promise<void>

Parameters

ParameterType
pointsCosmographPointInput[]

Returns

Promise<void>


addLinks(links): Promise<void>

Parameters

ParameterType
linksCosmographLinkInput[]

Returns

Promise<void>


removePointsByIndices()

removePointsByIndices(indices, removeAttachedLinks): Promise<void>

Removes the points specified by the given indices from the current graph.

Parameters

ParameterTypeDefault valueDescription
indicesnumber[]undefinedThe indices of the points to remove.
removeAttachedLinksbooleantrueWhether to also remove any links attached to the removed points. Defaults to true.

Returns

Promise<void>

A Promise that resolves when the points have been removed.

Remarks

  • Will not remove points if the result would be an empty graph, or if there is only one point in the graph.
  • When the simulation is running and transitionDuration > 0, the position update animates and the simulation pauses for the duration of the transition; it does not resume automatically. Call unpause() to continue the simulation, or set transitionDuration: 0 to keep position updates instant.

removePointsByIds()

removePointsByIds(ids): Promise<void>

Removes the points specified by the given IDs from the current graph.

Parameters

ParameterTypeDescription
idsstring[]The IDs of the points to remove.

Returns

Promise<void>

A Promise that resolves when the points have been removed.


removeLinksByPointIdPairs()

removeLinksByPointIdPairs(pairs): Promise<void>

Removes the links specified by the given point ID pairs from the current graph.

Parameters

ParameterTypeDescription
pairs[string, string][]An array of point ID pairs representing the links to remove.

Returns

Promise<void>

A Promise that resolves when the links have been removed.


removeLinksByPointIndicesPairs()

removeLinksByPointIndicesPairs(pairs): Promise<void>

Removes the links specified by the given point index pairs from the current graph.

Parameters

ParameterTypeDescription
pairs[number, number][]An array of point index pairs representing the links to remove.

Returns

Promise<void>

A Promise that resolves when the links have been removed.