Skip to content

Instantly share code, notes, and snippets.

@bsr203
bsr203 / d3-force.js
Created September 17, 2016 05:13 — forked from emeeks/d3-force.js
Working Rectangular Collide
// 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;

Using Yeoman and Jade

Getting started

  • Make sure you have yo installed: npm install -g yo
  • Run: yo webapp
  • Install grunt-contrib-jade: npm install grunt-contrib-jade --save-dev

Customization

<!DOCTYPE html>
<meta charset="utf-8">
<style>
path.link {
fill: none;
stroke: #666;
stroke-width: 1.5px;
}
marker#licensing {
@bsr203
bsr203 / index.html
Last active December 16, 2015 17:39
<!DOCTYPE html>
<meta charset="utf-8">
<style>
path.link {
fill: none;
stroke: #666;
stroke-width: 1.5px;
}
marker#licensing {
<!DOCTYPE html>
<meta charset="utf-8">
<style>
.node {
stroke: #fff;
stroke-width: 1.5px;
}
.node .selected {
@bsr203
bsr203 / data.tsv
Last active December 14, 2015 15:29
We can make this file beautiful and searchable if this error is corrected: It looks like row 2 should actually have 2 columns, instead of 1. in line 1.
date close
1-May-12 582.13
30-Apr-12 583.98
27-Apr-12 603.00
26-Apr-12 607.70
25-Apr-12 610.00
24-Apr-12 560.28
23-Apr-12 571.70
20-Apr-12 572.98
19-Apr-12 587.44
@bsr203
bsr203 / index.html
Last active December 14, 2015 15:29 — forked from mbostock/.block
<!DOCTYPE html>
<meta charset="utf-8">
<style>
body {
font: 10px sans-serif;
}
.axis path,
.axis line {
@bsr203
bsr203 / data.tsv
Last active December 14, 2015 15:29
We can make this file beautiful and searchable if this error is corrected: It looks like row 2 should actually have 1 column, instead of 2. in line 1.
date close
1-May-12 582.13
30-Apr-12 583.98
27-Apr-12 603.00
26-Apr-12 607.70
25-Apr-12 610.00
24-Apr-12 560.28
23-Apr-12 571.70
20-Apr-12 572.98
19-Apr-12 587.44
module.exports = function( grunt ) {
'use strict';
//
// Grunt configuration:
//
// https://github.com/cowboy/grunt/blob/master/docs/getting_started.md
//
grunt.initConfig({
// Project configuration
<!DOCTYPE html>
<meta charset="utf-8">
<style>
.update {
fill: blue;
}
</style>