Code For Walmart Growth Visualization Now Available

Code For Walmart Growth Visualization Now Available

It took me three months to do it, but the code to visualize the growth of Walmart is now available under a BSD license (that means free and open like a leaf in the wind):

Download Walmarts.tar.gz

I've included the Actionscript and the Walmart openings data, which should be all you need to create your own Walmart growth visualization, or if you're more industrious, some other type of growth in the world. Let me know if you're able to improve upon my code as there's definitely a few areas that wouldn't mind some improvement.

So go wild, have fun with it, and let me know if you apply the code to another dataset. (I also wouldn't mind if someone wrote some documentation.)

Like what you see? Subscribe to the FlowingData RSS feed to stay updated on what's new in data visualization.

Comments

  • miked98
    Oct 21, 2008, 6:28 am

    Nathan - Wonderful, thanks for sharing your work with all of us!

    “He who receives an idea from me, receives instruction himself without lessening mine; as he who lights his taper at mine, receives light without darkening me.”

    Thomas Jefferson would be proud! :)

  • Aiolos
    Oct 21, 2008, 9:54 am

    Doh! Just figured out how to do it by looking at the Visitr source code.

  • bungee
    Oct 21, 2008, 10:02 am

    Fascinating! I love your visualizations. Keep them coming!

  • Joe
    Oct 21, 2008, 3:47 pm

    awesome, yet scary. I’ll love to see just the map and the data and let someone try to figure out what they are looking at (is it a disease?) before telling them.

    Got any Starbucks maps coming down the pike?

  • Nathan
    Oct 21, 2008, 7:50 pm

    @Aiolos - maybe you know a better way to implement this walmart map then :)

  • bowlofudon
    Oct 24, 2008, 3:19 am

    How do I get this to compile? Will I need to use Adobe Flash CS4? Using Adobe Flash CS3 I’m missing import mx.effects.easing.

  • Nathan
    Oct 24, 2008, 11:41 am

    @bowlofudon - Actually, I use Flex builder 3 for all of this since it’s all actionscript. It’s available for free 30-day trial on Adobe, but even better, it’s free for students: http://flexregistration.com

    I haven’t used Flash, but I’m pretty sure there’s an equivalent that you can use - like import flash.effects.easing… um, try googling flash easing maybe?

  • dz
    Oct 24, 2008, 1:22 pm

    hi nathan,

    can you please provide some sample code on how to create a flex application from you code.

    Regards,
    dz

  • Scott
    Oct 28, 2008, 7:19 pm

    You can build this with the free Flex 3.0 SDK too. (No Flex Builder or other IDE.) Just use:

    mxmlc Walmarts.as

    The code, as written, gives you black text on a gray background. (It’s just a desaturated version of the Microsoft maps.) To get white text on a black background, like in the map above, add a line like this to Walmarts.as to invert the colors (put it before addChild(map)):

    map.grid.transform.colorTransform = new ColorTransform(-1,-1,-1,1,256,256,256,0)

    I got that tip from the Modest Maps people (http://getsatisfaction.com/modestmaps/topics/white_text_on_black_and_white_map).

  • Scott
    Oct 28, 2008, 7:27 pm

    Oh, and you should test the resulting .swf on a web server. You need to put the data file walmarts.xml in the same directory as the .swf, but the .swf won’t load it if it’s just on the local filesystem.

    And thanks, Nathan! This is really cool.

  • Nathan
    Oct 28, 2008, 7:43 pm

    @Scott - Sure thing. I’m glad you could make use of it. You can put walmarts.xml outside the .swf directory too. You just have to change the URL in the actionscript.

  • Reed
    Nov 14, 2008, 10:51 am

    Hi, thanks for posting this.
    I don’t know much about Flash but would like to add support for Flash displays like this to some software I’m working on. What is the best way to provide data to Flash? Is URLRequest the only way for AS programs to obtain external information, or does anyone know if there’s some kind of registry in the Flash runtime I might be able to access? Thanks

  • Benjamin Wiederkehr
    Nov 14, 2008, 12:04 pm

    Thanks very much for sharing Nathan! This is a superb example to learn from – much appreciated.

    @bowlofudon:
    just replace mx.effects.easing.* with fl.motion.easing.* in a AS3 project.

  • Kevin Carlson
    Nov 14, 2008, 1:52 pm

    Hi Reed,

    There are several other methods, but the programming can get a bit complex… For example, AMFPHP lets AS3 make remote calls to PHP scripts in order to interact with a database or handle other tasks.
    Check out friendsofed.com which has published a number of books on this topic.

  • Laura
    Jan 6, 2009, 1:24 pm

    Fantastic! Thank you!

Trackbacks/Pings

Add Your Comment

Comments for this post will be closed on 7 March 2009.