Skip to content

Instantly share code, notes, and snippets.

@biovisualize
biovisualize / README.md
Last active August 27, 2015 13:40
Simple GitHub Calendar

A simple version of the GiHub commit calendar, just to try to simplify this exemple by using d3.time utilities. if you need this type of calendar, you should know about the cal-heatmap plugin.

@biovisualize
biovisualize / capture.js
Created February 4, 2014 15:56
Phantomjs waitfor and write svg to file
var page = require('webpage').create(),
system = require('system');
fs = require('fs');
var waitFor = function(testFx, onReady, timeOutMillis) {
var maxtimeOutMillis = timeOutMillis ? timeOutMillis : 3000, //< Default Max Timout is 3s
start = new Date().getTime(),
condition = false;
var interval = setInterval(function() {
console.log('wait');
@biovisualize
biovisualize / index.html
Created May 12, 2014 05:13
scrolling line charts with 30K data points
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<script type='text/javascript' src="http://d3js.org/d3.v3.min.js"></script>
<style>
body{
-webkit-backface-visibility: hidden;
}
svg{
@biovisualize
biovisualize / index.html
Last active August 29, 2015 14:01
Resizing canvas preserving antialiasing
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<style>
canvas{
border: silver 1px solid;
}
</style>
</head>
<!DOCTYPE html>
<title>Render Queue</title>
<style type="text/css">
html, body { background: #f7f7f7; height: 100%; margin: 0; padding: 0; color: #b6b6b6; font-family: Ubuntu, Helvetica, sans-serif; font-size: 15px; line-height: 1.35em;}
a { color: #6be; text-decoration: none; }
#canvas { position: fixed; }
#center { position: absolute; top: 0; left: 0; margin: 40px; width: 520px; padding: 20px; background: #444; background: rgba(0,0,0,0.9); border-radius: 8px;}
h1 { margin-top:0; padding: 3px 0; font-size: 1.4em; }
h1, h3 { color: #f9f9f9; border-bottom: 1px solid #333; }
h3 { font-size: 1em; }
@biovisualize
biovisualize / README.md
Last active August 29, 2015 14:02
10K points line chart with progressive rendering

10K points in an interactive line chart using the excellent Kay Chang's (AKA Syntagmatic) progressive rendering.

It also uses some nice tricks like throttling the brush move (from underscore) and bisecting the data points to find the hovered dots. The reactive hover and tooltip clearly shows that the UI is not blocked by the rendering. You can even hover the points before they are rendered!

<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="https://rawgit.com/larskotthoff/d3/axisarrange-tmp/d3.js"></script>
<style type="text/css">
.tick {
stroke: #000;
}
.tickPointer {
stroke: #888;
@biovisualize
biovisualize / _.md
Last active August 29, 2015 14:09
droplet
@biovisualize
biovisualize / README.md
Last active August 29, 2015 14:13 — forked from skokenes/README.md

Test for the version of the Lasso on d3-plugins.

@biovisualize
biovisualize / config.js
Created June 9, 2015 15:00
Cirrus.js code embed
var config = {
container: '.container',
width: 'auto',
height: 'auto',
margin: {top: 50, right: 60, bottom: 70, left: 60},
type: 'bar',
subtype: 'stacked',
labelFormatterX: function(d){
return d3.time.format('%e %b')(new Date(d));
},