{ "metadata": { "name": "", "signature": "sha256:e125fb1bf312c51c6b564f646f367dbecd2eea9914d8b77b2348202ff05c67d5" }, "nbformat": 3, "nbformat_minor": 0, "worksheets": [ { "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "The goal I set out to do: rewrite the [Choropleth](http://bl.ocks.org/mbostock/4060606) d3.js example to work in the IPython notebook. For future work: once we are able to reproduce the Choropleth example, then work to feed the map arbitrary county-level data. \n", "\n", "The first thing I did was to make sure I could get \n", "\n", " \n", "\n", "to work by copying the source to\n", "\n", " \n", "\n", "and serving `us.json` and `unemployment.tsv` from my server with [CORS enabled](http://enable-cors.org/) for these two files:\n", "\n", " * \n", " * \n", " \n", "With the map working on standalone HTML page, then I turned to embedding the map inside an IPython notebook. That's where it got really interesting!" ] }, { "cell_type": "code", "collapsed": false, "input": [ "# print out the version of IPython used\n", "import IPython\n", "IPython.version_info" ], "language": "python", "metadata": {}, "outputs": [] }, { "cell_type": "heading", "level": 1, "metadata": {}, "source": [ "Initial unsuccessful attempt at rendering choropleth map in notebook" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "It turned out that the hard part of doing the translation to IPython Notebook was figuring out how to load the required JavaScript libraries. Being an off-and-on JavaScript programmer who is ramping up on the way to writing JavaScript properly in 2014, I was still living in the world of adding a `