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.
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.
.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()
.