Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
richardwhiuk
on May 15, 2015
|
parent
|
context
|
favorite
| on:
Replacing jQuery with D3
or $ = d3.selectAll; surely?
jordanscales
on May 15, 2015
[–]
You also need to re-bind it to d3.
$ = d3.selectAll.bind(d3);
Since `this` in the `selectAll` will refer to whatever is before the period. When we reassign to `$` in `$ = d3.selectAll`, we lose that. Silly, isn't it?
Demo:
http://jsbin.com/guyisewexu/1/edit?js,console
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: