Does anyone know what nx…

1 minute read

Does anyone know what nx uses to draw the dep graph?

Responses:

What npm package? Or is it custom?

dagreD3 - I don’t see it in the package.json

https://github.com/nrwl/nx/blob/master/packages/workspace/src/core/dep-graph/dep-graph.js

here’s the code that references it

dagre does the calculation of laying out the nodes and links

d3 does the drawing of the svgs

Thanks! That reminds me then there is an html page that uses dagreD3 cdn to render it?

I recently made a PR to generate html page with the dep graph, it was merged but I don’t think it’s been released yet

https://github.com/nrwl/nx/pull/3049

It’s been released already in the beta release, which you can get if you install @next but might be unstable

Doesnt nx dep-graph serve an html page today?

Ah you are saying one of the output formats will be html?

yes :slightly_smiling_face: at the moment you can only run it locally as a server essentially, this update allows you to output what you need to for example deploy the dependency graph somewhere

Thanks - That might play well into what I am planning on doing. We have many “micro services” and other apps that wont ever be migrated into the nx repo (java) but I would like to start generating an overarching dependency graph for all of our repos. So what I was planning on doing was adding a simple manually maintained dependency json file that list the dependencies of that specific micro service then build a tool that crawls all the repos in our bitbucket and if it has a file with dependencies listed it will add it to the dependency graph. Just an idea at this point.

Updated: