GraphEd: A graph editor for Leo

graphed.png

Installation

graphed.py and the Gato package are now in the Leo CVS and will be included in future Leo versions.

Enable the plugin, but adding it ("graphed.py") in the enabled plugins node in your (my)LeoSettings?.leo file.

Credits

The graphical editor is a slightly altered version of the one in the Gato graph algorithm visualization package at http://gato.sf.net/

horse

To do

Fix some minor bugs - multiple commanders? Make node labels editable after creation. Maybe provide access to the body text in the graph editor.

Usage

If installed successfully the plugin should add a 'Graph' submenu to the Outline menu. The submenu includes the following entries:

Edit node as graph

Opens the graph editor interface with the selected tree loaded. Nodes that have never been placed end up piled up in the top left corner. If the graph is a simple tree at this point you can get a more useful initial layout using the graph editor's Extras->Tree Layout command. The other layouts will work with cyclic graphs as well, but they tend to spread the nodes out more than may be convenient.

When you use this command Leo asks if you wish to 'Split labels with spaces', the default 'yes' will result in node labels containing spaces being displayed on multiple lines in the graph editor.

Edit the graph as you wish with the editor. When you're done use either File->Quit or just close the window. Leo will ask if you want to load the changes you made back into the tree. "No" abandons the changes. "Cancel" does nothing (graph editor remains open). "Yes" renames the old top-level graph node "OLD: whatever" and creates a new tree containing the edited graph. It will have the same name as the original node, unless there are multiple top level nodes, in which case it will be called "NEW: graph top level".

  • currently the node titles can only be entered at creation, changing them has to be done in Leo's tree-view. This will change soon.
  • nodes in the graph which are clones will be copies, not clones, after editing.
  • currently uAs are lost during editing, this will change soon.

@graph nodes

If a node's title contains '@graph', this indicates that the node is a graph container, and the node itself doesn't appear in the graph editor view. This is useful for graphs without a single top level node.

Export to Graphviz dot format

Save the graph in Graphviz .dot format for rendering or further processing.

Graphviz lives at http://www.graphviz.org/

Make Graphviz dot node

As above but create a node and place the text in it.

Color support

If you use the cleo Leo plugin to change the background colors of nodes in the Leo tree-view of a graph, these colors will appear in both the graph editor view and in graphviz dot export.