@graphty/graphty-element / managers / DefaultGraphContext
Class: DefaultGraphContext
Defined in: src/managers/GraphContext.ts:130
Default implementation of GraphContext This can be used by Graph to provide services to Node/Edge
Implements
Constructors
Constructor
new DefaultGraphContext(
styleManager,dataManager,layoutManager,meshCache,scene,statsManager,config,rayUpdateNeeded):DefaultGraphContext
Defined in: src/managers/GraphContext.ts:142
Creates an instance of DefaultGraphContext
Parameters
styleManager
StyleManager instance for style operations
dataManager
DataManager instance for node/edge operations
layoutManager
LayoutManager instance for layout operations
meshCache
MeshCache
MeshCache instance for mesh creation and caching
scene
Scene
Babylon.js Scene instance
statsManager
StatsManager instance for performance monitoring
config
Graph-level configuration options
rayUpdateNeeded
boolean = true
Whether ray updates are needed for edge arrows
Returns
DefaultGraphContext
Methods
getConfig()
getConfig():
GraphContextConfig
Defined in: src/managers/GraphContext.ts:232
Get graph-level configuration options
Returns
GraphContextConfig instance
Implementation of
getDataManager()
getDataManager():
DataManager
Defined in: src/managers/GraphContext.ts:165
Get the DataManager for node/edge operations
Returns
DataManager instance
Implementation of
getLayoutManager()
getLayoutManager():
LayoutManager
Defined in: src/managers/GraphContext.ts:173
Get the LayoutManager for layout operations
Returns
LayoutManager instance
Implementation of
getMeshCache()
getMeshCache():
MeshCache
Defined in: src/managers/GraphContext.ts:181
Get the MeshCache for mesh creation and caching
Returns
MeshCache
MeshCache instance
Implementation of
getScene()
getScene():
Scene
Defined in: src/managers/GraphContext.ts:189
Get the Babylon.js Scene
Returns
Scene
Scene instance
Implementation of
getStatsManager()
getStatsManager():
StatsManager
Defined in: src/managers/GraphContext.ts:197
Get the StatsManager for performance monitoring
Returns
StatsManager instance
Implementation of
getStyleManager()
getStyleManager():
StyleManager
Defined in: src/managers/GraphContext.ts:157
Get the StyleManager for style operations
Returns
StyleManager instance
Implementation of
is2D()
is2D():
boolean
Defined in: src/managers/GraphContext.ts:205
Check if the graph is in 2D mode
Returns
boolean
True if in 2D mode, false otherwise
Implementation of
isRunning()
isRunning():
boolean
Defined in: src/managers/GraphContext.ts:248
Check if the layout is running
Returns
boolean
True if layout is running, false otherwise
Implementation of
needsRayUpdate()
needsRayUpdate():
boolean
Defined in: src/managers/GraphContext.ts:216
Check if ray updates are needed for edge arrows
Returns
boolean
True if ray updates are needed, false otherwise
Implementation of
setRayUpdateNeeded()
setRayUpdateNeeded(
needed):void
Defined in: src/managers/GraphContext.ts:224
Set whether ray updates are needed for edge arrows
Parameters
needed
boolean
Whether ray updates are needed
Returns
void
setRunning()
setRunning(
running):void
Defined in: src/managers/GraphContext.ts:256
Set the running state
Parameters
running
boolean
Whether layout should be running
Returns
void
Implementation of
updateConfig()
updateConfig(
config):void
Defined in: src/managers/GraphContext.ts:240
Update configuration
Parameters
config
Partial<GraphContextConfig>
Partial configuration to merge with existing config
Returns
void