0

Is it possible to do a filtering by binding data with function datum()?

I tried to do so but the function filter() ran once and it filtered the data with all or nothing.

Adam Aiken
  • 418
  • 7
  • 18

1 Answers1

0

.datum() binds a single data element to a DOM element. Any filtering you do on this will affect the entire data. If you want to filter an array and bind to different elements, use .data() -- it doesn't really make sense to use .filter() with .datum().

Lars Kotthoff
  • 107,425
  • 16
  • 204
  • 204