Skip to content

Instantly share code, notes, and snippets.

@silviaclaire
silviaclaire / app.py
Last active August 11, 2023 19:37
Collapsible Tree Diagram using Flask and d3.js
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):
@janwillemtulp
janwillemtulp / .block
Last active October 17, 2023 03:36
Storm in NL, January 18, 2018
license: mit
height: 1000
@ajmistu
ajmistu / .block
Last active October 13, 2023 14:08
Collapsible Sankey Diagram Aligned Left (Sample 4)
license: mit
@1wheel
1wheel / README.MD
Created January 15, 2017 15:34
you-draw-it
@emmasaunders
emmasaunders / readme.md
Last active October 10, 2023 16:40
How to import the sakila database into MySQL

##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

@susielu
susielu / README.md
Last active October 10, 2023 14:24
K-Means Centroid Deviation

K-Means Centroid Deviation

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?"

@susielu
susielu / README.md
Last active October 10, 2023 14:22
Overlapping Bump Chart

Overlapping Bump Chart

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.

Alt text

@susielu
susielu / README.md
Last active October 10, 2023 14:25
Annual Temp - New York 2015

Weather Plot - New York 2015

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.

@susielu
susielu / README.md
Last active October 10, 2023 14:26
Radar Plot Annual Temperature

Radar Plot Example

In the example we're looking at historical weather data for San Francisco provided by intellicast.com.