Skip to content

Commit

Permalink
Prepare for release.
Browse files Browse the repository at this point in the history
  • Loading branch information
mbostock committed Jan 28, 2018
1 parent 3a4bd58 commit fda01a5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
14 changes: 6 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ d3.csv("/path/to/file.csv").then(function(data) {
});
```

This module has built-in support for parsing [JSON](#json), [CSV](#csv), and [TSV](#tsv). You can parse additional formats by using [text](#text) directly. This module is intended to replace [d3-request](https://github.com/d3/d3-request).
This module has built-in support for parsing [JSON](#json), [CSV](#csv), and [TSV](#tsv). You can parse additional formats by using [text](#text) directly. (This module replaced [d3-request](https://github.com/d3/d3-request).)

## Installing

If you use NPM, `npm install d3-fetch`. Otherwise, download the [latest release](https://github.com/d3/d3-fetch/releases/latest). You can also load directly from [d3js.org](https://d3js.org) as a [standalone library](https://d3js.org/d3-fetch.v0.min.js). AMD, CommonJS, and vanilla environments are supported. In vanilla, a `d3` global is exported:
If you use NPM, `npm install d3-fetch`. Otherwise, download the [latest release](https://github.com/d3/d3-fetch/releases/latest). You can also load directly from [d3js.org](https://d3js.org) as a [standalone library](https://d3js.org/d3-fetch.v1.min.js). AMD, CommonJS, and vanilla environments are supported. In vanilla, a `d3` global is exported:

```html
<script src="https://d3js.org/d3-dsv.v1.min.js"></script>
<script src="https://d3js.org/d3-fetch.v0.min.js"></script>
<script src="https://d3js.org/d3-fetch.v1.min.js"></script>
<script>
d3.csv("/path/to/file.csv").then(function(data) {
Expand All @@ -34,8 +34,6 @@ d3.csv("/path/to/file.csv").then(function(data) {
</script>
```

[Try d3-fetch in your browser.](https://runkit.com/npm/d3-fetch)

## API Reference

<a name="blob" href="#blob">#</a> d3.<b>blob</b>(<i>input</i>[, <i>init</i>]) [<>](https://github.com/d3/d3-fetch/blob/master/src/blob.js "Source")
Expand All @@ -48,7 +46,7 @@ Fetches the binary file at the specified *input* URL as an ArrayBuffer. If *init

<a name="csv" href="#csv">#</a> d3.<b>csv</b>(<i>input</i>[, <i>init</i>][, <i>row</i>]) [<>](https://github.com/d3/d3-fetch/blob/master/src/dsv.js "Source")

Equivalent to [dsv](#dsv) with the tab character as the delimiter.
Equivalent to [d3.dsv](#dsv) with the tab character as the delimiter.

<a name="dsv" href="#dsv">#</a> d3.<b>dsv</b>(<i>delimiter</i>, <i>input</i>[, <i>init</i>][, <i>row</i>]) [<>](https://github.com/d3/d3-fetch/blob/master/src/dsv.js "Source")

Expand All @@ -69,7 +67,7 @@ d3.dsv(",", "test.csv", function(d) {

If only one of *init* and *row* is specified, it is interpreted as the *row* conversion function if it is a function, and otherwise an *init* object.

See also [csv](#csv) and [tsv](#tsv).
See also [d3.csv](#csv) and [d3.tsv](#tsv).

<a name="image" href="#image">#</a> d3.<b>image</b>(<i>input</i>[, <i>init</i>]) [<>](https://github.com/d3/d3-fetch/blob/master/src/image.js "Source")

Expand All @@ -91,4 +89,4 @@ Fetches the text file at the specified *input* URL.

<a name="tsv" href="#tsv">#</a> d3.<b>tsv</b>(<i>input</i>[, <i>init</i>][, <i>row</i>]) [<>](https://github.com/d3/d3-fetch/blob/master/src/dsv.js "Source")

Equivalent to [dsv](#dsv) with the tab character as the delimiter.
Equivalent to [d3.dsv](#dsv) with the tab character as the delimiter.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"pretest": "rm -rf dist && mkdir dist && rollup -c --banner \"$(preamble)\"",
"test": "tape 'test/**/*-test.js'",
"prepublishOnly": "npm run test && uglifyjs -b beautify=false,preamble=\"'$(preamble)'\" dist/d3-fetch.js -c -m -o dist/d3-fetch.min.js",
"postpublish": "git push && git push --tags && cd ../d3.github.com && git pull && cp ../d3-fetch/dist/d3-fetch.js d3-fetch.v0.js && cp ../d3-fetch/dist/d3-fetch.min.js d3-fetch.v0.min.js && git add d3-fetch.v0.js d3-fetch.v0.min.js && git commit -m \"d3-fetch ${npm_package_version}\" && git push && cd - && zip -j dist/d3-fetch.zip -- LICENSE README.md dist/d3-fetch.js dist/d3-fetch.min.js"
"postpublish": "git push && git push --tags && cd ../d3.github.com && git pull && cp ../d3-fetch/dist/d3-fetch.js d3-fetch.v1.js && cp ../d3-fetch/dist/d3-fetch.min.js d3-fetch.v1.min.js && git add d3-fetch.v1.js d3-fetch.v1.min.js && git commit -m \"d3-fetch ${npm_package_version}\" && git push && cd - && zip -j dist/d3-fetch.zip -- LICENSE README.md dist/d3-fetch.js dist/d3-fetch.min.js"
},
"dependencies": {
"d3-dsv": "1"
Expand All @@ -35,6 +35,6 @@
"package-preamble": "0.1",
"rollup": "0.52",
"tape": "4",
"uglify-js": "3"
"uglify-js": "3.2"
}
}

0 comments on commit fda01a5

Please sign in to comment.