antvis / layout

Layout algorithms for graphs.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

G6使用ForceAtlas2Layout布局时center参数不生效

ZeroTo1024 opened this issue · comments

1652752396(1)

const options:ForceAtlas2LayoutOptions = {
center: [600, 400],
kr: 10,
kg: 1,
preventOverlap: true,
type:'forceAtlas2'
}
const layout= new ForceAtlas2Layout(options)

  layout.init({
    nodes: data.nodes,
    edges: data.edges,
  })

  layout.execute()
  
  graph.data(data)

  graph.render()