51

Is there a free (as in "cheers"), linux-compatible, interactive visual editor for graphviz or other graphs? aptitude seems to be drawing a blank.

edit: "cheers" means both "beer" and "speech". meta-edit: I guess it should be "free as in beach".

edit 2: Maybe a suitable svg editor would be a more realistic goal. I basically want something that can be used to conveniently create a collection of labeled shapes and lines which connect them. Actually it would probably make more theoretical sense to extract the graph from this data, since it includes both semantic data (the graph) and presentation data (the way it's arranged on the screen, the colours used, etc). Is there a way to lay out labeled shapes conveniently with inkscape or some other free vector graphics editor? I really need rearranging of the nodes, and (re)flowing of the text in them, to happen with maximum convenience.

I've also realized that this is really a superuser question. I was going to repost it over there when I found an existing question that seems likely to provide me with an answer: dia.

edit 3: dia seems useful except that it doesn't seem to be possible to get the textual contents of node objects to wrap in any useful manner (ie any way other than by inserting manual line breaks). This is kind of a dealbreaker, since it screws most of the convenience factor that's my incentive to do things this way rather than with a text editor or a pen and paper. But it supports some sort of event model and Python-based scripting, so I'm going to dig around a bit and see if I can use python to wrap the text in response to content changes. Unless one of you lovely people has a better idea..? Basically I want to have the option to explicitly set the node size via GUI interaction, and have the contents wrap and rescale (within a certain range of font sizes) to fit it. Rich text would be pretty useful.

In other words, this is actually a valid SO question at this point, since it appears to require coding.

Community
  • 1
  • 1
intuited
  • 23,174
  • 7
  • 66
  • 88

2 Answers2

60

To save time those eager to try existing programs handling DOT graphs:

  • dotty can display DOT graphs and with little luck you can move its nodes with a mouse, nothing more, and you can easily segfault as a bonus (I tried latest stable graphviz)
  • lefty is only a special-purpose language interpreter used by dotty, nothing to look at
  • KGraphEditor is an empty wishful project (a QT window and a few buttons)
  • gvedit is not really a graph editor: it provides a simple text editor and you hit F5 to run a layout tool and open a picture; you can actually get more functionality from configuring your own favourite text editor
  • grappa is an abandoned java applet, which I failed to run
  • interestingly, dia can export to DOT ("PyDia DOT Export"), but due to its buggy printing, you have to post-process the files to use them
  • graphedit can read in DOT a graph and you can move its nodes around and change their colors
  • Eclipse people started working on DOT support in GEF4, so it can display DOT graphs
  • GraphUI has a very interesting demonstration video, but beware: although it might seem that the graph is being created by clicking and dragging, in reality all editing happens through the keyboard, using shortcuts. On the plus side, contextual instructions are always available showing which shortcuts do what.
  • DotEditor claims a tree editor, modifying node attributes/color/shape with mouse.

The graph editors mentioned in other answers, yEd (a Java application) and JointJS/Rappid (a JaveScript thing) apparently have nothing to do with DOT (tried both).

I believe there exist no working DOT-handling graph editor out there at all.

ThorSummoner
  • 16,657
  • 15
  • 135
  • 147
Dawid Toton
  • 767
  • 5
  • 8
  • 1
    Thanks for that list; just wanted to add that `dotty` is the GUI that uses `dot` as an engine, so you cannot actually fix node positions there; you can fix node positions in `neato` (http://stackoverflow.com/a/5344221/277826) but then the same GUI like `dotty` that uses `neato` instead is called `lneato`. – sdaau Jun 23 '14 at 01:36
  • 2
    No, there is one such editor: **TINTFU**, http://tintfu.sourceforge.net/ . It is WYSIWUG editor for dot files. The .dot output file is not that nice though, but still... – t7ko Mar 26 '15 at 18:55
  • Very basic dot graph editing can be done with [ocamlgraph-editor](http://packages.ubuntu.com/trusty/ocamlgraph-editor). – thomie Mar 27 '15 at 21:46
  • 3
    @t7ko TINTFU is definitely not "one such editor". You don't manipulate the graph directly; instead, you have to click buttons that open dialogs where you need to fill up the properties that *then* build the graph. For instance, to link two nodes, you have to click the "edge" button, then manually type the names of the source and target nodes you want to connect (no auto-complete) and then click the ok button (simply pressing Enter doesn't work). That's certainly not what I'd call "visual editing of a DOT graph". – waldyrious Mar 30 '15 at 21:04
  • @waldyrious well, you didn't say you want "mouse-only" editor. TINTFU is WYSIWYG _graph editor_, you don't edit .dot source code, you edit a graph. It is able to load and save graphs in _DOT format_. It is _working_. I thought this will perfectly match your specification as it is stated in your original answer (see last sentence). Anyway. It's not perfect, but it's still something for those who don't want to go to .dot source editing. – t7ko Apr 02 '15 at 20:06
  • 2
    @t7ko I didn't mean to sound harsh or dismissive, just to provide a heads-up for those who, like I did, might not realize at first how TINTFU works. I honestly don't see much difference between specifying the graph properties as text in a document or as text in a GUI widget, apart form perhaps having the syntax handled for you automatically. As I see it, the main issue is not about using mouse only (you use the mouse to click the buttons in TINTFU anyway), but about manipulating the graph directly, rather than a text (or property-list) representation of it. – waldyrious Apr 03 '15 at 21:52
  • I found another option after trying the above alternatives which all failed to solve my problem: I often want to remove nodes and edges to create subsets of my graphs for publication. The solution is to export the graph to PDF `dot -Tpdf ingraph.dot -o outgraph.pdf`, then open with `LibreOffice Draw` and remove all the nodes and edges, then export to `outgraph_small.pdf`, then `pdfcrop outgraph_small.pdf`. You can even modify colors, texts etc. It might get a little sketchy if you change too much, though. – Radio Controlled Oct 28 '19 at 12:37
  • 2
    yEd Live supports importing of dot files since 2020, and it works very neat! https://www.yworks.com/yed-live/ – Willem Jun 18 '20 at 19:26
  • Actually dotty works here on debian buster compiled from graphviz 2.44.1 quite well. It is still an old X window app but actually the only one I've testing which allows to edit/add/remove nodes and edges. And it operates on dot files. Documentation is at http://graphviz.org/pdf/dottyguide.pdf. – t-b Oct 24 '20 at 17:53
  • As an alternative, if you are okay with editing the dot source code and immediately seeing the resulting graph, I can highly recommend the **Graphvizer** plugin for **Sublime Text 3**, see https://packagecontrol.io/packages/Graphvizer. – Johan Jan 27 '21 at 08:10
  • 2
    I know this answer is old, but virtually all of these programs either don't work, are abandoned or are unusually bad. – Cerin Jun 15 '21 at 23:28
-9

JointJS is a Javascript graph editing library based on Backbone : http://www.jointjs.com/

The author also provides Rappid, an online graph editor which might suit your needs, I don't know about dot files import though.

thodg
  • 1,773
  • 15
  • 24
  • 6
    "One Rappid license per single developer. Priced at €1500 each license ", and you "don't know about dot files import though"?! Downvote. At best this might have been a comment. An answer should be more than a link and should explain ***how*** it answers the question – Mawg says reinstate Monica Jan 03 '18 at 10:09