Skip to content

Instantly share code, notes, and snippets.

@skokenes
skokenes / friends.css
Created September 27, 2013 03:04
Friends
.link {
stroke: #D4D4D4;
}
.node {
stroke: grey;
}
div.tooltip {
position: absolute;
@skokenes
skokenes / README.md
Last active April 22, 2019 13:12
Scatterplot with Lasso

This example demonstrates incorporating the d3 lasso plugin with a d3 scatterplot. Clicking and dragging on the plot area will produce a lasso that can be used to hover or loop around the dots in the scatterplot. Functions are then executed based on whether dots were selected or not.

The lasso plugin can be found here.

@skokenes
skokenes / Employment Projections 2022.csv
Created March 21, 2015 02:55
U.S. Employment Projection Data for the year 2022 from the Bureau of Labor Statistics
We can make this file beautiful and searchable if this error is corrected: It looks like row 8 should actually have 10 columns, instead of 1. in line 7.
Occupation,Employment 2012 (k),Employment 2022 (k),Employment Change 2012-2022 (k),Employment Change 2012-2022 (%),Job openings due to growth and replacement needs 2012-2022(in thousands),2012 median annual wage,Typical entry-level education,Work experience in a related occupation,Typical on-the-job training
Accountants and auditors,1275.4,1442.2,166.7,13.1,544.2,63550,Bachelor's degree,None,None
Actors,79.8,83,3.3,4.1,28.9,N/A,Some college no degree,None,Long-term on-the-job training
Actuaries,24.3,30.6,6.3,26.1,13.2,93680,Bachelor's degree,None,Long-term on-the-job training
Adhesive bonding machine operators and tenders,16.8,16.9,0.1,0.6,4.1,29830,High school diploma or equivalent,None,Moderate-term on-the-job training
Administrative law judges adjudicators and hearing officers,14.9,14.7,-0.3,-1.7,2.4,87240,Doctoral or professional degree,Less than 5 years,Short-term on-the-job training
Administrative services managers,280.8,315,34.2,12.2,79.9,81080,Bachelor's degree,Less than 5 years,None
Adult basic and s
@skokenes
skokenes / Employment Projections cleaned.csv
Created March 27, 2015 02:12
Employment Project Data Load with D3
We can make this file beautiful and searchable if this error is corrected: It looks like row 8 should actually have 10 columns, instead of 1. in line 7.
Occupation,Employment 2012 (k),Employment 2022 (k),Employment Change 2012-2022 (k),Employment Change 2012-2022 (%),Job openings due to growth and replacement needs 2012-2022(in thousands),2012 median annual wage,Typical entry-level education,Work experience in a related occupation,Typical on-the-job training
Accountants and auditors,1275.4,1442.2,166.7,13.1,544.2,63550,Bachelor's degree,None,None
Actors,79.8,83,3.3,4.1,28.9,N/A,Some college no degree,None,Long-term on-the-job training
Actuaries,24.3,30.6,6.3,26.1,13.2,93680,Bachelor's degree,None,Long-term on-the-job training
Adhesive bonding machine operators and tenders,16.8,16.9,0.1,0.6,4.1,29830,High school diploma or equivalent,None,Moderate-term on-the-job training
Administrative law judges adjudicators and hearing officers,14.9,14.7,-0.3,-1.7,2.4,87240,Doctoral or professional degree,Less than 5 years,Short-term on-the-job training
Administrative services managers,280.8,315,34.2,12.2,79.9,81080,Bachelor's degree,Less than 5 years,None
Adult basic and s
@skokenes
skokenes / Employment Projections cleaned.csv
Created April 4, 2015 16:35
Employment Counts in the US by Occupation, 2012 (k)
We can make this file beautiful and searchable if this error is corrected: It looks like row 8 should actually have 10 columns, instead of 1. in line 7.
Occupation,Employment 2012 (k),Employment 2022 (k),Employment Change 2012-2022 (k),Employment Change 2012-2022 (%),Job openings due to growth and replacement needs 2012-2022(in thousands),2012 median annual wage,Typical entry-level education,Work experience in a related occupation,Typical on-the-job training
Accountants and auditors,1275.4,1442.2,166.7,13.1,544.2,63550,Bachelor's degree,None,None
Actors,79.8,83,3.3,4.1,28.9,N/A,Some college no degree,None,Long-term on-the-job training
Actuaries,24.3,30.6,6.3,26.1,13.2,93680,Bachelor's degree,None,Long-term on-the-job training
Adhesive bonding machine operators and tenders,16.8,16.9,0.1,0.6,4.1,29830,High school diploma or equivalent,None,Moderate-term on-the-job training
Administrative law judges adjudicators and hearing officers,14.9,14.7,-0.3,-1.7,2.4,87240,Doctoral or professional degree,Less than 5 years,Short-term on-the-job training
Administrative services managers,280.8,315,34.2,12.2,79.9,81080,Bachelor's degree,Less than 5 years,None
Adult basic and s
@skokenes
skokenes / index.html
Last active August 29, 2015 14:19
Lasso Map Example
<!DOCTYPE html>
<meta charset="utf-8">
<style>
.subunit {
fill: none;
stroke: #777;
}
.lasso path {
@skokenes
skokenes / data.tsv
Created August 31, 2015 14:24
Scatterplot with Lasso on points
sepalLength sepalWidth petalLength petalWidth species
5.1 3.5 1.4 0.2 setosa
4.9 3.0 1.4 0.2 setosa
4.7 3.2 1.3 0.2 setosa
4.6 3.1 1.5 0.2 setosa
5.0 3.6 1.4 0.2 setosa
5.4 3.9 1.7 0.4 setosa
4.6 3.4 1.4 0.3 setosa
5.0 3.4 1.5 0.2 setosa
4.4 2.9 1.4 0.2 setosa
{
"width": 400,
"height": 200,
"padding": {"top": 10, "left": 30, "bottom": 30, "right": 10},
"signals": [
{
"name": "tooltip",
"init": {},
"streams": [
@skokenes
skokenes / grouped_bar.json
Last active November 27, 2015 16:03
Vega Grouped Bar Chart
{
"width": 300,
"height": 240,
"data": [{
"name": "table",
"values": [{
"category": "A",
"position": "a",
"value": 0.1
}, {
@skokenes
skokenes / grouped_bar.json
Created November 27, 2015 16:11
Vega Grouped Bar - Streaming Data
{
"width": 300,
"height": 240,
"data": [{
"name": "table",
"values": [{
"category": "A",
"position": "a",
"value": 0.1
}, {