Skip to content

cytoscape.GpuUnfitError

cytoscape.GpuUnfitError — Getting started > Error types. Cytoscape.js signatures, parameters and return contract.

cytoscape.GpuUnfitError — Getting started › Error types

Preview · Getting started › Error types

Read in the complete API reference · All API members

// A graph or algorithm input exceeds the GPU device's limits
cytoscape.GpuUnfitError: GpuUnfitError

A graph or algorithm input exceeds the GPU device's limits.

Adding, loading or patching elements on a rendered core can throw this error before changing the graph. Mounting a graph that does not fit rejects cy.ready.

An explicit GPU algorithm rejects with this error when its input does not fit. With executor: 'auto', that algorithm falls back to the CPU instead. Other GPU errors still propagate.

Test error instanceof cytoscape.GpuUnfitError, or check error.name === 'GpuUnfitError', to distinguish this failure.

Returns GpuUnfitError

Example

// Catch an algorithm or layout error before choosing a CPU fallback.
const isDeviceLimit = error => error instanceof cytoscape.GpuUnfitError;
console.log(isDeviceLimit(new Error('application error'))); // false

Example graph and handle setup