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
@LeeMendelowitz
LeeMendelowitz / README.md
Last active December 6, 2018 23:02
D3 Dynamic Table with Nested Data

This script is another demonstration of the update, enter, and exit selections in D3. The script also makes use of key functions to bind data to each row, and transitions to animate opacity and delay the removal of rows. This script demonstrates nested data, where an array of values is bounded to each row (<tr>), and then a single value is bound to each cell (<td>) element in the row.

Each row of the table has a unique letter key, which is displayed as the first cell. The remainder of the row is an array of random digits. At each iteration:

  1. A new set of letter keys is randomly selected from the alphabet.
  2. For each letter in the set, a new row with random data will be inserted in the table if the letter is not already in the table.
  3. Any row in the table with a key which is not in the new set is removed.
  4. The number of columns in the table is randomly adjusted. If the new number of columns is larger than the current table, random data is appended to each row. Otherwise, cel
@saraquigley
saraquigley / Readme.md
Last active December 17, 2017 22:37
major migration #4

Using the latest data received from AE on July 3rd: file called Migration Tables v4.xslx

FYI - Some of the left nav bar is still under construction.

@nitaku
nitaku / README.md
Last active September 6, 2018 17:54
Data matching diagram

This experiment proposes a diagram for displaying the results of a data matching (aka record linkage) problem. In this kind of problems, two different datasets A and B are automatically compared, in order to find pairs of records that refer to the same real-world entity. We took the assumption of representing the results of a constrained matching problem, where the matching function is a one-to-one mapping (a bijective function from A to B). The implication is that the number of matches found in A is equal to the number of matches found in B.

The number of elements in A and B is represented by the length of two justaxposed, "misaligned" bars. A is depicted in brown-orange, while B in different shades of cyan. The number of matches is proportional to the length of the aligned portion of the bars (represented with more vivid colors). The remaining parts show the unmatched records in A (brown) and B (darker cyan).

The diagram could have been made more theoreti

@eesur
eesur / .DS_Store
Last active June 21, 2016 19:04
Chord diagram to explore overlap of lifespans
@mbostock
mbostock / .block
Last active January 14, 2023 04:21
Screen Recording to GIF
license: gpl-3.0
@wpoely86
wpoely86 / README.md
Last active March 14, 2023 22:07
Diverging Stacked Bar Chart

Diverging Stacked Bar Chart

We create a diverging stacked bar chart to plot a 5 point Likert scale. There a lots of ways to plot a Likert scale but according to Robbins & Heiberger, a diverging stacked bar chart is the best and I agree.

I've used D3.js. There is also an R package by Robbins & Heiberger.

The original can be found at github

<svg version="1.1"
baseProfile="full"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:ev="http://www.w3.org/2001/xml-events"
viewBox="0 0 4000 2000">
<style type="text/css">
<![CDATA[
]]>
@jonahwilliams
jonahwilliams / VotingInformation.tsv
Last active March 22, 2019 06:00
Interactive Bar Chart I
We can make this file beautiful and searchable if this error is corrected: It looks like row 8 should actually have 13 columns, instead of 11 in line 7.
Year State TotalPopulation TotalCitizen TotalRegistered TotalVoted HispanicPopulation HispanicCitizen HispanicRegistered HispanicVoted PercentHispanicPopulation PercentHispanicRegistered PercentHispanicVoted
2012 ALABAMA 3594.0 3479.0 2556.0 2154.0 107.0 35.0 12.0 0.0 0.029771841958820256 0.004694835680751174 0.0
2012 ALASKA 516.0 495.0 361.0 289.0 23.0 18.0 10.0 7.0 0.044573643410852716 0.027700831024930747 0.02422145328719723
2012 ARIZONA 4863.0 4314.0 2812.0 2412.0 1396.0 989.0 516.0 400.0 0.2870655973678799 0.18349928876244664 0.16583747927031509
2012 ARKANSAS 2198.0 2109.0 1376.0 1124.0 143.0 73.0 16.0 14.0 0.06505914467697907 0.011627906976744186 0.012455516014234875
2012 CALIFORNIA 28357.0 23419.0 15356.0 13462.0 9935.0 6510.0 3684.0 3157.0 0.35035440984589344 0.23990622557957803 0.2345119595899569
2012 COLORADO 3817.0 3544.0 2635.0 2495.0 681.0 497.0 284.0 259.0 0.17841236573225047 0.10777988614800758 0.10380761523046092
2012 CONNECTICUT 2726.0 2499.0 1760.0 1568.0 292.0 220.0 127.0 103.0 0.1071166544
@devdiva8
devdiva8 / gr4gr8_math_v4.csv
Created April 11, 2015 18:51
Small Multiples
Year Jurisdiction Grade Measure Race Score
2013 Boston 8 algebra White 311
2013 Boston 8 algebra Black 278
2013 Boston 8 algebra Hispanic 278
2013 Boston 8 algebra All races 287
2013 Chicago 8 algebra White 299
2013 Chicago 8 algebra Black 264
2013 Chicago 8 algebra Hispanic 275
2013 Chicago 8 algebra All races 274
2013 San Diego 8 algebra White 307
#!/usr/bin/perl
# This filter changes all words to Title Caps, and attempts to be clever
# about *un*capitalizing small words like a/an/the in the input.
#
# The list of "small words" which are not capped comes from
# the New York Times Manual of Style, plus 'vs' and 'v'.
#
# 10 May 2008
# Original version by John Gruber: