Skip to content

Commit 1fbe8f5

Browse files
committed
initial files
0 parents  commit 1fbe8f5

27 files changed

+278
-0
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.DS_Store
2+
npm-debug.log
3+
node_modules

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
## 0.1.0 - First Release
2+
* Add the first snippets

LICENSE.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2016 Martín González <m@martingonzalez.net>
4+
5+
Permission is hereby granted, free of charge, to any person obtaining
6+
a copy of this software and associated documentation files (the
7+
"Software"), to deal in the Software without restriction, including
8+
without limitation the rights to use, copy, modify, merge, publish,
9+
distribute, sublicense, and/or sell copies of the Software, and to
10+
permit persons to whom the Software is furnished to do so, subject to
11+
the following conditions:
12+
13+
The above copyright notice and this permission notice shall be
14+
included in all copies or substantial portions of the Software.
15+
16+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

README.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# d3-snippets
2+
An [Atom](https://atom.io) package with d3 snippets. Accelerate your graphics!
3+
4+
Contributions are appreciated, if you miss a snippet feel free to create an issue or open a pull request.
5+
6+
![d3-snippets in action](https://cloud.githubusercontent.com/assets/1236790/13730058/c2121150-e944-11e5-85fb-2158f62e082d.gif)
7+
8+
## Install
9+
You can install it inside Atom (just search for `d3-snippets`) or via command line:
10+
```
11+
$ apm install d3-snippets
12+
```
13+
14+
## Features
15+
A ton of nifty snippets are included:
16+
- Margin Convention
17+
- Data Join
18+
- Default values for d3 maps
19+
- Queue.js
20+
- d3.json
21+
- d3.csv
22+
- d3.locale
23+
- d3.nest
24+
- d3.select
25+
- d3.selectAll
26+
- Various SVG shapes (circle, rect, line, ellipse)
27+
28+
## Hacking
29+
```
30+
$ cd ~/.atom/packages
31+
$ git clone https://github.com/martgnz/d3-snippets.git
32+
$ cd d3-snippets
33+
$ apm install
34+
$ apm link
35+
```
36+
37+
## Credit
38+
Nearly everything comes from [fabriotav](https://github.com/fabriciotav/d3-snippets-for-sublime-text-2) and [shancarter](https://github.com/shancarter/sublime-text-d3/) Sublime Text packages. I just did the porting!

package.json

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"name": "d3-snippets",
3+
"main": "./lib/d3-snippets",
4+
"version": "0.0.0",
5+
"description": "A collection of d3 snippets. Accelerate your graphics!",
6+
"keywords": [
7+
"d3",
8+
"snippets",
9+
"javascript",
10+
"data visualization"
11+
],
12+
"activationCommands": {
13+
"atom-workspace": "d3-snippets:toggle"
14+
},
15+
"repository": "https://github.com/martgnz/d3-snippets",
16+
"license": "MIT",
17+
"engines": {
18+
"atom": ">=1.0.0 <2.0.0"
19+
},
20+
"dependencies": {
21+
}
22+
}

snippets/attr.cson

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
".source.js":
2+
"attr":
3+
prefix: "attr"
4+
body: "attr('${1:}', '${2:}')"

snippets/circle.cson

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
".source.js":
2+
"SVG Circle":
3+
prefix: "circle"
4+
body: """
5+
.enter().append('circle')
6+
.attr('cx', ${1:})
7+
.attr('cy', ${2:})
8+
.attr('r', ${3:})
9+
.style('fill', '${1:#111}');
10+
"""

snippets/csv.cson

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
".source.js":
2+
"d3.csv":
3+
prefix: "csv"
4+
body: """
5+
d3.csv('${1:}', function(error, data) {
6+
${2:console.log(data);}
7+
});
8+
"""

snippets/data-index.cson

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
".source.js":
2+
"d3 return data and index":
3+
prefix: "fdi"
4+
body: "function(d, i) { return ${1:};}"

snippets/data.cson

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
".source.js":
2+
"d3 return data":
3+
prefix: "fd"
4+
body: "function(d) { return ${1:};}"

0 commit comments

Comments
 (0)