Review: Data Visualization with D3.js Cookbook

I’ve been looking around for decent data visualization book on D3.  I think I’ve found it.

Data Visualization with D3.js Cookbook by Packt Publishing hits the mark.

It’s the right blend of detailed explanation combined with cookbook recipes to get going.

D3 is JavaScript library that separates data from presentation, but does so in a really cool manner.  When the underlying data is updated, the components on the screen that visualize it can be made to update to reflect it. This can lead to some pretty amazing transitions and interactivity with surprisingly little code.

D3 looks at the data you have visualized already and the data you want to visualize and divides them into three piles: New Data, Updated Data, and No Longer Present Data.  Transformations can be done for each set, for instance allowing new data to fade in, updated data to morph, and removed data to fade away.  D3 is focused primarily on just this task, so actual visualizations are up to the coder.

However, because D3′s nature allows each element to only focus on the part of the data it needs to, and to substitute that content into the HTML, CSS, and/or SVG that’s needed, it provides a surprising amount of flexibility and features and does so with impressive speed and efficiency.

The Data Visualization with D3.js Cookbook explains the above concepts with some well formed examples, and then proceeds to demonstrate how to make bar charts, pie charts, line charts, and other more complex multi-dimensional visualizations and add interactive interfaces to them. This is where the book absolutely shines!

Each example is carefully constructed and compact, serving both as a learning tool and a starting point for your own code.  As such, I’d highly recommend the book and convey that it’s very approachable, even to those with a limited JavaScript background.

I would recommend some degree of caution however, in particular with the Kindle book. This is not a fault of Packt Publishing, but with Amazon.  And I’ve spoken to them at length about it.  The Kindle viewer is intended of rendering pages of readable text to humans in a nicely formatted manner.  However, it is terrible (as of the time of this writing) as to maintaining code formatting and spacing, which is absolutely essential for any cut’n'paste operations. Be prepared to copy code by hand, and if you’re going to go that far, perhaps the paperback version is more to your liking.

That said, I did happen to notice a few errata in the examples; nothing major, nothing you can’t move past, and nothing that isn’t rectified by going onto GitHub for the updates.

All in all, after having gone through a number of books about D3.js, this one has been my favorite and the most useful.

 

Posted in JavaScript, Programming | Tagged | Leave a comment

A-w-k-w-a-r-d

As I was leaving the water fountain and returning to my office, a young woman on crutches popped out of an adjoining hallway in front of me. Normally I, and others, would tend to step around — and having been on crutches myself, I can say that I didn’t feel the least bit offended. But, I had read that sometimes this bothers people, so I figured I’d just catch up and slow my pace.

That’s when she noticed me and in the brightest voice said, “Good Morning! How are you doing?”

Surprised, I equally met her energetic tone and responded “Good Morning to you too! I’m doing well, thank you for asking! How are you doing?”

She sighed, “Not that well, actually.” And I took it to mean her foot, so I opened the conversation.

“Oh no! What happened to your foot? Did you slip on the ice?”

She paused and then explained, “No. I had a stroke when I was a baby. I’m like this normally.”

Posted in Humor, Mishap | Tagged | Leave a comment

If you don’t want to know, don’t ask.

An actual conversation that happened right before a meeting started:
“Hey Walt, how ya doing?”
“Sad, depressed, …beaten.”
(chuckle) “Tell us how you really feel!”
(short pause) “Surrounded by dementors.”
(awkward silence — then the meeting began)

Posted in Funny Quotes, Humor | Tagged , , , , , | Leave a comment

List iTunes Apps by Purchaser

Last year I was helping a friend who has pretty poor internet connectivity upgrade his iPad to the latest version of iOS. To do this, I connected his iPad to my system, performed a backup in iTunes, then synchronized to update the operating system. This had the side effect of beaming some of his applications to my iTunes, which in order to continue, he authenticated against. His iPad updated great, and he was on his way.

Things on my machine seemed okay for a while, that was until some of the apps he purchased that I didn’t have wanted to update. Not having his password, I wasn’t able to update them, but even worse, Apple wasn’t announcing which apps needed updating with his account so I could simply delete them as I wanted to.

Instead, for over a year, I was greeted in iTunes by a numerical indicator saying I needed up update my apps, but when I went to do it, I was up to date. Every once in a while I’d recognize an app that I didn’t purchase (in a haystack of nearly 1,000 iPhone apps) and delete it. Only then did the number drop, but later rise again when some other app needed updating.

What I needed to do was list out all the apps by Purchaser.

One of things that really annoys me about Apple is that stuff that is trivial to implement, like putting an optional Purchaser column in iTunes, they don’t do. The feature is half heartedly there, though. Press Command-I for Info, and you can see the purchaser for an item.

Only now you have to click and inspect your whole app list. And with the number of applications I own, this doesn’t scale well at all.

Searching the web reveals that others are in a similar bind, and that Apple seems to really care less about the few handful of users with this problem. Like much on the Apple Support Site, it’s unhelpfully silent.

Frustrated, I decided to solve this problem once and for all.  Open Terminal and cut’n'paste the following in:

for f in ~/Music/iTunes/iTunes\ Media/Mobile\ Applications/*.ipa; \
 do (echo "$f" ; unzip -p "$f" "iTunesMetadata.plist" | \
 plutil -p - | egrep -i "\"(itemName|artistName|AppleID)\"" ) | \
 perl -e 'while (<>) { if (m!^/!) { chop; $fqn=$_; } if (m/"(.+)" => (".+")/) { $e{lc($1)}=$2; } } print "\"${fqn}\",$e{\"itemname\"},$e{\"artistname\"},$e{\"appleid\"}\n";'; \
done
Posted in Apple, Hack, How To, iTunes, OS X, Rant, Trick, Walt's Desktop | Leave a comment

It Still Works!

I absolutely loved this description a friend shared of her Dell laptop, which is seven years old.  By her definition, it’s still working and doesn’t need replacement just yet. It’s used for Reddit, Facebook, Hulu, and applying for jobs.

Here’s what “working” means:

  • It’s missing the E key.
  • It runs so loudly she can’t sleep at night and has to turn it off.
  • There’s no such thing as a battery, there’s a gaping hole in the bottom of the laptop, so it has to be plugged in.
  • The power plug has duct tape around it.
  • It overheats and Blue Screens of Death about three times a week.
  • It looses WiFi about every five minutes or when it’s not in the mood to be social.
Posted in Humor | Leave a comment

Avoid Awesome Screenshot

While doing some web page debugging, I noticed that a simple, static, html file was pulling in a ton of web resource. Most noticeably from a place called Superfish, and sucking in with it a good deal of JavaScript libraries. On. Every. Page. Load.

The culprit seems to be a Safari Extension called Awesome Screen Show 1.3.7 by Dilgo. However, the developer site isn’t coming up, and I’m not all that encouraged by what I see over at Superfish either.

Uninstall the extension, as here’s the overhead you’ll be saving:

Posted in Apple, Browser, Disclosure, Walt's Desktop | Leave a comment

Turning Web Share Back On in Mountain Lion

I was rather surprised and disappointed to learn that Web Sharing was removed from Mountain Lion.

According to this post, it’s possible to bring back.

Per-user Web Sharing is gone from Preferences but can be easily re-enabled via Terminal.app. Copy the following snippet into /etc/apache2/users/USER.conf:


<Directory "/Users/USER/Sites/">
 Options Indexes MultiViews FollowSymlinks
 AllowOverride All
 Order allow,deny
 Allow from all
</Directory>

and restart Apache with sudo apachectl restart.

And PHP has been hidden as well, but again thanks to this article, it can come back as well.

Uncomment these lines by removing the leading pound sign in /etc/apache2/httpd.conf:

  • LoadModule rewrite_module libexec/apache2/mod_rewrite.so
  • LoadModule perl_module libexec/apache2/mod_perl.so
  • LoadModule php5_module libexec/apache2/libphp5.so
Posted in Apache, Hack, How To, OS X | Leave a comment

Wrong Registration Number

Humorous Registration Response

Wrong Registration

I’ll let you guess what I was doing when I made a typo.

Posted in Humor Photos | Leave a comment

Stumbled into a this using Safari, if you accidentally close the tab, immediately press Command-Z it — undoes the close! No need to dig through history.

Posted on by Walt Stoneburner | Leave a comment

Why Readers Lose Interest in Sequels

This week I was fortunate enough to be visited by long time friend, Danny Adams. Our friendship runs so deep that I often forget as we’re having dinner that sitting across from me is a well published author (whom if I’m not mistaken, is being interviewed in StarLog magazine this month).

During our conversation, I started to ask a question but distracted myself with a full scale analysis of sequels and it wasn’t until I realized Danny wasn’t saying anything that I stopped. Apparently this was useful feedback, but before we could finish, we had to leave.

Danny, and all interested authors, here’s my take on why readers lose interest in sequels.

What makes a story good?

I suppose the ideal story is one that drags you into it that you actually forget that you’re actually reading. But, how is that accomplished?

The common components that I’ve noticed from stories that I’ve enjoyed are ones where the main character is thrust into an unfamiliar environment, stumbles into an adventure as he learns the rules of the environment, events unfold and he becomes the reluctant hero, pushing his own boundaries, and eventually learning something about himself, and in the end making a difference.

This generalization appears everywhere: Neo from the The Matrix, Luke Skywalker from Star Wars, Ralph from Greatest American Hero, Stile from Splity Infinity, Zane from On A Pale Horse, William from Wizard’s Bane, and even Harry from Harry Potter and the Sorcerer’s Stone.

But it’s at this point where things diverge. Some stories end after they are told, other’s have long standing sequels, where others flop. What makes Spiderman 2 enjoyable while Ghostbusters 2 and Weekend At Bernie’s II a forgotten memories? Why are people so enthralled with The Lord of the Rings? How does Star Trek and Stargate SG-1 and Dr. Who to keep going with endless spin-offs, and what caused Babylon 5 to crash in the last season?

The thing in common with series that fail is where the author simply tried to capitalize on the existing relationship and knowledge from the prior story.

Superman II holds far less interest than Smallville, primarily because we are joining in on the character as he develops.

It’s just as enjoyable to share Author’s realization that he’s just done something incredible as he pulls the sword from the stone.

A story needs to continue the growth of the character.

Stories like Star Trek and Stargate SG-1 survive because each time they visit a different world, the rules, culture, and context are different — they have to learn all over again. Discovering the environment with the main character is vital, it’s provides the energy and wonder. Deep Space 9 had things come to them, but it wasn’t the same. Making a human the alien was a brilliant move on the part of Farscape, there was endless discovery.

A story needs a dynamic environment, in which the main character can rediscover himself and continually be tested, rise to the challenge, or even fail.

Posted in Speculation | Leave a comment