UNPKG

@antv/g6

Version:

graph visualization frame work

1 lines 2.54 kB
{"expireTime":9007200828541859000,"key":"transformer-remark-markdown-html-fce4a4bd875a9a549012b69b375ea250-gatsby-remark-prettiergatsby-remark-prismjsgatsby-remark-external-linksgatsby-remark-autolink-headersgatsby-remark-reading-time-","val":"<p>深度相同的节点将会被放置在同一层,与 compactBox 不同的是,布局不会考虑节点的大小。\n<br />\n<img src='https://gw.alipayobjects.com/mdn/rms_f8c6a0/afts/img/A*J1l5RofvbP0AAAAAAAAAAABkARQnAQ' alt='mindmap' width='250'/></p>\n<h2 id=\"使用指南\"><a href=\"#%E4%BD%BF%E7%94%A8%E6%8C%87%E5%8D%97\" aria-label=\"使用指南 permalink\" class=\"anchor\"><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></a>使用指南</h2>\n<p>脑图树适用于展示树结构数据,配合 TreeGraph 使用。如下面代码所示,可在实例化 TreeGraph 时使用该布局。除此之外,还可以如<a href=\"https://www.yuque.com/antv/g6/qopkkg#eYZc6\" target=\"_self\" rel=\"nofollow\">子图布局</a>所示单独使用布局。</p>\n<p>该布局有以下配置项,Function 类型的配置项可以为不同的元素配置不同的值。具体描述请查看相关教程。</p>\n<ul>\n<li><strong>direction</strong>:\nString 类型,树的布局方向。可选值有:'H':根节点的子节点分成两部分横向放置在根节点左右两侧 ,如代码演示 1 | 'V':将根节点的所有孩子纵向排列。</li>\n<li><strong>getWidth</strong>:\nNumber | Function 类型,每个节点的宽度。</li>\n<li><strong>getHeight</strong>:\nNumber | Function 类型,每个节点的高度。</li>\n<li><strong>getHGap</strong>:\nNumber | Function 类型,每个节点的水平间隙。</li>\n<li><strong>getVGap</strong>:\nNumber | Function 类型,每个节点的垂直间隙。</li>\n<li><strong>getSide</strong>:\nFunction 类型,节点排布在根节点的左侧/右侧。若设置了该值,则所有节点会在根节点同一侧,即 direction = 'H' 不再起效。若该参数为回调函数,则可以指定每一个节点在根节点的左/右侧。如代码演示 2、3、4。</li>\n</ul>"}