Skip to content

Instantly share code, notes, and snippets.

@biovisualize
biovisualize / index.html
Created July 10, 2012 20:04
Checkbox in foreignObject
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.js"></script>
</head>
<body>
<script type="text/javascript">
var svg = d3.select("body").append("svg")
.attr("width", 100)
.attr("height", 100);
@biovisualize
biovisualize / fiddle.css
Created July 12, 2012 07:02
jsFiddle/Gist template
.domain{
display: none;
}
@biovisualize
biovisualize / index.html
Last active February 15, 2017 13:25
Posting gist/blocks to blogger
<!-- Override Gist styling -->
<style type="text/css">
iframe{background-color: #0a0a0a;}
div.gist-syntax {background-color:#0a0a0a!important;}
div.gist {color:#ccc!important;}
span.nt, span.kd, span.k, span.o{color:aliceblue!important;}
.gist .gist-file{border-color:#444!important;}
.gist .gist-file .gist-meta{background-color:#0a0a0a!important;}
</style>
@biovisualize
biovisualize / geodesic.js
Created July 17, 2012 22:12 — forked from mbostock/.block
Icosahedron
(function() {
var φ = 1.618033988749895,
ρ = 180 / Math.PI;
var vertices = [
[1,φ,0], [-1,φ,0], [1,-φ,0], [-1,-φ,0],
[0,1,φ], [0,-1,φ], [0,1,-φ], [0,-1,-φ],
[φ,0,1], [-φ,0,1], [φ,0,-1], [-φ,0,-1]
];
@biovisualize
biovisualize / index.html
Created November 15, 2012 18:31
bl.ocks revision problem
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.js"></script>
</head>
<body>
<div class="viz"></div>
<script type="text/javascript">
var sampleSVG = d3.select(".viz")
@biovisualize
biovisualize / data.csv
Created November 28, 2012 17:43
Simple line chart
wl intensity r g b
300.0 11596267742211.613 0 0 0
301.00143061516451 11726043308732.258 0 0 0
302.00286123032902 11855744306329.936 0 0 0
303.00429184549358 11985353849584.15 0 0 0
304.00572246065803 12114855226784.52 0 0 0
305.0071530758226 12244231903068.889 0 0 0
306.00858369098711 12373467523405.512 0 0 0
307.01001430615162 12502545915422.795 0 0 0
308.01144492131618 12631451092087.922 0 0 0
@biovisualize
biovisualize / compat.js
Created November 30, 2012 16:49
Sankey Viz using R2D3
// https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/map
// Production steps of ECMA-262, Edition 5, 15.4.4.19
// Reference: http://es5.github.com/#x15.4.4.19
if (!Array.prototype.map) {
Array.prototype.map = function(callback, thisArg) {
var T, A, k;
if (this == null) {
throw new TypeError(" this is null or not defined");
@biovisualize
biovisualize / pivot_spec.js
Created November 30, 2012 19:00
Pivot/aggregate function jasmine specs
describe('New Pivot Function', function() {
var pivot, data, columnNames;
beforeEach(function () {
data = [
['P1', 'R1', 'T1', 10, 3],
['P1', 'R1', 'T2', 20, 12],
['P1', 'R2', 'T1', 3, 1],
['P2', 'R2', 'T2', 4, 40]];
@biovisualize
biovisualize / basic-editable-table.js
Created December 5, 2012 07:15
Reusable Circular Network with Editable Data Table
var Table = function module() {
var dispatch = d3.dispatch("edit");
function exports(_selection) {
_selection.each(function (_dataset) {
//________________________________________________
// Data
//________________________________________________
var data = _dataset[0];
@biovisualize
biovisualize / _.md
Created December 9, 2012 21:27
Circular network in Tributary