現在、私はd3プロジェクトに取り組んでいます。階層ツリーをマップして、人々とその責任者を表示しようとしています。基本的に私はユーザーAとユーザーBができ、それぞれ同じ人物の責任を負うことができます。ノード間のD3ツリー/階層関係のデータ
現在、私はデータを繰り返すビジュアライゼーションを構築するJSONデータでこれを強調するには、2人以上の人が同じ人物に責任を負うときにデータを繰り返したり同じデータポイントを使用しないでください。ここで
は私JSfiddle例です
あなたはレイモンドReddington &ドナルドResslerが自分responsibilitesの一部の間で交差持っていることをここに表示されます、私は、非効率的と思われるデータを繰り返していますがありより良い方法は、ここで私のJSONです。
[
{
"name" : "Company Name",
"parent" : null,
"children": [
{
"name" : "Raymond Reddington",
"parent" : "Cherry Tree Lodge",
"children" : [
{
"name" : "Debe Zuma",
"parent" : "Raymond Reddington",
},
{
"name" : "Tom Keen",
"parent" : "Raymond Reddington",
},
{
"name" : "Aram Mojtabai",
"parent" : "Raymond Reddington",
}
]
},
{
"name" : "Elizabeth Keen",
"parent" : "Cherry Tree Lodge",
"children" : [
{
"name" : "Samar Navabi",
"parent" : "Elizabeth Keen",
},
{
"name" : "Meera Malik",
"parent" : "Elizabeth Keen",
},
{
"name" : "Mr. Kaplan",
"parent" : "Elizabeth Keen",
},
{
"name" : "Reven Wright",
"parent" : "Elizabeth Keen",
}
]
},
{
"name" : "Donald Ressler",
"parent" : "Cherry Tree Lodge",
"children" : [
{
"name" : "Matius Solomon",
"parent" : "Donald Ressler",
"size" : 3938
},
{
"name" : "Peter Kotsiopulos",
"parent" : "Donal Ressler",
"size" : 3938
},
{
"name" : "Tom Keen",
"parent" : "Raymond Reddington",
"size" : 3938
},
{
"name" : "Aram Mojtabai",
"parent" : "Raymond Reddington",
"size" : 3938
}
]
},
{
"name" : "Harold Cooper",
"parent" : "Cherry Tree Lodge",
"children" : [
{
"name" : "Samar Navabi",
"parent" : "Elizabeth Keen",
"size" : 3938
},
{
"name" : "Meera Malik",
"parent" : "Elizabeth Keen",
"size" : 3938
}
]
}
]
}
]
上記のId配列はより効率的に処理できますが、アイデアを得ることができます –