Hacker News new | past | comments | ask | show | jobs | submit login

It lacks a ton of key features. No eq(), toggleClass(), show(), length, etc. Sure you can rewrite them in D3 but why bother?



eq() is equivalent to selecting an item from an array and can be replaced by using bracket notation (e.g., arr[1]).

In D3 you can do selection.classed('active', false). This is equivalent to toggleClass().

According to jQuery's API, show() "... is roughly equivalent to calling .css( "display", "block"), except that the display property is restored to whatever it was initially." Instead of show, you can just do selection.transition().duration(300).style(display, 'block').

The length method? You can just use JavaScript's native .length.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: