new DependencyDiagram({
title: 'model dependencies',
nodes: [
{ name: 'User', group: 'core' }, { name: 'Post', group: 'content' },
{ name: 'Comment', group: 'content' }, { name: 'Tag', group: 'content' },
],
edges: [
{ from: 'Post', to: 'User', label: 'authorId' },
{ from: 'Comment', to: 'Post', label: 'postId' },
{ from: 'Comment', to: 'User', label: 'authorId' },
],
}).generate()scripts/build-diagram-examples.mjs, not a picture of it.generate() returns the SVG as a string; save(path) writes it straight todiagram.save('docs/schema.svg');