Adding a D3.js figure in your document could not be simpler: open the figure dropdown that shows on hover below any text block and click on Interactive Figure.
A popup opens. Insert in the text box the HTML source code for your diagram, and click on the submit button when it’s ready. Done! Your d3.js should now magically appear, as in the figure below (click inside the image to play with it).
Note: for security reasons, you have to include all your data and CSS in the JS file or load it from URLs on https. Also- please load all d3 and related resources from CDNs on secure sites (https), such as