Skip to content

Instantly share code, notes, and snippets.

View eesur's full-sized avatar

Sundar Singh eesur

View GitHub Profile
@eesur
eesur / .DS_Store
Last active June 21, 2016 19:04
Chord diagram to explore overlap of lifespans
@eesur
eesur / .DS_Store
Last active October 12, 2019 18:55
d3 | Parallel Coordinates
@eesur
eesur / README.md
Last active August 29, 2015 14:10
d3 | zoom and panning
@eesur
eesur / README.md
Created December 10, 2014 16:40
d3 | I am

I agree with Whitman: “I exist as I am, that is enough"

The rest is additional :)

@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 August 29, 2015 14:20
Reusable lines
@eesur
eesur / README.md
Last active October 23, 2019 21:52
D3 Line chart with toggle legend

D3 Multiple Line chart with toggle legend

Line chart updates the yAxis depending on selection from the legend.

The legend uses purecss for the menu, which can be made into a responsive menu.

The legend has been added to the re-useable components from ScottLogic's awesome d3-financial-components

@eesur
eesur / README.md
Last active January 26, 2018 10:31
Sparse and missing data

Sparse and missing data

Sparse data can be really tricky to represent when dealing with real time data —especially as you don't know when it will be sparse or dense, or even both in one representation.

These examples look at views with the same data. A chart showing reading per minute but the dataset doesn't have values for each minute; they would be zero.

This example takes from this super article Padding for zero values but uses the difference of the start and end time to create an array to map to, instead of using the ticks()

The charts are rendered using the awesome [D3 Financial Components (D3FC)](https://github.com/ScottLogic/d3-financial-components`

@eesur
eesur / README.md
Last active September 13, 2019 10:53
d3 | hotspots

Hotspots with D3

Just a play with hotspots to make an image 'interactive' in D3 and an excuse to reminisce.

Process:

  • Find a pic, choose The Grand Budapest Hotel, it was an awesome film
  • Made a grid, so I can quickly reference the pixels
  • Made the data (my son helped me here)
  • Draw some transparent rects
@eesur
eesur / README.md
Created May 29, 2015 09:33
d3 | slider

Simple slider using D3

Needed a simple solution to move a legend back and forth. This example shows the logic and uses javascripts offsetLeft to move the item (li in this case)