Blobs
a diagram editor in Haskell
Blobs is a diagram editor for directed graphs. It is written in
Haskell, using the platform-independent GUI toolkit wxHaskell. It is a
community project at a fairly early stage of development - you are
encouraged to get involved and improve it!
Blobs is a front-end for drawing and editing graph diagrams.
You must add your own back-end engine if you want it to
do some analysis or processing of the graph. There are
various analysis engines that use Blobs as a front-end, e.g.
- Dazzle for bayesian analysis
of networks;
- FPTC for safety analysis of systems designs;
- INBlobs for
editing and interpreting Interaction Nets;
but these are not currently available as open source. We do supply a
couple of very simple engines, just to demonstrate how to connect the
engine up to Blobs.
What can Blobs do?
- Draw nodes with textual labels, and optional extra (polymorphic)
information labels.
- Connect nodes together with edges. An edge has optional extra
information labels.
- You can create palettes of different node shapes, and load a
palette into the editor. (Currently, palette creation is by
hand, not graphical.)
- Graphs are stored in an XML file format.
- If you have a backend engine, you can send the graph to it for
analysis, receiving a graph back for viewing as a result.
Because Blobs does not do anything much useful on its own, there is no
released version of Blobs. Individual projects which share Blobs as a
component have their own separate releases.
To use Blobs in your own project, you must collect a copy of the
darcs repository.
darcs get http://www.cs.york.ac.uk/fp/darcs/Blobs
The source tree and version history can be browsed on-line through
darcsweb.
Copyright: © 2005 the authors and contributors.
Blobs was originally written by Arjan van IJzendoorn and Martijn
Schrage of the Universiteit Utrecht. Other contributors include
Malcolm Wallace. Full details are in the COPYRIGHT file.
License: This software is distributed under
the terms of the LGPL (see file LICENCE-LGPL
for more details), but there is a special exception clause detailed in
file COPYRIGHT.
This software comes with no warranty. Use at your own risk.
Building instructions
To build Blobs, you need:
- ghc-6.2.2
(Note 6.4 may work, untested)
- wxWidgets
- wxHaskell-0.9.0
(or later?)
- HaXml-1.15
(Note, this unstable version or later is required.)
On Windows you may also need to install
mingw in order to have the GNU make
utility etc.
In the toplevel Blobs directory, there is a Makefile. You may need to
edit it slightly, e.g. for a different version of ghc, or to
enable/disable building a MacOS application bundle (symbol MAC=yes).
Just type 'make' and Blobs should build. If you change or add any
imports in the code itself, you may need to 'make depend' to update the
Makefile.
Usage instructions
- Right click on the canvas, nodes, and edges for context menus.
- To create a node, shift click on some blank canvas.
- To create an edge, select (click) the source node then shift-click
the target node.
- To delete a node or edge, select it and press backspace.
- To rearrange the diagram, click and drag nodes to where you want them.
- To make an edge look tidier, add a control-point from its context menu,
and drag the point to where you want it.
- You can add multiple items into the current selection by meta-clicking
the extra nodes and control points. (Meta = Apple key, or Alt key.)
A multiple selection can be dragged just like a single selection.
Step one: join the
Blobs mailing list.
Step two: darcs send your patches to the list.
Discussion about features is encouraged before you implement them.
Patches to create or improve documentation (including this webpage) are
just as welcome as actual code.
To Do list
- More than one analysis method. Currently, there is a class
Analysis with the methods analysis and
revert. But this means there can only ever be one
implementation of analysis for a given graph type. The class
should be replaced with a concrete datatype containing a lookup
table of analysis methods. Then the Edit menu can show as many or
as few analyses as are available.
Done, MW, 2005-11-16. The GraphOps datatype
(in module Operations) replaces the Analysis class. There is a new
"Operations" menu.
- Multiple selection. The ability to group multiple nodes
together, by selecting a rectangular area of the diagram. They can
then be dragged or deleted together. (Should also select any edge
control-points within the area.)
Partially done, MW, 2005-11-16. Implemented
multiple selection with meta-click. But dragging a rectangular
area (to select everything within it) remains to be done.
Nearly complete, MW, 2005-11-17.
Dragging a rectangular area now selects everything within it.
The rectangular area itself is not yet highlighted, just the
contained items.
Complete, MW, 2005-11-18.
Multiple selection by dragging out a rectangle now displays the
rectangle as well as the selected items.
- Positioning guides. Apple Keynote has the best diagram
layout editor I have ever come across. When one object lines up
horizontally or vertically with any other object on the diagram a
yellow line appears connecting up their centres. (It disappears
again once you drop the object). This simple idea makes it
incredibly easy to get things looking just right, without any need
for absolute coords or grids etc. I think the objects also "snap"
to the line when the mouse is within one or two pixels of the
alignment.
- Visible palette. At the moment, if you load a palette from file,
you get the palette on the right-click context menu of nodes. But this
is a bit nasty, because (a) you have to create the node first, then
change its shape; (b) you can't see pictures of the palette. So
there should be a separate window with a table of all the node
shapes in the palette. Selecting a shape from the palette will make
that the default shape for all subsequent node-creation until another
shape is selected from the palette.
- Palette editor. How do you create a palette? At the moment,
by hand in a text editor. Much better to have a graphical way of
creating shapes, cutting-n-pasting shapes into palette sets, etc.
- Edge palette. Do we need a palette of different edge shapes
as well as node shapes?
- Ports. A node may need some specific connection ports, where
edges may attach to. For instance, this might be because the
information stored at a node is an expression to be applied to
inputs from edges, generating output on other edges. The expression
would need to distinguish different input sources and output channels.