Confessions of a Social Tools Architect
29 Oct
Visualizing data has always been a a major priority in just about every project I’ve worked on in the past 8 years. Most people don’t know it, but before I was dragged into programming, I was doing graphic design for a living (manuals, covers, and web sites) and I’ve never let go of those skills.
More often than not, I hear developers complaining that they’re not designers which means they shouldn’t be required to make any consideration for how things look, feel, or operate. I know none of you really believe that though - I’ve seen the ASCII art you try to make. Perhaps there’s a middle ground.
Several months ago I read an intriguing article by Edward Tufte on the notion of Sparklines. What’s a Sparkline you ask? It’s an “Intense, Simple, Word-Sized Graphic”. That’s the concise way of saying that it’s a small graphic that crams a lot of data into something that fits well inline with text.
Yesterday, Hylton (founder of Corante.com), sent out a link to site with a collection of links that were all quite interesting. By chance, it happens that one of these links, to the Functioning Form Blog, was to an implementation of Sparklines for Web Logs. Naturally I had to know more.
I was blown away to see something I had been thinking about for some time but hadn’t found the means to illustrate. Luke Wroblewski, the blog’s author, has done an awesome job. Here’s what he’s come up with:
A simple Web-log post continuum sparkline could plot the current post a reader is viewing, the previous posts it references, and the later posts that reference it. This paints a picture of where the current post originated (what ideas it draws from), and where it went (how those ideas evolved).
The sparkline could also provide a macro-level overview of when the post occurred (in the life of the blog) how many posts are related to it and when those were added. So you could potentially see a flurry of writing on a particular topic, a lull in the evolution of the topic, and then a return to the topic at a later date (though perhaps less active).
Source: Functioning Form Blog, “Web-log Continuum Sparklines”
I really believe in Sparklines. I’m using them in another project I am trying to get off the ground. Heck, I even own sparklines.com. I also believe that Flash is the perfect medium for developing sparkines for the online world, though CSS does come in at a close second.
So the challenge is this. Can anyone produce this in Flash using the following data:
// SparkLine Object
function SparkLine(timeFrame, timeUnit, prevColor, currColor, fwdColor, cat2Color, cat3color) {
// Baseline properties
this.timeFrame = (timeFrame) ? timeFrame : 52;
this.timeUnit = (timeUnit) ? timeUnit : 'Weeks';
// Color properties
this.prevColor = (prevColor) ? prevColor : '#ffcc00';
this.currColor = (currColor) ? currColor : '#000000';
this.fwdColor = (fwdColor) ? fwdColor : '#ffcc00';
this.cat2Color = (cat2color) ? cat2Color : '#ffcc00';
this.cat3Color = (cat3color) ? cat3Color : '#ffcc00';
// Data
this.data = [];
// Methods
this.addData = new function(index, newData) {
this.data[index] = newData;
}
}
// Web-Log Continuum Object
function WCL(postURL, postLength, isCurrent, category) {
this.postURL = URL;
this.postLength = postLength;
this.isCurrent = isCurrent;
this.category = category;
}
// Sample Data
var spark = new SparkLine();
spark.addData(25, new WCL('http://yahoo.com',250,0,'code'));
spark.addData(30, new WCL('http://yahoo.com',50,0,'code'));
spark.addData(32, new WCL('http://yahoo.com',50,0,'code'));
spark.addData(40, new WCL('http://yahoo.com',300,1,'code'));
spark.addData(41, new WCL('http://yahoo.com',310,0,'code'));
spark.addData(47, new WCL('http://yahoo.com',300,0,'code'));
Sorry if this code is bad or broke, I just spit it out as a baseline. If you’ve got a better working model, stick it in the comments for all to see.
I know some of you drawing API guys are drolling over this :) Any takers on this challenge? If so, I think I can generate this data in a few places already. Ray Camden, if you’re seeing this, I can see a plug-in for BlogCFC that does this quite easily.
7 Responses for "Developer Challenge: Web-Log Continuum SparkLines"
I suppose the one bit of data missing from the sample data is the date of each addData call for placement on the field.
Would you discern the dates from some blog xml-rpc, api, or make a new servlet to handle custom data sets and formatting for flash?
To that end, are you looking for something that is actually functioning on dynamic data or just a quick API demo using the above single data set with fake date entries?
By the way, click on my user name to see my own dynamicly generated sparklines.
Persist,
Actually that data is included in there. The first argument for addData() is the index. The assumption is that the entire SparkLine is divided equally into the number of units.
In the example aboe, it’s assumed to be 52 weeks. The first item added to the Sparkline is added at index 25, meaning week 25.
Hope that clarifies things on that end. As for the end result, I’m just looking to see if someone can implement this using the data.. goal being to just produce what is shown in that image.
I think the Sparklines you made are pretty interesting. Glad to see there are others actively working on it.
Greg
I have started a contest to try and ’spark’ some interest. All are welcome. http://www.twelvestone.com/forums/showthread.php?s=&postid=322179
On a related note, I’ve just released a PHP sparkline library at http://sparkline.org . I agree that Flash is an excellent presentation mechanism for sparklines - if anyone has time and expertise, it might be an interesting project to provide parallel open source PHP and Flash implementations. Take a look at the project and join our mailing list if you’re interested.
Not directly relevant, but maybe of interest to readers. I released a PHP sparkline graphing library on SourceForge yesterday: http://sparkline.org . PHP is good for generating static images, but Flash is far more desirable for interactive sparklines. If anyone has interest and expertise in Flash, I wonder if it might be possible to create a set of parallel PHP and Flash sparkline generators? Have a look the project and join our mailing list if you’re interested.
James
http://annonces-gratuites.01-annonce.com
Leave a reply