Snowflake

A simple hierarchical data layout system. Originally intended for mind maps. Here’s my work mind map:

This is what I was working on at the end of last year. I was told to post about this when I started blogging in January. Better late than never!

The goal was to have a mind map program that allowed for simple and efficient input, with all the layout decisions to be taken automatically based on simple rules. There is very limited layout configurability: you can specify the of a node’s children (clockwise), and you can specify the hue of a node, which will be inherited (with some mutation) by its children. In the above example, the node being edited (towards the top, in the centre) has its hue set to 0 (which is red in the HSV colour space).

After about one day of work with wxPython, it had reached this state:

As I recall, I made that demo before I implemented the ability to save. The huge (and whimsical rather than authoritative) taxonomy tree had to be input anew.

Nodes are drawn in a hierarchically radial pattern. Depending on the input data, the results can be quite symmetric. Hence the name “Snowflake”. Here’s an early layout:

Current features and bugs

  • Scrolling, zooming and recentering.
  • Quick insertion of nodes; type INSERT then a sequence of strings, and each will become a child of the current node.
  • Editing of node text and attributes. The one supported attribute is hue.
  • Automatic text wrapping (though not perfect; it’s supposed to try to fit the text into an approximate square, circle would be better but even the square is a bit challenging).
  • Cut, copy and paste. The copy format is plain text, with indentation to show hierarchy. This is pretty useful for moving data to and from documents.
  • Pivot and set root commands. Pivot swaps a node with its parent.
  • Undo and redo (with a small bug around the set root operation).
  • Import from FreeMind mind maps (using regular expressions to parse XML, ick!).
  • An About box. ;)

Ideas for future work

  • The last major enhancement I had begun was an orthoganal layout mode. I lost the work on this but I’ve been gradually reconstructing it. It requires significant refactoring the layout algorithm.
  • Additional formatting options.
  • Ability to add non-tree links between nodes. I have no idea how these will be laid out.
  • Import and export from other formats, such as GraphViz‘s dot format.
  • URLs and images in nodes.
  • Improved text wrapping algorithm. Donald Knuth built (part of) his reputation on highly aesthetic text layout and kerning; I hacked mine together in a couple of days and it shows.
  • Improved layout algorithm, particularly reducing the amount of white space. Nodes are currently aggregated into bounding spheres, and these are packed at each level. Packing across multiple levels could reduce the amount of space.
  • A search function.

There’s no downloadable package yet, but the source is on my project hosting site. There is also a list of open issues; I mention it mostly as additional reading. Once again, I make no promises about when I’ll address any of them.

Advertisements
This entry was posted in Programming and tagged , , . Bookmark the permalink.

One Response to Snowflake

  1. Pingback: Project summary | EJRH

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s