JavaScript & React libraryAPI

Class: CosmographDataManager

Constructors

Constructor

new CosmographDataManager(_): CosmographDataManager

Parameters

ParameterType
_ICosmographInternalApi

Returns

CosmographDataManager

Accessors

dataUploadPromise

Get Signature

get dataUploadPromise(): null | Promise<void>

Returns

null | Promise<void>

Methods

dataReady()

dataReady(): Promise<void>

Returns

Promise<void>


updateGraphData()

updateGraphData(pointsChanged, linksChanged): Promise<boolean>

Parameters

ParameterType
pointsChangedboolean
linksChangedboolean

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

Method will not remove points if removing passed indices will lead to empty graph, or if it’s only point in the graph.


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.