Skip to content

Instantly share code, notes, and snippets.

View gabrielflorit's full-sized avatar

Gabriel Florit gabrielflorit

View GitHub Profile
svg {
background: #222;
}
circle {
fill: none;
stroke-width: 1.5px;
}
svg {
background: #012;
}
path {
stroke: #fff;
stroke-opacity: .5;
}
svg {
border: solid 1px #666;
overflow: hidden;
}
path {
fill: yellow;
stroke: #000;
stroke-width: .5px;
}
var url = 'http://examples.oreilly.com/0636920025429/mikedewar-getting_started_with_d3-bdfc34e/visualisations/data/service_status.json';
// only retrieve above script once
$.ajaxSetup({
cache: true
});
var postData = {
'url': url
};
@gabrielflorit
gabrielflorit / water.css
Created July 24, 2012 16:35 — forked from anonymous/water.css
blue bar chart
.chart rect {
stroke: white;
fill: steelblue;
}
var width = $('svg').width();
var height = $('svg').height();
var svg = d3.select('svg');
svg
.attr('width', width)
.attr('height', height);
svg.selectAll('circle')
.data([18, 57, 112, 323])
@gabrielflorit
gabrielflorit / water.css
Created July 24, 2012 16:45 — forked from anonymous/water.css
blue bar chart with axes
.chart rect {
stroke: white;
fill: steelblue;
}
$('svg').css('background', 'black');
var g = d3.select('svg')
.append('g')
.attr('transform', 'translate('
+ $('svg').width()/2
+ ', '
+ 499
+ ')');
{"libraries":["d3"]}
svg {
background: #262626;
}
path {
stroke: white;
fill: red;
stroke-width: 20;
}