Skip to content

Commit

Permalink
Fix #15 - rename d3.dsv to d3.dsvFormat.
Browse files Browse the repository at this point in the history
  • Loading branch information
mbostock committed Feb 23, 2016
1 parent 8558abd commit 7a9d731
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ For easy loading of DSV files in a browser, see [d3-request](https://github.com/
If you use NPM, `npm install d3-dsv`. Otherwise, download the [latest release](https://github.com/d3/d3-dsv/releases/latest). The released bundle supports AMD, CommonJS, and vanilla environments. Create a custom build using [Rollup](https://github.com/rollup/rollup) or your preferred bundler. You can also load directly from [d3js.org](https://d3js.org):

```html
<script src="https://d3js.org/d3-dsv.v0.2.min.js"></script>
<script src="https://d3js.org/d3-dsv.v0.3.min.js"></script>
```

In a vanilla environment, a `d3_dsv` global is exported. [Try d3-dsv in your browser.](https://tonicdev.com/npm/d3-dsv)
Expand All @@ -40,37 +40,37 @@ In a vanilla environment, a `d3_dsv` global is exported. [Try d3-dsv in your bro

<a name="csvParse" href="#csvParse">#</a> d3.<b>csvParse</b>(<i>string</i>[, <i>row</i>])

Equivalent to [dsv](#dsv)(",").[parse](#dsv_parse).
Equivalent to [dsvFormat](#dsvFormat)(",").[parse](#dsv_parse).

<a name="csvParseRows" href="#csvParseRows">#</a> d3.<b>csvParseRows</b>(<i>string</i>[, <i>row</i>])

Equivalent to [dsv](#dsv)(",").[parseRows](#dsv_parseRows).
Equivalent to [dsvFormat](#dsvFormat)(",").[parseRows](#dsv_parseRows).

<a name="csvFormat" href="#csvFormat">#</a> d3.<b>csvFormat</b>(<i>rows</i>[, <i>columns</i>])

Equivalent to [dsv](#dsv)(",").[format](#dsv_format).
Equivalent to [dsvFormat](#dsvFormat)(",").[format](#dsv_format).

<a name="csvFormatRows" href="#csvFormatRows">#</a> d3.<b>csvFormatRows</b>(<i>rows</i>)

Equivalent to [dsv](#dsv)(",").[formatRows](#dsv_formatRows).
Equivalent to [dsvFormat](#dsvFormat)(",").[formatRows](#dsv_formatRows).

<a name="tsvParse" href="#tsvParse">#</a> d3.<b>tsvParse</b>(<i>string</i>[, <i>row</i>])

Equivalent to [dsv](#dsv)("\t").[parse](#dsv_parse).
Equivalent to [dsvFormat](#dsvFormat)("\t").[parse](#dsv_parse).

<a name="tsvParseRows" href="#tsvParseRows">#</a> d3.<b>tsvParseRows</b>(<i>string</i>[, <i>row</i>])

Equivalent to [dsv](#dsv)("\t").[parseRows](#dsv_parseRows).
Equivalent to [dsvFormat](#dsvFormat)("\t").[parseRows](#dsv_parseRows).

<a name="tsvFormat" href="#tsvFormat">#</a> d3.<b>tsvFormat</b>(<i>rows</i>[, <i>columns</i>])

Equivalent to [dsv](#dsv)("\t").[format](#dsv_format).
Equivalent to [dsvFormat](#dsvFormat)("\t").[format](#dsv_format).

<a name="tsvFormatRows" href="#tsvFormatRows">#</a> d3.<b>tsvFormatRows</b>(<i>rows</i>)

Equivalent to [dsv](#dsv)("\t").[formatRows](#dsv_formatRows).
Equivalent to [dsvFormat](#dsvFormat)("\t").[formatRows](#dsv_formatRows).

<a name="dsv" href="#dsv">#</a> d3.<b>dsv</b>(<i>delimiter</i>)
<a name="dsvFormat" href="#dsvFormat">#</a> d3.<b>dsvFormat</b>(<i>delimiter</i>)

Constructs a new DSV parser and formatter for the specified *delimiter*. The *delimiter* must be a single character (*i.e.*, a single 16-bit code unit); so, ASCII delimiters are fine, but emoji delimiters are not.

Expand Down
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export {default as dsv} from "./src/dsv";
export {default as dsvFormat} from "./src/dsv";
export {csvParse, csvParseRows, csvFormat, csvFormatRows} from "./src/csv";
export {tsvParse, tsvParseRows, tsvFormat, tsvFormatRows} from "./src/tsv";
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"pretest": "mkdir -p build && node -e 'process.stdout.write(\"var version = \\\"\" + require(\"./package.json\").version + \"\\\"; export * from \\\"../index\\\"; export {version};\");' > build/bundle.js && rollup -f umd -n d3_dsv -o build/d3-dsv.js -- build/bundle.js",
"test": "faucet `find test -name '*-test.js'` && eslint index.js src",
"prepublish": "npm run test && uglifyjs build/d3-dsv.js -c -m -o build/d3-dsv.min.js && rm -f build/d3-dsv.zip && zip -j build/d3-dsv.zip -- LICENSE README.md build/d3-dsv.js build/d3-dsv.min.js",
"postpublish": "VERSION=`node -e 'console.log(require(\"./package.json\").version)'`; git push && git push --tags && cp build/d3-dsv.js ../d3.github.com/d3-dsv.v0.2.js && cp build/d3-dsv.min.js ../d3.github.com/d3-dsv.v0.2.min.js && cd ../d3.github.com && git add d3-dsv.v0.2.js d3-dsv.v0.2.min.js && git commit -m \"d3-dsv ${VERSION}\" && git push"
"postpublish": "VERSION=`node -e 'console.log(require(\"./package.json\").version)'`; git push && git push --tags && cp build/d3-dsv.js ../d3.github.com/d3-dsv.v0.3.js && cp build/d3-dsv.min.js ../d3.github.com/d3-dsv.v0.3.min.js && cd ../d3.github.com && git add d3-dsv.v0.3.js d3-dsv.v0.3.min.js && git commit -m \"d3-dsv ${VERSION}\" && git push"
},
"devDependencies": {
"faucet": "0.0",
Expand Down
2 changes: 1 addition & 1 deletion test/dsv-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ var tape = require("tape"),
fs = require("fs"),
table = require("./table");

var psv = dsv.dsv("|");
var psv = dsv.dsvFormat("|");

tape("dsv(\"|\").parse(string) returns the expected objects", function(test) {
test.deepEqual(psv.parse("a|b|c\n1|2|3\n"), table([{a: "1", b: "2", c: "3"}], ["a", "b", "c"]));
Expand Down

0 comments on commit 7a9d731

Please sign in to comment.