Skip to content

Instantly share code, notes, and snippets.

View eesur's full-sized avatar

Sundar Singh eesur

View GitHub Profile
@eesur
eesur / index.html
Last active August 29, 2015 13:57
d3 | random radius
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Random radius</title>
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/d3/3.4.2/d3.js"></script>
</head>
<body>
<script>
@eesur
eesur / README.md
Last active August 29, 2015 13:57
d3 | Loading external data (tsv)

Aim

Pull in external data, using d3 to load and parse

It pulls in some data formatted in tsv (pinched from Mike's Scatterplot) and loads the data via d3. In this example listing the 'petalLength' column in a 'ul'.

Info and sources

This was a test after watching dashing D3 tutorial Loading TSV Data From Server

Other sources:

@eesur
eesur / README.md
Last active August 29, 2015 13:57
d3 | random SVG paths
@eesur
eesur / README.md
Last active December 25, 2016 03:31
Input field dynamic text with D3
@eesur
eesur / README.md
Last active August 29, 2015 13:58
D3| Data from embedded json

Pulling in data in a simple list and svg shapes.

Data is of varying planetary years in earth days.

The planets revolve around the sun in different amounts of time, so a "year" on each planet is a different amount of time. The farther a planet is from the sun, the longer its year. source

@eesur
eesur / README.md
Last active August 29, 2015 13:58
d3 | svg shapes with labels

Pulling in data to display svg shapes with labels

Data is of varying planetary years in earth days.

The planets revolve around the sun in different amounts of time, so a "year" on each planet is a different amount of time. The farther a planet is from the sun, the longer its year. source

@eesur
eesur / README.md
Last active August 29, 2015 13:58
D3 | Input box to create SVG shapes
@eesur
eesur / README.md
Last active August 29, 2015 13:58
d3 | table data from matrix

Aim

Create and populate a html table form an array within an array (matrix)

Info and sources

Based on Nested Selections

@eesur
eesur / README.md
Last active August 29, 2015 13:58
d3 | JSON data to tree layout

Aim

Produce a tree layout that will display json data from spreedsheet data

ROOT  
       |   
       ·―― A  
       |   |  
       |   ·―― A 01  
       |   |  
@eesur
eesur / README.md
Last active August 29, 2015 13:58
d3 | manipulating a single SVG shape

Manipulating a single SVG shape triggered via user input.

Also a good way to illustrate how SVG coordinate space works. Note you need to put the radius in to view the circle (otherwise it's at 0).


The cx and cy attributes define the x and y coordinates of the center of the circle. 

If cx and cy are omitted, the circle's center is set to (0,0)