Граф коммитов

266 Коммитов

Автор SHA1 Сообщение Дата
John Firebaugh 1e8a579810 Add d3.set
Taking inspiration from d3.map, d3.set is a simple shim for ES6 sets.
2013-02-09 14:42:04 -08:00
Mike Bostock 0991f3b010 Use captured references for document and window.
This avoids an inconsistency (discussed in #1044) when using D3 inside Node.js,
where D3 internally creates a JSDOM document during initialization, but then
subsequently depends on the current global document, which is not exposed. D3
now always refers to the global document at the time of initialization, and
does not depend on the current global document or window.
2013-01-31 15:11:40 -08:00
Mike Bostock 75be0ab272 Rename for clarity.
d3_geo_cut is now d3_geo_clipAntimeridian.
d3_geo_circleClip is now d3_geo_clipCircle.
2012-12-15 12:42:00 -08:00
Mike Bostock ec1c7cfe04 Fix for UglifyJS 2.x. 2012-12-13 09:34:02 -08:00
Jason Davies b87bcbc22a Implement d3.geo.centroid via d3.geo.stream. 2012-12-13 12:22:41 +00:00
Jason Davies 37f64b74f2 Fix streaming polygon clipping. 2012-12-13 02:01:04 +00:00
Mike Bostock 6ca6d3ea07 Return undefined for empty buffers. 2012-12-12 16:42:07 -08:00
Mike Bostock 1a779c6f4d Implement d3.geo.path centroid via d3.geo.stream. 2012-12-12 16:17:02 -08:00
Jason Davies 33e24962be Refactor clipping to use streams.
Work in progress: everything is treated as lines at the moment.
2012-12-12 21:33:59 +00:00
Mike Bostock e06a279d62 Remove unused d3.geo.streamListener. 2012-12-12 10:17:52 -08:00
Mike Bostock 6994640f32 Add d3.geo.stream.
This will replace d3_geo_type and make projection faster.
2012-12-12 09:09:21 -08:00
Jason Davies c0f9ae7ad1 Extract d3_geo_resample. 2012-12-12 09:25:22 +00:00
Jason Davies bc06b2ec57 Refactor d3.geo.projection to be more data-driven. 2012-12-11 21:43:14 +00:00
Jason Davies 75520ecb46 Refactor cutting/clipping into separate files. 2012-12-11 12:53:01 +00:00
Mike Bostock 881e0e5fcf Extract simple vector math from d3_geo_circle. 2012-12-10 14:49:20 -08:00
Mike Bostock 1c8bff5d1d Add d3.geo.interpolate.
Refactor of d3_geo_greatArcInterpolate.
2012-12-10 12:05:43 -08:00
Jason Davies 7860b0d31e Add d3.geo.area.
See #941.
2012-12-09 19:42:05 +00:00
Jason Davies 2467834ec2 Add d3.geo.centroid.
Polygons are temporarily treated as lines while I work on adding area
weighting.

See #941.
2012-12-09 11:29:29 -08:00
Mike Bostock 09094cf342 Add d3.shuffle. Fixes #948. 2012-12-07 12:44:21 -08:00
Mike Bostock d5e3add1f3 Add placeholder d3.geo.centroid. 2012-12-06 19:50:36 -08:00
Jason Davies ba8c8ce170 Add benchmarks and performance improvement.
Dense graticule: 140→110ms/op.
Circle polygons: 69→61ms/op.
Spiral polygons: 3.3→2.6ms/op.
2012-11-21 15:35:44 +00:00
Mike Bostock 8ee6c126bc Squash warnings. 2012-11-11 09:44:40 -08:00
Mike Bostock ecb333903a Switch to UglifyJS2. 2012-11-02 12:50:20 -07:00
Mike Bostock 6d7b74241a Merge branch 'locale' of git://github.com/jasondavies/d3 into 3.0 2012-10-29 09:23:18 -07:00
Mike Bostock 3af91c35e4 Greedy evaluation of transition.{style,attr,text}.
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.
2012-10-16 16:47:20 -07:00
Mike Bostock 1e4b261b39 No more private state for transitions!
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.
2012-10-11 12:39:24 -07:00
Mike Bostock b957752b1d Fix bug in Makefile. 2012-10-06 07:11:07 -07:00
Mike Bostock d3f855ae01 Rename d3.v3.js to d3.js.
We'll still use the major-versioned name file for d3js.org, but this is simpler.
2012-10-05 18:46:05 -07:00
Mike Bostock 4eac85b596 Remove d3.svg.mouse and d3.svg.touches. 2012-10-05 16:59:50 -07:00
Mike Bostock 319d9954b9 Remove d3.split. 2012-10-05 16:58:19 -07:00
Mike Bostock a2589d79fd Remove d3.geo.greatCircle. 2012-10-05 16:57:39 -07:00
Mike Bostock e7dcae75c9 Remove d3.geom.contour. 2012-10-05 16:46:05 -07:00
Mike Bostock 0b1b9fbbda Remove d3.first and d3.last.
I never used these. They're fired!
2012-10-05 16:44:48 -07:00
Mike Bostock aa2e17e94c Merge branch 'projection' into 3.0
Conflicts:
	src/core/core.js
2012-10-05 16:35:13 -07:00
Mike Bostock 044f61507c Merge branch 'transition-reselect' into 2.11 2012-10-05 16:29:56 -07:00
Mike Bostock 223d6aa715 Transition reselection.
It is now possible to reselect elements with scheduled transitions and redefine
associated tweens; this enables "post-selection" to customize the behavior of
reusable components undergoing transitions, such as an axis. This commit also
makes it much easier to sequence transitions.

Previously, a transition's tweens were stored privately by the transition and
could only be accessed through the transition. This made it impossible to modify
transitions created by components: the transition is not accessible externally,
and cannot be reselected from the document. Consider the following snippet:

  g.select(".x.axis")
      .call(xAxis)
    .selectAll("text")
      .attr("dy", null);

If `g` is a selection, then this code alters the appearance of the axis as
expected. However, if `g` is a transition, then transition.selectAll creates a
new concurrent transition, and now multiple tweens compete to set the "dy"
attribute. Oy!

Under the new design, an element's scheduled tweens are stored semi-privately on
the node (in the existing node.__transition__). Transition parameters can thus
be reselected and modified by transitions that share the same id. If you now
reselect a transitioning element, you modify the transition rather creating a
competing transition; this should be less surprising and allow greater control.

As a side-effect of this change, it is no longer possible to schedule concurrent
transitions on the same element, even with the same id: only one transition may
be active on a given element at any time. (Note that you can still schedule
multiple future transitions on the same element, and concurrent transitions on
different elements.) For example, you could previously schedule overlapping
transitions with different easing functions, delays or durations, provided you
were careful to avoid conflict. This seems like a relatively obscure use-case
compared to modifying a transition, so I believe this is a reasonable change.

This commit also changes transition.transition, such that the returned
transition starts at the end of the originating transition, rather than
overlapping. This makes it much easier to schedule sequenced transitions without
the complexity of transition.each("end") and d3.select(this).

Also, transitions are now simply arrays of nodes, consistent with selections!
2012-10-05 13:36:11 -07:00
Mike Bostock d27a70f0c0 Refactor d3_geo_type. 2012-10-01 21:50:18 -07:00
Mike Bostock e294affffc Add d3_Color base class. 2012-09-28 15:17:54 -07:00
Mike Bostock 77adc10d86 Checkpoint integration of geo/projection plugin.
This is still a work in progress, but it's a start.
2012-09-23 16:49:11 -07:00
Mike Bostock 342924c23f Bump version number to appease Bower. 2012-09-14 12:48:53 -07:00
Mike Bostock d123998523 Add component.json to appease Bower. 2012-09-14 12:38:35 -07:00
Jason Davies 55acabc8e9 d3.format: support locales.
Note: the previous commit broke some tests relating to locale date
parsing, due to expecting "%m/%d/%y". On my system, the "en_US" locale
uses "%m/%d/%Y" by default. I've updated the tests to use %Y.
2012-08-13 19:58:53 +01:00
Jason Davies 550e84d36c Improve handling of intermediate locale files. 2012-08-12 22:17:50 +01:00
Jason Davies 16f56395a6 Add format-locale.js dependency to Makefile. 2012-08-12 18:45:12 +01:00
Jason Davies 51b2e678d2 Automate d3.time.format locale generation.
This avoids having to include a large number of locales in the D3
repository, and also reduces the potential for typos when transcribing
locale mappings.
2012-08-12 18:34:05 +01:00
Mike Bostock cded852ba4 Add d3.lab and d3.hcl.
Includes d3.interpolateLab and d3.interpolateHcl.
2012-08-08 21:22:21 -07:00
Mike Bostock e42eb90ca8 Add d3.scale.threshold. Fixes #755. 2012-08-08 20:33:30 -07:00
Mike Bostock 2d9fe177d0 Expose d3.tween. Fixes #747.
This is a little bit more verbose, but it avoids additional optional arguments
on transition.{attr,style}.
2012-08-08 17:53:46 -07:00
Mike Bostock 7ac1ae7c77 Merge remote-tracking branch 'origin/delimiter-separated-values' into 2.10.0 2012-08-08 17:36:01 -07:00
Mike Bostock d6d2792b53 Allow static localization of d3.time.format.
You can now build a locale-specific version of d3.time.format. For example,

  LANG=fr_FR make

will pull strings from the time/format-fr_FR.js file, rather than en_US.
2012-08-07 12:21:49 -07:00