Data Visualization

The American Credit Crisis (of 1772) Visualized

One of the first time-series line charts ever drawn was a visualization of the great American credit crisis (but probably not the credit crisis that comes immediately to mind). If you were to look at this chart today you might even mistake it for the charts of the housing credit crisis of the past few years.

playfair_north_america_trade2
(see image credits below for image details)

This chart was created by William Playfair and published in 1786 in The Commercial and Political Atlas. In that work Playfair literally invented the line chart. This particular chart shows the imports and exports between Britain and America between 1700-1800. The red line is the line for exports from Britain to America, and the lighter yellow line is the imports from America. You can see the relationship of imports to exports stays relatively constant for the first 50 years (1700-1750) and then the exports start shooting up dramatically, at a rate much greater than the increase in imports.

Compare that with this chart of housing prices, created by the New York Times.
nyt_chart_cropped
(image from the New York Times)

I guess we know what a credit-driven catastrophe looks like. And it’s not only the image itself that looks similar, at times his words sound as if he’s writing today about our current financial mess.

Between 1750-1772 there was a rapid increase in exports from Britain to America. These exports were the result of many new merchants hoping to strike it big by shipping goods to the new settlers. But the reason things got out of control has to do with credit. Merchants started lending and borrowing on credit to finance their get-rich-quick schemes of selling stuff to America. Playfair writes (all emphasis added is mine),

Ever since the invention of paper credit, trade has had a latitude it did not before enjoy, and its progress being less natural, has become more intricate. That bound set and preserved by the nature of things was removed, when paper credit was first invented; previous to which, nothing represented wealth that was not wealth itself, or that was not physically worth the sum it represented; and in order to give credit in business, it was absolutely necessary either to possess, or to have borrowed capital.

And because of this new credit, people started making business decisions that were insane. They started shipping products to America before they knew they could sell them. Since the money was free they took irrational risks. And if your business venture failed miserably you could always just hide from your creditors in that new land of opportunity.

Of the eventual crash, Playfair writes,

For the first fifty years, we observe the simple and regular growth, from poverty to wealth, of a new country; during the succeeding twenty years, we are astonished at the extent and operation of a mad mercantile speculation carried on by our own country; and the period which succeeds, shews the catastrophe that so airy and so ill-founded a project was likely, sooner or later, to experience. There is not any branch of trade, which, from the nature of its progress, affords so much instruction as this. It merits equally the attention of the philosopher, the politician, and the merchant; for it throws light upon all the three different objects of their pursuits.

Isn’t that beautiful? Almost the same words could apply to the current financial crisis. And one final quote that I like, which also made me think of our current crisis:

Upon the manner in which business is conducted, depends something more than merely the gaining or losing a little money. The happiness of numbers of innocent individuals is frequently depending upon the success of projects, with the formation of which they had no concern. What numbers have been ruined, and how many more deprived of fortune, by our ill-conducted trade with America?

What numbers have been ruined indeed.

I’ve been reading the works of Playfair to understand the history of data visualization (in this same work he also invented the bar chart, and in a successive work he invented the pie chart). I wanted to make sure I understood the history of statistical charts, since as they say, those who cannot remember the past are condemned to repeat it. I didn’t realize that phrase would also apply so perfectly to the text accompanying the images.

* Image Credits
The first image above is from William Playfair’s Commercial and Political Atlas, 3rd edition, published in 1801. The scan is of a copy contained in the University of Pennsylvania’s Annenberg Rare Book and Manuscript Library. It was reproduced in a publication by Cambridge University Press entitled The Commercial and Political Atlas and Statistical Breviary, published in 2005, which was compiled by Howard Wainer and Ian Spence (and if you want to be even more technical the image above is a reproduction from a Google scan of the Cambridge University scan). As was decided in Bridgeman vs Corel Corp (full text), a reproduction of a work of art in the public domain is not protected by copyright. As was stated in that verdict: “While it may be assumed that this required both skill and effort, there was no spark of originality — indeed, the point of the exercise was to reproduce the underlying works with absolute fidelity. Copyright is not available in these circumstances.” I am reproducing the image here with that legal precedent in mind, and with the best of intentions. I would highly recommend that if you are interested in Playfair’s work you buy the reprint by Cambridge University Press. It contains full-color reproductions of the charts, and the introduction contains great biographic information about Playfair.
Standard
Flex/Flash/Actionscript

Is that Flex on my Kindle?

Well, not really… but it’s a Flex book 🙂

flex_kindle1

While I was getting ready to travel for the holidays I was buying a few new books for my Amazon Kindle to read on the plane. As I was browsing through the online store right on the Kindle, there in my recommended books list was Creating Visual Experiences for Flex 3 by my friends Juan Sanchez and Andy McIntosh. Out of sheer curiosity I was forced to instantly buy it, wondering what it would look like on the Kindle’s screen.

Note that this isn’t in any way a review of the actual content of the book, since I haven’t read it yet. But knowing Juan and Andy I’m sure it’s fantastic. I just skimmed a few chapters trying to see what it looked like on the Kindle’s screen.

Text and Images
Turns out that reading the textual content of the book on the Kindle works great. The images leave a little to be desired, since they’re rendered (like all images in a Kindle book) in fairly minimal grayscale, but they don’t actually differ that much from the print book (also in black and white) and you usually don’t lose any important information by viewing the images on the Kindle’s screen. Some of the screenshots comparing different effects and blend modes didn’t work very well since they were so small and the low contrast makes it difficult to notice differences.

Tables
Tables actually turned out pretty readable, although quite small. But I was impressed how well the tables were actually preserved, and assuming you don’t have a problem reading small text (which I didn’t) then they’ll work just fine. If you’re old and your eyes are feeble then this might be an issue.

flex_kindle_table

Code Samples
The code listings are a bit more problematic. With the normal font size, the code listings become pretty unreadable on the Kindle’s screen. Pretty much all the code wraps in weird ways, breaking the lines up, often mid-word, and usually spilling over onto multiple pages.

flex_kindle_code

However, if you adjust the font to the smallest that the Kindle offers, then you get more readable code listings. Things still spill over across pages, and sometimes the lines wrap awkwardly, but overall the code listings are much improved. The smallest font size is really the only way to read a book like this. Truthfully, I imagined the code listings would be completely unreadable, but if you adjust the font size it’s much better than I ever imagined it would be.

The difficulty with code listings makes the Exercises section (section 4) difficult to get through. But the previous sections, which give you explanations of the skinning and styling techniques and discussion about all the particular components within the Flex framework, rely on much shorter snippets of code sprinkled in the text. The exercises are really code-heavy (as they should be), which makes viewing on the screen hard.

Of course, reading code on such a small screen (regardless of whether you’re reading a book or reviewing someone’s code or whatever) is far from ideal. I’d never choose to write code on a screen this size, and reading it here is certainly less than perfect. But reading code in any print book is always relatively awkward, with the only real difference between print and the Kindle being that print books have better formatted line breaks and the ability to see multiple pages at once (assuming the two print pages can be open side by side).

Overall, if you’re comfortable reading the entire text at the smallest font size, it’s pretty decent actually (again, I’m referring to the viewing experience, not the content of the text). I don’t think I’ll get any other programming books on my Kindle, instead I’ll buy the print versions if I have the choice (or more likely I won’t buy programming books at all, as I’ve written about previously). But if you’re traveling and you don’t mind the layout issues, there’s no reason you can’t learn Flex styling and skinning on an airplane.

P.S. For worry of breaking some unknown clause in my contract with my own publisher, I better tell you that I wrote a Flex book too! Deepa Subramaniam and I wrote Adobe Flex 3 for Dummies, which is awesome (although it’s not offered on the Kindle). Juan and Andy’s book and our Dummies book really target very different audiences, so if you’re just starting to learn Flex then you might want to check out our book first and then move on to Creating Visual Experiences.

P.P.S. Merry Christmas and happy holidays!

Legal stuff to try to keep me from getting in trouble
All images in this post are digital pictures I took of the Amazon Kindle displaying the Creating Visual Experiences with Flex 3.0 book, written by Juan Sanchez and Andy McIntosh and published by Addison-Wesley. All content is copyright Pearson Education, Inc. The images used in this blog post reproduce very small amounts of text and images from the original text, at very low quality in comparison to the original. The intent of this post is to explain the reading experience on the Kindle, not in any way to redistribute copyrighted content. I will, without argument, remove any images at the authors’ or publisher’s request.

Standard