Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

selection.selectChildren() to select immediate children #243

Closed
adumesny opened this issue Apr 25, 2020 · 4 comments
Closed

selection.selectChildren() to select immediate children #243

adumesny opened this issue Apr 25, 2020 · 4 comments

Comments

@adumesny
Copy link

adumesny commented Apr 25, 2020

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.

@mbostock
Copy link
Member

First pass: #244.

@adumesny
Copy link
Author

that's great. thank you.

@adumesny
Copy link
Author

adumesny commented Jul 9, 2020

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

@Fil
Copy link
Member

Fil commented Aug 23, 2020

Fixed in 04e9e75

@Fil Fil closed this as completed Aug 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants