Skip to content
New issue

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

获得数据对象是不是应该更方便一点 #19

Closed
ShikiRyougi opened this issue Jun 14, 2017 · 2 comments
Closed

获得数据对象是不是应该更方便一点 #19

ShikiRyougi opened this issue Jun 14, 2017 · 2 comments

Comments

@ShikiRyougi
Copy link

ShikiRyougi commented Jun 14, 2017

graph.edge().color(dim, fun) 边颜色映射
graph.edge().size(dim, fun) 边大小映射
graph.edge().shape(dim, fun) 边形状映射
graph.edge().label(dim, fun) 边文本映射
graph.edge().style(dim, fun) 样式映射
graph.edge().tooltip(dim, fun) 提示信息映射

这一系列方法 参数是否应该直接是(edge) => {} ?node()同理,为什么不直接把对象暴露出来呢?

@TomHuangCN
Copy link
Contributor

这个是历史原因,g6 最初延用了 g2 的映射方式。g2 里传 dim 是为了能做自动的legend(图例)等。现在看来 g6 里可能不会做自动的导引元素。所以 dim 变得没有必要。后面会加上 (edge) => {} 这样的方式,预计 1.1 版本上、七月初实现。

@TomHuangCN
Copy link
Contributor

已经可以使用直接传入回调函数的使用方式

daniele-pini pushed a commit to daniele-pini/G6 that referenced this issue Oct 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants