Re:Replacing jQuery with D3
by richardwhiuk on Friday May 15, 2015 @08:24AM
(#9550104)
or $ = d3.selectAll; surely?
[ Parent
| on HN ]
Re:Replacing jQuery with D3
by prezjordan on Friday May 15, 2015 @10:01AM
(#9550595)
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?