javascript - How to get a subselection of a D3.js selection -


I'm trying to get a sub-selection of a given D3.js selection.

Creates the code path:

  pieces.paths = pieces.groups .append ("path") .attr ("fill", function (d) {return d .data.color;});  

Then, I set the D "D" attribute:

  pieces. Penetration .attr ("d", arc);  

To do the right thing but pieces. There are 3 elements in the pith, and I want to set the first two elements in the class "highest". How can I do this?

is an option:

  pieces. Filter (function (D, i) {returns i <2;}) .attr ("class", "supreme");  

Comments

Popular posts from this blog

import - Python ImportError: No module named wmi -

Editing Python Class in Shell and SQLAlchemy -

c# - MySQL Parameterized Select Query joining tables issue -