A treemap recursively subdivides area into rectangles; the area of any node in the tree corresponds to its value. This example uses color to encode different packages of the Flare visualization toolkit. Treemap design invented by Ben Shneiderman. Squarified algorithm by Bruls, Huizing and van Wijk. Data courtesy Jeff Heer.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html> | |
<head> | |
<style> | |
.imgs, .json {display: inline-block; width: 40%;} | |
.desat {opacity: .2;} | |
.json {vertical-align: top;} | |
pre {white-space: pre-wrap;} | |
</style> | |
</head> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Abandon normal instruments [1st ed.] | |
Accept advice [1st ed.] | |
Accretion [1st ed.] | |
A line has two sides [1st ed.] | |
Allow an easement (an easement is the abandonment of a stricture) [1st ed.] | |
Are there sections? Consider transitions [1st ed.] | |
Ask people to work against their better judgement [1st ed.] | |
Ask your body [1st ed.] | |
Assemble some of the instruments in a group and treat the group [1st ed.] | |
Balance the consistency principle with the inconsistency principle [1st ed.] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from ka_automation import * | |
# yeesh, gross!!! | |
def random_domain_color(slug, **kwargs): | |
import random | |
seed = kwargs.get('seed', 53) | |
print seed | |
random.seed(seed) | |
subject_count = len(subjects_for_domain(slug)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# getting relative size of each subject in math using | |
# http://www.khanacademy.org/api/v1/topictree and helper | |
# methods from https://gist.github.com/nsfmc/2a877c61f0f7da984ead | |
# to plug into something like https://gist.github.com/nsfmc/2d496c1bb9e096402f8e | |
output = [] | |
for s in subjects_for_domain('math'): | |
count = 0 | |
for t in get_topics(domain='math', subject=s['slug']): | |
for tut in t['children']: |
A treemap recursively subdivides area into rectangles; the area of any node in the tree corresponds to its value. This example uses color to encode different packages of the Flare visualization toolkit. Treemap design invented by Ben Shneiderman. Squarified algorithm by Bruls, Huizing and van Wijk. Data courtesy Jeff Heer.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
ka design automation tools - | |
super rough, but this is a set of functions, documented at the bottom, | |
which let you get the text/names of topics/subjects/domains for parts of | |
our topic tree. | |
you need to get the topic tree, which you can do by running | |
curl -o ~/topictree.json http://www.khanacademy.org/api/v1/topictree | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# $VBOX_VERSION should probably be something like 4.3.10 or somesuch | |
# | |
FROM boot2docker/boot2docker-rootfs | |
RUN apt-get install p7zip-full | |
RUN mkdir -p /vboxguest && \ | |
cd /vboxguest && \ | |
curl -L -o vboxguest.iso http://download.virtualbox.org/virtualbox/$VBOX_VERSION/VBoxGuestAdditions_$VBOX_VERSION.iso && \ | |
7z x vboxguest.iso -ir'!VBoxLinuxAdditions.run' && \ | |
sh VBoxLinuxAdditions.run --noexec --target . && \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* returns a new buffer with toggled endianness | |
* @param {Buffer} buff a nodeJS buffer, presumably utf16le/ucs2 | |
* @return {Buffer} a nodeJS buffer, probably utf16be | |
*/ | |
function toggleEndian(buff){ | |
out = [] | |
for (var i = 0; i < buff.length; i+=2) { | |
out[i] = buff[i + 1]; | |
out[i + 1] = buff[i]; |