174 comments

[ 3.1 ms ] story [ 229 ms ] thread
Sounds sort of like OmniOutliner with plugins.
OmniOutliner is commercial; only for OSX; and a GUI, not a CLI. Just to mention _some_ weaknesses.
Another big limitation with Omni - it doesn't have a mode where it can just operate on and save to graphviz format. It's screaming out for this. Omni could be the editor of choice for graphviz. Instead they have gone down the route of allowing you to import what you want, but then you have to save it in their opaque format.
What about Workflowy (https://workflowy.com/)?
It seems like a good product, but it doesn't fit my requirements because (1) it doesn't support plugins to specialize its functionality to particular domains and (2) its reliance on the mouse looks like it would make it far too inefficient for the kind of work I would like to do.

It's an interesting project, though, I'll try to check it out and see what I can learn from it.

Not sure about plugins, but adding keyboard shortcuts shouldn't be hard, via a browser extension for example.

I use workflowy everyday and it's really cool; it doesn't feel very actively developed though, and that's a shame.

(comment deleted)
Workflowy has keyboard shortcuts for pretty much everything. I've been using it for about 6 months now and I swear by it.

Workflowy is an enlighteningly simple app (it's really just bullet lists with zooming) but it's incredibly effective for what it does, and the free-form nature of it makes it easy to just brain-dump random notes to get your thoughts out into text. I use it to do rubber ducking [1], because just the act of putting my problem into text helps me organize my thoughts. I can't say enough good things about it.

[1] http://c2.com/cgi/wiki?RubberDucking

you don't need a mouse, everything has keyboard shortcuts. hit ctrl-? for a list.
Also, try their search and hashtags: just brilliant!
There aren't even any screenshots. I have to sign up to even see what the thing looks like..

so I have no idea.

Check out my app - https://zetabee.com/text/

There's a screenshot and a live demo. Workflowy is more advanced and capable. I made my app solely to note down everything. I have been using it for 4 solid years now and it has helped me organize my life.

I am deeply fond of keyboard-driven browser-based outliner Checkvist (see description and screenshot at https://checkvist.com/auth/help). It's similar to Workflowy, and quite featureful. Like Workflowy, you can "zoom in" to a branch and only view it and it's children, which is very helpful when editing complicated outlines.
Hm... I've been quite happy using an Open Source tool called FreeMind. It seems to be a "tree editor", although I'm not sure it quite satisfies what this author is looking for.

Screenshot: http://freemind.sourceforge.net/wiki/index.php/File:FreeMind...

Website: http://freemind.sourceforge.net/wiki/index.php/Main_Page

Yeah, outliners and mindmappers provide a lot of this functionality although, alas, not all, which would certainly be nice.
Are any of them scriptable to the point where we could add our own desired functionality? Python preferred for me, but I'd learn another language if the app was compelling.
This is certainly an important point. There seems to be more potential in mind mapping software than I thought, but extensibility is key.
In the comments in the article somebody mentioned this:

http://strlen.com/treesheets/

Looks really cool. I always felt spreadsheets were too grid-oriented and flow charts too much about vectors and nodes. Treesheets looks like a great mashup of those two.

I agree. It also seems quite suited for keyboard navgation and editing. It has a linux version and the tutorial is very well made.
Just found TreeSheets in the comments too, really cool and handy.
Are you kidding? We have excellent tools to edit and manage trees: touch, mkdir, cd, mv, ... :)
Why the joking punctuation? With userspace filesystems it is easy to expose any tree like data as a filesystem. In fact, a while ago I made a (still readonly) filesystem for my browser bookmarks.

As long as I am on the topic of this, you know that you are in under explored territory where the first man page you visit for debugging your first non-trivial problem starts with "This is not the function you are interested in." (man getdents).

Heck why don't we have an xml editor, with syntax checking through a schema? This has been possible for a decade.
If you're not joking (and it is April 1), you seriously should check out nxml-mode for emacs. It has amazing support for RelaxNG based schema (the compact syntax).
I'm looking for more of a forms editor, that generates xml and guides editing with an xml schema. So no I don't want to edit xml; I want to edit data records, configuration file entries etc with a schema-driven editor.
We do. Have a google. Some are also mentioned in the comments. All major business tools have them (e.g. XMLSpy) - just not unix/lisp/hacker tools. May be why you haven't heard of them.
DOT/GraphViz [1] is very powerful. You might find it a bit unwieldy at first but, as with everything, editing in plain text is often faster than trying to use a GUI.

For extremely simple stuff, you can use TGF [2] to represent the graph and something like yEd [3] to view it.

None of these tools have any real provision for structured proofs etc., but that could be built.

[1] http://www.graphviz.org/Documentation/dotguide.pdf

[2] http://docs.yworks.com/yfiles/doc/developers-guide/tgf.html

[3] http://www.yworks.com/en/products_yed_about.html

I've seen DOT/GraphViz before, but I think its complexity put me off a bit. I'll give it another shot.

The other tools have promise as well.

It's not that complex, actually. Here's how the basic usage works: you have a text file containing something like this for an undirected graph --

graph graphname { a -- b -- c; b -- d; }

-- or like this for a directed graph (the -> arrows show you which direction the links are going):

digraph graphname { a -> b -> c; b -> d; }

You can break up that first line into a -> b and b -> c and get the same graph if you want. It's not necessary here but it is when you have lots of outgoing links from the same node.

The other things you can type in are basically formatting options for the various utilities. You then feed these text files to various command line tools to do things like get a PNG of your graph:

dot -Tpng my_text_file.dot -o my_graph_image.png

That's it. The rest is just playing with it to get what you want.

Ah, well, that doesn't look so bad. I'll have to play around with it. Thanks.
Yeah, it's more the size of it that comes off as imposing at first. I was able to find a decent tutorial when I had to use it and went through the very basic usage of "make a graph and get a PNG with a few formatting options" but there's a lot more available if you have need of it.
Yeah, +1 for Graphviz. Has worked well for me in the past.
I've made "proof graphs" with GraphViz, but honestly it was something of a challenge to make them look how I wanted them to. Compared to the time I spent drawing the graph on paper, (ie, collecting the statements and theorems), making the GraphViz version look okay took a long time.

http://www.naftaliharris.com/blog/mc-graph/

http://www.naftaliharris.com/blog/mg-graph/

Those graphs are good examples of what I want to be able to make. You bring up a critically important point, though: I must be able to write graphs very quickly, easily, and painlessly, like I use vim to write text or Trello for to-do lists. Most tree-editing interfaces are painfully inefficient and slow to use (and are far too reliant on the mouse).
Touch screens might help.
Agreed. When I read this article my first thought was, "What about dot"?

It can get complex, but the basic syntax is as simple as what this article suggests.

To be clear, the syntax I suggested in the article is what I want it to look like, not what I want to type in. It takes far too long to type most of those (except the lisp-style one).

I would like to be able to add nodes as easily as I add cards in Trello.

dude, it's called http://nestgrid.org. Add and rearrange nodes to your heart's content, in a beautiful ui resembling text editor or an IDE.
I wrote an iOS app around Graphviz called http://instaviz.com, you can create fairly sophisticated DOT files with shape sketching and linking and without delving into the underlying DOT language.
Because we don't have a commonly-accepted tree file format, so an editor has nothing to edit.
but we do: basic emacs org-mode file format is simple, intuitive, text-based and human-readable.
I don't think that qualifies as "commonly-accepted". It's not a bad format (for trees -- it doesn't look like it generalizes to DAGs or graphs), but a standard format might be helpful.
XML is a commonly-accepted tree file format.
XML is a meta-format.
Well, yeah, true. But all formats that are XML still fit my statement.
Yes thank you for down voting, what's incorrect about my statement?
I didn't downvote you, and I believe your comment was correct.
Fargo is quite nice http://fargo.io/
Is there a way to play with this without using Dropbox?
Some others have already mentioned that "mind mapping" software is similar, and I'd agree -- just see this image[2]. That image was created with Mindnode[1], which I really like (I've only tried the light version, but that seems to be discontinued).

[1]: https://mindnode.com/assets/images/screens/iphone-1-1136x640...

[2]: https://mindnode.com/

I'd never really seriously considered mind mapping software, and while I still don't think it's exactly what I want, it actually seems to have more potential than it seemed. Thanks for the suggestion.
For tree data you may want to look into various XML designers / editors. You can easily define a recursive XSL style sheet that has the structure you want, after that there are various editors that automatically read that structure and give you a GUI from it. It's been a few years but I found XMLSpy to be fairly decent. http://www.altova.com/xmlspy.html

Edit: The simplest tree editor is probably the file system on your computer. However, the problem is for proof's I suspect your going to want to have some sort of graph structure.

PS: If your willing to do some light coding XQuery/XSL-FO let's you transform the raw XML into various more user friendly formats like PDF's. However, if your structure is really nested that quickly get's hard for people to understand.

The issue with a lot of mind-mapping software is that the data must be strictly hierarchical. Sometimes when brainstorming you want to represent data with cross-links or in multiple categories, which is where something like Graphviz, Instaviz, Omnigraffle or Visio come in.
Mind-mapping is useful, though I've yet to find a tool I really like and can use 1) intuitively and 2) for very large models.

Online, there's Text2MindMap[1] which is quick and easy to use, and offers a rubber-band like ability to reposition nodes, but in my experience, once past a couple of hundred nodes (I do some fairly large maps) performance gets really laggy, especially if you've got an otherwise populated Chrome session running.

Offline, there's the FreeMind[2] tool, Java based. My main problem with it is that editing is incredibly fussy.

What I prefer mostly is GraphViz[3], which is not just a mind-mapping tool, but can be used as such. The advantage here is that what you're editing is a simple text file, with graphic output created by running one of the graphviz commands over it (dot, neato, twopi, circo, fdp, sfdp). For a traditional mind map, the 'circo' command is probably what you're looking for. While not as interactive as other methods, if you're working on a complex space, the lack of constant overhead for graphical presentation is a plus, as is the simplicity of the base language. What I'm still looking to do is to write a simple outline -> GraphViz converter which sets up edges based on indent levels and parent, which would further simplify the input problem.

________________________________

Notes:

1. http://text2mindmap.com/

2. https://help.ubuntu.com/community/Freemind

3. http://graphviz.org/

I use freemind which is excellent. You sail through your input, the defaults are very well optimized.
There's also treesheets. It's a nested table editor, but the tables can also be rendered as mind maps. My description doesn't really do it justice, but it's pretty cool.

http://strlen.com/treesheets/

You might like Flying Logic (flyinglogic.com) .
The author's examples -- proofs and ASTs -- provide a hint at the reason.

If you need a tree, it's most likely that you want some custom operations on that tree (e.g. parsing text into the tree, pretty-printing the tree, traversing the tree in various ways, etc.)

At some point, the tree is just a data structure and what you're interested in are full-blown, non-trivial algorithms/programs for fairly domain-specific tasks. In these cases, a library (or even custom implementation) for a general purpose programming language is more useful than a tool (a la Excel or vim).

Viewed in this light, it's not unsurprising that we have many domain-specific tools for manipulating trees. Most of the proof assistants have a GUI based on Gentzen-style sequents.

LaTeX has styles for type setting proofs which look like the ASCII ones in the article.

Tools for generating parsers often have tree-based UI's.

And so on.

You're right that most of the time we need non-trivial algorithms or visualizations for trees for it to be useful. If I ignored that it would be like wishing for a "general binary editor" because it would be so "powerful" and all data can be represented as binary.

I think, though, that there's enough common ground between the various domain-specific tree editors that some kind of useful intersection exists. Then the domain-specific tree editors would simply be plugins.

Perhaps the "killer app" is an extensible GUI framework with some sensible defaults already implemented (e.g. those mimicking some of the design dimensions explored by the software mentioned in other posts), combined with a scripting language and/or a suite of good libraries/apis for popular languages.

At any rate, thanks for provoking the discussion.

Yeah, I guess that's essentially the ideal.
can't believe nobody has mentioned org-mode yet.
Yes! Amazing for managing trees!
I think org-mode is a much better fit for what the author is looking for than mind-mapping programs, not least because org files can be literate programs.
Why did I have to scroll so far down for this! I was starting to think I was going to have to write "can't believe nobody has mentioned org-mode yet." myself.

Org-mode (and outliners in general) are tree editors. If they support links then they are graph editors.

I use org-mode a lot. I didn't think it's the tree editor the author want.
Yep. I use org-mode every day. I think it's because most emacs users have gotten tired of typing "Yeah, emacs does that. Has done for a few decades now. And if it isn't precisely what you're looking for, here are a dozen ways you can customize the behaviour before you even get into hacking elisp." Most of us are in "whatever, if they haven't gotten it by now, I'm not going to try to make them" mode. I just wish there was a config setting in HN to filter out the "look! yet another new editor for programmers" spam on the front page.
Another project related to the one propossed in this article is a diff-diff3-patch like program suite that can be used on trees. It would fit in a great way with version control systems and make them (more) aware of structural changes in changesets.

Imagine being able to dump plain-text files for real trees when diffing-merging. The way differences are shown to the user could be like a project i did a few years ago to show differences in graphs (applied to basic-blocks graphs). Here is the link: http://corelabs.coresecurity.com/index.php?module=Wiki&actio...

This would be wonderful. Certainly a prerequisite for any serious programming.
I have used yEd for a few years to do simple mind mapping with graphs. Not the best solution, but it works.
It seems like he (or someone) could quickly code up a javascript demo of what he wants using D3.js. Maybe this is my excuse to learn D3.
Speaking of which, I'm waiting for someone to create a good mindmapping app using D3.js =]
When I learned about D3.js this was exactly what I wanted to use it for. Unfortunately, I've mostly avoided web development, so my javascript isn't good enough to quickly code anything up. You're right, though, this could be a good excuse to learn it.

(by the way, I love your blog)

ty

Graph layout algorithms have come to mind for a topic on my blog from time to time. It's a woefully underdeveloped field, and it could be good blog fodder...

My favorite casual text editor is this one [1]. So likewise I imagine a graph editing program that's very simple and one could use it anywhere. Say you click and that creates a new node and a text area pops up for you to type things in. Then you can create a new node, drag to form an edge, etc. The only thing is that I imagine I'd hate working around the force-guided graph layout algorithms the entire time, cause stuff would keep bouncing around. I'd want to be able to drag and drop nodes to move them away momentarily, zoom in and out and pan to focus my attention on some small part of the graph, and then toggle the layout algorithm to snap things back into place.

Everything would be stored locally in the DOM (or, say, in the url), so you could bookmark and share easily, and import/export to JSON or edge-list representations. And... yeah that's about it. I can't imagine wanting colors or styling, but if the design is simple enough you could have plugins for that (and plugins for layout algorithms, etc). I also can't imagine how one would do text navigation on nodes of large degree... Even if you did come up with a system, it would necessarily depend on the graphical layout decisions (which change dynamically) and that would require you to tie the graph data structure to its geometric interpretation, which smells like spaghetti design to me.

It's something to think about. If your ideas are along similar lines, I'd be happy to team up and start a github repo. I just can't commit to working on it all that often.

[1]: data:text/html, <textarea style="font-size: 1.5em; width: 100%; height: 100%; border: none; outline: none; font-family:monospace" autofocus /> (copy and paste this as a url)

EDIT: I suppose if you really wanted a keyboard-based system you could have a text representation of the graph (as a vertex list + edge list) and have the graph update in real time. When you make changes in one side the changes automatically update in the other side. Then you could use keyboard or mouse however you see fit.

Frontier has been reborn. Dave Winer's outline editor is now GPLed and runs in a browser: http://scripting.com/2013/09/16/concordOurGplOutliner

There's a forked version that can save to the local filesystem here: https://github.com/interstar/OWL

This needs to be upvoted to the top, as this is the best possible answer to OP's question — with an open-source implementation!
I wonder if this good be a Getting things Done tool. You'd probably need multiple of those trees and a way to put simple, wiki-like multiline articles (maybe markdown syntax?). I'd use something like that!
You can do that with Fargo.io. Concord out of the box appears to just hold a single outline.
Well, if you're okay with XML there's Microsoft's XML Notepad. It's xsd-aware so you get type-safe constrained tree editing. But it's ms, XML, and xsd...that's like 3 strikes.
There's one for JQueryUi I've used and been pleased with, but damned if I can remember it now
Well mathematically we represent trees with matrices. So anything that can edit tabular data can edit trees.
Do we? That's only one possible implementation, and not a very efficient one for most uses.
Efficient in what sense? Computationally and storage wise it is the most efficient.
But not very human-readable and therefore it is inadequate for editing.
that isn't true. there are tradeoffs between using an adjacency matrix, and other representations. different operations will be more efficient on different representations.

and in the special case of extremely sparse graphs like trees, the adjacency matrix isn't going to win very often.

your copy of CLRS should discuss all of this. and for practical uses of non-adjacency matrix representations of trees, you can take a look at every functional programming language, ever.

You can represent trees with matrices. You can also represent trees with bits. What we want is a representation that is both easy to read and easy to write.
It's been a few years since I've played with it, but Leo[1] seems like it might be what the author is looking for. It's even scriptable (in Python). Looks like it is actively maintained[2].

http://leoeditor.com/

https://github.com/leo-editor/leo-editor

I was just about to write that... I barely know it but it seems it can be summed up as a hybrid of mind mapping [1] and literate programming [2], with a graph data model [3].

[1] http://leoeditor.com/tutorial-basics.html#selecting-and-movi... [2] http://leoeditor.com/tutorial-programming.html [3] http://leoeditor.com/tutorial-pim.html#clones

It's status somewhat resembles Org Mode: it has its own format (which hasn't caught on as interchange format) but has sufficient manipulation and export power to allow some people to spend their life inside it.

---

The second thing that spings to mind is YAML which is usually used for trees but the actual data model allows graphs. Is there any structured YAML editor (a-la paredit)?