This can be used with d3.geo.path.clip to clip the input coordinates of
geographical shapes using a given origin and angular radius, e.g. for
hemispherical or near-hemispherical views. Geodesics are inserted as
necessary.
This also includes a minor bugfix and test for d3.geo.path: the last
coordinate of Polygon features was being included unnecessarily
(MultiPolygon already handled this correctly).
Rather than have a treshold in transitions, we now clamp the easing functions.
This guarantees that when the transition ends, the tweens will be called with
t=1, and produce clean output values. Previously, that was not the case for
certain easing functions, such as exp-out and elastic.
Higher-order programming! This makes it more akin to d3.svg.chord i.e.
it can take "d" and "i" arguments. Thanks for the suggestion, Mike!
Also made "n" and "radius" configurable, too.
IE9 does not string-coerce values, instead throwing an error. We now wrap IE9's
implementation to force string coercion. While it would be simpler to turn on
string-coercion for all browsers inside D3's style operator, this approach
avoids penalizing standards-compliant browsers.
This commit also moves language-compatibility code to a separate directory, and
deletes the obsolete Object.create polyfill, which is no longer needed by D3.
Fixes#274. String coerce for uniqueness, but store the original input types in
the domain for subsequent retrieval. This way, you can more easily use
non-strings as domain values (such as dates or numbers).
Can be used to generate great circle paths. Similar to R's
geosphere.gcIntermediate (in which I discovered a bug, while writing the
test case for this!)
Includes d3.geo.greatcircle().distance for computing the shortest geo
path distance using the Haversine formula.
For a tutorial on using great circles, see:
http://flowingdata.com/2011/05/11/how-to-map-connections-with-great-circles/
As of 2.0.0, it's possible to have multiple transitions running concurrently
with the same id. Thus, it is no longer sufficient to check the transition id
to decide whether to delete the transition lock. We now use reference counting
to determine the number of transitions that are scheduled on a given element;
when that number drops to zero, we can delete the transition lock.
They weren't being invoked with the correct syntax (being passed the data and
index, with the current node as the context). This commit also removes the
d3_array wrapper, which does not appear to be necessary; I've forgotten why it
was there in the first place.
I'm including the axis component in the core build because it should be useful
in many different visualization types, similar to the other svg components. The
chart module contains a hodgepodge of more obscure visualization types, and
there's no reason to pull those in for more common visualizations. Perhaps most
importantly, the axis component isn't a chart type!
Rather than specifying the ticks directly, you specify the arguments that will
be passed to the scale's ticks function. I suppose there are some obscure cases
where you might want more direct control over the generation of ticks, but this
makes the common case easy, and we could add a tickFunction property in the
future if we wanted to allow arbitrary control. Alternatively, you could write
a new scale type that supports the desired tick behavior (e.g., time scale).
This means that you can now extend D3's selections and transitions with custom
functionality! Also, you can use now instanceof to see whether something is an
instanceof d3.selection or d3.transition.
Also fix a bug where it would be possible for an earlier to transition to become
the lock owner. We now guarantee that the lock owner can only increase while
transitions are scheduled on an element.
This caught a couple bugs in the previous commit. First, I wasn't sending the
correct index (i) to the "end" event listeners, because it was being masked by
a local variable. Second, the transition lock was being incorrectly deleted when
a transition is inherited on the same node and there is zero delay and
d3.timer.flush is called. There was potentially a related bug where the active
field was not being cleared on the transition lock. Yay tests!
This changes the core implementation of selections and transitions to use
prototype injection rather than direct extension. This offers better performance
by eliminating per-instance overhead from closures and assignment. On browsers
that don't support prototype injection, we fall back to direct extension.
This commit isn't just about performance, though; the code ends up being a lot
cleaner and more separable if we force methods to rely solely on `this`, rather
than capturing surrounding variables with closures.
Most importantly, transitions are now "transparent", like selections. Rather
than opaque objects, transitions are now arrays of nodes, similar to selections.
The nodes are wrapped in an object that stores the delay and duration, which
means you can now inspect the computed delay and duration. (This was the
original motivation for this commit, and will allow chart components to be
call'd on transitions as well as selections.)
Transitions now support the `each` operator with one argument, which has the
same behavior as on selections. The `each` operator now passes a third argument
containing the group index (`j`). Transitions now also support a `tween`
operator, which is a generic mechanism for doing things during a transition; use
this in place of a "tick" event.
This commit also fixes a few bugs. The enter selection now supports the empty
operator; we can add other operators in the future more easily, if we so choose.
Transition's attr operator now supports namespaced attributes. Selection's
property operator no longer parses property namespaces.
This is the simplest possible implementation. It does not yet support updating
an existing display, specifying different scales for different instances,
overriding ticks, overriding tick format, transitions, etc. etc.
Now you can say d3.time.seconds(start, stop, step), which will return every
step'th second after start (inclusive) and before stop (exclusive). In addition,
you can now pass a range method to the time scale's ticks method, which makes it
easier to generate ticks. For example, x.ticks(d3.time.seconds, 15) will return
15-second ticks, rather than using the automatic default.