D3.js Snippets
D3.js snippets for Sublime Text 2
Labels snippets
Details
Installs
- Total 6K
- Win 3K
- Mac 2K
- Linux 908
Nov 21 | Nov 20 | Nov 19 | Nov 18 | Nov 17 | Nov 16 | Nov 15 | Nov 14 | Nov 13 | Nov 12 | Nov 11 | Nov 10 | Nov 9 | Nov 8 | Nov 7 | Nov 6 | Nov 5 | Nov 4 | Nov 3 | Nov 2 | Nov 1 | Oct 31 | Oct 30 | Oct 29 | Oct 28 | Oct 27 | Oct 26 | Oct 25 | Oct 24 | Oct 23 | Oct 22 | Oct 21 | Oct 20 | Oct 19 | Oct 18 | Oct 17 | Oct 16 | Oct 15 | Oct 14 | Oct 13 | Oct 12 | Oct 11 | Oct 10 | Oct 9 | Oct 8 | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Windows | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
Mac | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
Linux | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 |
Readme
- Source
- raw.githubusercontent.com
D3.js snippets for Sublime Text 2
Selections
sel ⇥ d3.select('')
sela ⇥ d3.selectAll('')
attr ⇥ .attr('', )
translate ⇥ .attr('transform', 'translate(' + 0 + ',' + 0 + ')')
style ⇥ .style('fill', '#000')
join ⇥
d3.selectAll('')
.data()
margin ⇥
var margin = { top: 10, right: 10, bottom: 10, left: 10 };
width = 960 - margin.left - margin.right,
height = 640 - margin.top - margin.bottom;
var svg = d3.select('body').append('svg')
.attr('width', width + margin.left + margin.right)
.attr('height', height + margin.top + margin.bottom)
.append('g')
.attr('transform', 'translate(' + margin.left + ',' + margin.top + ')');
Data
dsv ⇥ var dsv = d3.dsv(';', 'text/plain');
csv ⇥
d3.csv('/', function(d) {
return {
};
}, function(err, rows) {
});
json ⇥
d3.json('/', function(err, data) {
});
SVG shapes
circle ⇥
.enter().append('circle')
.attr('cx', )
.attr('cy', )
.attr('r', )
.style('fill', '#000');
ellipse ⇥
.enter().append('ellipse')
.attr('cx', )
.attr('cy', )
.attr('rx', )
.attr('ry', )
.style('fill', '#000');
line ⇥
.enter().append('line')
.attr('x1', )
.attr('y1', )
.attr('x2', )
.attr('y2', )
.style('stroke', '#000');
rect ⇥
.enter().append('rect')
.attr('x', )
.attr('y', )
.attr('width', )
.attr('height', )
.attr('rx', 0)
.attr('ry', 0)
.style('fill', '#000');
Geography
map ⇥
var projection = d3.geo.equirectangular()
.center([0, 0])
.scale(0)
.translate([width / 2, height / 2]);
var path = d3.geo.path()
.projection(projection);
Functions
fd ⇥ function(d) { return ; }
fdi ⇥ function(d, i) { return ; }
fn ⇥ function() { return ; }
Miscellaneous
scale ⇥ d3.scale.linear().domain([]).range([]);
nest ⇥
var nest = d3.nest()
.key(function(d) { return d; })
.entries([]);
locale ⇥
var d3.locale.en_US = d3.locale({
'decimal': '.',
'thousands': ',',
'grouping': [3],
'currency': ['\$', ''],
'dateTime': '%a %b %e %X %Y',
'date': '%m/%d/%Y',
'time': '%H:%M:%S',
'periods': ['AM', 'PM'],
'days': ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],
'shortDays': ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
'months': ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
'shortMonths': ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
});