javascript - D3.js data key function -


i have troubles understand key function of data method. know how 'data join' working. question doesn't ask explication of how 'enter' section created.

here find jsfiddle http://jsfiddle.net/milottit/gv1qvdl2/10/. use key function output not expected. why when use key function function(d, i) { return i; } first 2 data values bound existing paragraph? noticed if use whatever key function uses i function(d, i) { return "azerty"+i; } results same. 2 first data values bound. see http://jsfiddle.net/milottit/gv1qvdl2/11/.

what expecting should use following key function instead function(d, i) { return "already existing paragraph " + i; } bind first 2 values.

what happening?


Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -