G6 icon indicating copy to clipboard operation
G6 copied to clipboard

Remove Tree Support

Open Aarebecca opened this issue 1 year ago • 0 comments

As we know, a tree is a special unidirectional acyclic graph, Therefore, any graph that satisfies this structure can be displayed as the structure of a tree.

It is not a good way to handle trees alone, and G6 will only support the standard Graph structure data stored in JSON and remove support for tree data.

To convert a tree data to graph data, you can use this method:

import { transformTreeData } from '@antv/g6-utils';

const treeData = {
  id: 'id1',
  children: [
    // ...
  ]
};

const graphData = transformTreeData(oldData);

Aarebecca avatar Jan 03 '24 06:01 Aarebecca