Lines going through poles are now detected, and multiple points are
inserted at the poles to aid resampling "along" a pole.
I've removed the distortion check for resampling, since this is no
longer necessary (this kind of distortion only really happens near
poles, which the cutting now takes care of).
For example, "%-d" formats the day with no padding, "%_d" formats the day with
space-padding equivalent to "%e", and "%0d" formats the day with zero-padding
equivalent to "%d".
Replace regular expression search with a simple if-else.
Replace a for-loop with a new Function to convert rows to objects, such that
each row is defined in a single step as an object literal rather than lazily
defining properties on a blank object. Note that parseRows can still be
substantially faster for large files provided you convert strings to smaller
types (e.g., numbers or booleans); greedy type-conversion reduces peak memory
usage and accelerates garbage collection.
Rather than computing the ending value when the transition starts, the ending
value is computed when the transition is scheduled. This gives more predictable
behavior and makes it easier to debug evaluation errors since they occur
immediately (during user code) rather than inside a d3_timer callback.
The behavior of attrTween and styleTween are unchanged, since the interpolator
can only be constructed once the starting value is known. This commit also
removes d3.tween; I may add this back in a future commit, but I think there is
probably a better way to specify an interpolator for transitions.
The start event is now fired before any tweens are evaluated, such that you can
do any necessary preprocessing work beforehand. The end event no longer causes
the transition id to be inherited, since we can do that more elegantly now using
transition.transition.
Setting the translate and scale now propagates the changes to the scale domains
in the same manner as user interaction. Likewise, setting new scales resets the
translate and scale back to their default values ([0, 0] and 1 respectively).
This commit moves easing and event listeners down to the node's transition
object, allowing these fields to be modified via post-selection. This removes
the last vestige of private state for transitions.
This required a few changes to tests that depended on the order of callbacks for
tweens and events. Because timers are called back in reverse order, tweens are
now initialized in reverse order, and listeners are now invoked in order.
Rather than producing separate files for each module, the default build now
produces a single file. This should encourage better page-load performance as
the files were relatively small. Also, it's easier to deal with only one file
rather than many, especially if you're not quite sure what the dependencies are.
You may still create minimized builds, if you don't want every feature.
This commit also demotes the chart components to the examples directory, rather
than keeping them as part of the core library. As always, D3 is not a charting
library, and these were ever only intended to serve as examples.
I simplified the implementation, though it still seems somewhat magical. I
would be more confident if there were an easy way to extract the mantissa and
exponent from a floating point number, but since JavaScript does not expose the
bitwise representation of numbers, there's no easy way to do it.