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

Series Chart X-axis does not recalculate on crossfilter data change #926

Closed
alan-unravel opened this issue Apr 29, 2015 · 10 comments
Closed
Labels
Milestone

Comments

@alan-unravel
Copy link
Contributor

When the crossfilter data is changed to data no longer matching the x domain then the graph appears to have no data. Here is a fiddle of the issue : http://jsfiddle.net/zvfqmzaz/

@ghost
Copy link

ghost commented Apr 29, 2015

+1

@gordonwoodhull gordonwoodhull added this to the v2.0 milestone Apr 29, 2015
@gordonwoodhull
Copy link
Contributor

Ugh. I don't think either domain is always getting propagated right for series/composite charts.

See #662 and #667.

@alan-unravel
Copy link
Contributor Author

Are you aware of any workarounds I could use in the mean time?

@gordonwoodhull
Copy link
Contributor

Looks like you found the culprit, although I don't see your comment anymore:

https://github.com/dc-js/dc.js/blob/develop/src/series-chart.js#L69

If our understanding is correct, this needs to be replaced with something that calculates from the current group rather than having frozen data. It could probably be replaced in each subchart. I will try to work something up later today if you don't figure it out first.

@alan-unravel
Copy link
Contributor Author

Yes sorry I thought I was mistaken for a minute so took it down. I will try to figure it out. Thanks

@alan-unravel
Copy link
Contributor Author


Actually it seems this is not the issue as when I changed the data and make a call to sub_chart.group().all() then I get the new data.This is probably due to the parent chart calling the '_chart._preprocessData' function on change. I think there is a missing step where there new data should be propagated to the object that is returned from sub_chart.data() as the values array in this object is empty on data change. I am however having a hard time finding where this is updated.


Scratch this, you are correct. The chart.data call does not seem to allow updating the grouping function on the fly. This changes the group and _group functions on the chart but still accesses the original set when using chart.data


Using a pseudo group as described here also doesn't work.I was filtering based on if the result of the seriesAccessor being run on the datum was equival to sub.key.

@gordonwoodhull
Copy link
Contributor

Okay, this is a lingering effect of #454, where the points were getting filtered by the current domain and making it impossible to calculate elasticX.

We have a special case to not filter the points by the current domain, when elasticX is true. But elasticX was not passed down to the child charts, so they were still getting filtered on the current domain.

Passing elasticX down to the children fixes this.

@gordonwoodhull
Copy link
Contributor

fixed in b836da4, dc.js 2.0.0 beta 9

@gordonwoodhull
Copy link
Contributor

fiddle pointing at develop version now works: http://jsfiddle.net/gordonwoodhull/tzcLzrhp/7/

i also had to add remove_empty_bins because crossfilter does not automatically remove bins when they drop to zero.

@alan-unravel
Copy link
Contributor Author

That is fantastic, thank you very much for all your help. Sorry I could not be more helpful!

tttp pushed a commit to tttp/dc.js that referenced this issue May 18, 2015
fixes dc-js#926 elasticX not working for series chart
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

2 participants