Skip to content

Instantly share code, notes, and snippets.

Avatar

Nick Strayer nstrayer

View GitHub Profile
@nstrayer
nstrayer / README.md
Last active Aug 29, 2015 — forked from kerryrodden/.block
Sequences sunburst
View README.md

This example shows how it is possible to use a D3 sunburst visualization (partition layout) with data that describes sequences of events.

A good use case is to summarize navigation paths through a web site, as in the sample synthetic data file (visit_sequences.csv). The visualization makes it easy to understand visits that start directly on a product page (e.g. after landing there from a search engine), compared to visits where users arrive on the site's home page and navigate from there. Where a funnel lets you understand a single pre-selected path, this allows you to see all possible paths.

Features:

  • works with data that is in a CSV format (you don't need to pre-generate a hierarchical JSON file, unless your data file is very large)
  • interactive breadcrumb trail helps to emphasize the sequence, so that it is easy for a first-time user to understand what they are seeing
  • percentages are shown explicitly, to help overcome the distortion of the data that occurs wh
@nstrayer
nstrayer / README.md
Last active Aug 29, 2015 — forked from bbest/.block
Aster Plot in D3
View README.md

This aster plot displays pie slices as lengths extending outward to the edge (0 at inner to 100 at outer). Widths of the pie slices represent the weight of each pie, which gets used to arrive at a weighted mean of the length scores in the center.

Contributors

Jim Regetz @regetz developed the initial aster plot function in R (see aster-plot on github)

Parker Abercrombie @parkerabercrombie developed the initial D3 prototype varying 3 of the 4 arc elements starting with Mike Bostock's Donut Chart:

  • outerRadius
  • startAngle
@nstrayer
nstrayer / README.md
Last active Aug 29, 2015 — forked from mbostock/.block
Voronoi Tessellation
View README.md
@nstrayer
nstrayer / README.md
Last active Aug 29, 2015 — forked from mbostock/.block
U.S. TopoJSON
View README.md

These county, state and country boundaries are extracted from a single TopoJSON file. Counties are stroked in thin gray, states in thin black, and the country in thick black.

@nstrayer
nstrayer / README.md
Last active Aug 29, 2015 — forked from jasondavies/README.md
Areas of Clipped Voronoi Regions
View README.md

A demonstration of how to calculate the areas of Voronoi regions clipped by geographic features using D3.

[D3’s implementation](Sutherland–Hodgman algorithm) of the Sutherland–Hodgman algorithm only works for convex clip polygons, but we exploit the fact that Voronoi regions are guaranteed to be convex, and use each Voronoi region as a clip polygon, with the projected geographic boundary as a subject polygon.

In response to a question by Gonzalo Bellver.

@nstrayer
nstrayer / README.md
Created Dec 30, 2015 — forked from mbostock/.block
Percentage Change II
View README.md

A variation of the percentage change example using clipping to apply different colors for positive change (green) and negative change (purple).

@nstrayer
nstrayer / README.md
Created Jan 5, 2016 — forked from blacki/README.md
K-Means Algorithm
View README.md

K-Means Unsupervised Learning Algorithm

@nstrayer
nstrayer / README.md
Last active Jan 30, 2016
(not quite) simple tables in D3
View README.md

Forked from Gregor Aisch's Block simple tables in D3.

Inspired by a question posted in the comments about using the cell values in a given row to color code the background of that cell.

@nstrayer
nstrayer / index.html
Created Jun 12, 2016 — forked from emeeks/index.html
Ch. 11, Fig. 14 - D3.js in Action
View index.html
<html>
<head>
<title>D3 in Action Chapter 11 - Example 8</title>
<meta charset="utf-8" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.5/d3.min.js"></script>
</head>
<style>
body, html {
margin: 0;
}
@nstrayer
nstrayer / .block
Last active Jul 26, 2016
Reusable dotplots.
View .block
license: mit