antvis / layout

Layout algorithms for graphs.
207 stars 55 forks source link

feat: wrap layout method exposed by WASM into layout object #159

Closed xiaoiver closed 1 year ago

xiaoiver commented 1 year ago

工程改造:

封装 WASM 暴露的 layout 方法,与 @antv/layout 保持一致:

import { Graph } from "@antv/graphlib";
import { ForceAtlas2 } from "@antv/layout-wasm";

const forceatlas2 = new ForceAtlas2({
  threads,
  maxIteration: 1000,
  // ...other params
});

const { nodes } = await forceatlas2.execute(graph);