You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For example if x=10 and domain is [0, 20], the ascending case is correct:
10 >= 0 && 10 <= 20 //returns true
In the descending case, if x=10 and domain is [20, 0], the descending case is incorrect:
10 >= 20 && 10 <= 0 //returns false
As a solution, likely d3.extent on the domain? Or if it's always expected that the domain is an array with min and max at the ends, Math.max and Math.min or some variation of that calculation should suffice:
These need to use the chart's ordering, which is how we build the domain of the scale.
There is almost a philosophical, or perhaps abstract nonsense, problem here, which is that d3 conflates ordinal and categorical variables. They probably did this because you eventually have to decide on an order for things.
In any case it is not the case that categorical variables can be ordered simply by using the comparison operators, and throughout dc.js we will have to detect whether we are dealing with an "ordinal" scale, which actually means categorical, and use the ordering there instead.
Hey Gordon,
From the thread on the user group:
https://groups.google.com/forum/#!topic/dc-js-user-group/g-Pws58K6B0
The stackMixin incorrectly filters descending non-ordinal scales. The domain filter on the stack function filters values with the following code:
For example if x=10 and domain is [0, 20], the ascending case is correct:
In the descending case, if x=10 and domain is [20, 0], the descending case is incorrect:
As a solution, likely d3.extent on the domain? Or if it's always expected that the domain is an array with min and max at the ends, Math.max and Math.min or some variation of that calculation should suffice:
As a secondary note, dc.filters.RangedFilter has similar logic, and should be checked as well.
The text was updated successfully, but these errors were encountered: