-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
DC extents, high side non-inclusive? #568
Comments
…joins on clicks. Addresses dc-js#568
I just ran across this again, in a barChart, a brush up to the xAxisMax would not include the highest valued sample, for the same reason. I'm temporarily working around it with the following code: In filters.js, at the top:
And in coordinate-grid-mixin.js, near/about line 774:
|
I just happened to run across this in dc.barChart
and also found that "dc.units.fp.precision(precision)" has _f.resolution = precision; so perhaps another (untested) workaround would be to apply fp precision to the xAxis ( via .xUnits(dc.units.fp.precision(some precision)) ) thereby increasing the axis max by the precision, allowing the last sample point to now be selectable. I quick search of the web and I see jrideout is using it in http://bl.ocks.org/jrideout/6826603, but in the intended use of precision. I like my previously posted solution better as it doesn't depend on knowledge of the data to be used. My application is using loaded csv data which can be of any precision. |
It makes sense to me that the brush would be closed at the top of the interval, while a filter would be open. It's kind of confusing though. If we make the change, we'd have to come up with some consistent way to translate between UI ranges and crossfilter ranges, which are open at the top: https://github.com/square/crossfilter/wiki/API-Reference#dimension_filterRange (Of course, we don't actually use crossfilter ranges, but we should, #478) |
Are you mostly talking about bar charts here? Is the objective to completely include the range of the top bar which is selected? Also related: #520 brush partial bar. |
Sorry I haven't considered all possible cases, my focus so far in this thread are just on the brushed-barChart and the areaSelection-scatterplot cases. |
You can work around this by adding +1 to your range, if possible; I'm here because I ran into this problem as well, but instead of patching, I went with modifying the range outside the bounds of the known data by calculating the range and adding '+1' to the max. |
As noted in #1066, Per #478, |
Given this is the way crossfilter works and there are decent workarounds, I'm closing this. Like it or now, crossfilter defines the standard framework and worldview for dc.js. I think #792 including the rightmost bar, would also fix this, and that's a more glaring problem. |
Can someone comment on why the high end of ranges is non-inclusive while the low side is inclusive?
I'm seeing on area selections in the scatterplot the highest point(s) are not included. If I change the extent code to use <= instead of < then it functions as expected.
dc.filters.RangedFilter
return value >= this[0] && value < this[1]
dc.filters.RangedTwoDimensionalFilter
_chart.fadeDeselectedArea
and possibly other locations.
I expect this is because it is using the same basic filter code as for Dimensions, which by nature you do not want to double include points at boundaries between/into groups. However, the charting selection needs to be inclusive.
I might get around to fixing this, but not this weekend.
The text was updated successfully, but these errors were encountered: