Graph view : a network visualization script for DT

As a followup to the ideas and prototypes thrown in Node Graph for Document Links, I finally took a bit of time to code something a bit more decent.

A script that takes the current selection of items in DT and generates a graph viz out of it.

Stay tuned to this thread for occasional updates, and don’t hesitate to ask questions.


A few snapshots

And zoomed in:

1 Like

Very interesting and obviously an immense amount of work

Can you clarify where the index.htm file and the sigma library go? I put them all in the Script directory but that was probably not correct because it froze at the “Preparing GraphView” stage with only a few items.

Keep it all together, because the applescript refers relatively to the index.html, which also refers relatively to the sigma.js files.

You’re right, I get the same freeze when launching from the menu.
Can’t find an immediate fix.
Try launching the script from outside DT (like double-clicking on it).

Double-clicking it opens Script Editor

Running it from there gives me an error - I think because it cannot identify which items I have selected in DT3


So sorry for the troubles.
Does it open the html file in DT before you see this error? and how if opened: tab in current window or a new window.

Not a trouble at all - this is a huge effort for you to have done

It did not open the html file last time

At present it is not even getting as far as the first time - it does not respond at all

Perhaps related - Chrome for some reason will not let me “Open with” any html file at all, though Safari will. Does the html file open in my default browser (Chrome) or in the DT3 browser (a version of Safari)?

I have realized the script had several bugs when running from within DT (ak from DT script menu).

The new version (please re-download) now works smoothly on my machine, when either run from DT, Script Editor or Script Debugger.

To your question, it opens a browser window within DT itself, and not in safari nor chrome.

A picture to better express the behaviour you may expect:

Well it does run from externally now - which is good because then I can abort the script without shutting down DT3 if desired

I only get half-way or so into the processing and then it stops

My apologies if I am doing something wrong


How many items?
If you run it from script editor, do you see any bug reported?

I do not see bugs

Just a small number of items - a dozen or less

I now cleanup potential faulty params, key escapings that would get wiped at compile time and weird chars. Hope it works better now. Re-download.
If it still does not work, I won’t be able to help you without having identify the culprit:

  • try with a single item selected
  • try putting some display alert ("all good til here") to identify the faulty line in the block that starts at line 90.

When I select just one or two the script completes with no error - nor with any graph output.

I face such an error from time to time, it looks like a race condition, like JS injected before page fully ready. Generally when I rerun the script, this disappears. I couldn’t dedicate enough time to fix that bug yet, it would probably mean generating the graph differently: embedding all the data and logic in one html which then gets opened.

1 Like

@benoit.pointet thank you for what looks like an important contribution.

I had to install the RegexAndStuffLib script library from this source; probably worth clarifying in the script documentation.

With the aforementioned script installed, I’m reproducing @rkaplan’s error: no errors, no graph output.

Rerunning the script, as you suggest, does not address the issue.

@macula @rkaplan

I just fixed (again) a bug that prevented it from running smoothly when launched from DT script menu item. Re-download.

Were it still not to display the graph (even after a re-run), please help me debug at-a-distance by uncommenting the following line and sending me in a PM the whole text that pops up in the alert box:
-- display alert (theJSONData)

thanks for your help.

PM sent

Many thanks for all your efforts

@benoit.pointet sending PM. Thank you.