sgratzl/chartjs-chart-graph

Stop the Simulation

Closed this issue · 5 comments

Is there a way to stop the simulation using forceDirectedGraph? :)

the controller has a stopLayout method

How do I access the controller? I tried using Chart.registry.getController("forceDirectedGraph");, which gives me some sort of controller - but there I cannot call stopLayout()

can you try chart.getSortedVisibleDatasetMetas()[0].controller.stopLayout()

Thanks for the answer. However, that gives me the following type error TS2339: Property 'stopLayout' does not exist on type 'DatasetController , Element , number | ... 7 more ... | (ITreeNode & { ...; })>' and thus doesn't seem to work.

try

chart.getDatasetMeta(0).controller.stopLayout();