★ Timeline creation
posted Tue 3 Nov 2009 by Michael Galloy under IDL, Object graphics, VisualizationRecently, I've been wanting to create some timelines for various projects of mine. I needed something fairly flexible and I wanted the timeline to be generated from an input file, not from source code or a GUI. I settled on `MG_TIMELINE` which accepts an XML input file and generates a PostScript output file (which I can then convert to PNG or PDF, depending on what I need). While `MG_TIMELINE` is not a finished solution yet, it does handle my needs fairly well now.
To run the main-level example program, just put all the required files in the `!path` and type:
IDL> .run mg_timeline
The input file contains a top-level `timeline` element which specifies the start and end dates as well as the tick interval:
If you want a vertical line at the current date, put in a `now` element:
Currently, there are three types of items to place on the timelines: `event`, `interval`, and `activity` elements. Examples of these elements from the `athletic.xml` file are shown below. Events are at a specific date:
!4GRUB!XBoulder, CO
The color name can be any of the HTML color names. The `level` attribute specifies the height of the text for the level where 0.1 is the bottom timeline axis and 0.9 is the top timeline axis (I trying to think of ways to make this friendlier). An interval is similar except it has start and end dates:
An `activity` element specifies some value for each time period of the timeline. Below is a weekly activity which starts on the 17th week, so the value for the 17-19th weeks is 5, 20-22 is 6, etc.:
5 5 5 6 6 6 7 7 7 8 8 8 9 9 9 10 10 10 11 11 11 12 12 12
13 13 14 14 14 15 15 15 10 10 10 5
It would be nice to add a sparkline visualization option for activities.
Here's the [source](http://lib.idldev.com/misc/mg_timeline.pro) code, the [data](http://lib.idldev.com/misc/athletic.xml) for the example, and the [documentation](http://docs.idldev.com/idllib/misc/mg_timeline.html). You will also need [`VIS_COLOR`](http://vis.idldev.com/browser/trunk/src/color/vis_color.pro) and its [data](http://vis.idldev.com/browser/trunk/src/color/htmlcolors.dat). The output is available as a [image](http://michaelgalloy.com/wp-content/uploads/2009/10/athletic.png) or [PDF](http://michaelgalloy.com/wp-content/uploads/2009/10/athletic.pdf).
November 3rd, 2009 at 8:38 pm
Goaltimate! It’s time.
December 24th, 2009 at 12:58 am
I’ll have a good look at this, Mike. I have fooling around with a javascript solution but would be keen to incorporate an IDL timeline into our operational tsunami warning services…you know, at what time does a particular gauge come under threat…when should a warning be issued/reissued/cancelled. We have rules for deciding when enough time has elapsed for you to be reasonably confident that a gauge has not recorded a significant wave.
Tony
Australia