Skip to content

reedspool/golden_rectangle_d3

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Golden Rectangle in d3js

A rendering of the Golden Spiral using d3.js

See a live demo

The chart is defined with mbostocks recommended chart template, with the interesting twist that it is (sometimes doubly) recursive.

Example useage:

// d3 components
var chart = goldenRectangleChart();

// Assumption: svg.goldenRectangle exists in HTML
d3.select('.goldenRectangle').call(chart);

// Same thing, but with additonal options:

// d3 components
var chart = goldenRectangleChart()
	// How many levels down to go.
	.maxDepth(9)
	// Draw the doubley nested beautiful rectangle
	// WARNING: Setting mini to 'true' incurs SERIOUS performance lag
	// Suggest you don't go above maxDepth 10 when this is turned on.
	.mini(true);

// Assumption: svg.goldenRectangle exists in HTML
d3.select('.goldenRectangle').call(chart);

About

Drawing the age old golden rectangle in d3, cuz why not

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published