diff options
author | Karel Kočí <cynerd@email.cz> | 2016-06-30 16:03:25 +0200 |
---|---|---|
committer | Karel Kočí <cynerd@email.cz> | 2016-06-30 16:03:25 +0200 |
commit | e573b3020c032400eed60b649a2cbf55266e6bb0 (patch) | |
tree | 8f572394ac8433529c7a8e70d160a2fbe8268b4e /vim/bundle/vim-snippets/snippets/javascript/javascript.d3.snippets | |
parent | b8c667bd64b3edd38d56c63c5bd1db53a23b4499 (diff) | |
download | myconfigs-e573b3020c032400eed60b649a2cbf55266e6bb0.tar.gz myconfigs-e573b3020c032400eed60b649a2cbf55266e6bb0.tar.bz2 myconfigs-e573b3020c032400eed60b649a2cbf55266e6bb0.zip |
Add current configurations from old repository
Diffstat (limited to 'vim/bundle/vim-snippets/snippets/javascript/javascript.d3.snippets')
-rw-r--r-- | vim/bundle/vim-snippets/snippets/javascript/javascript.d3.snippets | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/vim/bundle/vim-snippets/snippets/javascript/javascript.d3.snippets b/vim/bundle/vim-snippets/snippets/javascript/javascript.d3.snippets new file mode 100644 index 0000000..f5be918 --- /dev/null +++ b/vim/bundle/vim-snippets/snippets/javascript/javascript.d3.snippets @@ -0,0 +1,30 @@ +snippet .attr + .attr("${1}", ${2}) +snippet .style + .style("${1}", ${2}) +snippet axis + d3.svg.axis() + .orient(${1}) + .scale(${2}) +snippet fd + function(d) { ${1} } +snippet fdi + function(d, i) { ${1} } +snippet marginconvention + var ${1:margin} = { top: ${2:10}, right: ${3:10}, bottom: ${4:10}, left: ${5:10} }; + var ${6:width} = ${7:970} - $1.left - $1.right; + var ${8:height} = ${9:500} - $1.top - $1.bottom; + + var ${10:svg} = d3.select("${11}").append("svg") + .attr("width", $6 + $1.left + $1.right) + .attr("height", $8 + $1.top + $1.bottom) + .append("g") + .attr("transform", "translate(" + $1.left + "," + $1.top + ")") +snippet nest + d3.nest() + .key(${1}) + .entries(${2}) +snippet scale + d3.scale.linear() + .domain(${1}) + .range(${2}) |