Early/simplifed version of You Draw It: What Got Better or Worse During Obama’s Presidency
d3.drag is pretty great!
| import csv | |
| import json | |
| from flask import Flask, render_template | |
| # reference: https://stackoverflow.com/questions/29631711/python-to-parent-child-json | |
| # create a helper class for each tree node | |
| class Node(object): | |
| # generate new node | |
| def __init__(self, cluster): |
| license: mit | |
| height: 1000 |
| license: mit |
Early/simplifed version of You Draw It: What Got Better or Worse During Obama’s Presidency
d3.drag is pretty great!
##The old method, via phpmyadmin The first time I downloaded the sakila database, I did it via phpmyadmin using Import at the Server level. I did not use a command line. I did not create a database called Sakila and then populate it: the .sql files delete and re-create the database anyway. I imported the schema file and then the data file, ignoring the .mwb file, which is only useful if you have MySQL Workbench installed, at which point it supplies you a database diagram. A nice-to-have, but not critical in creating a database.
When I imported the files, I had to untick the box that said "Allow the interruption of an import in case the script detects...". I also had to temporarily change MySQL's maximum import size (using a line of SQL I found online): https://dev.mysql.com/doc/refman/5.5/en/packet-too-large.html
Today I find this method does not work. I get an error about geometry (which is due to a commented out line in the SQL). Even when I remove the commented out lines (whose purpose is to create spa
Added all of the Farmers' Markets data into the kMeans Library by @emilbayes, thank you!
Exploring the idea of using the areas around the centroids to exaggerate that cluster when it deviates from the rest of the clusters. This originates from the question "Which features in each cluster differentiate it from the rest?"
Playing around with the idea of a bump chart comparison with two overlapping areas. Based on Farmers Markets data from data.gov.
Another iteration with step interpolation instead of cardinal.
In the example we're looking at historical weather data for New York provided by intellicast.com and wunderground.com. Inspired by weather-radicals.com.
This example uses scales to roll your own radial projection by mapping out the x, y, and r positions. If you are creating a line or an area you can use d3's convenience functions d3.svg.line.radial and d3.svg.area.radial but this is a method you can use if you want to use different graphical elements in a circular layout.
In the example we're looking at historical weather data for San Francisco provided by intellicast.com.