8

I'd like to programmatically generate a draw.io map diagram from nested XML/JSON exported from Zotero (individual items nested in sub-collections and collections).

I already have the basic JSON/XML, which can be adapted to draw.io's format, but I'm not clear how. There seems to be no schema for the app's diagram format, and the source XML of existing diagrams includes a lot of style and layout information that I want to avoid having to calculate -- I am assuming, given that the Layout option in the app is automatic, that there must be a way to automatically render a diagram without having to include manually-specified style/layout info.

So I have three questions:

  1. Is there a standard XML/JSON scheme for hierarchical draw.io map diagrams?
  2. Is it possible to give draw.io just the relationship info between elements, and have it determine the layout automatically (akin to the automatic Arrange > Layout options within the app)?
  3. Within a draw.io map, can a node be connected to more than one parent?
melat0nin
  • 860
  • 1
  • 16
  • 37
  • 2
    Try CSV import instead, https://about.draw.io/automatically-create-draw-io-diagrams-from-csv-files/ , https://about.draw.io/import-from-csv-to-drawio/ – Frodo Baggins Sep 26 '19 at 21:18
  • 1
    Hi @melat0nin have you managed to find solution? I am also woke up with idea of automatically generating XML files and then sending them to draw.io to get it rendered. Looking for best solution for this idea ... – Almazini Oct 08 '19 at 09:00

2 Answers2

3

I've created a converter from json to drawio format. It does not work with nested collections now, but it may help anyway. https://github.com/Voravomas/drawio_diagram_converter

1

How about this VS Code extension? https://github.com/hediet/vscode-drawio

ottobar
  • 4,301
  • 1
  • 21
  • 15