I have two sets of data one for upstream and one for downstream. Both upstream and downstream have same master node of John.
Upstream data
var upstreamData = [
{ name: "John", parent: "" },
{ name: "Ann", parent: "John" },
{ name: "Adam", parent: "John" },
{ name: "Chris", parent: "John" },
{ name: "Tina", parent: "Ann" },
{ name: "Sam", parent: "Ann" },
{ name: "Rock", parent: "Chris" },
{ name: "will", parent: "Chris" },
{ name: "Nathan", parent: "Adam" },
{ name: "Roger", parent: "Tina" },
{ name: "Dena", parent: "Tina" },
{ name: "Jim", parent: "Dena" },
{ name: "Liza", parent: "Nathan" }
];
Downstream data
var downstreamData = [
{ name: "John", parent: "" },
{ name: "Kat", parent: "John" },
{ name: "Amily", parent: "John" },
{ name: "Summer", parent: "John" },
{ name: "Loki", parent: "Kat" },
{ name: "Liam", parent: "Kat" },
{ name: "Tom", parent: "Amily" }
];
I am able to represent upstream data to the right side of the master node using d3 hierarchy and d3 tree, below is the image
How do I represent downstream data to left side of master node John, so that I can see both upstream and downstream data of john at once in same graph?
Below is the link to my codesandbox
https://codesandbox.io/s/d3-practice-forked-y69kkw?file=/src/index.js
Thanks in advance!