pxkw.hatenadiary.com

めもめも

D3のenterとupdateとexitについて

Thinking with Joins : http://bost.ocks.org/mike/join/

The empty selection is joined to data: data(data). The data method binds data to elements, producing three virtual selections: enterupdate and exit. The enter selection contains placeholders for any missing elements. The update selection contains existing elements, bound to data. Any remaining elements end up in the exit selection for removal.

  • enter
    dataがバインドできない、
    不足分の空エレメント
  • < >   <- こいつにappendする感じ
  • update
    dataにバインドされる既存エレメント
  • exit
    上記以外(dataをバインドして余ったエレメント?)

(で合ってるかな...)