将画笔选择添加到Sankey中的节点

时间:2018-12-26 08:56:09

标签: d3.js brush sankey-diagram

我有兴趣为Sankey图添加画笔驱动的多节点选择事件。

<p id="chart"></p>
<script>
var ddata = {
    "nodes": [
{"node": 0,"name": "M1 Collected"}, 
{"node": 1,"name": "M1 Expenses"}, 
{"node": 2,"name": "M1 Profit"}, 
{"node": 3,"name": "M2 Collected"}, 
{"node": 4,"name": "M2 Expenses"}, 
{"node": 5,"name": "M2 Profit"}, 
{"node": 6,"name": "M3 Collected"}, 
{"node": 7,"name": "M3 Expenses"}, 
{"node": 8,"name": "M3 Profit"},
{"node": 9,"name": "Total Profit"},    
{"node": 10,"name": "Company"},
{"node": 11,"name": "Bonus"},    
],
    "links": [
{"source": 0,"target": 1,"value": 80}, 
{"source": 0,"target": 2,"value": 4},
{"source": 3, "target": 4, "value": 80},
{"source": 3, "target": 5, "value": -1},
{"source": 6, "target": 7, "value": 80},
{"source": 6, "target": 8, "value": 12},
{"source": 2, "target": 9, "value": 4},
{"source": 5, "target": 9, "value": -1},    
{"source": 8, "target": 9, "value": 9},
{"source": 9, "target": 10, "value": 6},
{"source": 9, "target": 11, "value": 6},    
]};
</script>

可以在以下位置找到相同的JSfiddle: https://jsfiddle.net/pajtai/sxd1u00h/

问题陈述: 拖动画笔需要为所有选定节点调用基于悬停的链接高亮显示

我在哪里卡住? 无法理解在哪里调用画笔调用,我知道这是第一步

0 个答案:

没有答案