Skip to content

@graphty/graphty-element / index / GraphContext

Interface: GraphContext ​

Defined in: graphty-element/src/managers/GraphContext.ts:22

GraphContext provides controlled access to graph services This interface allows Node and Edge classes to access required services without direct dependency on the Graph class, eliminating circular dependencies

Properties ​

onNodeLabelCounts? ​

readonly optional onNodeLabelCounts?: Observable<NodeLabelCounts>

Defined in: graphty-element/src/managers/GraphContext.ts:58

Told the node label counts once the view is still and they changed; see LabelDeclutter. Absent on a context nothing listens to.

Since ​

3.7.0

Methods ​

getAcceleration()? ​

optional getAcceleration(): AccelerationController

Defined in: graphty-element/src/managers/GraphContext.ts:137

The acceleration controller the graph owns; absent on a context built without a graph.

Returns ​

AccelerationController

Since ​

2.0.0


getConfig() ​

getConfig(): GraphContextConfig

Defined in: graphty-element/src/managers/GraphContext.ts:95

Get graph-level configuration options

Returns ​

GraphContextConfig


getDataManager() ​

getDataManager(): DataManager

Defined in: graphty-element/src/managers/GraphContext.ts:44

Get the DataManager for node/edge operations

Returns ​

DataManager


getEventManager()? ​

optional getEventManager(): EventManager | undefined

Defined in: graphty-element/src/managers/GraphContext.ts:131

Get EventManager for emitting events Optional method for event emission

Returns ​

EventManager | undefined

Since ​

1.5.0


getLayoutManager() ​

getLayoutManager(): LayoutManager

Defined in: graphty-element/src/managers/GraphContext.ts:63

Get the LayoutManager for layout operations

Returns ​

LayoutManager


getMeshCache() ​

getMeshCache(): MeshCache

Defined in: graphty-element/src/managers/GraphContext.ts:68

Get the MeshCache for mesh creation and caching

Returns ​

MeshCache


getScene() ​

getScene(): Scene

Defined in: graphty-element/src/managers/GraphContext.ts:73

Get the Babylon.js Scene

Returns ​

Scene


getSelectionManager()? ​

optional getSelectionManager(): SelectionManager | undefined

Defined in: graphty-element/src/managers/GraphContext.ts:124

Get SelectionManager for node selection operations Optional method for selection functionality

Returns ​

SelectionManager | undefined


getSession()? ​

optional getSession(): GraphSession

Defined in: graphty-element/src/managers/GraphContext.ts:51

Get the session whose state this graph draws, when there is one: what a node's own doors dispatch through.

Returns ​

GraphSession

The session, or undefined for a context built without one.


getStatsManager() ​

getStatsManager(): StatsManager

Defined in: graphty-element/src/managers/GraphContext.ts:78

Get the StatsManager for performance monitoring

Returns ​

StatsManager


getStylePainter()? ​

optional getStylePainter(): StylePainter | undefined

Defined in: graphty-element/src/managers/GraphContext.ts:39

Get the painter that answers what the session's style stack resolved for one element.

Optional, because a context can be built without one -- a headless test, or a Node built outside a graph. Absent, or present with no style pass bound, an element draws itself from the element's own defaults; see bootstrapNodePaint in StylePainter.

Returns ​

StylePainter | undefined


getStyles() ​

getStyles(): Styles

Defined in: graphty-element/src/managers/GraphContext.ts:30

Get the element's configuration document: the id paths, the view mode, the background, the layout and its options, the run-on-load algorithms and the behaviour settings.

It carries no style layers. Layers live in session.styles, and what one element is painted is answered by GraphContext.getStylePainter.

Returns ​

Styles


getXRConfig()? ​

optional getXRConfig(): XRConfig | undefined

Defined in: graphty-element/src/managers/GraphContext.ts:112

Get XR configuration Optional method for XR-specific functionality

Returns ​

XRConfig | undefined


getXRSessionManager()? ​

optional getXRSessionManager(): XRSessionManager | undefined

Defined in: graphty-element/src/managers/GraphContext.ts:118

Get XR session manager Optional method for XR-specific functionality

Returns ​

XRSessionManager | undefined


is2D() ​

is2D(): boolean

Defined in: graphty-element/src/managers/GraphContext.ts:83

Check if the graph is in 2D mode

Returns ​

boolean


isRunning() ​

isRunning(): boolean

Defined in: graphty-element/src/managers/GraphContext.ts:100

Check if the layout is running

Returns ​

boolean


needsRayUpdate() ​

needsRayUpdate(): boolean

Defined in: graphty-element/src/managers/GraphContext.ts:90

Always false.

Returns ​

boolean

Deprecated ​

Each edge aims its own ray when it needs one. Will be removed in graphty-element 4.0.


setRunning() ​

setRunning(running): void

Defined in: graphty-element/src/managers/GraphContext.ts:106

Play or pause the layout on a consumer's behalf. A pause holds until setRunning(true); the element's own restarts write getLayoutManager().running, which the pause refuses.

Parameters ​

running ​

boolean

Returns ​

void