Upstream and downstream dependencies

I have a main entity represented by a node which has a number of dependencies (downstream) it depends on, as well as a number of node entities (upstream) that depend on it.

I would like to generate a graph with the main entity in the center, the upstream nodes on the left-hand side with arrow links pointing to it, and the downstream nodes on the right-hand side with arrow links from the main node pointing to these nodes.

How can I do this?

Have a look at the Notebook Visualizer:

There are several other variants that are worth exploring as well: Search "notebook visualizer" | Observable

I am not familiar with the visualizer. How can I convert it to usable code that I can import into my application?

My bad, I misread your question.

Assuming you want something to generate an SVG for you, I would recommend to look into Mermaid or Viz.js. If you need more control, you could take a look at ELK instead which only generates the layout data.

I am using D3.js so would just want to have the example code, please.