Skip to content

Instantly share code, notes, and snippets.

@larskotthoff
larskotthoff / index.html
Created January 19, 2012 21:31
variable width line
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.js"></script>
<script type="text/javascript" src="https://raw.github.com/larskotthoff/d3/varline/src/svg/line-variable.js"></script>
</head>
<body>
<div id="linevar"></div>

Automatic Label Placement

This example is an extension of Mike Bostock’s tutorial Lets Make a Map that implements automatic label placement using collision detection. This is a proof of concept more than anything, not polished in any way.

References

@larskotthoff
larskotthoff / flare.json
Last active March 14, 2017 19:55 — forked from mbostock/.block
{
"name": "flare",
"children": [
{
"name": "analytics",
"children": [
{
"name": "cluster",
"children": [
{"name": "AgglomerativeCluster", "size": 3938},
@larskotthoff
larskotthoff / CREDITS
Last active March 8, 2017 23:41 — forked from GerHobbelt/.gitignore
d3.js: force layout; click to group/bundle nodes
Code derived from the d3.js 'force' example:
The miserables.json file contains the weighted network of coappearances of
characters in Victor Hugo's novel /Les Miserables/. Nodes represent characters
as indicated by the labels, and edges connect any pair of characters that
appear in the same chapter of the book. The values on the edges are the number
of such coappearances. The data on coappearances were taken from D. E. Knuth,
"The Stanford GraphBase: A Platform for Combinatorial Computing",
Addison-Wesley, Reading, MA (1993).
@larskotthoff
larskotthoff / README.md
Last active January 3, 2016 17:09 — forked from mbostock/.block
@larskotthoff
larskotthoff / README.md
Last active January 3, 2016 06:49 — forked from mbostock/.block

This simple force-directed graph shows character co-occurence in Les Misérables. A physical simulation of charged particles and springs places related characters in closer proximity, while unrelated characters are farther apart. Layout algorithm inspired by Tim Dwyer and Thomas Jakobsen. Data based on character coappearence in Victor Hugo's Les Misérables, compiled by Donald Knuth.

Compare this display to a force layout with curved links, a force layout with fisheye distortion and a matrix diagram.

@larskotthoff
larskotthoff / README.md
Last active January 3, 2016 06:39 — forked from mbostock/.block

Designed by Stephen Few, a bullet chart “provides a rich display of data in a small space.” A variation on a bar chart, bullet charts compare a given quantitative measure (such as profit or revenue) against qualitative ranges (e.g., poor, satisfactory, good) and related markers (e.g., the same measure a year ago). Layout inspired by Stephen Few. Implementation based on work by Clint Ivy, Jamie Love of N-Squared Software and Jason Davies. The "update" button randomizes the values slightly to demonstrate transitions.

@larskotthoff
larskotthoff / index.html
Last active January 2, 2016 15:39 — forked from mbostock/.block
<!DOCTYPE html>
<meta charset="utf-8">
<style>
rect {
stroke: #fff;
}
</style>
<body>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<title>Testing Pie Chart</title>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.js?2.4.5"></script>
<!-- Source for example located at: http://bl.ocks.org/1203641 -->