布局

changeLayout(layout)

更改并应用指定的布局。

参数

名称类型是否必选描述
layoutobjectfalse指定的布局配置,如不传,则不做变更

用法

  1. const layout = {
  2. type: 'mindmap',
  3. dirction: 'H',
  4. getSubTreeSep: () => 20,
  5. getVGap: () => 25,
  6. getHeight: () => 30,
  7. getWidth: () => 30,
  8. };
  9. treeGraph.changeLayout(layout);

refreshLayout(fitView)

数据变更后,重新布局,刷新视图,并更新到画布。

参数

名称类型是否必选描述
fitViewbooleanfalse更新布局后,是否需要自适应窗口

用法

  1. treeGraph.refreshLayout(true);