mtdv logo

力学模拟

阅读时间约 1 分钟

graph.initSimulation()

Function

初始化力学模拟,启动力学模拟时自动调用,不建议直接调用


graph.startSimulation()

Function

开始力学模拟,可以在停止力学模拟后调用方法重新启动力学模拟


graph.stopSimulation()

Function

停止力学模拟,在某些场景下用于减少模拟的性能消耗


graph.ticked()

Function

核心方法

力学模拟每次迭代执行的方法,用于计算和绘制节点、边及其他各种元素的坐标位置,用户可通过重写该函数来完成自定义图谱布局,参考d3.simulation.tick


graph.tickNum

number

tick 迭代次数


graph.tickTimeStart

number

tick 开始时间


graph.simulation

object

力学模拟d3.force.simulation实例