d3 / d3-selection

Transform the DOM by selecting elements and joining to data.

Home Page:https://d3js.org/d3-selection

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

selection.selectChildren() to select immediate children

adumesny opened this issue · comments

Would be nice to have a selection.selectChildren() (which could take for example 'g' for immediate node instead of all nested g, or empty for '*') shortcut for what might be very common - see https://stackoverflow.com/questions/20569670/d3-selector-for-immediate-children

Right now I had to research this and do this in Typescript (complains in Typescript even with latest @types/selection (so have to cast to any - yuck)

this.container.selectAll(function() {return this.children;} as any)

(where container is selection of my svg root).

see discussion in #63 as well.

First pass: #244.

that's great. thank you.

hey thanks for adding test cases and fixes. What is the likelihood of getting this a in release soon ?
I presume I can sync to a newer d3-selection than what d3 v5.16 gets me