This is the code for Chapter 5, Figure 6 from D3.js in Action demonstrating how to make a donut chart using d3.layout.pie().
forked from emeeks's block: Ch. 5, Fig. 6 - D3.js in Action
// https://d3js.org/d3-force/ Version 1.0.0. Copyright 2016 Mike Bostock. | |
(function (global, factory) { | |
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('d3-quadtree'), require('d3-collection'), require('d3-dispatch'), require('d3-timer')) : | |
typeof define === 'function' && define.amd ? define(['exports', 'd3-quadtree', 'd3-collection', 'd3-dispatch', 'd3-timer'], factory) : | |
(factory((global.d3 = global.d3 || {}),global.d3,global.d3,global.d3,global.d3)); | |
}(this, function (exports,d3Quadtree,d3Collection,d3Dispatch,d3Timer) { 'use strict'; | |
function center(x, y) { | |
var nodes; |
<html> | |
<head> | |
<title>Divided Lines II</title> | |
<meta charset="utf-8" /> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.16/d3.min.js"></script> | |
</head> | |
<style> | |
svg { | |
height: 500px; | |
width: 500px; |
<html> | |
<head> | |
<title>Divided Lines</title> | |
<meta charset="utf-8" /> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.16/d3.min.js"></script> | |
</head> | |
<style> | |
svg { | |
height: 500px; | |
width: 500px; |
source | target | |
---|---|---|
FALSE | p&q | |
FALSE | p&¬q | |
FALSE | ¬p&q | |
FALSE | ¬p&¬q | |
p&q | p | |
p&q | q | |
p&q | p IFF q | |
p&¬q | p | |
p&¬q | p IFF ¬q |
{"nodes": [{"id":"1","module":0,"i":0},{"id":"3","module":0,"i":1},{"id":"8","module":2,"i":2},{"id":"9","module":4,"i":3},{"id":"12","module":2,"i":4},{"id":"15","module":2,"i":5},{"id":"23","module":3,"i":6},{"id":"26","module":3,"i":7},{"id":"37","module":10,"i":8},{"id":"46","module":2,"i":9},{"id":"2","module":1,"i":10},{"id":"4","module":2,"i":11},{"id":"5","module":3,"i":12},{"id":"6","module":3,"i":13},{"id":"7","module":1,"i":14},{"id":"10","module":4,"i":15},{"id":"11","module":1,"i":16},{"id":"13","module":1,"i":17},{"id":"14","module":1,"i":18},{"id":"16","module":5,"i":19},{"id":"18","module":1,"i":20},{"id":"19","module":3,"i":21},{"id":"20","module":1,"i":22},{"id":"21","module":6,"i":23},{"id":"22","module":2,"i":24},{"id":"25","module":3,"i":25},{"id":"27","module":1,"i":26},{"id":"28","module":3,"i":27},{"id":"29","module":1,"i":28},{"id":"31","module":2,"i":29},{"id":"33","module":2,"i":30},{"id":"34","module":9,"i":31},{"id":"35","module":1,"i":32},{"id":"38","module":2,"i":33},{"id":"41", |
colorHash = { | |
"white": 0, | |
"black": 360, | |
"Orange Red": 15, | |
"Safety Orange": 25, | |
"Dark Orange": 35, | |
"Amber": 45, | |
"Golden Yellow": 55, | |
"Chartreuse Yellow": 65, | |
"Electric Lime": 75, |
colorHash = { | |
"Red": 0, | |
"Orange Red": 15, | |
"Safety Orange": 25, | |
"Dark Orange": 35, | |
"Amber": 45, | |
"Golden Yellow": 55, | |
"Chartreuse Yellow": 65, | |
"Electric Lime": 75, | |
"Spring Bud": 85, |
This is the code for Chapter 5, Figure 6 from D3.js in Action demonstrating how to make a donut chart using d3.layout.pie().
forked from emeeks's block: Ch. 5, Fig. 6 - D3.js in Action
(function() { | |
d3.hexbin = function() { | |
var width = 1, | |
height = 1, | |
r, | |
x = d3_hexbinX, | |
y = d3_hexbinY, | |
dx, | |
dy; |
(function() { | |
d3.hexbin = function() { | |
var width = 1, | |
height = 1, | |
r, | |
x = d3_hexbinX, | |
y = d3_hexbinY, | |
dx, | |
dy; |