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

hunt down the rest of the bad selectAlls #1239

Closed
gordonwoodhull opened this issue Dec 19, 2016 · 6 comments
Closed

hunt down the rest of the bad selectAlls #1239

gordonwoodhull opened this issue Dec 19, 2016 · 6 comments
Assignees
Labels
Milestone

Comments

@gordonwoodhull gordonwoodhull added this to the v2.0 milestone Dec 19, 2016
@gordonwoodhull gordonwoodhull self-assigned this Dec 19, 2016
@gordonwoodhull
Copy link
Contributor Author

gordonwoodhull commented Dec 19, 2016

Checkbox the permalinks to these lines in today's develop branch:

bubble chart

bubble mixin

@gordonwoodhull
Copy link
Contributor Author

gordonwoodhull commented Dec 19, 2016

heatmap

fixed in #1032

these are harmless but the selectAll of g.rows and g.cols above them is misleading - makes them look like a grouped selection when really it's just a simple axis-like g containing them. can be fixed without creating more tests. fixed in 0260b13

@gordonwoodhull
Copy link
Contributor Author

gordonwoodhull commented Dec 19, 2016

geo choropleth

This chart uses a non-standard data model, so these uses, although they look suspicious, actually work in the presence of data not updated in place. This is because the join is only between the map data and the elements, not between the crossfilter(ish) data and the elements. Instead the crossfilter data is read separately from its own array.

In fact, selectAll may be wanted in order not to rebind anything, because it should stay bound to the map.

I'm uncomfortable with this data model, and think that the crossfilter data should probably be bound with the map data before both are bound with the svg elements. This is the problem that causes it to be hard to e.g. add d3.tip support to the choropleth, because the crossfilter(ish) data is hidden. But I don't propose to fix that atm.

I also note that while #719 is a complete rewrite, and avoids some d3.select confusion through a lot of d3.select(x.parentNode).datum(), it still has the parallel data.

So this selectAll does not rebind data but it uses the parallel data[] instead:

These ones look like they are selecting a single item but they are actually selecting all regions, and again the use of selectAll is probably intentional because the map is the only bound data:

I've verified with a bunch of new tests in aa27858 that the chart is not relying on data being modified in-place.

@gordonwoodhull
Copy link
Contributor Author

gordonwoodhull commented Dec 19, 2016

line chart

overkill, ugly way to update a title but probably harmless. unfortunate to remove titles in order to update them, but the alternative is a very messy join on an array of one element and an explicit data carry-through. (the "add if not there" pattern is pretty gross if you're trying to pass data through from a previous selectAll.)

misleading as above

these can be fixed without writing new tests.

@gordonwoodhull
Copy link
Contributor Author

gordonwoodhull commented Dec 19, 2016

row chart

overkill as above

can be fixed without writing new tests.

line chart and row chart messiness fixed in f7e0a47

gordonwoodhull added a commit that referenced this issue Dec 19, 2016
there's only one or zero being selected
select should be paired with append
for #1239
gordonwoodhull added a commit that referenced this issue Dec 19, 2016
gordonwoodhull added a commit that referenced this issue Dec 19, 2016
supposedly for #1239 but not breaking because of the weird
way geo binds data
@gordonwoodhull
Copy link
Contributor Author

in 2.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant