Skip to content

Instantly share code, notes, and snippets.

@biovisualize
biovisualize / index.html
Created April 12, 2013 03:49
Simple Binary Tree
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title></title>
<script type="text/javascript" src="http://d3js.org/d3.v3.min.js"></script>
<style type="text/css">
</style>
</head>
<body>
@biovisualize
biovisualize / index.html
Last active October 15, 2018 01:29
D3.js Reusable Bar Chart with Angularjs
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<style>
body {
font: 14px sans-serif;
}
.axis path, .axis line {
fill: none;
@biovisualize
biovisualize / README.md
Created April 15, 2013 22:25
Binary tree

Binary tree with zoom/pan, percent leaves, link labels and path highlights

@biovisualize
biovisualize / index.html
Last active February 21, 2023 21:08
Fast pixel drawing on canvas
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<script type="text/javascript" src="http://d3js.org/d3.v3.min.js"></script>
<style type="text/css">
</style>
</head>
@biovisualize
biovisualize / index.html
Last active December 16, 2015 11:49
Parse dates with quarters (i.e., "Q4-2010")
<html>
<head>
<script src="http://d3js.org/d3.v3.min.js"></script>
</head>
<body>
<script>
var dates = ["Q4-2010", "Q1-2011", "Q2-2011", "Q3-2011", "Q4-2011", "Q1-2012", "Q2-2012", "Q3-2012","Q4-2012"];
var dateParsed = dates.map(function(d, i){
var splitted = d.split('-');
var quarterEndMonth = splitted[0].charAt(1) * 3;
/*
d3.phylogram.js
Wrapper around a d3-based phylogram (tree where branch lengths are scaled)
Also includes a radial dendrogram visualization (branch lengths not scaled)
along with some helper methods for building angled-branch trees.
d3.phylogram.build(selector, nodes, options)
Creates a phylogram.
Arguments:
selector: selector of an element that will contain the SVG
@biovisualize
biovisualize / index.html
Created May 1, 2013 03:41
Basic SVG grid
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title></title>
<script type='text/javascript' src="http://mbostock.github.com/d3/d3.js"></script>
<style type='text/css'>
.cell{
stroke: silver;
}
@biovisualize
biovisualize / index.html
Created May 1, 2013 16:49
Cellular Automaton Maze
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title></title>
<script type='text/javascript' src="http://mbostock.github.com/d3/d3.js"></script>
<style type='text/css'>
.cell{
stroke: none;
}
@biovisualize
biovisualize / _.md
Created May 14, 2013 07:25
Hexbin experiments
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Timeline - Proof-of-concept</title>
<!-- That's my local d3 path. When working locally, use your local path. -->
<!--<script src="../../../lib/d3/d3.v3.js"></script>-->