Skip to content

Instantly share code, notes, and snippets.

View eesur's full-sized avatar

Sundar Singh eesur

View GitHub Profile
@eesur
eesur / README.md
Created December 12, 2015 16:37
d3 | Reusable slopegraph

Reusable slopegraph inspired/adapted from Ben Van Dyke's example into a reusable chart.

This slopegraph example shows the number of personal computers installed in a country per household. This includes desktop PCs and laptops, but excludes smartphones and terminals connected to mainframe computers. All figures are calculated using total number of Personal Computers and the Total Number of Households.

data source

@eesur
eesur / README.md
Last active August 8, 2019 14:06
Pre-loading using spin.js with d3

Example using spin.js during load of JSON data for a D3 chart

Showing the spinner/loader being triggered before the JSON callback, and stopped within the JSON callback (hence after the JSON data has been loaded):

// loader settings
var target = document.getElementById('#chart-id');

function init() {
@eesur
eesur / README.md
Last active June 8, 2019 01:29
d3 | famous rock landmarks

School homework for Krishan, my 7 year old, looking at famous rock landmarks. We surfed the net and stored some examples in a Google Sheet and exported the data into JSON to display with some filters.

@eesur
eesur / README.md
Last active May 15, 2019 23:53
d3js | us hex map

flashing heatmap (random data updating, every five seconds)—testing out the very useful and awesome tilegrams

@eesur
eesur / README.md
Created June 25, 2016 15:28
d3js | hexagon world map built from canvas map

Hexagonal world map, that draws based hexagons on the generated canvas map (comment out display: hidden, in css, to see the canvas rendering)

Reference sources:

@eesur
eesur / README.md
Last active September 14, 2018 17:27
d3 | Pure css grid programmatically

Example uses D3 to produce Pure's responsive grid programmatically.

For example, elements within a '3' row grid will be width: 100% on small screens, but will shrink to become width: 33.33% on medium-sized screens and above.

<div class="pure-g">
    <div class="pure-u-1 pure-u-md-1-3"> ... </div>
    <div class="pure-u-1 pure-u-md-1-3"> ... </div>
    <div class="pure-u-1 pure-u-md-1-3"> ... </div>
@eesur
eesur / .block
Last active September 10, 2018 14:06
d3 | split bar chart
license: mit
height: 500
border: no
@eesur
eesur / .block
Last active June 25, 2018 12:08
d3 | pixelated image
license: mit
height: 500
border: no
@eesur
eesur / .block
Created June 4, 2018 15:03
d3 | masked image (clipPath)
license: mit
height: 500
border: no
@eesur
eesur / .block
Created May 16, 2018 16:16
d3 | partition diagram using lines
license: mit
height: 500
border: no