Skip to content

Commit 79a0c10

Browse files
committed
Export to d3.
Related d3/d3#2840.
1 parent e3b5455 commit 79a0c10

File tree

3 files changed

+9
-10
lines changed

3 files changed

+9
-10
lines changed

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,13 @@ Selections are immutable. All selection methods that affect which elements are s
3636

3737
## Installing
3838

39-
If you use NPM, `npm install d3-selection`. Otherwise, download the [latest release](https://github.com/d3/d3-selection/releases/latest). You can also load directly from [d3js.org](https://d3js.org), either as a [standalone library](https://d3js.org/d3-selection.v0.7.min.js) or as part of [D3 4.0](https://github.com/d3/d3). AMD, CommonJS, and vanilla environments are supported. In vanilla, a `d3_selection` global is exported:
39+
If you use NPM, `npm install d3-selection`. Otherwise, download the [latest release](https://github.com/d3/d3-selection/releases/latest). You can also load directly from [d3js.org](https://d3js.org), either as a [standalone library](https://d3js.org/d3-selection.v0.8.min.js) or as part of [D3 4.0](https://github.com/d3/d3). AMD, CommonJS, and vanilla environments are supported. In vanilla, a `d3` global is exported:
4040

4141
```html
42-
<script src="https://d3js.org/d3-selection.v0.7.min.js"></script>
42+
<script src="https://d3js.org/d3-selection.v0.8.min.js"></script>
4343
<script>
4444
45-
var div = d3_selection.selectAll("div");
45+
var div = d3.selectAll("div");
4646
4747
</script>
4848
```

index.js

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
export {version} from "./build/package";
21
export {default as creator} from "./src/creator";
32
export {default as local} from "./src/local";
43
export {default as matcher} from "./src/matcher";

package.json

+6-6
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"selection",
99
"data-join"
1010
],
11-
"homepage": "https://github.com/d3/d3-selection",
11+
"homepage": "https://d3js.org/d3-selection/",
1212
"license": "BSD-3-Clause",
1313
"author": {
1414
"name": "Mike Bostock",
@@ -21,16 +21,16 @@
2121
"url": "https://github.com/d3/d3-selection.git"
2222
},
2323
"scripts": {
24-
"pretest": "rm -rf build && mkdir build && json2module package.json > build/package.js && rollup -f umd -n d3_selection -o build/d3-selection.js -- index.js",
24+
"pretest": "rm -rf build && mkdir build && rollup --banner \"$(preamble)\" -f umd -n d3 -o build/d3-selection.js -- index.js",
2525
"test": "tape 'test/**/*-test.js' && eslint index.js src",
26-
"prepublish": "npm run test && uglifyjs build/d3-selection.js -c -m -o build/d3-selection.min.js",
27-
"postpublish": "VERSION=`node -e 'console.log(require(\"./package.json\").version)'`; git push && git push --tags && cp build/d3-selection.js ../d3.github.com/d3-selection.v0.7.js && cp build/d3-selection.min.js ../d3.github.com/d3-selection.v0.7.min.js && cd ../d3.github.com && git add d3-selection.v0.7.js d3-selection.v0.7.min.js && git commit -m \"d3-selection ${VERSION}\" && git push && cd - && zip -j build/d3-selection.zip -- LICENSE README.md build/d3-selection.js build/d3-selection.min.js"
26+
"prepublish": "npm run test && uglifyjs --preamble \"$(preamble)\" build/d3-selection.js -c -m -o build/d3-selection.min.js",
27+
"postpublish": "VERSION=`node -e 'console.log(require(\"./package.json\").version)'`; git push && git push --tags && cp build/d3-selection.js ../d3.github.com/d3-selection.v0.8.js && cp build/d3-selection.min.js ../d3.github.com/d3-selection.v0.8.min.js && cd ../d3.github.com && git add d3-selection.v0.8.js d3-selection.v0.8.min.js && git commit -m \"d3-selection ${VERSION}\" && git push && cd - && zip -j build/d3-selection.zip -- LICENSE README.md build/d3-selection.js build/d3-selection.min.js"
2828
},
2929
"devDependencies": {
3030
"eslint": "2",
3131
"jsdom": "9",
32-
"json2module": "0.0",
33-
"rollup": "0.26",
32+
"package-preamble": "0.0",
33+
"rollup": "0.27",
3434
"tape": "4",
3535
"uglify-js": "2"
3636
}

0 commit comments

Comments
 (0)