#D3.js code snippets
This extension contains code snippets for D3.js on Visual Studio Code.
https://marketplace.visualstudio.com/items/yoyo.D3Snippets
##Installation
- Install Visual Studio Code first on https://code.visualstudio.com/
- Open Command Pallete (Ctrl/Cmd + Shift + P)
- Key in: Extensions: Install Extension
- Search D3.js code snippets
Snippets
⇥ means the TAB key
Trigger |
Content |
sel→ |
d3.select |
sela→ |
d3.selectAll |
attr→ |
.attr(' ', ) |
translate→ |
.attr('transform', 'translate(' + 0 + ',' + 0 + ')') |
style→ |
.style(' ', ) |
scale→ |
D3 scale |
nest→ |
D3 nest |
###Data
| Trigger | Content |
| -------: | ------- |
| csv→ | d3.csv|
| dsv→ | d3.dsv|
| json→ |d3.json |
###SVG
| Trigger | Content |
| -------: | ------- |
| circle→ | svg:circle|
| ellipse→ | svg:ellipse|
| line→ | svg:line|
| rect→ | svg:rect|
###Function
| Trigger | Content |
| -------: | ------- |
| af→ | Anonymous Function|
| |