We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
你好,今天在看 G2 的文档的时候发现 https://antv.alipay.com/zh-cn/g2/3.x/demo/other/tree-compact-box.html 这个页面的示例代码出错了,似乎一共是两处错误
DataSet.View#getAllNodes
Node#each
Node#eachNode
item.point.hasChildren
item.hasChildren
想要修复第一个问题时,一开始以为是 data-set 这个库的代码有问题,但在我 fork 并修改了 data-set 这个仓库的代码后,单元测试报错说没有 eachNode 这个方法,于是我打印了一下 Node 的原型的属性:
data-set
eachNode
Node
https://github.com/bolasblack/data-set/blob/b32d2f5e27f315d599fe6065db98c9047c2948c1/test/unit/api/hierarchy-spec.js#L12
结果是
真的有 each 但没有 eachNode
each
我检查了很久没有找到原因,只发现在 node_modules/@antv/hierarchy/lib/layout/ 中对比 src/layout/ 多出了一个 node.js 文件,里面确实有 each 方法没有 eachNode 方法
node_modules/@antv/hierarchy/lib/layout/
src/layout/
node.js
但是在我尝试重新生成 lib 目录,并且删除 build 和 dist 目录后,依旧存在这个问题
我实在没辙了,只好发一个 issue ……
如果你们有空的话可以顺便修一下上面提到的文档里的代码,如果优先级不高的话也可以等我把这个问题解决我再提一个 PR 更新一下上面的文档……
The text was updated successfully, but these errors were encountered:
No branches or pull requests
你好,今天在看 G2 的文档的时候发现 https://antv.alipay.com/zh-cn/g2/3.x/demo/other/tree-compact-box.html 这个页面的示例代码出错了,似乎一共是两处错误
DataSet.View#getAllNodes
里调用了Node#each
,但其实应该是Node#eachNode
item.point.hasChildren
,但似乎 API 已经发生变化了,应该是item.hasChildren
想要修复第一个问题时,一开始以为是 data-set 这个库的代码有问题,但在我 fork 并修改了
data-set
这个仓库的代码后,单元测试报错说没有eachNode
这个方法,于是我打印了一下Node
的原型的属性:https://github.com/bolasblack/data-set/blob/b32d2f5e27f315d599fe6065db98c9047c2948c1/test/unit/api/hierarchy-spec.js#L12
结果是
真的有
each
但没有eachNode
我检查了很久没有找到原因,只发现在
node_modules/@antv/hierarchy/lib/layout/
中对比src/layout/
多出了一个node.js
文件,里面确实有each
方法没有eachNode
方法但是在我尝试重新生成 lib 目录,并且删除 build 和 dist 目录后,依旧存在这个问题
我实在没辙了,只好发一个 issue ……
如果你们有空的话可以顺便修一下上面提到的文档里的代码,如果优先级不高的话也可以等我把这个问题解决我再提一个 PR 更新一下上面的文档……
The text was updated successfully, but these errors were encountered: