JavaScript & React libraryAPI Generated DocsClassesCosmograph

Class: Cosmograph

Public Cosmograph API interface.

Implements

Constructors

Constructor

new Cosmograph(containerElement, config, duckDbConnection?): Cosmograph

Creates a new instance of the Cosmograph class.

Parameters

ParameterTypeDescription
containerElementHTMLElementThe HTML div element that will contain the Cosmograph visualization.
configCosmographConfigThe configuration options for the Cosmograph instance.
duckDbConnection?string | WasmDuckDBConnection(Optional) The connection string or WasmDuckDBConnection instance for the DuckDB database.

Returns

Cosmograph

Accessors

stats

Get Signature

get stats(): CosmographStats

Statistical information about current points and links in the graph.

Returns

CosmographStats

An object containing the count of points and links and summaries of points and links data.

Summaries include:

  • Column names and types
  • Aggregates for each column (count, min, max, approx_unique, avg, std, q25, q50, q75)
  • Percentage of NULL values

Statistical information about current points and links in the graph.

Implementation of

ICosmograph.stats


maxPointSize

Get Signature

get maxPointSize(): number

Gets the maximum point size. This value is the maximum size of the gl.POINTS primitive that WebGL can render on the user’s hardware.

Returns

number

The maximum point size, or 0 if not available.

Gets the maximum point size. This value is the maximum size of the gl.POINTS primitive that WebGL can render on the user’s hardware.

Implementation of

ICosmograph.maxPointSize


progress

Get Signature

get progress(): number | undefined

A value that gives information about the running simulation progress.

Returns

number | undefined

The current progress of the simulation, where 0 represents the start of the simulation and 1 represents the end, or undefined if not available.

A value that gives information about the running simulation progress.

Implementation of

ICosmograph.progress


isSimulationRunning

Get Signature

get isSimulationRunning(): boolean | undefined

Gets a boolean indicating whether the simulation is currently running.

Returns

boolean | undefined

true if the simulation is running, false if it is not running, or undefined if the information is not available.

Gets a boolean indicating whether the simulation is currently running.

Implementation of

ICosmograph.isSimulationRunning


isSimulationAvailable

Get Signature

get isSimulationAvailable(): boolean

Gets a boolean indicating if a simulation can run for the current graph configuration and data.

Remarks

Determined on graph init/rebuild. Based on enableSimulation config (if set), or defaults to true if links exist or points lack layout (pointXBy/pointYBy).

The value updates upon graph initialization or rebuild (e.g., after setConfig or data loading).

Returns

boolean

true if a simulation can run, false otherwise.

Gets a boolean indicating if a simulation can run for the current graph configuration and data.

Remarks

Determined on graph init/rebuild. Based on enableSimulation config (if set), or defaults to true if links exist or points lack layout (pointXBy/pointYBy).

The value updates upon graph initialization or rebuild (e.g., after setConfig or data loading).

Implementation of

ICosmograph.isSimulationAvailable


pointDegrees

Get Signature

get pointDegrees(): number[] | undefined

Gets the point degrees for the current graph.

Returns

number[] | undefined

The point degrees as an array of their degree values in the order they were sent to Cosmograph, or undefined if not available.

Gets the point degrees for the current graph.

Implementation of

ICosmograph.pointDegrees


pointDirections

Get Signature

get pointDirections(): number[] | undefined

Gets the point directions for the current graph.

Remarks

The point directions are calculated based on the in-degree and out-degree of the points. The value is 0 if the point has only an outgoing link (source), 1 if it has both incoming and outgoing links (source+target), 2 if it has only an incoming link (target), and 3 if it has no links (not linked).

Returns

number[] | undefined

The point directions as an array of their direction values in the order they were sent to Cosmograph, or undefined if not available.

Gets the point directions for the current graph.

Remarks

The point directions are calculated based on the in-degree and out-degree of the points. The value is 0 if the point has only an outgoing link (source), 1 if it has both incoming and outgoing links (source+target), 2 if it has only an incoming link (target), and 3 if it has no links (not linked).

Implementation of

ICosmograph.pointDirections


rescaleXFn

Get Signature

get rescaleXFn(): (x) => number | undefined

Gets the callback function for rescaling the x-axis.

Returns

(x) => number | undefined

The callback function for rescaling the x-axis, or undefined if not set.

Gets the callback function for rescaling the x-axis.

Implementation of

ICosmograph.rescaleXFn


rescaleYFn

Get Signature

get rescaleYFn(): (y) => number | undefined

Gets the callback function for rescaling the y-axis.

Returns

(y) => number | undefined

The callback function for rescaling the y-axis, or undefined if not set.

Gets the callback function for rescaling the y-axis.

Implementation of

ICosmograph.rescaleYFn


focusedPointIndex

Get Signature

get focusedPointIndex(): number | undefined

Gets the index of the currently focused point.

Returns

number | undefined

The index of the focused point, or undefined if no point is focused.

Gets the index of the currently focused point.

Implementation of

ICosmograph.focusedPointIndex


clusterMapping

Get Signature

get clusterMapping(): Map<string, { index: number; count: number; }>

Gets the mapping of cluster values to their auto-generated indices and counts of items in each cluster.

Remarks

If pointClusterByFn is provided, keys of map will be values of pointClusterBy after applying pointClusterByFn.

Returns

Map<string, { index: number; count: number; }>

Gets the mapping of cluster values to their auto-generated indices and counts of items in each cluster.

Remarks

If pointClusterByFn is provided, keys of map will be values of pointClusterBy after applying pointClusterByFn.

Implementation of

ICosmograph.clusterMapping


activePointColorStrategy

Get Signature

get activePointColorStrategy(): "map" | "categorical" | "continuous" | "degree" | "preciseDegree" | "linkDirection" | "direct" | "single"

Provides the active point color strategy for the Cosmograph instance.

Returns

"map" | "categorical" | "continuous" | "degree" | "preciseDegree" | "linkDirection" | "direct" | "single"

The active point color strategy.

Provides the active point color strategy for the Cosmograph instance.

Implementation of

ICosmograph.activePointColorStrategy


activePointSizeStrategy

Get Signature

get activePointSizeStrategy(): "auto" | "degree" | "preciseDegree" | "direct" | "single"

Provides the active point size strategy for the Cosmograph instance.

Returns

"auto" | "degree" | "preciseDegree" | "direct" | "single"

The active point size strategy.

Provides the active point size strategy for the Cosmograph instance.

Implementation of

ICosmograph.activePointSizeStrategy


activeLinkColorStrategy

Get Signature

get activeLinkColorStrategy(): "count" | "categorical" | "direct" | "single" | "sum" | "average"

Provides the active link color strategy for the Cosmograph instance.

Returns

"count" | "categorical" | "direct" | "single" | "sum" | "average"

The active link color strategy.

Provides the active link color strategy for the Cosmograph instance.

Implementation of

ICosmograph.activeLinkColorStrategy


activeLinkWidthStrategy

Get Signature

get activeLinkWidthStrategy(): "count" | "direct" | "single" | "sum" | "average"

Provides the active link width strategy for the Cosmograph instance.

Returns

"count" | "direct" | "single" | "sum" | "average"

The active link width strategy.

Provides the active link width strategy for the Cosmograph instance.

Implementation of

ICosmograph.activeLinkWidthStrategy


linksTableName

Get Signature

get linksTableName(): string

Provides the name of the links table used by the Cosmograph instance.

Returns

string

The name of the links table.

Provides the name of the links table used by the Cosmograph instance.

Implementation of

ICosmograph.linksTableName


pointsTableName

Get Signature

get pointsTableName(): string

Provides the name of the points table used by the Cosmograph instance.

Returns

string

The name of the points table.

Provides the name of the points table used by the Cosmograph instance.

Implementation of

ICosmograph.pointsTableName


is3D

Get Signature

get is3D(): boolean | undefined

Whether Cosmograph is currently rendering in 3D mode.

Returns

boolean | undefined

Whether Cosmograph is currently rendering in 3D mode.

Implementation of

ICosmograph.is3D


pointsSelection

Get Signature

get pointsSelection(): Selection

The Mosaic selection for the points side — filter widgets, vgplot interactors, and any custom Mosaic clause source publish their clauses here. Exposes Mosaic’s standard clause/active API.

Returns

Selection

The Mosaic selection for the points side — filter widgets, vgplot interactors, and any custom Mosaic clause source publish their clauses here. Exposes Mosaic’s standard clause/active API.

Implementation of

ICosmograph.pointsSelection


linksSelection

Get Signature

get linksSelection(): Selection

The Mosaic selection for the links side — filter widgets, vgplot interactors, and any custom Mosaic clause source publish their clauses here. Exposes Mosaic’s standard clause/active API.

Returns

Selection

The Mosaic selection for the links side — filter widgets, vgplot interactors, and any custom Mosaic clause source publish their clauses here. Exposes Mosaic’s standard clause/active API.

Implementation of

ICosmograph.linksSelection

Methods

dataUploaded()

dataUploaded(): Promise<void>

Waits for the data upload promise to resolve, if it exists. This method is used to ensure that any necessary data has been uploaded before proceeding with other operations.

Returns

Promise<void>

A promise that resolves when the data is ready.

Implementation of

ICosmograph.dataUploaded


getConfig()

getConfig(): Promise<CosmographConfig>

Retrieves the current configuration of the Cosmograph.

Returns

Promise<CosmographConfig>

A promise that resolves with the current Cosmograph configuration.

Implementation of

ICosmograph.getConfig


getActivePointColorFn()

getActivePointColorFn(): Promise<ColorAccessorFn | undefined>

Gets the current coloring function.

Returns

Promise<ColorAccessorFn | undefined>

The point coloring function, or undefined if not available.

Implementation of

ICosmograph.getActivePointColorFn


getActivePointSizeFn()

getActivePointSizeFn(): Promise<SizeAccessorFn | undefined>

Gets the current point sizing function.

Returns

Promise<SizeAccessorFn | undefined>

The point sizing function, or undefined if not available.

Implementation of

ICosmograph.getActivePointSizeFn


getActiveLinkColorFn()

getActiveLinkColorFn(): Promise<ColorAccessorFn | undefined>

Gets the current link coloring function.

Returns

Promise<ColorAccessorFn | undefined>

The link coloring function, or undefined if not available.

Implementation of

ICosmograph.getActiveLinkColorFn


getActiveLinkWidthFn()

getActiveLinkWidthFn(): Promise<SizeAccessorFn | undefined>

Gets the current link width function.

Returns

Promise<SizeAccessorFn | undefined>

The link width function, or undefined if not available.

Implementation of

ICosmograph.getActiveLinkWidthFn


setConfig()

setConfig(config?): Promise<void>

Sets the config for the Cosmograph.

Parameters

ParameterTypeDescription
config?CosmographConfigConfig to be applied to the Cosmograph.

Returns

Promise<void>

Implementation of

ICosmograph.setConfig


captureScreenshot()

captureScreenshot(fileName, scale): void

Captures a screenshot of the current graph view.

Parameters

ParameterTypeDefault valueDescription
fileNamestring'cosmograph-screenshot.png'Optional name for the downloaded file (default: ‘cosmograph-screenshot.png’).
scalenumber2-

Returns

void

Implementation of

ICosmograph.captureScreenshot


getCanvas()

getCanvas(): HTMLCanvasElement | null

Gets the graph canvas element.

Returns

HTMLCanvasElement | null

The canvas element, or null if it is not available.

Implementation of

ICosmograph.getCanvas


getPointPositions()

getPointPositions(options?): Float32Array<ArrayBufferLike> | undefined

Gets the current point coordinates.

Parameters

ParameterType
options?PositionDimensionsOptions

Returns

Float32Array<ArrayBufferLike> | undefined

Float32Array of point positions ([x, y, ...] or [x, y, z, ...]).

Implementation of

ICosmograph.getPointPositions


getClusterPositions()

getClusterPositions(options?): number[] | undefined

Gets the current X and Y coordinates of the clusters.

Parameters

ParameterType
options?PositionDimensionsOptions

Returns

number[] | undefined

Array of point cluster positions.

Implementation of

ICosmograph.getClusterPositions


getPointColors()

getPointColors(): Float32Array<ArrayBufferLike> | undefined

Gets the current colors for each point.

Returns

Float32Array<ArrayBufferLike> | undefined

A Float32Array containing RGBA color values for each point, or undefined if not available.

Implementation of

ICosmograph.getPointColors


getPointSizes()

getPointSizes(): Float32Array<ArrayBufferLike> | undefined

Gets the current sizes for each point.

Returns

Float32Array<ArrayBufferLike> | undefined

A Float32Array containing size values for each point, or undefined if not available.

Implementation of

ICosmograph.getPointSizes


getLinkColors()

getLinkColors(): Float32Array<ArrayBufferLike> | undefined

Gets the current colors for each link.

Returns

Float32Array<ArrayBufferLike> | undefined

A Float32Array containing RGBA color values for each link, or undefined if not available.

Implementation of

ICosmograph.getLinkColors


getLinkWidths()

getLinkWidths(): Float32Array<ArrayBufferLike> | undefined

Gets the current widths for each link.

Returns

Float32Array<ArrayBufferLike> | undefined

A Float32Array containing width values for each link, or undefined if not available.

Implementation of

ICosmograph.getLinkWidths


setPointShapes()

setPointShapes(shapes): void

Parameters

ParameterType
shapesCosmographPointShape[]

Returns

void


setPointImageIndices()

setPointImageIndices(indices): void

Parameters

ParameterType
indicesnumber[]

Returns

void


setPointImageSizes()

setPointImageSizes(sizes): void

Parameters

ParameterType
sizesnumber[]

Returns

void


setImageData()

setImageData(imageData): void

Parameters

ParameterType
imageDataImageData | ImageData[]

Returns

void


getPointPositionByIndex()

Call Signature

getPointPositionByIndex(index, options?): [number, number] | undefined

Gets the current X and Y coordinates of a point by its index.

Parameters
ParameterTypeDescription
indexnumberPoint index.
options?PositionDimensionsOptions & object-
Returns

[number, number] | undefined

Array with X and Y coordinates of the point, or undefined if the point index is invalid.

Implementation of

ICosmograph.getPointPositionByIndex

Call Signature

getPointPositionByIndex(index, options): [number, number, number] | undefined

Parameters
ParameterType
indexnumber
optionsPositionDimensionsOptions & object
Returns

[number, number, number] | undefined

Implementation of

ICosmograph.getPointPositionByIndex


activateRectSelection()

activateRectSelection(): void

Activates the rectangular selection element.

Returns

void

Implementation of

ICosmograph.activateRectSelection


deactivateRectSelection()

deactivateRectSelection(): void

Deactivates the rectangular selection element.

Returns

void

Implementation of

ICosmograph.deactivateRectSelection


activatePolygonalSelection()

activatePolygonalSelection(): void

Activates the polygonal selection element.

Returns

void

Implementation of

ICosmograph.activatePolygonalSelection


deactivatePolygonalSelection()

deactivatePolygonalSelection(): void

Deactivates the polygonal selection element.

Returns

void

Implementation of

ICosmograph.deactivatePolygonalSelection


getSelectedPointIndices()

getSelectedPointIndices(): number[] | undefined

Get the resolved point highlight — the indices currently selected on the canvas, combining user selection, clauses on pointsSelection, and graph consistency driven by clauses on linksSelection.

Returns

number[] | undefined

A copy of the highlighted point indices, or undefined when the points side is inactive.

Implementation of

ICosmograph.getSelectedPointIndices


getSelectedLinkIndices()

getSelectedLinkIndices(): number[] | undefined

Get the resolved link highlight — the indices currently selected on the canvas, combining user selection, clauses on linksSelection, and graph consistency driven by clauses on pointsSelection.

Returns

number[] | undefined

A copy of the highlighted link indices, or undefined when the links side is inactive.

Implementation of

ICosmograph.getSelectedLinkIndices


isPointHighlighted()

isPointHighlighted(pointIndex): boolean

Returns whether the point is currently highlighted. The highlight set is the resolved combination of Mosaic clauses, user selection, and graph consistency from the link side. When the points side is inactive, every point is treated as highlighted.

Parameters

ParameterTypeDescription
pointIndexnumberPoint index to check.

Returns

boolean

Implementation of

ICosmograph.isPointHighlighted


selectPointsInRect()

selectPointsInRect(rect, addToSelection): void

Selects points inside a rectangular area, plus links between them. The link selection always also picks up edges that bridge the new region to the prior selection.

Parameters

ParameterTypeDefault valueDescription
rect[[number, number], [number, number]] | nullundefinedTwo opposite corners [[left, top], [right, bottom]], or null.
addToSelectionbooleanfalse-

Returns

void

Implementation of

ICosmograph.selectPointsInRect


selectPointsInPolygon()

selectPointsInPolygon(polygonPoints, addToSelection): void

Selects points inside a polygonal area. Same rule as selectPointsInRect.

Parameters

ParameterTypeDefault value
polygonPoints[number, number][]undefined
addToSelectionbooleanfalse

Returns

void

Implementation of

ICosmograph.selectPointsInPolygon


unselectPointsInRect()

unselectPointsInRect(rect): void

Removes the region’s points (and their connected links) from the current user selection.

Parameters

ParameterType
rect[[number, number], [number, number]] | null

Returns

void

Implementation of

ICosmograph.unselectPointsInRect


unselectPointsInPolygon()

unselectPointsInPolygon(polygonPoints): void

Removes the region’s points (and their connected links) from the current user selection.

Parameters

ParameterType
polygonPoints[number, number][]

Returns

void

Implementation of

ICosmograph.unselectPointsInPolygon


selectPoints()

selectPoints(pointIndices, addToSelection, selectConnectedPoints): void

Replace, or with addToSelection: true extend, the user point selection.

addToSelection: false (replace) clears BOTH user-selection Sets first, then applies the new point contribution — a clean restart. addToSelection: true only adds to the point side, leaving the link side as-is.

With selectConnectedPoints: true, also extends the link selection additively with edges-within(input) ∪ edges-between(input, S_p_after) — links among the new region and links bridging the new region to whatever is already selected on the point side.

  • selectPoints([1, 2, 3]) — replace: clears both sides, then sets point side to {1, 2, 3}.
  • selectPoints([4, 5], true) — additive: extends point selection, link side untouched.
  • selectPoints([1, 2, 3], false, true) — replace + internal links: clears both, sets points, adds internal edges.
  • selectPoints(null) / selectPoints([]) — clears both user-selection Sets (default). Alias for unselectAll. addToSelection is ignored for null; selectPoints([], true, _) is a no-op.
  • selectPoints(null, _, false) / selectPoints([], _, false) — clears the point user selection only. Alias for unselectAllPoints(false).

Parameters

ParameterTypeDefault value
pointIndicesnumber[] | nullundefined
addToSelectionbooleanfalse
selectConnectedPointsbooleantrue

Returns

void

Implementation of

ICosmograph.selectPoints


selectPoint()

selectPoint(pointIndexBy, addToSelection, selectConnectedPoints): void

Selects a single point. Delegates to selectPoints after expanding to {P} ∪ N(P) when selectConnectedPoints is true. addToSelection: false clears both user-selection Sets first (clean restart); addToSelection: true adds to current. selectConnectedPoints defaults to true (smart mode). Pass false for single-point / point-only selection. Canvas click handlers pass the config-driven value explicitly.

Pass null to reset user selection — delegates to selectPoints(null, …). For a full reset including Mosaic widget clauses, use resetSelection instead.

Parameters

ParameterTypeDefault value
pointIndexBynumber | nullundefined
addToSelectionbooleanfalse
selectConnectedPointsbooleantrue

Returns

void

Implementation of

ICosmograph.selectPoint


unselectPoint()

unselectPoint(pointIndexBy?, unselectConnectedPoints?): void

Unselects a point. With unselectConnectedPoints: true (default), also removes incident links from the link selection when that side is user-active. Pass false for single mode. Canvas click handlers pass the config-driven value explicitly.

Parameters

ParameterTypeDefault value
pointIndexBy?numberundefined
unselectConnectedPoints?booleantrue

Returns

void

Implementation of

ICosmograph.unselectPoint


unselectPoints()

unselectPoints(indicesToRemove, unselectConnectedPoints): void

Removes the given points from the current user point selection. With unselectConnectedPoints: true, also removes the points’ incident links from the link selection. Symmetric naming with selectPoints.

Parameters

ParameterTypeDefault value
indicesToRemovenumber[]undefined
unselectConnectedPointsbooleantrue

Returns

void

Implementation of

ICosmograph.unselectPoints


unselectPointsByIndices()

unselectPointsByIndices(indicesToRemove, unselectConnectedPoints): void

Parameters

ParameterTypeDefault value
indicesToRemovenumber[]undefined
unselectConnectedPointsbooleantrue

Returns

void

Deprecated

Use unselectPoints instead.

Implementation of

ICosmograph.unselectPointsByIndices


unselectAllPoints()

unselectAllPoints(alsoUnselectLinks): void

Clears the point user selection and drops the focused point. Default (true) also clears the link user selection — alias for unselectAll. Pass false for point side only. Does NOT touch Mosaic clauses or filter widgets.

Parameters

ParameterTypeDefault value
alsoUnselectLinksbooleantrue

Returns

void

Implementation of

ICosmograph.unselectAllPoints


selectLinks(linkIndices, addToSelection, selectEndpoints): void

Replace, or with addToSelection: true extend, the user link selection.

addToSelection: false (replace) clears BOTH user-selection Sets first — same clean-restart semantics as selectPoints. addToSelection: true only adds to the link side. With selectEndpoints: true, also extends the point selection with each link’s endpoints.

Pass null for a user-selection reset. For a full reset including Mosaic widget clauses, use resetSelection instead:

  • selectLinks(null) / selectLinks([]) — clears both user-selection Sets (default). Alias for unselectAll. addToSelection is ignored for null; selectLinks([], true, _) is a no-op.
  • selectLinks(null, _, false) / selectLinks([], _, false) — clears the link user selection only. Alias for unselectAllLinks(false).

Parameters

ParameterTypeDefault value
linkIndicesnumber[] | nullundefined
addToSelectionbooleanfalse
selectEndpointsbooleantrue

Returns

void

Implementation of

ICosmograph.selectLinks


selectLink(linkIndex, addToSelection, selectEndpoints): void

Selects a single link. Delegates to selectLinks. addToSelection: false clears both user-selection Sets first (clean restart); addToSelection: true adds to current. With selectEndpoints: true, also adds the link’s two endpoint points additively. Pass null to reset user selection — same semantics as selectLinks(null, …).

Parameters

ParameterTypeDefault value
linkIndexnumber | nullundefined
addToSelectionbooleanfalse
selectEndpointsbooleantrue

Returns

void

Implementation of

ICosmograph.selectLink


unselectLink(linkIndex?, unselectEndpoints?): void

Removes a single link from the link selection. Default (true) also removes the link’s endpoints AND every other link incident to those endpoints. Pass false for single mode. Canvas click handlers pass the config-driven value explicitly.

Parameters

ParameterTypeDefault value
linkIndex?numberundefined
unselectEndpoints?booleantrue

Returns

void

Implementation of

ICosmograph.unselectLink


unselectLinks(indicesToRemove, unselectEndpoints): void

Removes the given links from the current user link selection. With unselectEndpoints: true, also removes each link’s endpoints AND every other link incident to those endpoints (no danglers left behind). Symmetric naming with selectLinks.

Parameters

ParameterTypeDefault value
indicesToRemovenumber[]undefined
unselectEndpointsbooleantrue

Returns

void

Implementation of

ICosmograph.unselectLinks


unselectAllLinks(alsoUnselectPoints): void

Clears the link user selection. Default (true) also clears the point user selection and drops the focused point — alias for unselectAll. Pass false for link side only. Does NOT touch Mosaic clauses or filter widgets.

Parameters

ParameterTypeDefault value
alsoUnselectPointsbooleantrue

Returns

void

Implementation of

ICosmograph.unselectAllLinks


unselectAll()

unselectAll(): void

Clear both user-selection Sets (the “user selection” channel). Drops the focused point (a point-side concept). Does NOT touch Mosaic clauses on pointsSelection / linksSelection (filter widgets stay active). For a full reset that also clears widgets, use resetSelection.

Returns

void

Implementation of

ICosmograph.unselectAll


resetSelection()

resetSelection(): void

Full reset across both selection channels: clears user-selection Sets, drops the focused point, AND dispatches resetSelections so filter widgets (histograms, bars, search, timeline) drop their Mosaic clauses. Use when you want the canvas to return to the default “no input active” state.

Returns

void

Implementation of

ICosmograph.resetSelection


setFocusedPoint()

setFocusedPoint(index?): void

Sets focus on a point by index. Draws a ring around the focused point.

Parameters

ParameterTypeDescription
index?numberIndex of the point to be focused.

Returns

void

Remarks

If focusedPointIndex is set, it will have priority over this method.

Implementation of

ICosmograph.setFocusedPoint


setPinnedPoints()

setPinnedPoints(indices): void

Sets which points are pinned (fixed) in position.

Pinned points:

  • Do not move due to physics forces (gravity, repulsion, link forces, etc.)
  • Still participate in force calculations (other nodes are attracted to/repelled by them)
  • Can still be dragged by the user if enableDrag is true

Parameters

ParameterTypeDescription
indicesnumber[]Array of point indices to pin. Set to [] or null to unpin all points.

Returns

void

Example

// Pin points 0 and 5
  graph.setPinnedPoints([0, 5])
 
  // Unpin all points
  graph.setPinnedPoints([])
  graph.setPinnedPoints(null)

Implementation of

ICosmograph.setPinnedPoints


start()

start(alpha?): void

Starts the simulation.

Parameters

ParameterTypeDescription
alpha?numberValue between 0 and 1. The higher the value, the more energy the simulation gets.

Returns

void

Implementation of

ICosmograph.start


pause()

pause(): void

Pauses the simulation.

Returns

void

Implementation of

ICosmograph.pause


unpause()

unpause(): void

Unpauses the simulation.

Returns

void

Implementation of

ICosmograph.unpause


stop()

stop(): void

Stops the simulation.

Returns

void

Implementation of

ICosmograph.stop


step()

step(): void

Renders only one frame of the simulation (stops the simulation if it was running).

Returns

void

Implementation of

ICosmograph.step


setZoomLevel()

setZoomLevel(value, duration): void

Zooms the view in or out to the specified zoom level.

Parameters

ParameterTypeDefault valueDescription
valuenumberundefinedZoom level.
durationnumber0Duration of the zoom transition.

Returns

void

Implementation of

ICosmograph.setZoomLevel


getZoomLevel()

getZoomLevel(): number | undefined

Gets the zoom level of the view.

Returns

number | undefined

Zoom level value.

Implementation of

ICosmograph.getZoomLevel


setZoomTransformByPointPositions()

setZoomTransformByPointPositions(pointPositions, duration?, scale?, padding?): void

Sets the zoom transform so that the given point positions fit in the viewport, with optional animation.

Parameters

ParameterTypeDescription
pointPositionsFloat32Array-
duration?numberAnimation duration in milliseconds. Default 250.
scale?numberOptional scale factor; if omitted, scale is chosen to fit the positions.
padding?numberPadding around the viewport as a fraction (e.g. 0.1 = 10%). Default 0.1.

Returns

void

Implementation of

ICosmograph.setZoomTransformByPointPositions


zoomToPoint()

zoomToPoint(index, duration, scale?, canZoomOut?): void

Centers the view and zooms in to a point by its index.

Parameters

ParameterTypeDescription
indexnumberPoint index to be zoomed in.
durationnumber | undefinedOptional duration in milliseconds.
scale?numberOptional zoom level.
canZoomOut?booleanOptional parameter determining whether the view can zoom out.

Returns

void

Implementation of

ICosmograph.zoomToPoint


fitView()

fitView(duration, padding): void

Centers and zooms the view to fit all points in the scene.

Parameters

ParameterTypeDescription
durationnumber | undefinedDuration of the animation (default: 250ms).
paddingnumber | undefinedPadding around the viewport (0 to 1 as 100% of the viewport, default 0.1.

Returns

void

Remarks

During an active position transition the camera fits the target layout, not the interpolated positions currently on screen.

Implementation of

ICosmograph.fitView


fitViewByIndices()

fitViewByIndices(indices, duration, padding): void

Centers and zooms the viewport to fit points based on their indices.

Parameters

ParameterTypeDescription
indicesnumber[]Array of point indices.
durationnumber | undefinedDuration of the animation (default: 250ms).
paddingnumber | undefinedPadding around the viewport (0 to 1 as 100% of the viewport, default 0.1.

Returns

void

Remarks

During an active position transition the camera fits the target layout, not the interpolated positions currently on screen.

Implementation of

ICosmograph.fitViewByIndices


fitViewByCoordinates()

fitViewByCoordinates(coordinates, duration, padding): void

Fits the given coordinates into the viewport.

Parameters

ParameterTypeDescription
coordinatesnumber[]Array of coordinates in the format [x0, y0, x1, y1, …].
durationnumber | undefinedDuration of the animation (default: 250ms).
paddingnumber | undefinedPadding around the viewport (0 to 1 as 100% of the viewport, default 0.1).

Returns

void

Remarks

During an active position transition the camera fits the supplied coordinates directly; ongoing point animations may finish at a layout that no longer matches the framed view.

Implementation of

ICosmograph.fitViewByCoordinates


getConnectedPointIndices()

getConnectedPointIndices(index): number[] | undefined

Gets the indices of the points that are connected to the point with the given index.

Parameters

ParameterTypeDescription
indexnumberThe index of the point to get the connected points for.

Returns

number[] | undefined

An array of indices of the connected points, or undefined if the point index is invalid or there are no connected points.

Deprecated

Prefer getNeighboringPointIndices.

Implementation of

ICosmograph.getConnectedPointIndices


getNeighboringPointIndices()

getNeighboringPointIndices(pointIndices): number[] | undefined

Returns each input point’s neighbors — points connected by a link in either direction. Results are deduplicated when multiple inputs share neighbors.

Parameters

ParameterTypeDescription
pointIndicesnumber | number[]A single point index or an array of indices.

Returns

number[] | undefined

Array of neighboring point indices, or undefined if the graph is not initialized.

Implementation of

ICosmograph.getNeighboringPointIndices


getConnectedLinkIndices()

getConnectedLinkIndices(pointIndices): number[] | undefined

Returns link indices where both endpoints are within the provided point set.

Parameters

ParameterTypeDescription
pointIndicesnumber | number[]A single point index or an array of point indices.

Returns

number[] | undefined

Deduplicated array of link indices, or undefined if the graph is not initialized.

Implementation of

ICosmograph.getConnectedLinkIndices


findPointsInRect()

findPointsInRect(rect): number[] | undefined

Find point indices inside a rectangular area. Coordinates are canvas-relative pixels.

Parameters

ParameterTypeDescription
rect[[number, number], [number, number]]Two opposite corners of the rectangle: [[left, top], [right, bottom]].

Returns

number[] | undefined

Array of point indices inside the rectangle, or undefined if the graph is not initialized.

Implementation of

ICosmograph.findPointsInRect


findPointsInPolygon()

findPointsInPolygon(polygonPath): number[] | undefined

Find point indices inside a polygon area. Coordinates are canvas-relative pixels.

Parameters

ParameterTypeDescription
polygonPath[number, number][]Array of points defining the polygon [[x1, y1], [x2, y2], ..., [xn, yn]].

Returns

number[] | undefined

Array of point indices inside the polygon, or undefined if the graph is not initialized.

Implementation of

ICosmograph.findPointsInPolygon


getPointDegrees()

getPointDegrees(index): { inDegree: number; outDegree: number; } | undefined

Gets the in-degree and out-degree (link counts) for the point with the given index.

Parameters

ParameterTypeDescription
indexnumberThe index of the point to get the degrees for.

Returns

{ inDegree: number; outDegree: number; } | undefined

An object containing the in-degree (incoming links) and out-degree (outgoing links) for the point, or undefined if the cosmograph instance is not initialized or the point index is invalid.

Implementation of

ICosmograph.getPointDegrees


getCameraState()

getCameraState(): Camera3dState | undefined

Returns

Camera3dState | undefined

Implementation of

ICosmograph.getCameraState


setCameraState()

setCameraState(state, duration?): void

Parameters

ParameterType
statePartial<Camera3dState>
duration?number

Returns

void

Implementation of

ICosmograph.setCameraState


spaceToScreenPosition()

Call Signature

spaceToScreenPosition(spacePosition, options?): [number, number] | undefined

Converts the X and Y point coordinates from the space coordinate system to the screen coordinate system.

Parameters
ParameterTypeDescription
spacePosition[number, number]Array of x and y coordinates in the space coordinate system.
options?PositionDimensionsOptions-
Returns

[number, number] | undefined

Array of x and y coordinates in the screen coordinate system.

Implementation of

ICosmograph.spaceToScreenPosition

Call Signature

spaceToScreenPosition(spacePosition, options): [number, number] | undefined

Parameters
ParameterType
spacePosition[number, number, number]
optionsPositionDimensionsOptions & object
Returns

[number, number] | undefined

Implementation of

ICosmograph.spaceToScreenPosition


screenToSpacePosition()

Call Signature

screenToSpacePosition(screenPosition, options?): [number, number] | undefined

Converts the X and Y point coordinates from the screen coordinate system to the space coordinate system.

Parameters
ParameterTypeDescription
screenPosition[number, number]Array of x and y coordinates in the screen coordinate system.
options?PositionDimensionsOptions & object-
Returns

[number, number] | undefined

Array of x and y coordinates in the space coordinate system.

Implementation of

ICosmograph.screenToSpacePosition

Call Signature

screenToSpacePosition(screenPosition, options): [number, number, number] | undefined

Parameters
ParameterType
screenPosition[number, number]
optionsPositionDimensionsOptions & object
Returns

[number, number, number] | undefined

Implementation of

ICosmograph.screenToSpacePosition


spaceToScreenRadius()

spaceToScreenRadius(spaceRadius): number | undefined

Converts the point radius value from the space coordinate system to the screen coordinate system.

Parameters

ParameterTypeDescription
spaceRadiusnumberRadius of the point in the space coordinate system.

Returns

number | undefined

Radius of the point in the screen coordinate system.

Implementation of

ICosmograph.spaceToScreenRadius


getPointRadiusByIndex()

getPointRadiusByIndex(index): number | undefined

Get point space radius by its index.

Parameters

ParameterTypeDescription
indexnumberIndex of the point.

Returns

number | undefined

Radius of the point in the space coordinate system.

Implementation of

ICosmograph.getPointRadiusByIndex


getPointScreenRadiusByIndex()

getPointScreenRadiusByIndex(index, pointPosition?): number

Get point screen radius by its index.

Parameters

ParameterTypeDescription
indexnumberIndex of the point.
pointPosition?[number, number, number]-

Returns

number

Radius of the point in the screen coordinate system.

Implementation of

ICosmograph.getPointScreenRadiusByIndex


trackPointPositionsByIndices()

trackPointPositionsByIndices(indices): void

Tracks point positions by indices on each simulation tick. Once tracking is enabled, use getTrackedPointPositionsArray or getTrackedPointPositionsMap to retrieve the current positions.

Parameters

ParameterTypeDescription
indicesnumber[]Array of point indices.

Returns

void

See

Implementation of

ICosmograph.trackPointPositionsByIndices


getTrackedPointPositionsArray()

getTrackedPointPositionsArray(options?): number[] | undefined

Gets an array of point positions that are currently tracked by the renderer. Use trackPointPositionsByIndices to specify which points to track.

Parameters

ParameterType
options?PositionDimensionsOptions

Returns

number[] | undefined

A flattened array of point positions [x0, y0, x1, y1, ...] for tracked points, or undefined if not available.

See

Implementation of

ICosmograph.getTrackedPointPositionsArray


getTrackedPointPositionsMap()

Call Signature

getTrackedPointPositionsMap(options?): ReadonlyMap<number, [number, number]> | undefined

Gets a Map of point positions that are currently tracked by the renderer. Use trackPointPositionsByIndices to specify which points to track.

Parameters
ParameterType
options?PositionDimensionsOptions & object
Returns

ReadonlyMap<number, [number, number]> | undefined

A Map where keys are point indices and values are their corresponding X, Y coordinates, or undefined if not available.

See
Implementation of

ICosmograph.getTrackedPointPositionsMap

Call Signature

getTrackedPointPositionsMap(options): ReadonlyMap<number, [number, number, number]> | undefined

Parameters
ParameterType
optionsPositionDimensionsOptions & object
Returns

ReadonlyMap<number, [number, number, number]> | undefined

Implementation of

ICosmograph.getTrackedPointPositionsMap


getSampledPoints()

getSampledPoints(options?): { indices: number[]; positions: number[]; } | undefined

Retrieves sampled point data as arrays with indices and positions.

Parameters

ParameterType
options?PositionDimensionsOptions

Returns

{ indices: number[]; positions: number[]; } | undefined

An object containing separate arrays for point indices and their corresponding positions, or undefined if not available. The indices array contains point indices, and the positions array contains flattened coordinates [x0, y0, x1, y1, ...].

Implementation of

ICosmograph.getSampledPoints


getSampledLinks(options?): { indices: number[]; positions: number[]; angles: number[]; } | undefined

For the links that are currently visible on the screen, get a sample of link indices, midpoint positions, and angles. The resulting number of links will depend on the linkSamplingDistance configuration property, and the sampled links will be evenly distributed. Positions are in data space; angles are in radians for screen-space rotation (0 = right, positive = clockwise, e.g. for CSS rotation).

Parameters

ParameterType
options?PositionDimensionsOptions

Returns

{ indices: number[]; positions: number[]; angles: number[]; } | undefined

Implementation of

ICosmograph.getSampledLinks


getSampledPointPositionsMap()

Call Signature

getSampledPointPositionsMap(options?): Map<number, [number, number]> | undefined

For the points that are currently visible on the screen, get a sample of point ids with their coordinates. The resulting number of points will depend on the pointSamplingDistance configuration property, and the sampled points will be evenly distributed.

Parameters
ParameterType
options?PositionDimensionsOptions & object
Returns

Map<number, [number, number]> | undefined

A Map where keys are the ids of the points and values are their corresponding X and Y coordinates.

Implementation of

ICosmograph.getSampledPointPositionsMap

Call Signature

getSampledPointPositionsMap(options): Map<number, [number, number, number]> | undefined

Parameters
ParameterType
optionsPositionDimensionsOptions & object
Returns

Map<number, [number, number, number]> | undefined

Implementation of

ICosmograph.getSampledPointPositionsMap


getSampledLinkPositionsMap()

Call Signature

getSampledLinkPositionsMap(options?): Map<number, [number, number, number]> | undefined

For the links that are currently visible on the screen, get a sample of link indices with their midpoint coordinates and angle. The resulting number of links will depend on the linkSamplingDistance configuration property, and the sampled links will be evenly distributed (one link per grid cell, based on link midpoint in screen space). Each value is [x, y, angle]: position in data space; angle in radians for screen-space rotation (0 = right, positive = clockwise, e.g. for CSS rotation).

Parameters
ParameterType
options?PositionDimensionsOptions & object
Returns

Map<number, [number, number, number]> | undefined

Implementation of

ICosmograph.getSampledLinkPositionsMap

Call Signature

getSampledLinkPositionsMap(options): Map<number, [number, number, number, number]> | undefined

Parameters
ParameterType
optionsPositionDimensionsOptions & object
Returns

Map<number, [number, number, number, number]> | undefined

Implementation of

ICosmograph.getSampledLinkPositionsMap


getActiveSelectionSourceId()

getActiveSelectionSourceId(): string | undefined

Gets the id of the filter widget that last drove the points crossfilter.

Returns

string | undefined

The id of the active filter widget, or undefined if no filter is active.

Implementation of

ICosmograph.getActiveSelectionSourceId


getPointIndicesByIds()

getPointIndicesByIds(ids): Promise<number[] | undefined>

Returns an array of point indices in the order they were sent to getPointIndicesByIds.

Parameters

ParameterTypeDescription
idsstring[]Array of point ids.

Returns

Promise<number[] | undefined>

A Promise resolving to an array of point indices.

Implementation of

ICosmograph.getPointIndicesByIds


getPointIdsByIndices()

getPointIdsByIndices(indices): Promise<string[] | undefined>

Returns an array of point ids in the order they were sent to getPointIdsByIndices.

Parameters

ParameterTypeDescription
indicesnumber[]Array of point indices.

Returns

Promise<string[] | undefined>

A Promise resolving to an array of point ids.

Implementation of

ICosmograph.getPointIdsByIndices


getPointsByIndices()

getPointsByIndices(indices): Promise<CosmographData | undefined>

Returns points entries as a CosmographData table by their indices.

Parameters

ParameterTypeDescription
indicesnumber[]Array of point indices.

Returns

Promise<CosmographData | undefined>

A Promise resolving to a CosmographData table of points.

Implementation of

ICosmograph.getPointsByIndices


getPointIndicesByExactValues()

getPointIndicesByExactValues(column, values): Promise<number[] | undefined>

Returns an array of point indices that match the provided values in a column.

Parameters

ParameterTypeDescription
columnstringThe column to filter by.
values(string | number)[]The values to match in the specified column.

Returns

Promise<number[] | undefined>

A Promise resolving to an array of point indices, or undefined if the operation fails.

Implementation of

ICosmograph.getPointIndicesByExactValues


getPointIndicesByNumericValue()

getPointIndicesByNumericValue(column, value, isMax): Promise<number[] | undefined>

Returns an array of point indices that match the provided numeric value in the specified column.

Parameters

ParameterTypeDescription
columnstringThe column in the points table to filter by.
valuestring | numberThe numeric value to match in the specified column.
isMaxbooleanIndicates whether to return the indices for the maximum or minimum value.

Returns

Promise<number[] | undefined>

A Promise resolving to an array of point indices, or undefined if the operation fails.

Implementation of

ICosmograph.getPointIndicesByNumericValue


getPointIndicesByLinksExactValues()

getPointIndicesByLinksExactValues(column, values): Promise<number[] | undefined>

Returns an array of point indices that match the provided link column values.

Parameters

ParameterTypeDescription
columnstringThe column in the links table to filter by.
values(string | number)[]The values to match in the specified column.

Returns

Promise<number[] | undefined>

A Promise resolving to an array of point indices.

Implementation of

ICosmograph.getPointIndicesByLinksExactValues


getPointIndicesByLinksNumericValue()

getPointIndicesByLinksNumericValue(column, value, isMax): Promise<number[] | undefined>

Returns an array of point indices that match the provided link column numeric value.

Parameters

ParameterTypeDescription
columnstringThe column in the links table to filter by.
valuestring | numberThe numeric value to match in the specified column.
isMaxbooleanIndicates whether to return the indices for the maximum or minimum value.

Returns

Promise<number[] | undefined>

A Promise resolving to an array of point indices.

Implementation of

ICosmograph.getPointIndicesByLinksNumericValue


getLinksByPointIds()

getLinksByPointIds(ids): Promise<CosmographData | undefined>

Returns links entries as a CosmographData table where the source or target point id is in the provided array.

Parameters

ParameterTypeDescription
idsstring[]Array of point ids.

Returns

Promise<CosmographData | undefined>

A Promise resolving to a CosmographData table of links.

Implementation of

ICosmograph.getLinksByPointIds


getLinksByPointIndices()

getLinksByPointIndices(indices): Promise<CosmographData | undefined>

Returns links entries as a CosmographData table where the source or target point index is in the provided array.

Parameters

ParameterTypeDescription
indicesnumber[]Array of point indices.

Returns

Promise<CosmographData | undefined>

A Promise resolving to a CosmographData table of links.

Implementation of

ICosmograph.getLinksByPointIndices


getLinksData()

getLinksData(): Promise<CosmographData | undefined>

Returns all links entries as a CosmographData table.

Returns

Promise<CosmographData | undefined>

A Promise resolving to a CosmographData table of links.

Implementation of

ICosmograph.getLinksData


getPointsSummary()

getPointsSummary(force): Promise<Record<string, unknown>[] | undefined>

Parameters

ParameterTypeDefault value
forcebooleanfalse

Returns

Promise<Record<string, unknown>[] | undefined>

Implementation of

ICosmograph.getPointsSummary


getLinksSummary()

getLinksSummary(force): Promise<Record<string, unknown>[] | undefined>

Parameters

ParameterTypeDefault value
forcebooleanfalse

Returns

Promise<Record<string, unknown>[] | undefined>

Implementation of

ICosmograph.getLinksSummary


getSummary()

getSummary(force): Promise<CosmographSummary>

Parameters

ParameterTypeDefault value
forcebooleanfalse

Returns

Promise<CosmographSummary>

Implementation of

ICosmograph.getSummary


getPointsData()

getPointsData(): Promise<CosmographData | undefined>

Returns all points entries as a CosmographData table.

Returns

Promise<CosmographData | undefined>

A Promise resolving to a CosmographData table of points.

Implementation of

ICosmograph.getPointsData


searchPoints()

searchPoints(input, options): Promise<CosmographSearchResult>

Searches point data across the requested fields.

Each searched field value is converted to a string before matching, so this method can search text, numeric, boolean, date, and other scalar columns. By default, matching is case-insensitive and checks whether the query occurs anywhere in a field value.

The returned rows are limited to 100 by default. Use limit and offset for pagination, returnFields to return only specific columns, and totalCount to display the complete number of matching points before pagination.

This method does not update the graph selection.

Parameters

ParameterTypeDescription
inputstringSearch query.
optionsCosmographSearchOptionsSearch behavior, fields, pagination, and returned columns.

Returns

Promise<CosmographSearchResult>

Matching point rows and the total number of matches before pagination.

Example

const result = await cosmograph.searchPoints('bike', {
  fields: ['label', 'topic'],
  returnFields: ['idx', 'label', 'topic'],
  limit: 50,
})
 
console.log(result.rows)
console.log(result.totalCount)

Implementation of

ICosmograph.searchPoints


getPointIndicesBySearch()

getPointIndicesBySearch(input, options): Promise<number[]>

Returns point indices matching a search query.

Matching follows the same rules as searchPoints, but the query returns point indices only. This is more efficient when the caller wants to select, filter, or fit the view to all matching points without loading complete rows.

Unlike searchPoints, this method has no default limit, so it returns every matching point index unless limit is explicitly provided. The returnFields option is ignored.

This method does not update the graph selection. Pass the result to selectPoints when selection is desired.

Parameters

ParameterTypeDescription
inputstringSearch query.
optionsCosmographSearchOptionsSearch options. The default limit is undefined, returning all matching point indices.

Returns

Promise<number[]>

Matching point indices.

Example

const indices = await cosmograph.getPointIndicesBySearch('bike', {
  fields: ['label', 'topic'],
})
 
cosmograph.selectPoints(indices)
cosmograph.fitViewByIndices(indices)

Implementation of

ICosmograph.getPointIndicesBySearch


convertCosmographDataToObject()

convertCosmographDataToObject(data): Record<string, unknown>[]

Converts a CosmographData table to an array of objects.

Parameters

ParameterTypeDescription
dataCosmographDataCosmographData table.

Returns

Record<string, unknown>[]

An array of objects.

Implementation of

ICosmograph.convertCosmographDataToObject


flattenPositions()

flattenPositions(positions): number[] | undefined

Converts an array of tuple positions to a single flattened array containing all coordinates sequentially.

Parameters

ParameterTypeDescription
positions[number, number][]An array of tuple positions.

Returns

number[] | undefined

A flattened array of coordinates.

Implementation of

ICosmograph.flattenPositions


pair()

pair(pointPositions): [number, number][] | undefined

Converts a flat array of point positions to tuple pairs representing coordinates.

Parameters

ParameterTypeDescription
pointPositionsnumber[]A flattened array of coordinates.

Returns

[number, number][] | undefined

An array of tuple positions.

Implementation of

ICosmograph.pair


addPoints()

addPoints(points): Promise<void>

Adds points to the Cosmograph instance.

Parameters

ParameterTypeDescription
pointsCosmographPointInput[]The points data to add.

Returns

Promise<void>

A promise that resolves when the points have been added.

Remarks

Minimal to provide is point a id. Other fields are optional, should respect already existing fields in the points data, if not provided, will be filled with default values.

Implementation of

ICosmograph.addPoints


addLinks(links): Promise<void>

Adds links to the Cosmograph instance.

Parameters

ParameterTypeDescription
linksCosmographLinkInput[]The links data to add.

Returns

Promise<void>

A promise that resolves when the links have been added.

Remarks

Minimal to provide is a source point and target point id. Other fields are optional, should respect already existing fields in the links data, if not provided, will be filled with default values.

Implementation of

ICosmograph.addLinks


removePointsByIndices()

removePointsByIndices(indices, removeAttachedLinks): Promise<void>

Removes points from the Cosmograph instance by their indices.

Parameters

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

Returns

Promise<void>

A promise that resolves when the points have been removed.

Implementation of

ICosmograph.removePointsByIndices


removePointsByIds()

removePointsByIds(ids): Promise<void>

Removes points from the Cosmograph instance by their IDs.

Parameters

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

Returns

Promise<void>

A promise that resolves when the points have been removed.

Implementation of

ICosmograph.removePointsByIds


removeLinksByPointIdPairs()

removeLinksByPointIdPairs(pairs): Promise<void>

Removes links from the Cosmograph instance by their point ID pairs.

Parameters

ParameterTypeDescription
pairs[string, string][]The point ID pairs of the links to remove.

Returns

Promise<void>

A promise that resolves when the links have been removed.

Implementation of

ICosmograph.removeLinksByPointIdPairs


removeLinksByPointIndicesPairs()

removeLinksByPointIndicesPairs(pairs): Promise<void>

Removes links from the Cosmograph instance by their point indices pairs.

Parameters

ParameterTypeDescription
pairs[number, number][]The point indices pairs of the links to remove.

Returns

Promise<void>

A promise that resolves when the links have been removed.

Implementation of

ICosmograph.removeLinksByPointIndicesPairs


addMosaicComponent()

addMosaicComponent(component, container, config?): Promise<MosaicVgplotComponent | undefined>

Adds a custom Mosaic component (vgplot, spec, etc.) and mounts it to a container. The component will automatically participate in Cosmograph’s crossfilter system.

Parameters

ParameterTypeDescription
componentHTMLElementThe vgplot component
containerHTMLElementThe DOM element to mount the component into
config?{ id?: string; }Optional configuration for the component
config.id?string-

Returns

Promise<MosaicVgplotComponent | undefined>

A promise that resolves to the created component

Implementation of

ICosmograph.addMosaicComponent


removeMosaicComponent()

removeMosaicComponent(id): Promise<boolean>

Removes a custom Mosaic component by its ID.

Parameters

ParameterTypeDescription
idstringThe ID of the component to remove

Returns

Promise<boolean>

A promise that resolves to true if the component was removed, false otherwise

Implementation of

ICosmograph.removeMosaicComponent


getMosaicComponents()

getMosaicComponents(): ReadonlyMap<string, MosaicVgplotComponent> | undefined

Gets all registered Mosaic components.

Returns

ReadonlyMap<string, MosaicVgplotComponent> | undefined

A readonly map of component IDs to components

Implementation of

ICosmograph.getMosaicComponents


reset()

reset(total): Promise<void>

Resets the Cosmograph instance to its initial state.

Parameters

ParameterTypeDefault valueDescription
totalbooleantrueIf true, resets configuration and displays the message div.

Returns

Promise<void>

A promise that resolves when the reset operation is complete.

Implementation of

ICosmograph.reset


destroy()

destroy(): Promise<void>

Destroys the Cosmograph instance and cleans up associated resources.

Returns

Promise<void>

A promise that resolves when the destroy operation is complete.

Implementation of

ICosmograph.destroy