Skip to content
New issue

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

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

Already on GitHub? # to your account

Heatmaps seem to be empty after crossfilter reloads data #1032

Closed
wants to merge 1 commit into from

Conversation

smee
Copy link
Contributor

@smee smee commented Oct 29, 2015

selectAll does not inherit data from its parent. This means that if the underlying crossfilter gets new data the selection of g.box-group will see the new data, the children title and rect will not. The optical result of that is a seemingly empty heatmap although the data has changed.

`selectAll` does not inherit data from its parent. This means that if the underlying crossfilter gets new data the selection
of `g.box-group` will see the new data, the children `title` and `rect` will not. The optical result of that is a seemingly emtpy
heatmap although the data has changed.
smee added a commit to smee/dc.js that referenced this pull request Oct 29, 2015
@gordonwoodhull gordonwoodhull added this to the v2.0 milestone Oct 29, 2015
@gordonwoodhull
Copy link
Contributor

Thanks @smee! Good catch.

@gordonwoodhull
Copy link
Contributor

Thanks @mtraynham - this is confusing because in most of the code you refer to, the data is used right on the next line. And it doesn't seem to be nested data.

I think we would know if all these locations were failing. So are there some cases where selectAll will in fact replicate the data to the child?

@mtraynham
Copy link
Contributor

Well I deemed these cases as bad, because it was using a selectAll parent selection which did recieve .data() and then using a selectAll for a single child item, such as labels or a g which contains a single circle. It's not entirely problematic because, yes, the data is not nested, but it does introduce issues with enter/update/exit selections.

I believe some of these may be masked by the fact that we transition the same nodes twice:
https://github.com/dc-js/dc.js/blob/develop/src/bubble-chart.js#L117
https://github.com/dc-js/dc.js/blob/develop/src/bubble-chart.js#L133

@gordonwoodhull
Copy link
Contributor

Nice!

Hmm. Just when I thought I understood selections. I agree they should be selects but wonder why they are not failing as they are. (Or failing twice!)

@gordonwoodhull
Copy link
Contributor

See #1237 (comment) for the reason this doesn't break the whole world. (Hint: most people use crossfilter, but dc.js doesn't require you to.)

@gordonwoodhull
Copy link
Contributor

Yesterday Mike posted a detailed rationale for why select works this way: d3/d3-selection#106 (comment)

gordonwoodhull added a commit that referenced this pull request Dec 18, 2016
@gordonwoodhull
Copy link
Contributor

adding test and merging for 2.0. thanks @smee!

@gordonwoodhull
Copy link
Contributor

still need to check against the very helpful @mtraynham list above

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

Successfully merging this pull request may close these issues.

3 participants