hierarchy
hierarchy copied to clipboard
Layout algorithms for visualizing hierarchical data.
**当根据是不是根节点或节点的层级,来设置不同的横向间距时** 结果左侧的间距不对,右侧的间距正确 Demo : 在官方g6的示例基础上, getHGap 中,根据是否根节点返回不同间距 改写下面这一行 ``` getHGap: (node) => { return node.id === '0' ? 200 : 60; }, ``` Demo: [https://stackblitz.com/edit/react-rre1us?file=index.js](https://stackblitz.com/edit/react-rre1us?file=index.js)
import Hierarchy from '@antv/hierarchy' 会报:Cannot find module '@antv/hierarchy' or its corresponding type declarations.ts(2307) 直接访问官方例子就会报: https://codesandbox.io/s/vp6tk?file=/index.ts:51-90
如下图所示,在第 3 列中绿色卡片与白色卡片并未相交, 但由于第 5 列太宽了,绿色卡片就与白色卡片间出现了间隙。 我 fork 了你的代码,demo 中是造好的数据,你可以下载下来快速查看。[链接点我](https://github.com/huyaocode/hierarchy) 希望得到您的帮助,谢谢! 
## Beep boop. Your images are optimized! Your image file size has been reduced by **42%** 🎉 Details | File | Before | After | Percent reduction | |:--|:--|:--|:--| |...
* **Link**: https://github.com/bolasblack/data-set/tree/fix/transform-hierarchy-node-traverse-bug * **Platform**: macOS * **Mini Showcase(like screenshots)**: 你好,今天在看 G2 的文档的时候发现 https://antv.alipay.com/zh-cn/g2/3.x/demo/other/tree-compact-box.html 这个页面的示例代码出错了,似乎一共是两处错误 1. `DataSet.View#getAllNodes` 里调用了 `Node#each` ,但其实应该是 `Node#eachNode` 2. 第 75 行代码尝试读取 `item.point.hasChildren` ,但似乎 API 已经发生变化了,应该是 `item.hasChildren`...
#16 紧凑树计算位置出错 新增 `forceCompact` 配置,开启后可以强制对子树位置进行计算以解决父节点被子节点撑开的问题
修复indented布局, direction为H且dropCap为false时,左侧第一个节点不对齐问题
``` js const result = Hierarchy.mindmap(data, { direction: 'LR', getHeight(d: node) { return d?.height; }, getWidth(d: node) { return d?.width; }, getHGap() { return 40; }, // 父节点与子节点之间的垂直间距 getVGap(d: MindMapData)...
**使用Hierarchy.compactBox函数,在dev模式下运行正常,在production模式下会报错:`TypeError: Cannot read properties of null (reading 'index')`** > **发生错误的函数为内部函数,似乎是未作非空判断,** - 操作系统:windows11 - "@antv/hierarchy": "^0.6.11" - "vue": "^3.4.19" - "vite": "^5.1.4"  