Skip to content

Instantly share code, notes, and snippets.

View kgryte's full-sized avatar
😃
Working on stdlib...

Athan kgryte

😃
Working on stdlib...
View GitHub Profile
@kgryte
kgryte / .block
Last active November 24, 2017 22:46 — forked from mbostock/.block
Grouped Bar Chart
license: gpl-3.0
@kgryte
kgryte / .editorconfig
Last active May 23, 2016 03:52
Parsing Markdown containing HTML elements using remark.
root = true
[*]
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
[*.js]
indent_style = tab
@kgryte
kgryte / proxy.js
Created December 24, 2015 03:48
Using ES6 proxy with arrays.
/* jshint esnext:true */
function get( target, prop, receiver ) {
console.log( 'target: ' + target );
console.log( 'property: ' + prop );
// console.log( 'Receiver: ' + receiver );
return Reflect.get( target, prop, receiver );
}
var handler = {
@kgryte
kgryte / README.md
Last active April 8, 2021 15:15
Minard and Napolean's 1812 March + D3.js

Napolean's March

A D3.js recreation of Charles Minard's Napolean's 1812 March.

Data from Wilkinson's The Grammar of Graphics.

Several works provided inspiration; see Michael Friendly's Re-visions of Minard.

Note that this implementation uses several different data files. Included are both original JSON files and associated GeoJSON files. For the army size labels, the data has been massaged some to agree with the (edited) army movements (data from Mike Bostock's Protovis implementation). River data is from Natural Earth; admittedly, the river da

@kgryte
kgryte / README.md
Last active April 13, 2018 20:05
Nightingale and the Crimean War + D3.js
@kgryte
kgryte / README.md
Last active April 21, 2024 02:33
Nightingale's Rose + D3.js

Nightingale's Rose

D3.js visualization of the famous polar area diagram from Florence Nightingale's "A contribution to the sanitary history of the British army during the late war with Russia".

Two works served as the inspiration for this implementation:

A few comments. Bostock's implmentation, while visually similar to Nightingale's visualization, is wrong. First, the data is not correct. You can verify this in Nightingale's original work. Second, Bostock directly maps the wedge radius to deaths. This mistake is common. Instead, Nightingale represents deaths in terms of area, thus requiring the radius for each

@kgryte
kgryte / README.md
Created July 3, 2013 04:45
Anscombe's Quartet + D3.js

Anscombe's Quartet

D3.js visualization of Anscombe's Quartet. Each dataset in the quartet is graphed separately along with its linear best fit. While all datasets have the same summary statistics (mean, variance, correlation, linear fit), their structures differ markedly.

Anscombe used the quartet in his seminal paper "Graphs in Statistical Analysis" to emphasize the importance of data visualization for exploratory data analysis. Such visualization exploration enables the analyst to make more informed analytical decisions and conclusions.

@kgryte
kgryte / README.md
Last active December 17, 2015 18:29
Leaflet.js + D3.js

Leaflet Visualization: Places Traveled

This gist was created to demonstrate map generation with Leaflet.js, and all files are associated with my blog post under the same name.

We access map tiles through Open Street Maps (OSM) and then plot location data formatted as GeoJSON.

@kgryte
kgryte / README.md
Last active August 29, 2016 02:19
D3.js + Orthographic Projection

D3 Visualization: Places Traveled

This gist was originally created to illustrate the data scrubbing process, and all files are associated with my blog post under the same name.

The file progression proceeds from data.txt, a simple text document which contains a list of places, to formatting this original data set as GeoJSON, data.geojson.

Once formatted as GeoJSON, we use D3.js to visualize the data, drawing inspiration from similar visualizations utilizing the same framework.