Skip to content

Instantly share code, notes, and snippets.

View UNFPAmaldives's full-sized avatar
💭
the distance between what we have and what we want

UNFPA Maldives UNFPAmaldives

💭
the distance between what we have and what we want
View GitHub Profile
@mbostock
mbostock / .block
Last active February 26, 2019 22:41
Chord Diagram
license: gpl-3.0
redirect: https://observablehq.com/@d3/d3-chord-dependency-diagram
@mbostock
mbostock / .block
Last active March 18, 2020 01:28
Threshold Choropleth
license: gpl-3.0
redirect: https://observablehq.com/@d3/threshold-choropleth
@mbostock
mbostock / .block
Last active May 8, 2024 16:54 — forked from mbostock/.block
Choropleth
license: gpl-3.0
height: 600
border: no
redirect: https://beta.observablehq.com/@mbostock/d3-choropleth
@gencay
gencay / data.csv
Last active September 19, 2019 15:37
State Under 5 Years 5 to 13 Years 14 to 17 Years 18 to 24 Years 25 to 44 Years 45 to 64 Years 65 Years and Over
AL 310504 552339 259034 450818 1231572 1215966 641667
AK 52083 85640 42153 74257 198724 183159 50277
AZ 515910 828669 362642 601943 1804762 1523681 862573
AR 202070 343207 157204 264160 754420 727124 407205
CA 2704659 4499890 2159981 3853788 10604510 8819342 4114496
CO 358280 587154 261701 466194 1464939 1290094 511094
CT 211637 403658 196918 325110 916955 968967 478007
@mstanaland
mstanaland / README.md
Last active June 15, 2020 05:34
Stacked bar chart with tooltips

A simple stacked coloumn graph built using d3's stack layout.

The SVG tooltip is based on this gist by Mike Bostock. In short, the tooltip's group, comprised of a rect and a text element, are created when the chart is first drawn and set to be hidden. Action is applied to the stacks' rects: on mouseover the group become visible; on mousemove the mouse's XY position is captured and used to transform/translate the group.

If you ajust the tooltip's XY offset, keep in mind that there can be no overlap between the group and the mouse's position or the group's visibility will remain hidden.

@tmaybe
tmaybe / README.md
Last active January 5, 2018 01:31
Stacked to Normalized Stacked Bar Chart

Based on mbostock's examples Stacked Bar Chart and Normalized Stacked Bar Chart. Adds transitions between the two states.

Data shows answers to the question "Generally speaking, do you think things in Afghanistan today are going in the right direction, or do you think they are going in the wrong direction?" in the Asia Foundation's 2012 Survey of the Afghan People broken down by gender, age, location, ethnicity, income, education and region.

@officeofjane
officeofjane / README.md
Last active December 17, 2017 18:04
Small multiple bar charts with tooltips
@stevenae
stevenae / README.md
Last active November 28, 2019 01:00
Interactive Choropleth

This example shows how it is possible to use crossfilter bar charts (up to any number) to visually subset a choropleth. The map above shows the population and per-capita income growth of the US from 2011-2012.

@dougdowson
dougdowson / index.html
Last active March 18, 2021 06:25
Choropleth
<!DOCTYPE HTML>
<meta charset="utf-8">
<html>
<head>
<link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Source+Sans+Pro:400italic,600italic,700italic,200,300,400,600,700,900">
<script src="http://d3js.org/d3.v3.min.js"></script>
<script src="http://d3js.org/queue.v1.min.js"></script>
<script src="http://d3js.org/topojson.v1.min.js"></script>
@th0ma5w
th0ma5w / comparer.py
Created April 8, 2014 23:00
CSV logging script for stock dump1090
#!/usr/bin/python
#
# CSV logging script for stock dump1090
#
# Uses the Requests library to compare the state of planes in view
# and prints changes to standard out
#
# Start dump1090
# modify this script to point to your dump1090 URL if different
# run the script and pipe the output to a file eg: