Skip to content

GpuForceLayout

class

Back to Helios Web API

Kind
class
Source
src/layouts/GpuForceLayout.js:288

Description

GPU-backed force layout that can run through WebGPU or WebGL2 delegates.

Signature

export class GpuForceLayout extends Layout {

Parameters

NameTypeAttributesDefaultDescription
networkHeliosNetworkSource graph.
visualsimport('../pipeline/VisualAttributes.js').VisualAttributesVisual attribute owner.
optionsObjectoptionalForce, UMAP-like force, sampling, damping, recentering, and renderer delegate options.

Notes

Renderer support and graph size determine whether WebGPU or WebGL2 backing is selected. Position output is written into Helios visual position buffers for rendering.

Lifecycle

Creation, initialization, prewarming, cleanup, and renderer lifetime.

initialize()

Source: src/layouts/GpuForceLayout.js:328

Configures or reads initialize.

Network And Persistence

Network replacement, serialization, and visualization state persistence. ExporterBehavior and InterfaceBehavior can surface parts of this flow in the UI.

syncAutoSettingsForNetwork(network = this.network, { reheat = false, reason = 'layout-auto-tune' } = {})

Source: src/layouts/GpuForceLayout.js:376

Configures or reads sync auto settings for network.

Parameters

NameTypeAttributesDefaultDescription
networkHeliosNetworkoptionalthis.networkNetwork instance to read from or mutate.
reheatoptionalfalseValue passed to syncAutoSettingsForNetwork.
reasonstringoptional'layout-auto-tune' } = {}Reason for this operation.

seedFromNetworkPositions(options = {}) → {Object|this}

Source: src/layouts/GpuForceLayout.js:472

Read or set the seed from network positions setting.

Parameters

NameTypeAttributesDefaultDescription
optionsObjectoptional{}Options object for this operation.

Returns

Current seed from network positions value when called without arguments; otherwise this instance for chaining.

Type Object|this

Example


helios.seedFromNetworkPositions({
  enabled: true,
});

Layout And Positions

Layout selection, position sources, interpolation, and position snapshots. LayoutBehavior handles the built-in layout UI.

getPositionDelegate()

Source: src/layouts/GpuForceLayout.js:324

Returns the current position delegate value or state.

Example


const value = helios.getPositionDelegate();

Configuration

General configuration setters and compatibility helpers.

setSettings(next = {}, { reheat = false, reason = 'layout-settings' } = {}) → {this}

Source: src/layouts/GpuForceLayout.js:415

Set the settings setting.

Parameters

NameTypeAttributesDefaultDescription
nextoptional{}Value passed to setSettings.
reheatoptionalfalseValue passed to setSettings.
reasonstringoptional'layout-settings' } = {}Reason for this operation.

Returns

This instance.

Type this

getParameterBindings()

Source: src/layouts/GpuForceLayout.js:483

Returns the current parameter bindings value or state.

Example


const value = helios.getParameterBindings();

Utilities

Additional public helpers that do not belong to a narrower API area.

shouldRun()

Source: src/layouts/GpuForceLayout.js:332

Configures or reads should run.

step(deltaMs = 16)

Source: src/layouts/GpuForceLayout.js:336

Configures or reads step.

Parameters

NameTypeAttributesDefaultDescription
deltaMsoptional16Value passed to step.

resize(size)

Source: src/layouts/GpuForceLayout.js:357

Configures or reads resize.

Parameters

NameTypeAttributesDefaultDescription
sizeValue passed to resize.

reheat(reason = 'layout')

Source: src/layouts/GpuForceLayout.js:466

Configures or reads reheat.

Parameters

NameTypeAttributesDefaultDescription
reasonstringoptional'layout'Reason for this operation.

dispose()

Source: src/layouts/GpuForceLayout.js:852

Configures or reads dispose.