g6/packages/site/docs/apis/data/TreeData.en.md
Aaron 3534d4669b
docs: adjust docs of data (#5211)
* docs: adjust docs of data

* docs: update api docs
2023-12-01 17:44:49 +08:00

1.0 KiB

title order
TreeData 2

A tree is a special graph, that is, a graph without a cycle. Tree data (TreeData) does not explicitly define edges, but implicitly represents edges through nested children, that is, there is an edge between parent and child nodes.

An example of a tree data is as follows:

{
  "id": "root",
  "data": {},
  "children": [
    {
      "id": "node-1",
      "data": {},
      "children": [
        {
          "id": "node-1-1",
          "data": {},
          "children": [
            {
              "id": "node-1-1-1",
              "data": {},
              "children": []
            }
          ]
        }
      ]
    }
  ]
}

G6 5.0 can read TreeData, TreeData[], that is, tree and forest.

Properties

data Required

Type: NodeUserModelData;

The data of the node

children

Type: TreeData

The array of child nodes of the current node