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

1406 Коммитов

Автор SHA1 Сообщение Дата
Mike Bostock f37fd52100 Add d3.scale.identity. Fixes #483. 2012-02-19 20:52:44 -08:00
Mike Bostock b9170fb394 Add d3.time.{interval}.round. 2012-02-19 19:18:43 -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
Mike Bostock c2780d5075 Add various weekday methods, and dayOfYear.
This commit augments d3.time.week and d3.time.weeks with weekday-specific
methods, so that you may pick a starting day for the week other than Sunday. For
backwards-compatibility, the new sunday methods have aliases:

  d3.time.sunday = d3.time.week
  d3.time.sundays = d3.time.weeks

This commit also adds new weekdayOfYear methods, so that you can determine the
week number without needing to use a d3.time.format. For example, sundayOfYear
returns the week number, where weeks start on Sunday; mondayOfYear does the same
where weeks start on Monday. This commit also adds a dayOfYear method which
returns the day-of-year number for a given date, similar to the time format's %j
directive, but zero-based.

Fixes #512. Fixes #513.
2012-02-19 17:00:04 -08:00
Jason Davies 064822630e Slightly more graceful check for createSVGPoint.
Less brittle, anyway.
2012-02-19 23:56:06 +00:00
Jason Davies 12ac60d273 HTML+CSS3-based force-directed layout example!
It might be nice to gracefully hide the CSS3-rotated links for browsers
that don't support them.  But D3 only really supports current browsers
anyway, and they all support CSS3 rotations.
2012-02-19 23:54:42 +00:00
Jason Davies 1a6efaddca Simplify. 2012-02-19 23:20:56 +00:00
Jason Davies 24cb609add Fix d3 reference. 2012-02-19 23:20:30 +00:00
Mike Bostock 67833444a9 Update copyright year. 2012-02-19 13:35:09 -08:00
Mike Bostock e1473e2d4a Remove obsolete file. 2012-02-19 13:34:19 -08:00
Mike Bostock 0b48ec4a9a Merge branch 'zoom-extent' into v2.8.0 2012-02-19 13:28:16 -08:00
Mike Bostock 380a2f4eb6 Merge branch 'decorative-brush-resizers' into v2.8.0 2012-02-19 13:24:57 -08:00
Mike Bostock 4af8633d88 Add tests for interval.offset.
Also, don't modify the passed-in date; for consistency with other methods, and
for convenience over performance, return a new date.
2012-02-19 12:24:38 -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
Jason Davies 15357fa43e Adjust frame of reference for HTML coordinates.
The returned coordinates are now consistent with absolute positioning
numbers, for parity with the SVG behaviour (current user coordinates).

This is equivalent to [e.offsetX, e.offsetY] but unfortunately this is
buggy and inconsistent in the major browsers.
2012-02-19 20:03:58 +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 82cd7257f9 Add d3.time.{interval}.offset. Fixes #435.
This method can be used to advance a given date by a given interval.
2012-02-18 22:00:47 -08:00
Mike Bostock 35dfb87d50 Add interval.ceil. Fixes #453. 2012-02-18 21:23:17 -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 230d8e9080 Merge branch 'v2.7.5' 2012-02-18 13:10:03 -08:00
Mike Bostock 1643aa9b46 Merge branch 'master' of https://github.com/trevnorris/d3 into v2.8.0
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.
2012-02-18 13:05:02 -08:00
Mike Bostock c3516c06a6 Update src/package.js rather than package.json. 2012-02-18 11:51:45 -08:00
Mike Bostock c042431222 Merge branch 'better-node-package' into v2.8.0 2012-02-18 11:46:18 -08:00
Mike Bostock cfd5915035 Merge branch 'tweaks' of https://github.com/jasondavies/d3 into v2.8.0 2012-02-18 11:40:32 -08:00
Mike Bostock 4949310bce Merge branch 'fix-polylinear' into v2.8.0 2012-02-18 11:39:43 -08:00
Mike Bostock 4345a0ce02 Merge branch 'force-stop' of https://github.com/jasondavies/d3 into v2.8.0 2012-02-18 11:39:24 -08:00
Mike Bostock b54181e5da A wee bit o' code consolidation. 2012-02-17 08:40:27 -08:00
Jason Davies 0b93bee13f Merge branch 'brush-touch' into decorative-brush-resizers
Conflicts:
	d3.js
	d3.min.js
	src/svg/brush.js
2012-02-17 15:56:55 +00:00
Jason Davies ef46aafd06 Initial touch support for d3.svg.brush.
Fixes #418.
2012-02-17 14:28:59 +00:00
Mike Bostock 80e0e78127 Merge pull request #508 from jasondavies/rollup
Add PivotGraph (rollup) layout example.
2012-02-16 08:43:19 -08:00
Jason Davies 58e640cbcb Fix incorrect x/y swap in rollup example. 2012-02-16 16:19:53 +00:00
Jason Davies 191445a5c5 Add linkSource, linkTarget and linkValue to rollup. 2012-02-16 16:16:51 +00:00
Jason Davies 4f37a4869b Prevent next tick when force.stop is called.
This is useful when stopping the layout in response to a user action,
e.g. if another layout is used to position the nodes in an event
handler.  In this case, we don't want the next tick of the force layout
to run as it could undo the positioning work done in the event handler.
2012-02-16 12:49:20 +00:00
Jason Davies 1a9cd3c2ea Simplify again. 2012-02-16 09:50:16 +00:00
Jason Davies 17fdd13509 Simplify. 2012-02-16 09:45:50 +00:00
Jason Davies fef068d2da Add PivotGraph (rollup) layout example.
This is ported from the Protovis implementation, pv.Layout.Rollup.
The only difference is that the rollup nodes are not instances of any
original nodes (Protovis used pv.extend).  Users are expected to use the
"x" and "y" properties of the rollup node, or alternatively the "rolled
up" nodes can be retrieved via the "nodes" property.
2012-02-16 09:02:06 +00:00
Trevor Norris 8178c2961b clean up step calculations. add better method for values with no decimal part. included additional tests to demonstrate fixes. 2012-02-15 14:23:27 -08:00
Mike Bostock 1ffbf9721f Fix the resizer positioning.
A small bug was introduced where the invisible resizers were off by three
pixels. I've also removed the 1-pixel fudge factor that was designed to line up
with stroke and shape-rendering: crispEdges, in favor of simplicity.
2012-02-14 22:26:12 -08:00
Mike Bostock 79708d8d2c Show or hide resizers automatically.
The brush component now hides the resizers when empty, rather than requiring you
to do this in CSS. In addition, the brush component also temporarily overrides
the body's cursor style, so that the cursor doesn't flicker when dragging.
2012-02-14 22:07:57 -08:00
Mike Bostock 50bf5d3e38 Allow decorative brush resizers.
The brush component now allows you to add decorative elements to serve as brush
resizers, while keeping the default behavior of a few invisible pixels on the
edge of the extent. Any element you add to ".resize" containers can serve as
visible handles for the brush.

This commit also fixes two small bugs with the brush component. First, we now
track the offset between the extent edge and the mouse, rather than immediately
jumping the extent edge to the mouse position; this was barely noticeable
previously due to the resizers being so thin, but it is very noticeable with
large resizers. Second, the default behavior for the SPACE key is not prevented
whilst dragging.
2012-02-14 20:19:31 -08:00
Mike Bostock 2567c25cd3 Keep zoom behavior in-sync with projection. 2012-02-14 16:43:15 -08:00
Trevor Norris de8cddc6b8 forgot to follow spacing rules 2012-02-14 16:09:52 -08:00
Trevor Norris 25c0bca405 update d3.js and d3.min.js 2012-02-14 16:04:03 -08:00
Trevor Norris 76b13d547f use better method for calculating error correction. add test that failed the old method. 2012-02-14 16:03:38 -08:00
Jason Davies b5f8f96155 Add constrained translate zoom example. 2012-02-14 23:44:39 +00:00
Jason Davies 4f506339d4 Add missing files. 2012-02-14 18:49:16 +00:00
Jason Davies 6a0ad0247a Simplify as we don't support IE8- anyway.
Thanks, @mbostock!
2012-02-14 18:46:48 +00:00
Jason Davies 2936a6b1e7 Add d3.svg.{mouse,touches} aliases.
For backwards-compatibility.
2012-02-14 18:45:13 +00:00