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
interpolateNumberArray #77
Conversation
Fil
commented
Nov 19, 2019
•
edited
edited
- interpolates typed arrays (Float64Array, etc) and standard arrays that contain only numbers with a simple for… loop.
- autodetects both situations (we could optionally unplug the number array detection) [EDIT: unplugged]
- not compatible with BigInt typed arrays (Support BigInt? #75)
- interpolates typed arrays (Float64Array, etc) and standard arrays that contain only numbers with a simple for… loop. - autodetects both situations (we could optionally unplug the number array detection) - not compatible with BigInt typed arrays (#75)
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.
Added a tiny optimization to avoid a redundant call to isNumberArray in the d3.interpolate code path.
} | ||
|
||
export function isNumberArray(x) { | ||
return ArrayBuffer.isView(x) && !(x instanceof DataView); |
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.
Hi! Just wanted to flag that typeof ArrayBuffer.isView === 'undefined'
in PhantomJS. I know it's a super old browser and I'm not really expecting D3 to be perfectly compatible with it, but just commenting here in case someone else gets the same error. Thanks!
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.
we could test for it?
return ArrayBuffer.isView && ArrayBuffer.isView(x) && !(x instanceof DataView);