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

Don’t set the this context. #17

Closed
11 tasks done
mbostock opened this issue Nov 12, 2015 · 1 comment
Closed
11 tasks done

Don’t set the this context. #17

mbostock opened this issue Nov 12, 2015 · 1 comment
Assignees

Comments

@mbostock
Copy link
Member

The nest operator is currently using rollup.call(nest, array) but rollup(array) should be sufficient. I don’t see a good reason to set the nest instance as this. Related:

  • nest.rollup uses rollup.call(nest, array) but could use rollup(array).
  • extent uses f.call(array, d, i), but could use f(d, i, array).
  • max uses f.call(array, d, i), but could use f(d, i, array).
  • min uses f.call(array, d, i), but could use f(d, i, array).
  • mean uses f.call(array, d, i), but could use f(d, i, array).
  • median uses f.call(array, d, i), but could use f(d, i, array).
  • sum uses f.call(array, d, i), but could use f(d, i, array).
  • variance uses f.call(array, d, i), but could use f(d, i, array).
  • map.each uses f.call(map, value, key), but could use f(value, key, map).
  • set.each uses f.call(set, value), but could use f(value, value, set). (Note: repeated value!)
  • tests!
@mbostock mbostock changed the title nest.rollup needn’t set the this context. Don’t set the this context. Nov 19, 2015
@mbostock
Copy link
Member Author

Related d3/d3#2246 regarding ES6 arrow functions.

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