There was a bug when parsing positive time zone offsets with a non-zero
number of minutes: the use of Math.floor on negative numbers rounded in
the wrong direction. Replacing Math.floor with (x | 0) correctly
truncates positive and negative values.
Slice is shorter and more intuitive: negative arguments are treated as
being relative to the end of the string, similar to arrays.
The only place it made sense to keep substring was in
d3_locale_numberFormat, where the first argument can be negative but
substring automatically treats this as zero.
Fixes a regression introduced when XDomainRequest support was added in
2eeb2057b2. XDomainRequest only supports
request.responseText, not request.response, but XMLHttpRequest throws an
error if request.responseText is read for non-text response types.
A status code of 0 can mean either a local file was accessed, or there
was an error. The response is checked to see if the error flag was set:
* In the case of request.responseType being "text" or "",
request.responseText should be "". Unfortunately it’s impossible to
distinguish between an empty local text file and an error state, but
wanting to load empty local files seems rare.
XDomainRequest doesn’t have a responseType and it only has
responseText, so we handle it here too.
* For other response types, request.response should be null. At the
moment, Safari 7.0.5 doesn’t respect this, e.g. the response will be a
zero-length blob for the "blob" response type if the local file wasn’t
found, but this seems to be fixed as of WebKit r171650.
Rather than set the zoom center on the first mousewheel following a mousemove,
we now set the zoom center on the first mousewheel event of a zoom gesture. This
is slightly simpler logic and avoids confusing behavior during constrained
momentum scrolling.
With regards to #1689 adding AMD compatibility, it seemed odd to me that
D3 opt'd out of exposing itself globally for third-party plugins.
Within a discussion about this very problem, found here:
https://github.com/jakevdp/mpld3/issues/33#issuecomment-32101013
the argument is made that exposing the global defeats the point of
module systems. I agree that module systems help avoid global
pollution, but that is not something I'd consider the point of module
systems, especially since they are registered in a global namespace
themselves.
This patch will fix third-party modules that are shimmed.