-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Filter numbers during calc step #4063
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
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -407,6 +407,20 @@ describe('Bar.calc', function() { | |
assertPointField(cd, 'x', [[1, NaN, NaN, 15]]); | ||
assertPointField(cd, 'y', [[1, 2, 10, 30]]); | ||
}); | ||
|
||
it('should guard against negative marker.line.width values', function() { | ||
var gd = mockBarPlot([{ | ||
marker: { | ||
line: { | ||
width: [2, 1, 0, -1, false, true, null, [], -Infinity, Infinity, NaN, {}] | ||
} | ||
}, | ||
y: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12] | ||
}], {}); | ||
|
||
var cd = gd.calcdata; | ||
assertPointField(cd, 'mlw', [[2, 1, 0, 0, 0, 1, 0, 0, 0, Infinity, NaN, NaN]]); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does having There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. console errors e.g. when drawing a svg path? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I didn't notice any: There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Ok, but looks like marker pts with There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good call. Done in f9db523 and fixed |
||
}); | ||
}); | ||
|
||
describe('Bar.crossTraceCalc (formerly known as setPositions)', function() { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you want
isNumeric
here. Have tried something like?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works OK with those cases. Using
isNumeric
might be slow.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have you tried running benchmarks here? I doubt that
isNumeric
is that much slower thanisNaN
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moreover, could we lock those cases down in a
_module.calc
test?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tests are added in 39b9840.