Skip to content

Instantly share code, notes, and snippets.

View nstrayer's full-sized avatar

Nick Strayer nstrayer

View GitHub Profile
@nstrayer
nstrayer / README.md
Last active August 29, 2015 14:26 — forked from bbest/.block
Aster Plot in D3

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 August 29, 2015 14:26 — forked from kerryrodden/.block
Sequences sunburst

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 August 29, 2015 14:26 — forked from mbostock/.block
Voronoi Tessellation
@nstrayer
nstrayer / README.md
Last active August 29, 2015 14:26 — forked from jasondavies/README.md
Areas of Clipped Voronoi Regions

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
Last active August 29, 2015 14:26 — forked from mbostock/.block
U.S. TopoJSON

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
Created December 30, 2015 04:21 — forked from mbostock/.block
Percentage Change II

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 January 5, 2016 19:40 — forked from blacki/README.md
K-Means Algorithm

K-Means Unsupervised Learning Algorithm

@nstrayer
nstrayer / .block
Created May 10, 2016 21:17 — forked from mbostock/.block
Cluster Dendrogram
license: gpl-3.0
@nstrayer
nstrayer / .block
Last active July 26, 2016 23:35 — forked from ejb/.block
Reusable D3 Histograms
license: mit
@nstrayer
nstrayer / index.html
Created June 12, 2016 17:39 — forked from emeeks/index.html
Ch. 11, Fig. 14 - D3.js in Action
<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;
}