Skip to content

Instantly share code, notes, and snippets.

View alansmithy's full-sized avatar

Alan Smith alansmithy

View GitHub Profile
@alansmithy
alansmithy / .block
Last active July 4, 2019 10:46
Basic react
license: mit
@alansmithy
alansmithy / README.md
Last active June 21, 2019 19:39
d3js - enter(), update() and exit()

This is a simple example of enter/update/exit in d3js.

2 arrays - of differing length - are used to generate alternating sequences of bubbles.

.enter() creates the initial join of data to elements, creating one circle element for every data element in the array.

After the button is clicked, the alternative array is rejoined to the graphical elements.

Because each array is of a different length, this means we must use .exit() to remove any circle elements no longer needed and create any new circle elements by using .enter().

@alansmithy
alansmithy / .block
Last active April 26, 2019 06:17
Pictogram grid in d3js
license: mit
@alansmithy
alansmithy / README.md
Last active March 15, 2019 15:53
Heatmap Calendar in d3js

###Calendar heatmap

A calendar heatmap using a simple csv file structure of date and value. These kinds of displays are good for highlighting patterns in time series data where there might be multiple time patterns present - i.e. daily/weekly/monthly/seasonal. A great implementation of this kind of graphic is the Wisconsin crash calendar.

This particular implementation produces just one svg element with a discrete group element for every year referenced in the data set.

@alansmithy
alansmithy / .block
Last active February 11, 2019 17:22
Anscombe's Quartet with simple-statistics and d3js v4 -
license: mit
@alansmithy
alansmithy / .block
Last active July 24, 2017 15:18
Enzo
license: mit
@alansmithy
alansmithy / .block
Last active July 24, 2017 00:49
fresh block
license: mit
@alansmithy
alansmithy / .block
Created June 28, 2017 15:45
Billy's circle
license: mit
@alansmithy
alansmithy / .block
Last active June 8, 2017 17:01
parli grids
license: mit
@alansmithy
alansmithy / .block
Last active June 8, 2017 16:15
Scalable grid
license: mit