What would be a reasonable way to bring the diagrams to a frontend and make them interactive? Not in the sense of editing the diagrams but rather attaching onClick handlers to nodes, or displaying metadata when hovering over a node or edge?
interactive tooltips are a wip, but to the larger point, D2 has a plugin system which enables extensions like this (https://github.com/terrastruct/d2/pull/91). there's still some fleshing out to do with the API, but once it's up, it should be a straightforward plugin for custom handlers.
To further elaborate, the output is an SVG so you can embed it into your DOM and then add make it interactive like any other part of the DOM. Though until we set each svg node's ID to its D2 ID, you'll have to add event handlers by selecting on value.