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*.selection() returns itself #248

Merged
merged 3 commits into from
Jul 23, 2020
Merged

*selection*.selection() returns itself #248

merged 3 commits into from
Jul 23, 2020

Conversation

Fil
Copy link
Member

@Fil Fil commented Jun 29, 2020

fixes #238

"demo" (or rather, playground) at https://observablehq.com/d/a722404aa28e9fc9

@mbostock
Copy link
Member

transition.selection is used to distinguish a transition from a selection in d3-axis.

@Fil
Copy link
Member Author

Fil commented Jun 29, 2020

We have the case in:

If I'm not mistaken, in axis and zoom what we want is the selection, so using selection.selection() without checking would work in both cases (the code would only get simpler). The only place where it's an issue is in brush, where we would have to find another way to test (maybe check for the tween method?).

@mbostock
Copy link
Member

Ah, you’re right. d3-axis and d3-zoom do context !== selection to check, and that will still work. d3-brush could do the same.

Fil added a commit to d3/d3-brush that referenced this pull request Jul 2, 2020
@Fil Fil added the feature label Jul 10, 2020
@Fil Fil mentioned this pull request Jul 10, 2020
Merged
9 tasks
@Fil Fil changed the base branch from master to two July 23, 2020 09:43
@Fil Fil merged commit e30ceae into two Jul 23, 2020
@Fil Fil deleted the selection.selection-238 branch July 23, 2020 09:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3 participants