Class: CosmographDataManager
Constructors
Constructor
new CosmographDataManager(
_):CosmographDataManager
Parameters
| Parameter | Type |
|---|---|
_ | 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
| Parameter | Type |
|---|---|
pointsChanged | boolean |
linksChanged | boolean |
config | CosmographConfig |
updateVersion? | number |
Returns
Promise<boolean>
addPoints()
addPoints(
points):Promise<void>
Parameters
| Parameter | Type |
|---|---|
points | CosmographPointInput[] |
Returns
Promise<void>
addLinks()
addLinks(
links):Promise<void>
Parameters
| Parameter | Type |
|---|---|
links | CosmographLinkInput[] |
Returns
Promise<void>
removePointsByIndices()
removePointsByIndices(
indices,removeAttachedLinks):Promise<void>
Removes the points specified by the given indices from the current graph.
Parameters
| Parameter | Type | Default value | Description |
|---|---|---|---|
indices | number[] | undefined | The indices of the points to remove. |
removeAttachedLinks | boolean | true | Whether 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. Callunpause()to continue the simulation, or settransitionDuration: 0to keep position updates instant.
removePointsByIds()
removePointsByIds(
ids):Promise<void>
Removes the points specified by the given IDs from the current graph.
Parameters
| Parameter | Type | Description |
|---|---|---|
ids | string[] | 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
| Parameter | Type | Description |
|---|---|---|
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
| Parameter | Type | Description |
|---|---|---|
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.