This is a five part series, taking you through stages of designing and creating reusable visualizations with d3.js
All visualizations have the same functionality, showcase the individual points with a bar chart and sum up the selected bars.
This is a five part series, taking you through stages of designing and creating reusable visualizations with d3.js
All visualizations have the same functionality, showcase the individual points with a bar chart and sum up the selected bars.
-- SELECT Faraday_JoyDivision('households'::text, 'year_built'::text) AS the_geom | |
explain analyze WITH | |
-- Snap the disparate points to a regular grid where theres data for the given filter | |
grid AS ( | |
SELECT | |
-- note transform here | |
ST_SnapToGrid(ST_Transform(wkb_geometry, 4326), 0.002) the_geom, | |
year_built |
This examples demonstrates how to use D3's brush component to implement focus + context zooming. Click and drag in the small chart below to pan or zoom.
This demonstrates using topojson.merge, a feature that will be released in TopoJSON 1.6, to merge multiple polygons into a single polygon whilst removing interior borders.
(An alternative approach is to draw the polygons twice.)
This example is in response to a Stack Overflow question.
This grouped bar chart is constructed from a CSV file storing the populations of different states by age group. The chart employs conventional margins and a number of D3 features:
var data = [{ | |
date: new Date("Jan 01, 2013"), | |
data: 12 | |
},{ | |
date: new Date("Jan 02, 2013"), | |
data: 17 | |
},{ | |
date: new Date("Jan 03, 2013"), | |
data: 5 | |
},{ |
//Practically all this code comes from https://github.com/alangrafu/radar-chart-d3 | |
//I only made some additions and aesthetic adjustments to make the chart look better | |
//(of course, that is only my point of view) | |
//Such as a better placement of the titles at each line end, | |
//adding numbers that reflect what each circular level stands for | |
//Not placing the last level and slight differences in color | |
// | |
//For a bit of extra information check the blog about it: | |
//http://nbremer.blogspot.nl/2013/09/making-d3-radar-chart-look-bit-better.html |
Adapted from Mike Bostock's example (detailed below) by Tristan Davies and Andy Rossmeissl to cycle through a set of defined colors instead of a mathematically-generated rainbow. Particularly nice with divergent palettes, we recommend you try chroma.js to populate the colors
array in index.html
.
Original notes: A spanning tree of the canvas is generated using Wilson’s algorithm and then flooded with color. Hue encodes Manhattan distance from the root of the tree. (This is not an optimal visual encoding, but it suffices and is pretty.)
_Spanning trees can also be used to generate mazes. See a maze generated with Wilson’s algorithm flooded with color, and compare color floods of spanning trees generate
This stylized globe uses D3’s in-development geometry pipeline to jitter points before rendering. Points are sampled along great arcs, jittered, and then smoothed using basis-spline interpolation to achieve a hand-drawn effect. The resulting spherical geometry is computed once, allowing faster rendering with arbitrary rotation!
This techinque was developed in collaboration with Derek Watkins for Norway the Slow Way.
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>UVM map4ebola</title> | |
<meta charset='utf-8' /> | |
<link href='http://fonts.googleapis.com/css?family=Lora' rel='stylesheet' type='text/css'> | |
<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0' /> | |
<style type='text/css'> | |
body { | |
background:#1B346C; |