UNPKG

@antv/g6

Version:

graph visualization frame work

1 lines 88.3 kB
{"expireTime":9007200828528711000,"key":"transformer-remark-markdown-ast-8d35378b8c39b7f4dd47cafca4297b4b-gatsby-remark-prettiergatsby-remark-prismjsgatsby-remark-external-linksgatsby-remark-autolink-headersgatsby-remark-reading-time-","val":{"type":"root","children":[{"type":"paragraph","children":[{"type":"text","value":"TreeGraph是G6专门为树图场景打造的图。TreeGraph继承自Graph。","position":{"start":{"line":2,"column":1,"offset":1},"end":{"line":2,"column":43,"offset":43},"indent":[]}},{"type":"html","value":"<code class=\"language-text\">G6.TreeGraph</code>","position":{"start":{"line":2,"column":43,"offset":43},"end":{"line":2,"column":57,"offset":57},"indent":[]}},{"type":"text","value":"与","position":{"start":{"line":2,"column":57,"offset":57},"end":{"line":2,"column":58,"offset":58},"indent":[]}},{"type":"html","value":"<code class=\"language-text\">G6.Graph</code>","position":{"start":{"line":2,"column":58,"offset":58},"end":{"line":2,"column":68,"offset":68},"indent":[]}},{"type":"text","value":"最大的区别就是数据结构和内置布局计算。主要出于以下考虑:","position":{"start":{"line":2,"column":68,"offset":68},"end":{"line":2,"column":96,"offset":96},"indent":[]}}],"position":{"start":{"line":2,"column":1,"offset":1},"end":{"line":2,"column":96,"offset":96},"indent":[]}},{"type":"list","ordered":false,"start":null,"spread":true,"children":[{"type":"listItem","spread":false,"checked":null,"children":[{"type":"paragraph","children":[{"type":"text","value":"数据结构:树图的数据一般是嵌套结构,边的数据隐含在嵌套结构中,并不会特意指定edge。此布局要求数据中一个节点需要有","position":{"start":{"line":4,"column":3,"offset":100},"end":{"line":4,"column":61,"offset":158},"indent":[]}},{"type":"html","value":"<code class=\"language-text\">id</code>","position":{"start":{"line":4,"column":61,"offset":158},"end":{"line":4,"column":65,"offset":162},"indent":[]}},{"type":"text","value":"和","position":{"start":{"line":4,"column":65,"offset":162},"end":{"line":4,"column":66,"offset":163},"indent":[]}},{"type":"html","value":"<code class=\"language-text\">children</code>","position":{"start":{"line":4,"column":66,"offset":163},"end":{"line":4,"column":76,"offset":173},"indent":[]}},{"type":"text","value":"两个数据项,最精简的数据结构如下所示:","position":{"start":{"line":4,"column":76,"offset":173},"end":{"line":4,"column":95,"offset":192},"indent":[]}}],"position":{"start":{"line":4,"column":3,"offset":100},"end":{"line":4,"column":95,"offset":192},"indent":[]}},{"type":"html","lang":"javascript","meta":null,"value":"<div class=\"gatsby-highlight\" data-language=\"javascript\"><pre class=\"language-javascript\"><code class=\"language-javascript\"><span class=\"token keyword\">const</span> data <span class=\"token operator\">=</span> <span class=\"token punctuation\">{</span>\nid<span class=\"token punctuation\">:</span> <span class=\"token string\">'root'</span><span class=\"token punctuation\">,</span>\nchildren<span class=\"token punctuation\">:</span> <span class=\"token punctuation\">[</span>\n<span class=\"token punctuation\">{</span>\n  id<span class=\"token punctuation\">:</span> <span class=\"token string\">'subTree1'</span><span class=\"token punctuation\">,</span>\n  children<span class=\"token punctuation\">:</span> <span class=\"token punctuation\">[</span><span class=\"token operator\">...</span><span class=\"token punctuation\">]</span>\n<span class=\"token punctuation\">}</span><span class=\"token punctuation\">,</span> \n<span class=\"token punctuation\">{</span>\n  id<span class=\"token punctuation\">:</span> <span class=\"token string\">'subTree2'</span><span class=\"token punctuation\">,</span>\n  children<span class=\"token punctuation\">:</span> <span class=\"token punctuation\">[</span><span class=\"token operator\">...</span><span class=\"token punctuation\">]</span>           \n<span class=\"token punctuation\">}</span>\n<span class=\"token punctuation\">]</span>\n<span class=\"token punctuation\">}</span><span class=\"token punctuation\">;</span></code></pre></div>","position":{"start":{"line":5,"column":1,"offset":193},"end":{"line":19,"column":4,"offset":385},"indent":[1,3,3,5,5,5,5,5,5,5,5,3,1,1]}}],"position":{"start":{"line":4,"column":1,"offset":98},"end":{"line":20,"column":1,"offset":386},"indent":[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]}},{"type":"listItem","spread":false,"checked":null,"children":[{"type":"paragraph","children":[{"type":"text","value":"布局特殊性:","position":{"start":{"line":21,"column":3,"offset":389},"end":{"line":21,"column":9,"offset":395},"indent":[]}}],"position":{"start":{"line":21,"column":3,"offset":389},"end":{"line":21,"column":9,"offset":395},"indent":[]}},{"type":"list","ordered":false,"start":null,"spread":false,"children":[{"type":"listItem","spread":false,"checked":null,"children":[{"type":"paragraph","children":[{"type":"text","value":"树图的布局算法一般是不改变源数据的,而是重新生成一份数据,将源数据作为新数据的一个属性。如果每次都需要做次遍历转换数据到节点和边的数据增加了用户的实现复杂度。","position":{"start":{"line":22,"column":5,"offset":400},"end":{"line":22,"column":84,"offset":479},"indent":[]}}],"position":{"start":{"line":22,"column":5,"offset":400},"end":{"line":22,"column":84,"offset":479},"indent":[]}}],"position":{"start":{"line":22,"column":3,"offset":398},"end":{"line":22,"column":84,"offset":479},"indent":[]}},{"type":"listItem","spread":false,"checked":null,"children":[{"type":"paragraph","children":[{"type":"text","value":"树图的每次新增/删除/展开/收缩节点,都需要重新计算布局。遍历一份结构化数据对应到图上每个节点去做更新操作,也很麻烦。","position":{"start":{"line":23,"column":5,"offset":484},"end":{"line":23,"column":64,"offset":543},"indent":[]}}],"position":{"start":{"line":23,"column":5,"offset":484},"end":{"line":23,"column":64,"offset":543},"indent":[]}}],"position":{"start":{"line":23,"column":3,"offset":482},"end":{"line":23,"column":64,"offset":543},"indent":[]}}],"position":{"start":{"line":22,"column":3,"offset":398},"end":{"line":23,"column":64,"offset":543},"indent":[3]}}],"position":{"start":{"line":21,"column":1,"offset":387},"end":{"line":23,"column":64,"offset":543},"indent":[1,1]}}],"position":{"start":{"line":4,"column":1,"offset":98},"end":{"line":23,"column":64,"offset":543},"indent":[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]}},{"type":"heading","depth":2,"children":[{"type":"link","url":"#初始化","title":null,"children":[],"data":{"hProperties":{"aria-label":"初始化 permalink","class":"anchor"},"hChildren":[{"type":"raw","value":"<svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg>"}]}},{"type":"text","value":"初始化","position":{"start":{"line":26,"column":4,"offset":549},"end":{"line":26,"column":7,"offset":552},"indent":[]}}],"position":{"start":{"line":26,"column":1,"offset":546},"end":{"line":26,"column":7,"offset":552},"indent":[]},"data":{"id":"初始化","htmlAttributes":{"id":"初始化"},"hProperties":{"id":"初始化"}}},{"type":"heading","depth":3,"children":[{"type":"link","url":"#g6treegraph","title":null,"children":[],"data":{"hProperties":{"aria-label":"g6treegraph permalink","class":"anchor"},"hChildren":[{"type":"raw","value":"<svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg>"}]}},{"type":"text","value":"G6.TreeGraph","position":{"start":{"line":28,"column":5,"offset":558},"end":{"line":28,"column":17,"offset":570},"indent":[]}}],"position":{"start":{"line":28,"column":1,"offset":554},"end":{"line":28,"column":17,"offset":570},"indent":[]},"data":{"id":"g6treegraph","htmlAttributes":{"id":"g6treegraph"},"hProperties":{"id":"g6treegraph"}}},{"type":"paragraph","children":[{"type":"strong","children":[{"type":"text","value":"参数","position":{"start":{"line":30,"column":3,"offset":574},"end":{"line":30,"column":5,"offset":576},"indent":[]}}],"position":{"start":{"line":30,"column":1,"offset":572},"end":{"line":30,"column":7,"offset":578},"indent":[]}},{"type":"text","value":"\n| 名称 | 类型 | 默认值 | 描述 |\n| --- | --- | --- | --- |\n| layout | object | null | ","position":{"start":{"line":30,"column":7,"offset":578},"end":{"line":33,"column":28,"offset":655},"indent":[1,1,1]}},{"type":"strong","children":[{"type":"text","value":"3.0.4 版本开始支持树布局算法配置","position":{"start":{"line":33,"column":30,"offset":657},"end":{"line":33,"column":49,"offset":676},"indent":[]}}],"position":{"start":{"line":33,"column":28,"offset":655},"end":{"line":33,"column":51,"offset":678},"indent":[]}},{"type":"text","value":"。3.0.4 版本之前是 function 形式。建议开发者使用配置形式,操作粒度更细。 |\n| animate | boolean | true | 默认打开重布局动画开关。 |","position":{"start":{"line":33,"column":51,"offset":678},"end":{"line":34,"column":44,"offset":768},"indent":[1]}}],"position":{"start":{"line":30,"column":1,"offset":572},"end":{"line":34,"column":44,"offset":768},"indent":[1,1,1,1]}},{"type":"paragraph","children":[{"type":"strong","children":[{"type":"text","value":"用法","position":{"start":{"line":37,"column":3,"offset":773},"end":{"line":37,"column":5,"offset":775},"indent":[]}}],"position":{"start":{"line":37,"column":1,"offset":771},"end":{"line":37,"column":7,"offset":777},"indent":[]}}],"position":{"start":{"line":37,"column":1,"offset":771},"end":{"line":37,"column":7,"offset":777},"indent":[]}},{"type":"html","lang":"javascript","meta":null,"value":"<div class=\"gatsby-highlight\" data-language=\"javascript\"><pre class=\"language-javascript\"><code class=\"language-javascript\"><span class=\"token keyword\">const</span> treeGraph <span class=\"token operator\">=</span> <span class=\"token keyword\">new</span> <span class=\"token class-name\">G6<span class=\"token punctuation\">.</span>TreeGraph</span><span class=\"token punctuation\">(</span><span class=\"token punctuation\">{</span>\n  container<span class=\"token punctuation\">:</span> <span class=\"token string\">'mountNode'</span><span class=\"token punctuation\">,</span>\n  width<span class=\"token punctuation\">:</span> <span class=\"token number\">800</span><span class=\"token punctuation\">,</span>\n  height<span class=\"token punctuation\">:</span> <span class=\"token number\">600</span><span class=\"token punctuation\">,</span>\n  modes<span class=\"token punctuation\">:</span> <span class=\"token punctuation\">{</span>\n    <span class=\"token keyword\">default</span><span class=\"token punctuation\">:</span> <span class=\"token punctuation\">[</span>\n      <span class=\"token punctuation\">{</span>\n        type<span class=\"token punctuation\">:</span> <span class=\"token string\">'collapse-expand'</span><span class=\"token punctuation\">,</span>\n        <span class=\"token function\">onChange</span><span class=\"token punctuation\">(</span><span class=\"token parameter\">item<span class=\"token punctuation\">,</span> collapsed</span><span class=\"token punctuation\">)</span> <span class=\"token punctuation\">{</span>\n          <span class=\"token keyword\">const</span> icon <span class=\"token operator\">=</span> item<span class=\"token punctuation\">.</span><span class=\"token function\">get</span><span class=\"token punctuation\">(</span><span class=\"token string\">'group'</span><span class=\"token punctuation\">)</span><span class=\"token punctuation\">.</span><span class=\"token function\">findByClassName</span><span class=\"token punctuation\">(</span><span class=\"token string\">'collapse-icon'</span><span class=\"token punctuation\">)</span><span class=\"token punctuation\">;</span>\n          <span class=\"token keyword\">if</span> <span class=\"token punctuation\">(</span>collapsed<span class=\"token punctuation\">)</span> <span class=\"token punctuation\">{</span>\n            icon<span class=\"token punctuation\">.</span><span class=\"token function\">attr</span><span class=\"token punctuation\">(</span><span class=\"token string\">'symbol'</span><span class=\"token punctuation\">,</span> <span class=\"token constant\">EXPAND_ICON</span><span class=\"token punctuation\">)</span><span class=\"token punctuation\">;</span>\n          <span class=\"token punctuation\">}</span> <span class=\"token keyword\">else</span> <span class=\"token punctuation\">{</span>\n            icon<span class=\"token punctuation\">.</span><span class=\"token function\">attr</span><span class=\"token punctuation\">(</span><span class=\"token string\">'symbol'</span><span class=\"token punctuation\">,</span> <span class=\"token constant\">COLLAPSE_ICON</span><span class=\"token punctuation\">)</span><span class=\"token punctuation\">;</span>\n          <span class=\"token punctuation\">}</span>\n        <span class=\"token punctuation\">}</span><span class=\"token punctuation\">,</span>\n      <span class=\"token punctuation\">}</span><span class=\"token punctuation\">,</span>\n      <span class=\"token string\">'drag-canvas'</span><span class=\"token punctuation\">,</span>\n      <span class=\"token string\">'zoom-canvas'</span><span class=\"token punctuation\">,</span>\n    <span class=\"token punctuation\">]</span><span class=\"token punctuation\">,</span>\n  <span class=\"token punctuation\">}</span><span class=\"token punctuation\">,</span>\n  layout<span class=\"token punctuation\">:</span> <span class=\"token punctuation\">{</span>\n    type<span class=\"token punctuation\">:</span> <span class=\"token string\">'dendrogram'</span><span class=\"token punctuation\">,</span>\n    direction<span class=\"token punctuation\">:</span> <span class=\"token string\">'LR'</span><span class=\"token punctuation\">,</span> <span class=\"token comment\">// H / V / LR / RL / TB / BT</span>\n    nodeSep<span class=\"token punctuation\">:</span> <span class=\"token number\">50</span><span class=\"token punctuation\">,</span>\n    rankSep<span class=\"token punctuation\">:</span> <span class=\"token number\">100</span><span class=\"token punctuation\">,</span>\n    radial<span class=\"token punctuation\">:</span> <span class=\"token boolean\">true</span><span class=\"token punctuation\">,</span>\n  <span class=\"token punctuation\">}</span><span class=\"token punctuation\">,</span>\n<span class=\"token punctuation\">}</span><span class=\"token punctuation\">)</span><span class=\"token punctuation\">;</span>\n</code></pre></div>","position":{"start":{"line":38,"column":1,"offset":778},"end":{"line":64,"column":4,"offset":1388},"indent":[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]}},{"type":"heading","depth":2,"children":[{"type":"link","url":"#layout配置项","title":null,"children":[],"data":{"hProperties":{"aria-label":"layout配置项 permalink","class":"anchor"},"hChildren":[{"type":"raw","value":"<svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg>"}]}},{"type":"text","value":"layout配置项","position":{"start":{"line":67,"column":4,"offset":1394},"end":{"line":67,"column":13,"offset":1403},"indent":[]}}],"position":{"start":{"line":67,"column":1,"offset":1391},"end":{"line":67,"column":13,"offset":1403},"indent":[]},"data":{"id":"layout配置项","htmlAttributes":{"id":"layout配置项"},"hProperties":{"id":"layout配置项"}}},{"type":"paragraph","children":[{"type":"text","value":"layout目前支持dendrogram、compactBox、mindmap和indeted四种布局方式。","position":{"start":{"line":68,"column":1,"offset":1404},"end":{"line":68,"column":55,"offset":1458},"indent":[]}}],"position":{"start":{"line":68,"column":1,"offset":1404},"end":{"line":68,"column":55,"offset":1458},"indent":[]}},{"type":"heading","depth":3,"children":[{"type":"link","url":"#通用配置项","title":null,"children":[],"data":{"hProperties":{"aria-label":"通用配置项 permalink","class":"anchor"},"hChildren":[{"type":"raw","value":"<svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg>"}]}},{"type":"text","value":"通用配置项","position":{"start":{"line":71,"column":5,"offset":1465},"end":{"line":71,"column":10,"offset":1470},"indent":[]}}],"position":{"start":{"line":71,"column":1,"offset":1461},"end":{"line":71,"column":10,"offset":1470},"indent":[]},"data":{"id":"通用配置项","htmlAttributes":{"id":"通用配置项"},"hProperties":{"id":"通用配置项"}}},{"type":"table","align":[null,null,null,null],"children":[{"type":"tableRow","children":[{"type":"tableCell","children":[{"type":"text","value":"名称","position":{"start":{"line":72,"column":3,"offset":1473},"end":{"line":72,"column":5,"offset":1475},"indent":[]}}],"position":{"start":{"line":72,"column":3,"offset":1473},"end":{"line":72,"column":5,"offset":1475},"indent":[]}},{"type":"tableCell","children":[{"type":"text","value":"类型","position":{"start":{"line":72,"column":8,"offset":1478},"end":{"line":72,"column":10,"offset":1480},"indent":[]}}],"position":{"start":{"line":72,"column":8,"offset":1478},"end":{"line":72,"column":10,"offset":1480},"indent":[]}},{"type":"tableCell","children":[{"type":"text","value":"默认值","position":{"start":{"line":72,"column":13,"offset":1483},"end":{"line":72,"column":16,"offset":1486},"indent":[]}}],"position":{"start":{"line":72,"column":13,"offset":1483},"end":{"line":72,"column":16,"offset":1486},"indent":[]}},{"type":"tableCell","children":[{"type":"text","value":"描述","position":{"start":{"line":72,"column":19,"offset":1489},"end":{"line":72,"column":21,"offset":1491},"indent":[]}}],"position":{"start":{"line":72,"column":19,"offset":1489},"end":{"line":72,"column":21,"offset":1491},"indent":[]}}],"position":{"start":{"line":72,"column":1,"offset":1471},"end":{"line":72,"column":23,"offset":1493},"indent":[]}},{"type":"tableRow","children":[{"type":"tableCell","children":[{"type":"text","value":"type","position":{"start":{"line":74,"column":3,"offset":1522},"end":{"line":74,"column":7,"offset":1526},"indent":[]}}],"position":{"start":{"line":74,"column":3,"offset":1522},"end":{"line":74,"column":7,"offset":1526},"indent":[]}},{"type":"tableCell","children":[{"type":"text","value":"string","position":{"start":{"line":74,"column":10,"offset":1529},"end":{"line":74,"column":16,"offset":1535},"indent":[]}}],"position":{"start":{"line":74,"column":10,"offset":1529},"end":{"line":74,"column":16,"offset":1535},"indent":[]}},{"type":"tableCell","children":[{"type":"text","value":"dendrogram","position":{"start":{"line":74,"column":19,"offset":1538},"end":{"line":74,"column":29,"offset":1548},"indent":[]}}],"position":{"start":{"line":74,"column":19,"offset":1538},"end":{"line":74,"column":29,"offset":1548},"indent":[]}},{"type":"tableCell","children":[{"type":"text","value":"布局类型,支持dendrogram、compactBox、mindmap和indeted。","position":{"start":{"line":74,"column":32,"offset":1551},"end":{"line":74,"column":77,"offset":1596},"indent":[]}}],"position":{"start":{"line":74,"column":32,"offset":1551},"end":{"line":74,"column":77,"offset":1596},"indent":[]}}],"position":{"start":{"line":74,"column":1,"offset":1520},"end":{"line":74,"column":79,"offset":1598},"indent":[]}},{"type":"tableRow","children":[{"type":"tableCell","children":[{"type":"text","value":"direction","position":{"start":{"line":75,"column":3,"offset":1601},"end":{"line":75,"column":12,"offset":1610},"indent":[]}}],"position":{"start":{"line":75,"column":3,"offset":1601},"end":{"line":75,"column":12,"offset":1610},"indent":[]}},{"type":"tableCell","children":[{"type":"text","value":"string","position":{"start":{"line":75,"column":15,"offset":1613},"end":{"line":75,"column":21,"offset":1619},"indent":[]}}],"position":{"start":{"line":75,"column":15,"offset":1613},"end":{"line":75,"column":21,"offset":1619},"indent":[]}},{"type":"tableCell","children":[{"type":"text","value":"LR","position":{"start":{"line":75,"column":24,"offset":1622},"end":{"line":75,"column":26,"offset":1624},"indent":[]}}],"position":{"start":{"line":75,"column":24,"offset":1622},"end":{"line":75,"column":26,"offset":1624},"indent":[]}},{"type":"tableCell","children":[{"type":"text","value":"布局方向,有 ","position":{"start":{"line":75,"column":29,"offset":1627},"end":{"line":75,"column":36,"offset":1634},"indent":[]}},{"type":"html","value":"<code class=\"language-text\">LR</code>","position":{"start":{"line":75,"column":36,"offset":1634},"end":{"line":75,"column":40,"offset":1638},"indent":[]}},{"type":"text","value":" , ","position":{"start":{"line":75,"column":40,"offset":1638},"end":{"line":75,"column":43,"offset":1641},"indent":[]}},{"type":"html","value":"<code class=\"language-text\">RL</code>","position":{"start":{"line":75,"column":43,"offset":1641},"end":{"line":75,"column":47,"offset":1645},"indent":[]}},{"type":"text","value":" , ","position":{"start":{"line":75,"column":47,"offset":1645},"end":{"line":75,"column":50,"offset":1648},"indent":[]}},{"type":"html","value":"<code class=\"language-text\">TB</code>","position":{"start":{"line":75,"column":50,"offset":1648},"end":{"line":75,"column":54,"offset":1652},"indent":[]}},{"type":"text","value":" , ","position":{"start":{"line":75,"column":54,"offset":1652},"end":{"line":75,"column":57,"offset":1655},"indent":[]}},{"type":"html","value":"<code class=\"language-text\">BT</code>","position":{"start":{"line":75,"column":57,"offset":1655},"end":{"line":75,"column":61,"offset":1659},"indent":[]}},{"type":"text","value":" , ","position":{"start":{"line":75,"column":61,"offset":1659},"end":{"line":75,"column":64,"offset":1662},"indent":[]}},{"type":"html","value":"<code class=\"language-text\">H</code>","position":{"start":{"line":75,"column":64,"offset":1662},"end":{"line":75,"column":67,"offset":1665},"indent":[]}},{"type":"text","value":" , ","position":{"start":{"line":75,"column":67,"offset":1665},"end":{"line":75,"column":70,"offset":1668},"indent":[]}},{"type":"html","value":"<code class=\"language-text\">V</code>","position":{"start":{"line":75,"column":70,"offset":1668},"end":{"line":75,"column":73,"offset":1671},"indent":[]}},{"type":"text","value":" 可选。","position":{"start":{"line":75,"column":73,"offset":1671},"end":{"line":75,"column":77,"offset":1675},"indent":[]}},{"type":"html","value":"<br />","position":{"start":{"line":75,"column":77,"offset":1675},"end":{"line":75,"column":83,"offset":1681},"indent":[]}},{"type":"text","value":"L: 左; R: 右; T: 上; B:下; H: 垂直; V: 水平。","position":{"start":{"line":75,"column":83,"offset":1681},"end":{"line":75,"column":119,"offset":1717},"indent":[]}}],"position":{"start":{"line":75,"column":29,"offset":1627},"end":{"line":75,"column":119,"offset":1717},"indent":[]}}],"position":{"start":{"line":75,"column":1,"offset":1599},"end":{"line":75,"column":121,"offset":1719},"indent":[]}},{"type":"tableRow","children":[{"type":"tableCell","children":[{"type":"text","value":"getChildren","position":{"start":{"line":76,"column":3,"offset":1722},"end":{"line":76,"column":14,"offset":1733},"indent":[]}}],"position":{"start":{"line":76,"column":3,"offset":1722},"end":{"line":76,"column":14,"offset":1733},"indent":[]}},{"type":"tableCell","children":[{"type":"text","value":"Function","position":{"start":{"line":76,"column":17,"offset":1736},"end":{"line":76,"column":25,"offset":1744},"indent":[]}}],"position":{"start":{"line":76,"column":17,"offset":1736},"end":{"line":76,"column":25,"offset":1744},"indent":[]}},{"type":"tableCell","children":[],"position":{"start":{"line":76,"column":29,"offset":1748},"end":{"line":76,"column":29,"offset":1748},"indent":[]}},{"type":"tableCell","children":[{"type":"text","value":"返回当前节点的所有子节点","position":{"start":{"line":76,"column":31,"offset":1750},"end":{"line":76,"column":43,"offset":1762},"indent":[]}}],"position":{"start":{"line":76,"column":31,"offset":1750},"end":{"line":76,"column":43,"offset":1762},"indent":[]}}],"position":{"start":{"line":76,"column":1,"offset":1720},"end":{"line":76,"column":45,"offset":1764},"indent":[]}}],"position":{"start":{"line":72,"column":1,"offset":1471},"end":{"line":76,"column":45,"offset":1764},"indent":[1,1,1,1]}},{"type":"paragraph","children":[{"type":"text","value":"⚠️","position":{"start":{"line":78,"column":1,"offset":1766},"end":{"line":78,"column":3,"offset":1768},"indent":[]}},{"type":"strong","children":[{"type":"text","value":"注意:","position":{"start":{"line":78,"column":5,"offset":1770},"end":{"line":78,"column":8,"offset":1773},"indent":[]}}],"position":{"start":{"line":78,"column":3,"offset":1768},"end":{"line":78,"column":10,"offset":1775},"indent":[]}},{"type":"text","value":"当","position":{"start":{"line":78,"column":10,"offset":1775},"end":{"line":78,"column":11,"offset":1776},"indent":[]}},{"type":"html","value":"<code class=\"language-text\">type=indeted</code>","position":{"start":{"line":78,"column":11,"offset":1776},"end":{"line":78,"column":25,"offset":1790},"indent":[]}},{"type":"text","value":"时,","position":{"start":{"line":78,"column":25,"offset":1790},"end":{"line":78,"column":27,"offset":1792},"indent":[]}},{"type":"html","value":"<code class=\"language-text\">direction</code>","position":{"start":{"line":78,"column":27,"offset":1792},"end":{"line":78,"column":38,"offset":1803},"indent":[]}},{"type":"text","value":"只能取LR、RL和H这三个值。","position":{"start":{"line":78,"column":38,"offset":1803},"end":{"line":78,"column":53,"offset":1818},"indent":[]}}],"position":{"start":{"line":78,"column":1,"offset":1766},"end":{"line":78,"column":53,"offset":1818},"indent":[]}},{"type":"heading","depth":3,"children":[{"type":"link","url":"#dendrogram","title":null,"children":[],"data":{"hProperties":{"aria-label":"dendrogram permalink","class":"anchor"},"hChildren":[{"type":"raw","value":"<svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg>"}]}},{"type":"text","value":"dendrogram","position":{"start":{"line":81,"column":5,"offset":1825},"end":{"line":81,"column":15,"offset":1835},"indent":[]}}],"position":{"start":{"line":81,"column":1,"offset":1821},"end":{"line":81,"column":15,"offset":1835},"indent":[]},"data":{"id":"dendrogram","htmlAttributes":{"id":"dendrogram"},"hProperties":{"id":"dendrogram"}}},{"type":"paragraph","children":[{"type":"strong","children":[{"type":"text","value":"dendrogram示意图","position":{"start":{"line":83,"column":3,"offset":1839},"end":{"line":83,"column":16,"offset":1852},"indent":[]}}],"position":{"start":{"line":83,"column":1,"offset":1837},"end":{"line":83,"column":18,"offset":1854},"indent":[]}},{"type":"text","value":"\n使用","position":{"start":{"line":83,"column":18,"offset":1854},"end":{"line":84,"column":3,"offset":1857},"indent":[1]}},{"type":"html","value":"<code class=\"language-text\">dendrogram</code>","position":{"start":{"line":84,"column":3,"offset":1857},"end":{"line":84,"column":15,"offset":1869},"indent":[]}},{"type":"text","value":"方式布局时,","position":{"start":{"line":84,"column":15,"offset":1869},"end":{"line":84,"column":21,"offset":1875},"indent":[]}},{"type":"html","value":"<code class=\"language-text\">direction</code>","position":{"start":{"line":84,"column":21,"offset":1875},"end":{"line":84,"column":32,"offset":1886},"indent":[]}},{"type":"text","value":"取不同值时的效果如下所示。","position":{"start":{"line":84,"column":32,"offset":1886},"end":{"line":84,"column":45,"offset":1899},"indent":[]}}],"position":{"start":{"line":83,"column":1,"offset":1837},"end":{"line":84,"column":45,"offset":1899},"indent":[1]}},{"type":"table","align":[null,null,null],"children":[{"type":"tableRow","children":[{"type":"tableCell","children":[{"type":"text","value":"LR","position":{"start":{"line":86,"column":3,"offset":1903},"end":{"line":86,"column":5,"offset":1905},"indent":[]}}],"position":{"start":{"line":86,"column":3,"offset":1903},"end":{"line":86,"column":5,"offset":1905},"indent":[]}},{"type":"tableCell","children":[{"type":"text","value":"RL","position":{"start":{"line":86,"column":8,"offset":1908},"end":{"line":86,"column":10,"offset":1910},"indent":[]}}],"position":{"start":{"line":86,"column":8,"offset":1908},"end":{"line":86,"column":10,"offset":1910},"indent":[]}},{"type":"tableCell","children":[{"type":"text","value":"H","position":{"start":{"line":86,"column":13,"offset":1913},"end":{"line":86,"column":14,"offset":1914},"indent":[]}}],"position":{"start":{"line":86,"column":13,"offset":1913},"end":{"line":86,"column":14,"offset":1914},"indent":[]}}],"position":{"start":{"line":86,"column":1,"offset":1901},"end":{"line":86,"column":16,"offset":1916},"indent":[]}},{"type":"tableRow","children":[{"type":"tableCell","children":[{"type":"html","value":"<img src='https://intranetproxy.alipay.com/skylark/lark/0/2019/png/178530/1560909423150-acf04d11-7016-49ae-a888-f90edb96adbd.png#align=left&display=inline&percent=0&size=0&status=done' width='230' height='100'>","position":{"start":{"line":88,"column":3,"offset":1939},"end":{"line":88,"column":213,"offset":2149},"indent":[]}}],"position":{"start":{"line":88,"column":3,"offset":1939},"end":{"line":88,"column":213,"offset":2149},"indent":[]}},{"type":"tableCell","children":[{"type":"html","value":"<img src='https://intranetproxy.alipay.com/skylark/lark/0/2019/png/178530/1560909423566-cca49639-6dab-43d0-bfac-5ed9b9197237.png#align=left&display=inline&percent=0&size=0&status=done' width='230' height='100'>","position":{"start":{"line":88,"column":216,"offset":2152},"end":{"line":88,"column":426,"offset":2362},"indent":[]}}],"position":{"start":{"line":88,"column":216,"offset":2152},"end":{"line":88,"column":426,"offset":2362},"indent":[]}},{"type":"tableCell","children":[{"type":"html","value":"<img src='https://intranetproxy.alipay.com/skylark/lark/0/2019/png/178530/1560909423225-ad3bb9b4-2119-4014-ae98-65e02185e95e.png#align=left&display=inline&percent=0&size=0&status=done' width='230' height='100'>","position":{"start":{"line":88,"column":429,"offset":2365},"end":{"line":88,"column":639,"offset":2575},"indent":[]}}],"position":{"start":{"line":88,"column":429,"offset":2365},"end":{"line":88,"column":639,"offset":2575},"indent":[]}}],"position":{"start":{"line":88,"column":1,"offset":1937},"end":{"line":88,"column":641,"offset":2577},"indent":[]}}],"position":{"start":{"line":86,"column":1,"offset":1901},"end":{"line":88,"column":641,"offset":2577},"indent":[1,1]}},{"type":"table","align":[null,null,null],"children":[{"type":"tableRow","children":[{"type":"tableCell","children":[{"type":"text","value":"TB","position":{"start":{"line":90,"column":3,"offset":2581},"end":{"line":90,"column":5,"offset":2583},"indent":[]}}],"position":{"start":{"line":90,"column":3,"offset":2581},"end":{"line":90,"column":5,"offset":2583},"indent":[]}},{"type":"tableCell","children":[{"type":"text","value":"BT","position":{"start":{"line":90,"column":8,"offset":2586},"end":{"line":90,"column":10,"offset":2588},"indent":[]}}],"position":{"start":{"line":90,"column":8,"offset":2586},"end":{"line":90,"column":10,"offset":2588},"indent":[]}},{"type":"tableCell","children":[{"type":"text","value":"V","position":{"start":{"line":90,"column":13,"offset":2591},"end":{"line":90,"column":14,"offset":2592},"indent":[]}}],"position":{"start":{"line":90,"column":13,"offset":2591},"end":{"line":90,"column":14,"offset":2592},"indent":[]}}],"position":{"start":{"line":90,"column":1,"offset":2579},"end":{"line":90,"column":16,"offset":2594},"indent":[]}},{"type":"tableRow","children":[{"type":"tableCell","children":[{"type":"html","value":"<img src='https://intranetproxy.alipay.com/skylark/lark/0/2019/png/178530/1560909422368-c7b8499f-053b-497f-ad34-f45b8c2a5549.png#align=left&display=inline&percent=0&size=0&status=done' width='230' height='100'>","position":{"start":{"line":92,"column":3,"offset":2617},"end":{"line":92,"column":213,"offset":2827},"indent":[]}}],"position":{"start":{"line":92,"column":3,"offset":2617},"end":{"line":92,"column":213,"offset":2827},"indent":[]}},{"type":"tableCell","children":[{"type":"html","value":"<img src='https://intranetproxy.alipay.com/skylark/lark/0/2019/png/178530/1560909422252-07a6933e-93d8-490e-ae15-ed51e576d69a.png#align=left&display=inline&percent=0&size=0&status=done' width='230' height='100'>","position":{"start":{"line":92,"column":216,"offset":2830},"end":{"line":92,"column":426,"offset":3040},"indent":[]}}],"position":{"start":{"line":92,"column":216,"offset":2830},"end":{"line":92,"column":426,"offset":3040},"indent":[]}},{"type":"tableCell","children":[{"type":"html","value":"<img src='https://intranetproxy.alipay.com/skylark/lark/0/2019/png/178530/1560909422727-f14a4f4c-c326-4f3f-bea5-abae28867835.png#align=left&display=inline&percent=0&size=0&status=done' width='230' height='100'>","position":{"start":{"line":92,"column":429,"offset":3043},"end":{"line":92,"column":639,"offset":3253},"indent":[]}}],"position":{"start":{"line":92,"column":429,"offset":3043},"end":{"line":92,"column":639,"offset":3253},"indent":[]}}],"position":{"start":{"line":92,"column":1,"offset":2615},"end":{"line":92,"column":641,"offset":3255},"indent":[]}}],"position":{"start":{"line":90,"column":1,"offset":2579},"end":{"line":92,"column":641,"offset":3255},"indent":[1,1]}},{"type":"paragraph","children":[{"type":"strong","children":[{"type":"text","value":"dendrogram配置项","position":{"start":{"line":95,"column":3,"offset":3260},"end":{"line":95,"column":16,"offset":3273},"indent":[]}}],"position":{"start":{"line":95,"column":1,"offset":3258},"end":{"line":95,"column":18,"offset":3275},"indent":[]}},{"type":"text","value":"\n| 名称 | 类型 | 默认值 | 描述 |\n| --- | --- | --- | --- |\n| nodeSep | number | 20 | 同层次节点之间的间距 |\n| rankSep | number | 200 | 相邻层级节点之间的间距 |\n| nodeSize | number | 20 | 节点大小 |\n| subTreeSep | number | 10 | 子树之间的间距 |\n| isHorizontal | boolean | true | 是否是水平方向,默认为水平方向 |","position":{"start":{"line":95,"column":18,"offset":3275},"end":{"line":102,"column":52,"offset":3529},"indent":[1,1,1,1,1,1,1]}}],"position":{"start":{"line":95,"column":1,"offset":3258},"end":{"line":102,"column":52,"offset":3529},"indent":[1,1,1,1,1,1,1]}},{"type":"heading","depth":3,"children":[{"type":"link","url":"#compactbox","title":null,"children":[],"data":{"hProperties":{"aria-label":"compactbox permalink","class":"anchor"},"hChildren":[{"type":"raw","value":"<svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg>"}]}},{"type":"text","value":"compactBox","position":{"start":{"line":105,"column":5,"offset":3536},"end":{"line":105,"column":15,"offset":3546},"indent":[]}}],"position":{"start":{"line":105,"column":1,"offset":3532},"end":{"line":105,"column":15,"offset":3546},"indent":[]},"data":{"id":"compactbox","htmlAttributes":{"id":"compactbox"},"hProperties":{"id":"compactbox"}}},{"type":"paragraph","children":[{"type":"strong","children":[{"type":"text","value":"compactBox示意图","position":{"start":{"line":107,"column":3,"offset":3550},"end":{"line":107,"column":16,"offset":3563},"indent":[]}}],"position":{"start":{"line":107,"column":1,"offset":3548},"end":{"line":107,"column":18,"offset":3565},"indent":[]}},{"type":"text","value":"\n使用","position":{"start":{"line":107,"column":18,"offset":3565},"end":{"line":108,"column":3,"offset":3568},"indent":[1]}},{"type":"html","value":"<code class=\"language-text\">compactBox</code>","position":{"start":{"line":108,"column":3,"offset":3568},"end":{"line":108,"column":15,"offset":3580},"indent":[]}},{"type":"text","value":"方式布局时,","position":{"start":{"line":108,"column":15,"offset":3580},"end":{"line":108,"column":21,"offset":3586},"indent":[]}},{"type":"html","value":"<code class=\"language-text\">direction</code>","position":{"start":{"line":108,"column":21,"offset":3586},"end":{"line":108,"column":32,"offset":3597},"indent":[]}},{"type":"text","value":"取不同值时的效果如下所示。","position":{"start":{"line":108,"column":32,"offset":3597},"end":{"line":108,"column":45,"offset":3610},"indent":[]}}],"position":{"start":{"line":107,"column":1,"offset":3548},"end":{"line":108,"column":45,"offset":3610},"indent":[1]}},{"type":"table","align":[null,null,null],"children":[{"type":"tableRow","children":[{"type":"tableCell","children":[{"type":"text","value":"LR","position":{"start":{"line":110,"column":3,"offset":3614},"end":{"line":110,"column":5,"offset":3616},"indent":[]}}],"position":{"start":{"line":110,"column":3,"offset":3614},"end":{"line":110,"column":5,"offset":3616},"indent":[]}},{"type":"tableCell","children":[{"type":"text","value":"RL","position":{"start":{"line":110,"column":8,"offset":3619},"end":{"line":110,"column":10,"offset":3621},"indent":[]}}],"position":{"start":{"line":110,"column":8,"offset":3619},"end":{"line":110,"column":10,"offset":3621},"indent":[]}},{"type":"tableCell","children":[{"type":"text","value":"H","position":{"start":{"line":110,"column":13,"offset":3624},"end":{"line":110,"column":14,"offset":3625},"indent":[]}}],"position":{"start":{"line":110,"column":13,"offset":3624},"end":{"line":110,"column":14,"offset":3625},"indent":[]}}],"position":{"start":{"line":110,"column":1,"offset":3612},"end":{"line":110,"column":16,"offset":3627},"indent":[]}},{"type":"tableRow","children":[{"type":"tableCell","children":[{"type":"html","value":"<img src='https://intranetproxy.alipay.com/skylark/lark/0/2019/png/178530/1560909250873-b6b156b5-8edc-468c-bd8e-e1336a0c4589.png#align=left&display=inline&percent=0&size=0&status=done' width='230' height='100'>","position":{"start":{"line":112,"column":3,"offset":3650},"end":{"line":112,"column":213,"offset":3860},"indent":[]}}],"position":{"start":{"line":112,"column":3,"offset":3650},"end":{"line":112,"column":213,"offset":3860},"indent":[]}},{"type":"tableCell","children":[{"type":"html","value":"<img src='https://intranetproxy.alipay.com/skylark/lark/0/2019/png/178530/1560909251752-c5fef594-c0d5-4e0f-80e0-50ef0ad030d7.png#align=left&display=inline&percent=0&size=0&status=done' width='230' height='100'>","position":{"start":{"line":112,"column":216,"offset":3863},"end":{"line":112,"column":426,"offset":4073},"indent":[]}}],"position":{"start":{"line":112,"column":216,"offset":3863},"end":{"line":112,"column":426,"offset":4073},"indent":[]}},{"type":"tableCell","children":[{"type":"html","value":"<img src='https://intranetproxy.alipay.com/skylark/lark/0/2019/png/178530/1560909252469-d1429897-cbe0-4d1f-933e-f1da998e5057.png#align=left&display=inline&percent=0&size=0&status=done' width='230' height='100'>","position":{"start":{"line":112,"column":429,"offset":4076},"end":{"line":112,"column":639,"offset":4286},"indent":[]}}],"position":{"start":{"line":112,"column":429,"offset":4076},"end":{"line":112,"column":639,"offset":4286},"indent":[]}}],"position":{"start":{"line":112,"column":1,"offset":3648},"end":{"line":112,"column":641,"offset":4288},"indent":[]}}],"position":{"start":{"line":110,"column":1,"offset":3612},"end":{"line":112,"column":641,"offset":4288},"indent":[1,1]}},{"type":"table","align":[null,null,null],"children":[{"type":"tableRow","children":[{"type":"tableCell","children":[{"type":"text","value":"TB","position":{"start":{"line":114,"column":3,"offset":4292},"end":{"line":114,"column":5,"offset":4294},"indent":[]}}],"position":{"start":{"line":114,"column":3,"offset":4292},"end":{"line":114,"column":5,"offset":4294},"indent":[]}},{"type":"tableCell","children":[{"type":"text","value":"BT","position":{"start":{"line":114,"column":8,"offset":4297},"end":{"line":114,"column":10,"offset":4299},"indent":[]}}],"position":{"start":{"line":114,"column":8,"offset":4297},"end":{"line":114,"column":10,"offset":4299},"indent":[]}},{"type":"tableCell","children":[{"type":"text","value":"V","position":{"start":{"line":114,"column":13,"offset":4302},"end":{"line":114,"column":14,"offset":4303},"indent":[]}}],"position":{"start":{"line":114,"column":13,"offset":4302},"end":{"line":114,"column":14,"offset":4303},"indent":[]}}],"position":{"start":{"line":114,"column":1,"offset":4290},"end":{"line":114,"column":16,"offset":4305},"indent":[]}},{"type":"tableRow","children":[{"type":"tableCell","children":[{"type":"html","value":"<img src='https://intranetproxy.alipay.com/skylark/lark/0/2019/png/178530/1560909252526-b8936ca5-0c10-475e-a695-c10d6719a9cf.png#align=left&display=inline&percent=0&size=0&status=done' width='230' height='100'>","position":{"start":{"line":116,"column":3,"offset":4328},"end":{"line":116,"column":213,"offset":4538},"indent":[]}}],"position":{"start":{"line":116,"column":3,"offset":4328},"end":{"line":116,"column":213,"offset":4538},"indent":[]}},{"type":"tableCell","children":[{"type":"html","value":"<img src='https://intranetproxy.alipay.com/skylark/lark/0/2019/png/178530/1560909253376-12485bcb-cf79-4036-9e34-9d8310622071.png#align=left&display=inline&percent=0&size=0&status=done' width='230' height='100'>","position":{"start":{"line":116,"column":216,"offset":4541},"end":{"line":116,"column":426,"offset":4751},"indent":[]}}],"position":{"start":{"line":116,"column":216,"offset":4541},"end":{"line":116,"column":426,"offset":4751},"indent":[]}},{"type":"tableCell","children":[{"type":"html","value":"<img src='https://intranetproxy.alipay.com/skylark/lark/0/2019/png/178530/1560909250963-09c4db6e-5f67-49ea-a0ce-b922ad54548d.png#align=left&display=inline&percent=0&size=0&status=done' width='230' height='100'>","position":{"start":{"line":116,"column":429,"offset":4754},"end":{"line":116,"column":639,"offset":4964},"indent":[]}}],"position":{"start":{"line":116,"column":429,"offset":4754},"end":{"line":116,"column":639,"offset":4964},"indent":[]}}],"position":{"start":{"line":116,"column":1,"offset":4326},"end":{"line":116,"column":641,"offset":4966},"indent":[]}}],"position":{"start":{"line":114,"column":1,"offset":4290},"end":{"line":116,"column":641,"offset":4966},"indent":[1,1]}},{"type":"paragraph","children":[{"type":"strong","children":[{"type":"text","value":"compactBox配置项","position":{"start":{"line":119,"column":3,"offset":4971},"end":{"line":119,"column":16,"offset":4984},"indent":[]}}],"position":{"start":{"line":119,"column":1,"offset":4969},"end":{"line":119,"column":18,"offset":4986},"indent":[]}},{"type":"text","value":"\n| 名称 | 类型 | 默认值 | 描述 |\n| --- | --- | --- | --- |\n| getId | Function |  | 指定节点ID |\n| getHeight | Function | 36 | 指定节点高度 |\n| getWidth | Function | 18 | 指定节点宽度 |\n| getVGap | Function | 18 | 指定节点之间的垂直间距 |\n| getHGap | Function | 18 | 指定节点之间的水平间距 |","position":{"start":{"line":119,"column":18,"offset":4986},"end":{"line":126,"column":42,"offset":5229},"indent":[1,1,1,1,1,1,1]}}],"position":{"start":{"line":119,"column":1,"offset":4969},"end":{"line":126,"column":42,"offset":5229},"indent":[1,1,1,1,1,1,1]}},{"type":"paragraph","children":[{"type":"text","value":"⚠️","position":{"start":{"line":128,"column":1,"offset":5231},"end":{"line":128,"column":3,"offset":5233},"indent":[]}},{"type":"strong","children":[{"type":"text","value":"注意:","position":{"start":{"line":128,"column":5,"offset":5235},"end":{"line":128,"column":8,"offset":5238},"indent":[]}}],"position":{"start":{"line":128,"column":3,"offset":5233},"end":{"line":128,"column":10,"offset":5240},"indent":[]}},{"type":"text","value":"使用getWidth、getHeight、getVGap和getHGap指定节点的宽高及间距后,并不会改变节点的大小,具体原理如下所示:","position":{"start":{"line":128,"column":10,"offset":5240},"end":{"line":128,"column":78,"offset":5308},"indent":[]}}],"position":{"start":{"line":128,"column":1,"offset":5231},"end":{"line":128,"column":78,"offset":5308},"indent":[]}},{"type":"html","lang":"javascript","meta":null,"value":"<div class=\"gatsby-highlight\" data-language=\"javascript\"><pre class=\"language-javascript\"><code class=\"language-javascript\"><span class=\"token comment\">/*\n * Gaps: filling space between nodes\n * (x, y) ----------------------\n * |            vgap            |\n * |    --------------------    h\n * | h |                    |   e\n * | g |                    |   i\n * | a |                    |   g\n * | p |                    |   h\n * |   ---------------------    t\n * |                            |\n *  -----------width------------\n */</span>\n</code></pre></div>","position":{"start":{"line":129,"column":1,"offset":5309},"end":{"line":143,"column":4,"offset":5732},"indent":[1,1,1,1,1,1,1,1,1,1,1,1,1,1]}},{"type":"paragraph","children":[{"type":"strong","children":[{"type":"text","value":"🦁以上原理同样适用于indented和mindmap布局。","position":{"start":{"line":145,"column":3,"offset":5736},"end":{"line":145,"column":33,"offset":5766},"indent":[]}}],"position":{"start":{"line":145,"column":1,"offset":5734},"end":{"line":145,"column":35,"offset":5768},"indent":[]}}],"position":{"start":{"line":145,"column":1,"offset":5734},"end":{"line":145,"column":35,"offset":5768},"indent":[]}},{"type":"heading","depth":3,"children":[{"type":"link","url":"#indented","title":null,"children":[],"data":{"hProperties":{"aria-label":"indented permalink","class":"anchor"},"hChildren":[{"type":"raw","value":"<svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg>"}]}},{"type":"text","value":"indented","position":{"start":{"line":148,"column":5,"offset":5775},"end":{"line":148,"column":13,"offset":5783},"indent":[]}}],"position":{"start":{"line":148,"column":1,"offset":5771},"end":{"line":148,"column":13,"offset":5783},"indent":[]},"data":{"id":"indented","htmlAttributes":{"id":"indented"},"hProperties":{"id":"indented"}}},{"type":"paragraph","children":[{"type":"strong","children":[{"type":"text","value":"indented示意图","position":{"start":{"line":150,"column":3,"offset":5787},"end":{"line":150,"column":14,"offset":5798},"indent":[]}}],"position":{"start":{"line":150,"column":1,"offset":5785},"end":{"line":150,"column":16,"offset":5800},"indent":[]}},{"type":"text","value":"\n使用","position":{"start":{"line":150,"column":16,"offset":5800},"end":{"line":151,"column":3,"offset":5803},"indent":[1]}},{"type":"html","value":"<code class=\"language-text\">indented</code>","position":{"start":{"line":151,"column":3,"offset":5803},"end":{"line":151,"column":13,"offset":5813},"indent":[]}},{"type":"text","value":"方式布局时,","position":{"start":{"line":151,"column":13,"offset":5813},"end":{"line":151,"column":19,"offset":5819},"indent":[]}},{"type":"html","value":"<code class=\"language-text\">direction</code>","position":{"start":{"line":151,"column":19,"offset":5819},"end":{"line":151,"column":30,"offset":5830},"indent":[]}},{"type":"text","value":"取不同值时的效果如下所示。","position":{"start":{"line":151,"column":30,"offset":5830},"end":{"line":151,"column":43,"offset":5843},"indent":[]}}],"position":{"start":{"line":150,"column":1,"offset":5785},"end":{"line":151,"column":43,"offset":5843},"indent":[1]}},{"type":"table","align":[null,null,null],"children":[{"type":"tableRow","children":[{"type":"tableCell","children":[{"type":"text","value":"LR","position":{"start":{"line":153,"column":3,"offset":5847},"end":{"line":153,"column":5,"offset":5849},"indent":[]}}],"position":{"start":{"line":153,"column":3,"offset":5847},"end":{"line":153,"column":5,"offset":5849},"indent":[]}},{"type":"tableCell","children":[{"type":"text","value":"RL","position":{"start":{"line":153,"column":8,"offset":5852},"end":{"line":153,"column":10,"offset":5854},"indent":[]}}],"position":{"start":{"line":153,"column":8,"offset":5852},"end":{"line":153,"column":10,"offset":5854},"indent":[]}},{"type":"tableCell","children":[{"type":"text","value":"H","position":{"start":{"line":153,"column":13,"offset":5857},"end":{"line":153,"column":14,"offset":5858},"indent":[]}}],"position":{"start":{"line":153,"column":13,"offset":5857},"end":{"line":153,"column":14,"offset":5858},"indent":[]}}],"position":{"start":{"line":153,"column":1,"offset":5845},"end":{"line":153,"column":16,"offset":5860},"indent":[]}},{"type":"tableRow","children":[{"type":"tableCell","children":[{"type":"html","value":"<img src='https://intranetproxy.alipay.com/skylark/lark/0/2019/png/178530/1560910055783-3783faed-29f0-4e34-9076-df951aa6ea10.png#align=left&display=inline&percent=0&size=0&status=done' width='230' height='100'>","position":{"start":{"line":155,"column":3,"offset":5883},"end":{"line":155,"column":213,"offset":6093},"indent":[]}}],"position":{"start":{"line":155,"column":3,"offset":5883},"end":{"line":155,"column":213,"offset":6093},"indent":[]}},{"type":"tableCell","children":[{"type":"html","value":"<img src='https://intranetproxy.alipay.com/skylark/lark/0/2019/png/178530/1560910055615-54aaca32-7de4-471e-8600-611854094b90.png#align=left&display=inline&percent=0&size=0&status=done' width='230' height='100'>","position":{"start":{"line":155,"column":216,"offset":6096},"end":{"line":155,"column":426,"offset":6306},"indent":[]}}],"position":{"start":{"line":155,"column":216,"offset":6096},"end":{"line":155,"column":426,"offset":6306},"indent":[]}},{"type":"tableCell","children":[{"type":"html","value":"<img src='https://intranetproxy.alipay.com/skylark/lark/0/2019/png/178530/1560910055676-86d316d8-9487-4b3d-99a4-27b4a8c091c0.png#align=left&display=inline&percent=0&size=0&status=done' width='230' height='100'>","position":{"start":{"line":155,"column":429,"offset":6309},"end":{"line":155,"column":639,"offset":6519},"indent":[]}}],"position":{"start":{"line":155,"column":429,"offset":6309},"end":{"line":155,"column":639,"offset":6519},"indent":[]}}],"position":{"start":{"line":155,"column":1,"offset":5881},"end":{"line":155,"column":641,"offset":6521},"indent":[]}}],"position":{"start":{"line":153,"column":1,"offset":5845},"end":{"line":155,"column":641,"offset":6521},"indent":[1,1]}},{"type":"paragraph","children":[{"type":"strong","children":[{"type":"text","value":"indented配置项","position":{"start":{"line":158,"column":3,"offset":6526},"end":{"line":158,"column":14,"offset":6537},"indent":[]}}],"position":{"start":{"line":158,"column":1,"offset":6524},"end":{"line":158,"column":16,"offset":6539},"indent":[]}},{"type":"text","value":"\n| 名称 | 类型 | 默认值 | 描述 |\n| --- | --- | --- | --- |\n| indent | number | 20 | 与直接父节点的缩进值 |\n| getVGap | Function | 18 | 指定节点之间的垂直间距 |\n| getHeight | Function | 36 | 指定节点的高度 |","position":{"start":{"line":158,"column":16,"offset":6539},"end":{"line":163,"column":40,"offset":6708},"indent":[1,1,1,1,1]}}],"position":{"start":{"line":158,"column":1,"offset":6524},"end":{"line":163,"column":40,"offset":6708},"indent":[1,1,1,1,1]}},{"type":"heading","depth":3,"children":[{"type":"link","url":"#mindmap","title":null,"children":[],"data":{"hProperties":{"aria-label":"mindmap permalink","class":"anchor"},"hChildren":[{"type":"raw","value":"<svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg>"}]}},{"type":"text","value":"mindmap","position":{"start":{"line":166,"column":5,"offset":6715},"end":{"line":166,"column":12,"offset":6722},"indent":[]}}],"position":{"start":{"line":166,"column":1,"offset":6711},"end":{"line":166,"column":12,"offset":6722},"indent":[]},"data":{"id":"mindmap","htmlAttributes":{"id":"mindmap"},"hProperties":{"id":"mindmap"}}},{"type":"paragraph","children":[{"type":"strong","children":[{"type":"text","value":"mindmap示意图","position":{"start":{"line":168,"column":3,"offset":6726},"end":{"line":168,"column":13,"offset":6736},"indent":[]}}],"position":{"start":{"line":168,"column":1,"offset":6724},"end":{"line":168,"column":15,"offset":6738},"indent":[]}},{"type":"text","value":"\n","position":{"start":{"line":168,"column":15,"offset":6738},"end":{"line":169,"column":1,"offset":6739},"indent":[1]}},{"type":"html","value":"<img src='https://intranetproxy.alipay.com/skylark/lark/0/2019/png/178530/1560908396116-af8c9bf3-ec9b-4a06-b32a-9c6be6ee927c.png#align=left&display=inline&height=327&name=image.png&originHeight=654&originWidth=1276&size=112648&status=done&width=638' width='750'>","position":{"start":{"line":169,"column":1,"offset":6739},"end":{"line":169,"column":263,"offset":7001},"indent":[]}}],"position":{"start":{"line":168,"column":1,"offset":6724},"end":{"line":169,"column":263,"offset":7001},"indent":[1]}},{"type":"paragraph","children":[{"type":"strong","children":[{"type":"text","value":"mindmap配置项","position":{"start":{"line":172,"column":3,"offset":7006},"end":{"line":172,"column":13,"offset":7016},"indent":[]}}],"position":{"start":{"line":172,"column":1,"offset":7004},"end":{"line":172,"column":15,"offset":7018},"indent":[]}},{"type":"text","value":"\n| 名称 | 类型 | 默认值 | 描述 |\n| --- | --- | --- | --- |\n| getId | Function |  | 指定节点ID |\n| getHeight | Function | 36 | 指定节点高度 |\n| getWidth | Function | 18 | 指定节点宽度 |\n| getSide | Function |  | 指定当前节点在主题的左边 (left) 还是右边 (right) |\n| getSubTreeSep | Function | 0 | 指定子节点之间的高度间隔 |\n| getVGap | Function | 18 | 指定节点的垂直间距 |\n| getHGap | Function | 18 | 指定节点的水平间距 |","position":{"start":{"line":172,"column":15,"offset":7018},"end":{"line":181,"column":40,"offset":7366},"indent":[1,1,1,1,1,1,1,1,1]}}],"position":{"start":{"line":172,"column":1,"offset":7004},"end":{"line":181,"column":40,"offset":7366},"indent":[1,1,1,1,1,1,1,1,1]}},{"type":"heading","depth":2,"children":[{"type":"link","url":"#更新","title":null,"children":[],"data":{"hProperties":{"aria-label":"更新 permalink","class":"anchor"},"hChildren":[{"type":"raw","value":"<svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg>"}]}},{"type":"text","value":"更新","position":{"start":{"line":184,"column":4,"offset":7372},"end":{"line":184,"column":6,"offset":7374},"indent":[]}}],"position":{"start":{"line":184,"column":1,"offset":7369},"end":{"line":184,"column":6,"offset":7374},"indent":[]},"data":{"id":"更新","htmlAttributes":{"id":"更新"},"hProperties":{"id":"更新"}}},{"type":"heading","depth":3,"children":[{"type":"link","url":"#addchilddata-parent","title":null,"children":[],"data":{"hProperties":{"aria-label":"addchilddata parent permalink","class":"anchor"},"hChildren":[{"type":"raw","value":"<svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg>"}]}},{"type":"text","value":"addChild(data, parent)","position":{"start":{"line":186,"column":5,"offset":7380},"end":{"line":186,"column":27,"offset":7402},"indent":[]}}],"position":{"start":{"line":186,"column":1,"offset":7376},"end":{"line":186,"column":27,"offset":7402},"indent":[]},"data":{"id":"addchilddata-parent","htmlAttributes":{"id":"addchilddata-parent"},"hProperties":{"id":"addchilddata-parent"}}},{"type":"paragraph","children":[{"type":"text","value":"在指定的父节点下添加子树。","position":{"start":{"line":187,"column":1,"offset":7403},"end":{"line":187,"column":14,"offset":7416},"indent":[]}}],"position":{"start":{"line":187,"column":1,"offset":7403},"end":{"line":187,"column":14,"offset":7416},"indent":[]}},{"type":"paragraph","children":[{"type":"strong","children":[{"type":"text","value":"参数","position":{"start":{"line":190,"column":3,"offset":7421},"end":{"line":190,"column":5,"offset":7423},"indent":[]}}],"position":{"start":{"line":190,"column":1,"offset":7419},"end":{"line":190,"column":7,"offset":7425},"indent":[]}},{"type":"text","value":"\n| 名称 | 类型 | 是否必选 | 描述 |\n| --- | --- | --- | --- |\n| data | object | true | 子树的数据 |\n| parent | Node | string | true | 父节点或父节点ID |","position":{"start":{"line":190,"column":7,"offset":7425},"end":{"line":194,"column":46,"offset":7554},"indent":[1,1,1,1]}}],"position":{"start":{"line":190,"column":1,"offset":7419},"end":{"line":194,"column":46,"offset":7554},"indent":[1,1,1,1]}},{"type":"paragraph","children":[{"type":"strong","children":[{"type":"text","value":"用法","position":{"start":{"line":197,"column":3,"offset":7559},"end":{"line":197,"column":5,"offset":7561},"indent":[]}}],"position":{"start":{"line":197,"column":1,"offset":7557},"end":{"line":197,"column":7,"offset":7563},"indent":[]}}],"position":{"start":{"line":197,"column":1,"offset":7557},"end":{"line":197,"column":7,"offset":7563},"indent":[]}},{"type":"html","lang":"javascript","meta":null,"value":"<div class=\"gatsby-highlight\" data-language=\"javascript\"><pre class=\"language-javascript\"><code class=\"language-javascript\"><span class=\"token keyword\">const</span> data <span class=\"token operator\">=</span> <span class=\"token punctuation\">{</span>\n  id<span class=\"token punctuation\">:</span> <span class=\"token string\">'sub1'</span><span class=\"token punctuation\">,</span>\n  children<span class=\"token punctuation\">:</span> <span class=\"token punctuation\">[</span>\n    <span class=\"token punctuation\">{</span>\n      id<span class=\"token punctuation\">:</span> <span class=\"token string\">'subTree1'</span><span class=\"token punctuation\">,</span>\n      children<span class=\"token punctuation\">:</span> <span class=\"token punctuation\">[</span><span class=\"token operator\">...</span><span class=\"token punctuation\">]</span>\n    <span class=\"token punctuation\">}</span><span class=\"token punctuation\">,</span> \n    <span class=\"token punctuation\">{</span>\n      id<span class=\"token punctuation\">:</span> <span class=\"token string\">'subTree2'</span><span class=\"token punctuation\">,</span>\n      children<span class=\"token punctuation\">:</span> <span class=\"token punctuation\">[</span><span class=\"token operator\">...</span><span class=\"token punctuation\">]</span>           \n    <span class=\"token punctuation\">}</span>\n  <span class=\"token punctuation\">]</span>\n<span class=\"token punctuation\">}</span><span class=\"token punctuation\">;</span>\n\ntreeGraph<span class=\"token punctuation\">.</span><span class=\"token function\">addChild</span><span class=\"token punctuation\">(</span>data<span class=\"token punctuation\">,</span> <span class=\"token string\">'root'</span><span class=\"token punctuation\">)</span></code></pre></div>","position":{"start":{"line":198,"column":1,"offset":7564},"end":{"line":214,"column":4,"offset":7790},"indent":[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]}},{"type":"heading","depth":3,"children":[{"type":"link","url":"#updatechilddata-parent","title":null,"children":[],"data":{"hProperties":{"aria-label":"updatechilddata parent permalink","class":"anchor"},"hChildren":[{"type":"raw","value":"<svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg>"}]}},{"type":"text","value":"updateChild(data, parent)","position":{"start":{"line":217,"column":5,"offset":7797},"end":{"line":217,"column":30,"offset":7822},"indent":[]}}],"position":{"start":{"line":217,"column":1,"offset":7793},"end":{"line":217,"column":30,"offset":7822},"indent":[]},"data":{"id":"updatechilddata-parent","htmlAttributes":{"id":"updatechilddata-parent"},"hProperties":{"id":"updatechilddata-parent"}}},{"type":"paragraph","children":[{"type":"text","value":"更新数据,差量更新子树。","position":{"start":{"line":218,"column":1,"offset":7823},"end":{"line":218,"column":13,"offset":7835},"indent":[]}}],"position":{"start":{"line":218,"column":1,"offset":7823},"end":{"line":218,"column":13,"offset":7835},"indent":[]}},{"type":"paragraph","children":[{"type":"strong","children":[{"type":"text","value":"参数","position":{"start":{"line":221,"column":3,"offset":7840},"end":{"line":221,"column":5,"offset":7842},"indent":[]}}],"position":{"start":{"line":221,"column":1,"offset":7838},"end":{"line":221,"column":7,"offset":7844},"indent":[]}},{"type":"text","value":"\n| 名称 | 类型 | 是否必选 | 描述 |\n| --- | --- | --- | --- |\n| data | object | true | 子树的数据 |\n| parent | Node | string | false | 父节点或父节点ID |","position":{"start":{"line":221,"column":7,"offset":7844},"end":{"line":225,"column":47,"offset":7974},"indent":[1,1,1,1]}}],"position":{"start":{"line":221,"column":1,"offset":7838},"end":{"line":225,"column":47,"offset":7974},"indent":[1,1,1,1]}},{"type":"paragraph","children":[{"type":"text","value":"⚠️","position":{"start":{"line":227,"column":1,"offset":7976},"end":{"line":227,"column":3,"offset":7978},"indent":[]}},{"type":"strong","children":[{"type":"text","value":"注意:","position":{"start":{"line":227,"column":5,"offset":7980},"end":{"line":227,"column":8,"offset":7983},"indent":[]}}],"position":{"start":{"line":227,"column":3,"offset":7978},"end":{"line":227,"column":10,"offset":7985},"indent":[]}},{"type":"text","value":"当parent参数为空时,则全量更新。","position":{"start":{"line":227,"column":10,"offset":7985},"end":{"line":227,"column":29,"offset":8004},"indent":[]}}],"position":{"start":{"line":227,"column":1,"offset":7976},"end":{"line":227,"column":29,"offset":8004},"indent":[]}},{"type":"paragraph","children":[{"type":"strong","children":[{"type":"text","value":"用法","position":{"start":{"line":230,"column":3,"offset":8009},"end":{"line":230,"column":5,"offset":8011},"indent":[]}}],"position":{"start":{"line":230,"column":1,"offset":8007},"end":{"line":230,"column":7,"offset":8013},"indent":[]}}],"position":{"start":{"line":230,"column":1,"offset":8007},"end":{"line":230,"column":7,"offset":8013},"indent":[]}},{"type":"html","lang":"javascript","meta":null,"value":"<div class=\"gatsby-highlight\" data-language=\"javascript\"><pre class=\"language-javascript\"><code class=\"language-javascript\"><span class=\"token keyword\">const</span> data <span class=\"token operator\">=</span> <span class=\"token punctuation\">{</span>\n  id<span class=\"token punctuation\">:</span> <span class=\"token string\">'sub1'</span><span class=\"token punctuation\">,</span>\n  children<span class=\"token punctuation\">:</span> <span class=\"token punctuation\">[</span>\n    <span class=\"token punctuation\">{</span>\n      id<span class=\"token punctuation\">:</span> <span class=\"token string\">'subTree1'</span><span class=\"token punctuation\">,</span>\n      children<span class=\"token punctuation\">:</span> <span class=\"token punctuation\">[</span><span class=\"token operator\">...</span><span class=\"token punctuation\">]</span>\n    <span class=\"token punctuation\">}</span><span class=\"token punctuation\">,</span> \n    <span class=\"token punctuation\">{</span>\n      id<span class=\"token punctuation\">:</span> <span class=\"token string\">'subTree2'</span><span class=\"token punctuation\">,</span>\n      children<span class=\"token punctuation\">:</span> <span class=\"token punctuation\">[</span><span class=\"token operator\">...</span><span class=\"token punctuation\">]</span>           \n    <span class=\"token punctuation\">}</span>\n  <span class=\"token punctuation\">]</span>\n<span class=\"token punctuation\">}</span><span class=\"token punctuation\">;</span>\n\ntreeGraph<span class=\"token punctuation\">.</span><span class=\"token function\">updateChild</span><span class=\"token punctuation\">(</span>data<span class=\"token punctuation\">,</span> <span class=\"token string\">'root'</span><span class=\"token punctuation\">)</span></code></pre></div>","position":{"start":{"line":231,"column":1,"offset":8014},"end":{"line":247,"column":4,"offset":8243},"indent":[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]}},{"type":"heading","depth":3,"children":[{"type":"link","url":"#removechildid","title":null,"children":[],"data":{"hProperties":{"aria-label":"removechildid permalink","class":"anchor"},"hChildren":[{"type":"raw","value":"<svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg>"}]}},{"type":"text","value":"removeChild(id)","position":{"start":{"line":250,"column":5,"offset":8250},"end":{"line":250,"column":20,"offset":8265},"indent":[]}}],"position":{"start":{"line":250,"column":1,"offset":8246},"end":{"line":250,"column":20,"offset":8265},"indent":[]},"data":{"id":"removechildid","htmlAttributes":{"id":"removechildid"},"hProperties":{"id":"removechildid"}}},{"type":"paragraph","children":[{"type":"text","value":"删除指定的子树。","position":{"start":{"line":251,"column":1,"offset":8266},"end":{"line":251,"column":9,"offset":8274},"indent":[]}}],"position":{"start":{"line":251,"column":1,"offset":8266},"end":{"line":251,"column":9,"offset":8274},"indent":[]}},{"type":"paragraph","children":[{"type":"strong","children":[{"type":"text","value":"参数","position":{"start":{"line":254,"column":3,"offset":8279},"end":{"line":254,"column":5,"offset":8281},"indent":[]}}],"position":{"start":{"line":254,"column":1,"offset":8277},"end":{"line":254,"column":7,"offset":8283},"indent":[]}},{"type":"text","value":"\n| 名称 | 类型 | 是否必选 | 描述 |\n| --- | --- | --- | --- |\n| id | string | true | 要删除的子树的ID |","position":{"start":{"line":254,"column":7,"offset":8283},"end":{"line":257,"column":35,"offset":8368},"indent":[1,1,1]}}],"position":{"start":{"line":254,"column":1,"offset":8277},"end":{"line":257,"column":35,"offset":8368},"indent":[1,1,1]}},{"type":"paragraph","children":[{"type":"strong","children":[{"type":"text","value":"用法","position":{"start":{"line":260,"column":3,"offset":8373},"end":{"line":260,"column":5,"offset":8375},"indent":[]}}],"position":{"start":{"line":260,"column":1,"offset":8371},"end":{"line":260,"column":7,"offset":8377},"indent":[]}}],"position":{"start":{"line":260,"column":1,"offset":8371},"end":{"line":260,"column":7,"offset":8377},"indent":[]}},{"type":"html","lang":"javascript","meta":null,"value":"<div class=\"gatsby-highlight\" data-language=\"javascript\"><pre class=\"language-javascript\"><code class=\"language-javascript\">treeGraph<span class=\"token punctuation\">.</span><span class=\"token function\">removeChild</span><span class=\"token punctuation\">(</span><span class=\"token string\">'sub'</span><span class=\"token punctuation\">)</span><span class=\"token punctuation\">;</span>\n</code></pre></div>","position":{"start":{"line":261,"column":1,"offset":8378},"end":{"line":263,"column":4,"offset":8424},"indent":[1,1]}},{"type":"heading","depth":2,"children":[{"type":"link","url":"#布局","title":null,"children":[],"data":{"hProperties":{"aria-label":"布局 permalink","class":"anchor"},"hChildren":[{"type":"raw","value":"<svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg>"}]}},{"type":"text","value":"布局","position":{"start":{"line":266,"column":4,"offset":8430},"end":{"line":266,"column":6,"offset":8432},"indent":[]}}],"position":{"start":{"line":266,"column":1,"offset":8427},"end":{"line":266,"column":6,"offset":8432},"indent":[]},"data":{"id":"布局","htmlAttributes":{"id":"布局"},"hProperties":{"id":"布局"}}},{"type":"heading","depth":3,"children":[{"type":"link","url":"#changelayoutlayout","title":null,"children":[],"data":{"hProperties":{"aria-label":"changelayoutlayout permalink","class":"anchor"},"hChildren":[{"type":"raw","value":"<svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg>"}]}},{"type":"text","value":"changeLayout(layout)","position":{"start":{"line":268,"column":5,"offset":8438},"end":{"line":268,"column":25,"offset":8458},"indent":[]}}],"position":{"start":{"line":268,"column":1,"offset":8434},"end":{"line":268,"column":25,"offset":8458},"indent":[]},"data":{"id":"changelayoutlayout","htmlAttributes":{"id":"changelayoutlayout"},"hProperties":{"id":"changelayoutlayout"}}},{"type":"paragraph","children":[{"type":"text","value":"更改并应用指定的布局。","position":{"start":{"line":269,"column":1,"offset":8459},"end":{"line":269,"column":12,"offset":8470},"indent":[]}}],"position":{"start":{"line":269,"column":1,"offset":8459},"end":{"line":269,"column":12,"offset":8470},"indent":[]}},{"type":"paragraph","children":[{"type":"strong","children":[{"type":"text","value":"参数","position":{"start":{"line":272,"column":3,"offset":8475},"end":{"line":272,"column":5,"offset":8477},"indent":[]}}],"position":{"start":{"line":272,"column":1,"offset":8473},"end":{"line":272,"column":7,"offset":8479},"indent":[]}},{"type":"text","value":"\n| 名称 | 类型 | 是否必选 | 描述 |\n| --- | --- | --- | --- |\n| layout | object | false | 指定的布局配置,如不传,则不做变更 |","position":{"start":{"line":272,"column":7,"offset":8479},"end":{"line":275,"column":48,"offset":8577},"indent":[1,1,1]}}],"position":{"start":{"line":272,"column":1,"offset":8473},"end":{"line":275,"column":48,"offset":8577},"indent":[1,1,1]}},{"type":"paragraph","children":[{"type":"strong","children":[{"type":"text","value":"用法","position":{"start":{"line":278,"column":3,"offset":8582},"end":{"line":278,"column":5,"offset":8584},"indent":[]}}],"position":{"start":{"line":278,"column":1,"offset":8580},"end":{"line":278,"column":7,"offset":8586},"indent":[]}}],"position":{"start":{"line":278,"column":1,"offset":8580},"end":{"line":278,"column":7,"offset":8586},"indent":[]}},{"type":"html","lang":"javascript","meta":null,"value":"<div class=\"gatsby-highlight\" data-language=\"javascript\"><pre class=\"language-javascript\"><code class=\"language-javascript\"><span class=\"token keyword\">const</span> layout <span class=\"token operator\">=</span> <span class=\"token punctuation\">{</span>\n  type<span class=\"token punctuation\">:</span> <span class=\"token string\">'mindmap'</span><span class=\"token punctuation\">,</span>\n  dirction<span class=\"token punctuation\">:</span> <span class=\"token string\">'H'</span><span class=\"token punctuation\">,</span>\n  <span class=\"token function-variable function\">getSubTreeSep</span><span class=\"token punctuation\">:</span> <span class=\"token punctuation\">(</span><span class=\"token punctuation\">)</span> <span class=\"token operator\">=></span> <span class=\"token number\">20</span><span class=\"token punctuation\">,</span>\n  <span class=\"token function-variable function\">getVGap</span><span class=\"token punctuation\">:</span> <span class=\"token punctuation\">(</span><span class=\"token punctuation\">)</span> <span class=\"token operator\">=></span> <span class=\"token number\">25</span><span class=\"token punctuation\">,</span>\n  <span class=\"token function-variable function\">getHeight</span><span class=\"token punctuation\">:</span> <span class=\"token punctuation\">(</span><span class=\"token punctuation\">)</span> <span class=\"token operator\">=></span> <span class=\"token number\">30</span><span class=\"token punctuation\">,</span>\n  <span class=\"token function-variable function\">getWidth</span><span class=\"token punctuation\">:</span> <span class=\"token punctuation\">(</span><span class=\"token punctuation\">)</span> <span class=\"token operator\">=></span> <span class=\"token number\">30</span><span class=\"token punctuation\">,</span>\n<span class=\"token punctuation\">}</span><span class=\"token punctuation\">;</span>\ntreeGraph<span class=\"token punctuation\">.</span><span class=\"token function\">changeLayout</span><span class=\"token punctuation\">(</span>layout<span class=\"token punctuation\">)</span><span class=\"token punctuation\">;</span>\n</code></pre></div>","position":{"start":{"line":279,"column":1,"offset":8587},"end":{"line":289,"column":4,"offset":8781},"indent":[1,1,1,1,1,1,1,1,1,1]}},{"type":"heading","depth":3,"children":[{"type":"link","url":"#refreshlayoutfitview","title":null,"children":[],"data":{"hProperties":{"aria-label":"refreshlayoutfitview permalink","class":"anchor"},"hChildren":[{"type":"raw","value":"<svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg>"}]}},{"type":"text","value":"refreshLayout(fitView)","position":{"start":{"line":292,"column":5,"offset":8788},"end":{"line":292,"column":27,"offset":8810},"indent":[]}}],"position":{"start":{"line":292,"column":1,"offset":8784},"end":{"line":292,"column":27,"offset":8810},"indent":[]},"data":{"id":"refreshlayoutfitview","htmlAttributes":{"id":"refreshlayoutfitview"},"hProperties":{"id":"refreshlayoutfitview"}}},{"type":"paragraph","children":[{"type":"text","value":"数据变更后,重新布局,刷新视图,并更新到画布。","position":{"start":{"line":293,"column":1,"offset":8811},"end":{"line":293,"column":24,"offset":8834},"indent":[]}}],"position":{"start":{"line":293,"column":1,"offset":8811},"end":{"line":293,"column":24,"offset":8834},"indent":[]}},{"type":"paragraph","children":[{"type":"strong","children":[{"type":"text","value":"参数","position":{"start":{"line":296,"column":3,"offset":8839},"end":{"line":296,"column":5,"offset":8841},"indent":[]}}],"position":{"start":{"line":296,"column":1,"offset":8837},"end":{"line":296,"column":7,"offset":8843},"indent":[]}},{"type":"text","value":"\n| 名称 | 类型 | 是否必选 | 描述 |\n| --- | --- | --- | --- |\n| fitView | boolean | false | 更新布局后,是否需要自适应窗口 |","position":{"start":{"line":296,"column":7,"offset":8843},"end":{"line":299,"column":48,"offset":8941},"indent":[1,1,1]}}],"position":{"start":{"line":296,"column":1,"offset":8837},"end":{"line":299,"column":48,"offset":8941},"indent":[1,1,1]}},{"type":"paragraph","children":[{"type":"strong","children":[{"type":"text","value":"用法","position":{"start":{"line":302,"column":3,"offset":8946},"end":{"line":302,"column":5,"offset":8948},"indent":[]}}],"position":{"start":{"line":302,"column":1,"offset":8944},"end":{"line":302,"column":7,"offset":8950},"indent":[]}}],"position":{"start":{"line":302,"column":1,"offset":8944},"end":{"line":302,"column":7,"offset":8950},"indent":[]}},{"type":"html","lang":"javascript","meta":null,"value":"<div class=\"gatsby-highlight\" data-language=\"javascript\"><pre class=\"language-javascript\"><code class=\"language-javascript\">treeGraph<span class=\"token punctuation\">.</span><span class=\"token function\">refreshLayout</span><span class=\"token punctuation\">(</span><span class=\"token boolean\">true</span><span class=\"token punctuation\">)</span><span class=\"token punctuation\">;</span>\n</code></pre></div>","position":{"start":{"line":303,"column":1,"offset":8951},"end":{"line":305,"column":4,"offset":8998},"indent":[1,1]}},{"type":"heading","depth":2,"children":[{"type":"link","url":"#查找","title":null,"children":[],"data":{"hProperties":{"aria-label":"查找 permalink","class":"anchor"},"hChildren":[{"type":"raw","value":"<svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg>"}]}},{"type":"text","value":"查找","position":{"start":{"line":308,"column":4,"offset":9004},"end":{"line":308,"column":6,"offset":9006},"indent":[]}}],"position":{"start":{"line":308,"column":1,"offset":9001},"end":{"line":308,"column":6,"offset":9006},"indent":[]},"data":{"id":"查找","htmlAttributes":{"id":"查找"},"hProperties":{"id":"查找"}}},{"type":"heading","depth":3,"children":[{"type":"link","url":"#finddatabyidid-target","title":null,"children":[],"data":{"hProperties":{"aria-label":"finddatabyidid target permalink","class":"anchor"},"hChildren":[{"type":"raw","value":"<svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg>"}]}},{"type":"text","value":"findDataById(id, target)","position":{"start":{"line":310,"column":5,"offset":9012},"end":{"line":310,"column":29,"offset":9036},"indent":[]}}],"position":{"start":{"line":310,"column":1,"offset":9008},"end":{"line":310,"column":29,"offset":9036},"indent":[]},"data":{"id":"finddatabyidid-target","htmlAttributes":{"id":"finddatabyidid-target"},"hProperties":{"id":"finddatabyidid-target"}}},{"type":"paragraph","children":[{"type":"text","value":"根据指定的ID获取对应的源数据。","position":{"start":{"line":311,"column":1,"offset":9037},"end":{"line":311,"column":17,"offset":9053},"indent":[]}}],"position":{"start":{"line":311,"column":1,"offset":9037},"end":{"line":311,"column":17,"offset":9053},"indent":[]}},{"type":"paragraph","children":[{"type":"strong","children":[{"type":"text","value":"参数","position":{"start":{"line":314,"column":3,"offset":9058},"end":{"line":314,"column":5,"offset":9060},"indent":[]}}],"position":{"start":{"line":314,"column":1,"offset":9056},"end":{"line":314,"column":7,"offset":9062},"indent":[]}},{"type":"text","value":"\n| 名称 | 类型 | 是否必选 | 描述 |\n| --- | --- | --- | --- |\n| id | string | true | 指定的元素ID |\n| target | object | false | 从指定的节点开始查找,为空时从根节点开始查找 |","position":{"start":{"line":314,"column":7,"offset":9062},"end":{"line":318,"column":53,"offset":9198},"indent":[1,1,1,1]}}],"position":{"start":{"line":314,"column":1,"offset":9056},"end":{"line":318,"column":53,"offset":9198},"indent":[1,1,1,1]}},{"type":"paragraph","children":[{"type":"strong","children":[{"type":"text","value":"返回值","position":{"start":{"line":321,"column":3,"offset":9203},"end":{"line":321,"column":6,"offset":9206},"indent":[]}}],"position":{"start":{"line":321,"column":1,"offset":9201},"end":{"line":321,"column":8,"offset":9208},"indent":[]}}],"position":{"start":{"line":321,"column":1,"offset":9201},"end":{"line":321,"column":8,"offset":9208},"indent":[]}},{"type":"list","ordered":false,"start":null,"spread":false,"children":[{"type":"listItem","spread":false,"checked":null,"children":[{"type":"paragraph","children":[{"type":"text","value":"返回值类型:object;","position":{"start":{"line":323,"column":3,"offset":9212},"end":{"line":323,"column":16,"offset":9225},"indent":[]}}],"position":{"start":{"line":323,"column":3,"offset":9212},"end":{"line":323,"column":16,"offset":9225},"indent":[]}}],"position":{"start":{"line":323,"column":1,"offset":9210},"end":{"line":323,"column":16,"offset":9225},"indent":[]}},{"type":"listItem","spread":false,"checked":null,"children":[{"type":"paragraph","children":[{"type":"text","value":"返回值为查找到的节点的源数据。","position":{"start":{"line":324,"column":3,"offset":9228},"end":{"line":324,"column":18,"offset":9243},"indent":[]}}],"position":{"start":{"line":324,"column":3,"offset":9228},"end":{"line":324,"column":18,"offset":9243},"indent":[]}}],"position":{"start":{"line":324,"column":1,"offset":9226},"end":{"line":324,"column":18,"offset":9243},"indent":[]}}],"position":{"start":{"line":323,"column":1,"offset":9210},"end":{"line":324,"column":18,"offset":9243},"indent":[1]}},{"type":"paragraph","children":[{"type":"strong","children":[{"type":"text","value":"用法","position":{"start":{"line":327,"column":3,"offset":9248},"end":{"line":327,"column":5,"offset":9250},"indent":[]}}],"position":{"start":{"line":327,"column":1,"offset":9246},"end":{"line":327,"column":7,"offset":9252},"indent":[]}}],"position":{"start":{"line":327,"column":1,"offset":9246},"end":{"line":327,"column":7,"offset":9252},"indent":[]}},{"type":"html","lang":"javascript","meta":null,"value":"<div class=\"gatsby-highlight\" data-language=\"javascript\"><pre class=\"language-javascript\"><code class=\"language-javascript\"><span class=\"token keyword\">const</span> target <span class=\"token operator\">=</span> <span class=\"token punctuation\">{</span>\n\tid<span class=\"token punctuation\">:</span> <span class=\"token string\">'sub1'</span><span class=\"token punctuation\">,</span>\n  children<span class=\"token punctuation\">:</span> <span class=\"token punctuation\">[</span><span class=\"token operator\">...</span><span class=\"token punctuation\">]</span>\n<span class=\"token punctuation\">}</span>\n\n<span class=\"token comment\">// 从target节点开始查找sub1.1节点</span>\n<span class=\"token keyword\">const</span> subData <span class=\"token operator\">=</span> treeGraph<span class=\"token punctuation\">.</span><span class=\"token function\">findDataById</span><span class=\"token punctuation\">(</span><span class=\"token string\">'sub1.1'</span><span class=\"token punctuation\">,</span> target<span class=\"token punctuation\">)</span>\n  \n<span class=\"token comment\">// 从根节点开始查找sub1.1节点</span>\n<span class=\"token keyword\">const</span> subData <span class=\"token operator\">=</span> treeGraph<span class=\"token punctuation\">.</span><span class=\"token function\">findDataById</span><span class=\"token punctuation\">(</span><span class=\"token string\">'sub1.1'</span><span class=\"token punctuation\">)</span></code></pre></div>","position":{"start":{"line":328,"column":1,"offset":9253},"end":{"line":339,"column":4,"offset":9475},"indent":[1,1,1,1,1,1,1,1,1,1,1]}}],"position":{"start":{"line":1,"column":1,"offset":0},"end":{"line":340,"column":1,"offset":9476}}}}