In my opinion, d3.js excels at presenting data (hence its name "data driven documents"), but it may not be the best choice for developing an editor that allows users to "generate data from visualizations/documents, which would be "cdv.js" ;-) ).
D3.js lacks a robust graph model and is capable of interpreting various types of data to generate visual representations, however implementing interactive features like modifying or creating data elements (such as flow chart components) would require starting from scratch.
Instead, I recommend exploring tools that offer advanced diagram editing capabilities. Several options are mentioned in the responses to this particular question.
By using more advanced tools like those listed, you can create intricate diagram editors such as this example. These tools come equipped with built-in graph editing functionalities rather than solely focusing on graph visualization.
You could potentially build upon d3.js to achieve similar results, however d3.js primarily aids in visualization rather than enhancing interactivity.