-
Notifications
You must be signed in to change notification settings - Fork 537
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
Cr/issue 138 #139
Cr/issue 138 #139
Changes from all 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 |
---|---|---|
|
@@ -34,7 +34,7 @@ module.exports = function(d3_scale_linear, d3_time, d3_bisect, techan_util_rebin | |
* @returns {*} | ||
*/ | ||
function scale(x, offset) { | ||
var mappedIndex = dateIndexMap[+x]; | ||
var mappedIndex = dateIndexMap[x.getTime ? x.getTime() : +x]; | ||
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. Nice catch here, but after profiling I would prefer: x instanceof Date ? x.getTime() : +x Faster still (for me, linux chrome) and handles 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. |
||
offset = offset || 0; | ||
|
||
// Make sure the value has been mapped, if not, determine if it's just before, round in, or just after domain | ||
|
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.
Another great catch. Those
join
s in chrome are a killer.Any reason for
String
constructor rather than implicit conversion? For my profiling in chrome implicit conversion is much faster. Will post cases for review.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.
Test: https://gist.github.com/andredumas/7a3277e3cb06c35f4ba34562a873cf35#file-number-tostring-html-L25
Pls flick through the tests make sure I'm not doing anything crazy for these suggestions. These area's are key to responsiveness feel for the chart. This is a really good step forward.