I am always getting excited when I have a new e-mail with a Google alert for Sankey diagrams. This time I was directed to this blog post.

SankeyR is a function for the R open source statistical computing and graphics package based on the drawSankey routine for Matlab developed at EPFL. Aaron Berdanier at Colorado State adapted it to work with R. It produces simple left-to-right Sankey diagrams like this one:

Sample diagram produced with SankeyR by Aaron Benadier at Colorado State University.

The routine creates a plot in R, or can be outputed to bmp or pdf format. “Inputs do not need to equal losses. Any difference will be displayed as a discrepancy in the height of the left and right sides of the diagram. This capability enables the developer to examine imbalances in flows.”

Get the source from Aaron’s blog.

I have added SankeyR to the Sankey software list. Thanks Aaron for sharing this with the R community. I am just not sure how what to make of the blog name…

Gabor Doka, developer fo SankeyHelper is currently working on SankeyTurtle, the implementation of a simple language for arrow routing in his Excel macro-based diagramming tool SankeyHelper. SankeyTurtle is currently being beta-tested.

The idea of SankeyTurtle code is to give each Sankey flux – each data cell – an accompagnying instruction how to draw the flux exactly in terms of path and geometry. The SankeyTurtle syntax is based on the vintage Logo TurtleGraphics drawing language, where you tell an imaginary turtle with a pen attached to it’s tail commands like “Move Forward” and “Turn Right 90°” and record the trail of the pen.

SankeyTurtle, a scripting language for Sankey Helper, currently being beta-tested

This will definitely an exciting improvement for all users of the SankeyHelper freeware … sorry, Sankeyware.

I’ll keep you posted about the progress and any official release.

After the colorful Sankey diagrams in the last two posts, here is a black/white one to soothe your eyes…

Sample diagram left-to-right produced with DrawSankey matalb plugin. See http://leniwiki.epfl.ch/index.php/DrawSankey

It has a left-to-right orientation, with inputs from the left, and losses branching out to the top. Made with Matlab add-on m.DrawSankey from EPFL Lausannne.

Gabor Doka has relased an updated version of his freeware tool Sankey Helper. The new version 2.4 has a macro for one-step default diagram generation, as well as enhanced colouring features such as using colours from data cells, and creation of colour hue variations. I haven’t tested the new release myself, but will keep you posted after doing so.

Just before the holidays a new version of e!Sankey became available. I had some time to play around with the new 2.5 release. Not that many new functions, it seems, but apparently some bug fixes and smaller improvements. The main new feature is the interface langauges in French, Portuguese and Spanish. The entry in my Sankey diagram software list has been updated accordingly.

Just came across a new piece of software for simple Sankey diagrams.
DrawSankey.m is a routine for Matlab that allows to produce diagrams like these:

Sample output of drawSankey.m plugin for Matlab from EPFL Lausanne.

DrawSankey.m is from the Industrial Energy Systems Laboratory (LENI) at Swiss EPFL in Lausanne. Find more information on their Wiki.

I haven’t tested it myself yet, but this definitely looks like an interesting add-on for Matlab users. I have added drawSankey.m to the Sankey software list.

For those of you interested in some of the maths behind drawing Sankey diagrams properly, you might want to read this article on ‘Programmatic Rendering of Directed, Weighted Graphs’ submitted for SVG Open 2003 by Philip A. Mansfield and Mark Ambachtsheer of SchemaSoft.

The authors consider Sankey diagrams as directed weighted graphs but they “can be difficult, time-consuming, and uninteresting to render by hand”. However, “Sankey diagrams do add an indisputable expressive power to a standard mathematical rendering of a graph…[and] when professionally constructed, Sankey diagrams represent flow in a manner … can be understood by anyone, instantly.”

Three diagrams are presented: a simple directed, weighted graph representing a candy factory, a pen-sketched B/W Sankey diagram, and the corresponding Sankey diagram in SVG format, created using data in XML format and XSLT style sheet transformation.

Candy factory: the raw materials quantities for the production of chocolate bars and caramel core candies are shown with a simple weighted, directed graph (Source: Mansfield/Ambachtsheer. Programmatic Rendering of Directed, Weighted Graphs, 2003)The same candy factory with a hand-drawn Sankey diagram (Source: Mansfield/Ambachtsheer. Programmatic Rendering of Directed, Weighted Graphs, 2003)Sankey diagram for the candy factory. A vector graphic has been created using XML and XSLT. (Source: Mansfield/Ambachtsheer. Programmatic Rendering of Directed, Weighted Graphs, 2003)

They also have some interesting details on graphical problems, such as overlay, edge layout, width of Sankey arrows in curves, etc. Basically all that stuff that developers of professional Sankey software tools have to cope with.

Just back from a short late summer holiday, enjoying a few “Sankey-free” days at the coast. To get going again I am presenting a Sankey diagram you might have seen already. It is Gabor Doka’s sample diagram for his ‘Sankey Helper’ application.

Sankey diagram created with Sankey Helper 2.1 (by G.Doka)

The tool comes as a Microsoft Excel workbook, with a number of macros and a toolbar that allows to create shapes and assignments from the data sheet to these shapes. Of course, graphical layout capacities of this helper tool is limited, however, simple diagrams can be drawn easily once you understand how to handle it.

Sankey Helper 2.1 is freeware – err, sorry! – “Sankeyware”. You must sent the author a Sankey diagram you created, but otherwise there is no cost. Nice idea! Download Sankey Helper from Gabor Doka’s website.