问题描述
我想在此示例的基础上实现一个基本的sankey图:
在这种情况下我想永远保持A在顶部。
有关如何做的任何想法?
同样的问题:
您可以修改此函数:
函数中心(节点){
return node.y + node.dy / 2;
}
就像这样:
函数中心(节点){
return 0;
}
,然后修改ascendingDepth的函数,如下所示:
函数ascendingDepth(a,b){
return by - ay;
}
我在另一个问题中发现了这个问题
如何在d3 sankey插件中强制一个分支的y位置? / a>
I'm trying to achieve a basic sankey diagram building on top of this example: http://bl.ocks.org/d3noob/c9b90689c1438f57d649
By default they get sorted by value. I want to customize the vertical order of the nodes. Here is an example:
In this case I'd like to always keep "A" on top.
Any thoughts on how to do that?
Similar question: D3 sankey diagram - enforce node position
You can modify this function:
function center(node) {
return node.y + node.dy / 2;
}
like this:
function center(node) {
return 0;
}
and after modify ascendingDepth's function like this:
function ascendingDepth(a, b) {
return b.y - a.y;
}
I found this in another questionHow to force y position of one branch in d3 sankey plugin?
这篇关于垂直排序的节点在D3中的Sankey图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!