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
Some value of maxbins can cause scale to incorrectly calculate domain #468
Labels
bug
For bugs or other software errors
Comments
kanitw
added a commit
to vega/vega-lite
that referenced
this issue
Dec 6, 2015
A couple notes:
var v1 = [300, 400, 100, 100, 200, 0, 200, 0, 0, 100, 0, 300, 200];
var v2 = [400, 500, 200, 200, 300, 100, 300, 100, 100, 200, 100, 400, 300];
var agg = dl.groupby().stream(true).summarize([{
name:'value', get:dl.identity, ops:['min','max'], as:['min','max']
}]);
// add values to aggregator
v1.forEach(function(x) { agg._add(x); }); agg.changes();
v2.forEach(function(x) { agg._add(x); }); agg.changes();
console.log('ADD', JSON.stringify(agg.result()));
// test mark mod
v1.forEach(function(x) { agg._markMod(x); }); agg.changes();
v2.forEach(function(x) { agg._markMod(x); }); agg.changes();
console.log('MARK', JSON.stringify(agg.result()));
// test actual mod
v1.forEach(function(x) { agg._mod(x,x); }); agg.changes();
v2.forEach(function(x) { agg._mod(x,x); }); agg.changes();
console.log('MOD', JSON.stringify(agg.result())); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The following spec for binned scatterplot is broken. However, if we increase Displacement’s
maxbins
from10
to15
then it works.I think I’m pretty close to finding the root cause and I think I reach the point where it will be more productive for you guys to figure out :) Here are the spec and my debug log:
If I tried to debug,
Considering x’s domain
I try to inspect domain data:
There is no
NaN
value!I put a breakpoint on line 223 of
Scale.js
Looks like this line is evaluated twice for each scale. For x, the first time, it correctly has
domain
=[0, 500]
. However, the second time, it has[Infinity, 500]
.However, if I change
maxbins
to15
, then the same line is evaluated only once and hasdomain
=[50, 500]
.I think the bug has to deal with the fact that when
maxbins
is lower (e.g.,10
in this case), the domain contains zero.The text was updated successfully, but these errors were encountered: