Get the full source code of the d3-sankey example

If you’re looking at the source code for the notebook https://api.observablehq.com/@d3/sankey-diagram.js you will see that it’s not minified. But if you’re looking at the source code for the runtime https://cdn.jsdelivr.net/npm/@observablehq/runtime@4/dist/runtime.js, then you’re right, it’s minified.

The code coming from the notebook needs the runtime to run all the fancy reactivity and data flow. You can use the runtime inside your vue application and take control of your observable code. This is the best example for that case https://observablehq.com/@observablehq/how-to-embed-a-notebook-in-a-react-app, it’s using react as an example but hopefully it can give you an idea.

If you’re looking into convert the code from Observable to vanilla js, then look at other threads here Yet another attempt to go from Observable to VanillaJS

2 Likes