Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Renames for better compatibility. #14

Closed
mbostock opened this issue Feb 4, 2016 · 0 comments
Closed

Renames for better compatibility. #14

mbostock opened this issue Feb 4, 2016 · 0 comments

Comments

@mbostock
Copy link
Member

mbostock commented Feb 4, 2016

In D3 3.x, the request-and-parse methods were renamed:

  • d3.csv ↦ d3.requestCsv
  • d3.html ↦ d3.requestHtml
  • d3.json ↦ d3.requestJson
  • d3.text ↦ d3.requestText
  • d3.tsv ↦ d3.requestTsv
  • d3.xml ↦ d3.requestXml

This was needed in part because this repo, d3-dsv, defines two objects:

  • d3.csv
  • d3.tsv

These objects then expose methods:

  • d3.csv.parse
  • d3.csv.parseRows
  • d3.csv.format
  • d3.csv.formatRows
  • d3.tsv.parse
  • d3.tsv.parseRows
  • d3.tsv.format
  • d3.tsv.formatRows

The downside of this renaming is that the commonly used methods were renamed (and longer), while the less commonly used methods stayed the same.

However, another option would be to retain the short names for requests:

  • d3.csv
  • d3.html
  • d3.json
  • d3.text
  • d3.tsv
  • d3.xml

And rather than exposing d3.csv and d3.tsv objects, expose the methods directly:

  • d3.csvParse
  • d3.csvParseRows
  • d3.csvFormat
  • d3.csvFormatRows
  • d3.tsvParse
  • d3.tsvParseRows
  • d3.tsvFormat
  • d3.tsvFormatRows
mbostock added a commit to d3/d3-request that referenced this issue Feb 4, 2016
And backwards-compatible with 3.x. Renamed:

    d3.requestCsv ↦ d3.csv
    d3.requestHtml ↦ d3.html
    d3.requestJson ↦ d3.json
    d3.requestText ↦ d3.text
    d3.requestTsv ↦ d3.tsv
    d3.requestXml ↦ d3.xml

See d3/d3-dsv#14.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant