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

301 Коммитов

Автор SHA1 Сообщение Дата
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
Jason Davies e9abea57d3 More efficient handling of null transforms.
Avoid unnecessary object creation.
2012-07-31 13:42:48 +01:00
Mike Bostock 4c66d7d16e Merge branch 'beautify' into 2.9.7 2012-07-30 19:43:47 -07:00
Jason Davies 1893f2941b Add transition.filter. Fixes #726.
Behaves the same as selection.filter.
2012-07-25 10:02:49 +01:00
Mike Bostock fd308af6ca Beautify d3.v2.js.
The main advantage of beautification is that we can add abundant source comments
to the original files without increasing the size of d3.v2.js.
2012-07-19 11:07:36 -07:00
Mike Bostock 66b439d433 Add d3.tsv for tab-separated values.
This makes the previous d3.csv code a bit more generic via a d3_dsv (delimiter-
separated values) module generator. Fixes #501. (Thanks, @vlandham!)
2012-06-28 12:58:39 -07:00
webmonarch 831a241894 Removing make prepare target. 2012-04-26 09:27:35 -07:00
webmonarch 7b5175c75f removing make package.json dep on d3.vs.json, since it've been removed in the source code 2012-04-25 23:01:47 -07:00
webmonarch 8759241f59 biting the bullet, renaming install target to prepare (more in-line with it's meaning) 2012-04-25 21:51:18 -07:00
webmonarch d70b00cd60 adding make prepare (which calls make install). More inline with make traditions 2012-04-25 18:59:42 -07:00
webmonarch ddc3a5f95e add package.json dependency to make install 2012-04-25 18:39:03 -07:00
Mike Bostock 22b1c0ba49 Better implementation of defined.
The previous implementation had a bug where the original index (i) was not
preserved if the input data array were split. The new implementation eschews the
previous approach of branching based on whether the x- and y-properties are
defined as functions or constants, opting for the simpler functor approach. The
x- and y-values are also coerced to numbers, as appropriate.
2012-03-19 15:43:15 -07:00
Mike Bostock 7f38862f9f Use d3_identity instead of Object. 2012-03-16 17:17:32 -07:00
Mike Bostock f80b1cf244 Add selection.datum. Fixes #489. 2012-02-21 10:31:15 -08:00
Mike Bostock f1197ed8b6 Use d3.map for d3_svg_symbols.
This fixes a crash with the symbol type "hasOwnProperty", rather than defaulting
to "circle". This commit also adds new map methods to retrieve the keys, values
and entries. The map class now uses non-enumerable properties (if supported).
2012-02-20 21:30:23 -08:00
Mike Bostock 738b634789 Add d3.map.
This is, essentially, an ES6 shim for a Harmony Map. We will use it instead of
using a bare object, so that we don't need to worry about collision with built-
in properties names (such as "__proto__" and "hasOwnProperty").
2012-02-20 11:23:36 -08:00
Mike Bostock f37fd52100 Add d3.scale.identity. Fixes #483. 2012-02-19 20:52:44 -08:00
Mike Bostock 1fac89e74f Merge branch 'mouse' of https://github.com/jasondavies/d3 into jasondavies-mouse 2012-02-19 17:14:41 -08:00
Jason Davies 9c124a687e Merge branch 'master' into mouse
Conflicts:
	Makefile
	d3.min.js
	d3.v2.js
	examples/zoom/zoom.html
2012-02-19 20:18:07 +00:00
Jason Davies a59ade5f55 Rename to d3.{mouse,touches}. 2012-02-19 20:10:47 +00:00
Mike Bostock 077411a236 Add interval.range, and time.scale.nice.
This commit provides a standard interface for time intervals:

  interval.floor(date)
  interval.ceil(date)
  interval.offset(date, k)
  interval.range(start, stop, step)

All local-time intervals (such as d3.time.day) have a UTC-equivalent interval,
available as interval.utc (such as d3.time.day.utc).

Fixes #463. Note that for the time.scale, an interval function is required to
nice (such as d3.time.day). In the future, we might relax that to allow a count
of ticks, similar to the ticks method, but in that case we'd also need the
ability to floor to a given tick number (e.g., every other week) and likewise
for ceil. This seems like a reasonable first implementation.
2012-02-18 22:56:54 -08:00
Mike Bostock 0e4fc7cdc6 Unify interval definitions via d3_time_utc.
Rather than having two implementations for local time and UTC time, we now have
a single local-time implementation and use d3_time_utc to adapt for UTC.
2012-02-18 20:36:06 -08:00
Mike Bostock 3081dd45ef Consolidate everything into d3.v2.js.
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.
2012-02-18 14:04:01 -08:00
Mike Bostock c3516c06a6 Update src/package.js rather than package.json. 2012-02-18 11:51:45 -08:00
Jason Davies 2936a6b1e7 Add d3.svg.{mouse,touches} aliases.
For backwards-compatibility.
2012-02-14 18:45:13 +00:00
Mike Bostock f67e89597d Expand the default custom build. 2012-01-26 11:58:40 -08:00
Jason Davies b426e78dce Rename d3.svg.touches to d3.behavior.touches. 2012-01-09 08:35:57 +00:00
Jason Davies 30e6f51672 Add d3.behavior.mouse: supports both SVG and HTML. 2012-01-09 08:29:30 +00:00
Mike Bostock 4a35d78848 Add selection.order.
It's like selection.sort, except it assumes that the data is already sorted;
the elements are reordered to match the selection.
2011-12-08 17:14:08 -08:00
Mike Bostock 3d6b4cf2fb Add transpose. 2011-11-23 12:44:04 -08:00
Mike Bostock e3f6f33b3d Add d3.transform and d3.interpolateTransform.
This is based on @jasondavies previous work on interpolating 3D matrices,
simplified to only handle 2D transforms, and using SVG to parse transforms.
2011-11-04 16:19:58 -07:00
Mike Bostock 149320f73f Add parallel coordinates example.
This includes a d3.extent convenience method for [d3.min, d3.max], and fixes the
brush component such that the resizers are hidden when the extent is empty.
2011-11-02 16:19:37 -07:00
Mike Bostock a475cd5e5c Query the brush selection.
You can now query the brush for its selection. This commit also includes a new
d3.random.normal for generating random numbers with a normal distribution. This
is useful for jittering points for display.
2011-11-01 13:30:58 -07:00
Mike Bostock e3d59bd581 First cut at a brush component.
The d3.svg.brush component allows one- or two-dimensional rectangular brushing.
A future commit will allow the brushed region to be resized by grabbing an edge,
and also provide some way of reporting the selection (duh)!
2011-10-31 16:59:17 -07:00
Mike Bostock 2f6d2fa07a Merge branch 'deps' of https://github.com/jasondavies/d3 2011-10-19 21:01:39 -04:00
Mike Bostock a62bd527ca Fix a bug in enter selection's empty.
Due to the ordering in which the prototypes are defined, it was still undefined!
Also, the empty method depends on the node method being defined. Added a test.
2011-10-19 20:57:53 -04:00
Jason Davies c724d95f77 Update UglifyJS, JSDOM and Vows.
I ran the tests on the newly minified files too, for good measure, and
everything passed.
2011-10-13 11:35:59 +01:00
Mike Bostock 307016e843 Fix a rounding bug in SI-prefix format.
Also, expose d3.formatPrefix so that it's easier for callers to create a
formatter for a specific prefix (such as using the "G" prefix for all ticks).
2011-10-11 16:46:47 -07:00
Mike Bostock 31cb66f9f1 Add d3.median. 2011-10-10 17:49:53 -07:00
Mike Bostock 9523c4d2d1 Merge branch 'mean' of https://github.com/jasondavies/d3 into mean 2011-10-10 17:41:52 -07:00
Jason Davies da189667c1 Add d3.mean.
Uses Welford's algorithm to avoid overflow.

See #245.
2011-10-07 22:00:44 +01:00
Mike Bostock 05e9a39837 Fix spaces. 2011-10-07 12:22:56 -07:00
Lars Kotthoff f3b8c0ef04 remove duplicate rule and tweak "all" target (mbostock) 2011-10-04 19:34:16 +01:00
Lars Kotthoff 1bd3a255d5 make Makefile GNU make v3.82 compatible
Quote from NEWS file:

In previous versions of make it was acceptable to list one or more explicit
targets followed by one or more pattern targets in the same rule and it
worked "as expected". However, this was not documented as acceptable and if
you listed any explicit targets AFTER the pattern targets, the entire rule
would be mis-parsed. This release removes this ability completely: make
will generate an error message if you mix explicit and pattern targets in
the same rule.
2011-10-03 21:07:38 +01:00
Mike Bostock 6a65451b90 Merge branch 'bonne' of https://github.com/jasondavies/d3 into release 2011-09-27 13:57:56 -07:00
Mike Bostock a70975b248 Merge branch 'gnomonic' into release 2011-09-27 13:56:18 -07:00
Mike Bostock 7d93964615 Add install rule to Makefile. 2011-09-27 13:53:46 -07:00
Mike Bostock bd585e265e Add d3.geo.circle.
There is also a greatCircle as an alias, whose angle defaults to 90 degrees. (Or
should, but some projections cannot handle 90 degrees so we use 89 instead.)
2011-09-27 09:00:23 -07:00
Mike Bostock 14dcdea8f6 Add d3.geo.greatArc.
The greatArc class is the new name for greatCircle, which actually represents
great arcs. Meanwhile, a new greatCircle class is for great circles. The new
greatCircle class replaces the old clip class, providing clipping and resampling
functionality (using greatArc internally). This isn't backwards-compatible, but
I may forgo the major version number bump in light of the fact that greatCircle
was just added, and not used in any (official) examples or documented.
2011-09-27 00:34:22 -07:00
Mike Bostock b678e0876d Merge branch 'gnomonic' of https://github.com/jasondavies/d3 into gnomonic 2011-09-26 16:36:46 -07:00
Jason Davies a6eb928490 Add Bonne geographic projection.
Note that the Werner projection is a special case with standard parallel
at 90°N, and the Sinusoidal projection is also a special case with
standard parallel at 0°N.
2011-09-26 00:58:59 +01:00
Johan Sundström 46891e93eb Make "make test" work even if npm installs pkgs elsewhere. 2011-09-24 15:47:06 -07:00
Mike Bostock f8ce5235e1 Merge branch 'package' of https://github.com/jasondavies/d3 into release 2011-09-17 20:07:56 -07:00
Mike Bostock 8f78039773 Rename equirect to equirectangular; add test. 2011-09-17 19:02:34 -07:00
Jason Davies abc6541cd5 Add d3.geo.clip for radial clipping.
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).
2011-09-12 09:27:57 +01:00
Mike Bostock 1e60010370 Merge branch 'greatcircle' of https://github.com/jasondavies/d3 into release 2011-08-29 11:53:22 -07:00
Jason Davies c06043919f Rename d3.geo.greatcircle to d3.geo.greatCircle. 2011-08-29 18:05:09 +01:00
Mike Bostock c2e37352ac Fix for IE9's style.setProperty.
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.
2011-08-28 19:35:53 -07:00
Jason Davies 399b145a20 Add d3.geo.greatcircle.
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/
2011-08-28 17:06:48 +01:00
Mike Bostock 5aeb312196 Create the root selection after the prototype.
This fixes a breakage on IE9, which doesn't support array subclassing through
prototype injection. On IE9, we then use direct extension of the prototype, but
this can only be done after the prototype is fully-defined.
2011-08-26 13:17:27 -07:00
Jason Davies a97464fa78 Use pure node.js to generate package.json. 2011-08-26 00:36:40 +01:00
Mike Bostock d5533276bc Add transition.transition.
This derives a new transition from the existing transition, equivalent to (and
implemented as) transition.select(function() { return this; }).
2011-08-24 17:46:10 -07:00
Mike Bostock 2db0875d75 Merge branch 'd3-all-target' of https://github.com/xaviershay/d3 into custom 2011-08-23 13:09:39 -07:00
Mike Bostock 2af6fbf172 Merge branch 'axis' into release 2011-08-23 12:51:44 -07:00
Mike Bostock 545e9de74c Merge branch 'drag' of https://github.com/jasondavies/d3 into release
This also fixes a few bugs in the new implementation, restoring support for the
offset between the mouse and the dragged element by reporting a delta rather
than an absolute offset. Also, this fixes an infinite loop when an element is
removed from the DOM.
2011-08-23 12:47:46 -07:00
Mike Bostock 95805adc9b Promote the axis component to the svg module.
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!
2011-08-23 12:02:12 -07:00