Commit Graph

201 Commits

Author SHA1 Message Date
Leon Radley
626e4aa1e4 d3 extent should take array T, not array U 2016-06-28 08:50:19 +02:00
James McCallum
6429513724 Updated extent - added [Date, Date] return type
The interfaces for extent don't seem to cover the common date extent scenario - I can see there's one covering generics with a generic argument accessor but it's return type is still limited to 'primitive' (toString()-able) or the original object type 'U' - not a date typed property of U.  

In any case the standard x.domain(d3.extent(data, d=> d.date)) where data is an array of objects currently gives type errors in typescript - maybe this fix is a very specific case and there's a better generic way to approach, but I can see there are already dedicated overloads for [number, number] and [string, string]
2016-06-28 08:50:15 +02:00
Eddie Antonio Santos
af71014144 Fix bisectLeft function declaration
It should match the type signature of `bisectRight()`.
2016-06-20 16:01:25 -06:00
Phil Scott
00e58d84f3 d3 - Adds function type to d3.layout.partition<T> (#9668)
interface Partition<T> was missing it's function type.
2016-06-19 12:22:10 +09:00
Oliver Joseph Ash
2a1181267d d3: Correct overload order (#9663)
Given `selection.datum((d,i,o) => 'string')`, TypeScript would always use the first overload, when it should be using the second. Correcting the order fixes this.
2016-06-19 11:33:13 +09:00
Viktor Zozuliak
65a9e09db4 D3 - add "median" to array methods (#9637) 2016-06-14 18:18:20 +09:00
Tom Wanzek
adfe4a9c78 D3 enter (#9318)
* Added empty() and size() methods to interface Enter<Datum>. As per D3 API these methods are defined on the enter selection.

* Added test function testEnterSizeEmpty() for .enter().empty() and .enter.size() methods.
2016-05-15 02:19:29 +09:00
vvakame
7de6c3dd94 Merge branch 'master' into rename-repo-url 2016-03-17 21:06:54 +09:00
vvakame
14fe4313f4 replace internal module to namespace 2016-03-17 02:18:10 +09:00
vvakame
56295f5058 replace https://github.com/borisyankov/DefinitelyTyped to https://github.com/DefinitelyTyped/DefinitelyTyped 2016-03-17 00:55:26 +09:00
Valentin Robert
f3b5648444 D3.diagonal's index is optional 2016-03-14 18:19:39 -07:00
Valentin Robert
87a5be72a9 loosen restrictive type signature for d3 diagonal 2016-02-26 17:45:26 -08:00
Adi Stadelmann
c09bd95917 Add layout.partition because was removed by commit 7600257 2015-12-20 21:00:37 +01:00
pragyandas
f6e34ebc7c changed return type of node() to Node 2015-12-08 16:19:41 +05:30
Douglas
b06dffee48 Fix d3.dsv callback parameter types 2015-11-19 14:27:10 -06:00
Douglas
807a294636 Fix d3.dsv callback parameter types 2015-11-19 11:59:49 -06:00
Noah Chen
fcfb229162 d3.geom.quadtree<T>(..) should accept 4 arguments 2015-10-12 17:17:57 -04:00
Alex Ford
548d64f933 [#5751] Add d3.time.format.utc.multi 2015-09-20 08:29:31 -04:00
Paul Jolly
9d8cbdb263 Correctly type d3.event 2015-09-10 17:28:06 +01:00
Daniel Rosenwasser
58345fc448 Merge branch 'master' into handleExtraObjectLiteralProperties
Conflicts:
	angular-ui-bootstrap/angular-ui-bootstrap-tests.ts
2015-08-17 12:28:46 -07:00
Masahiro Wakame
667ff70834 Merge pull request #5256 from MatthiasHild/patch-1
Transition.styleTween has incorrect signature
2015-08-13 23:54:57 +09:00
Daniel Rosenwasser
e9a00d26d8 Add missing 'weight' property to labelAnchorLinks type in 'd3'. 2015-08-11 14:52:35 -07:00
vvakame
eba9f1e2ff remove unrequired .tscparams 2015-08-08 15:41:13 +09:00
Matthias Hild
00c2478e98 Transition.styleTween has incorrect signature
The signature of Transition.styleTween is currently:

styleTween(name: string, tween: (datum: Datum, index: number, attr: string) => Primitive, priority?: string): Transition<Datum>; (line 833)

Note that the tween is said to return a Primitive. This seems incorrect, both in terms of D3 intent and implementation.

The *correct* version appears to be:

styleTween(name: string, tween: (datum: Datum, index: number, attr: string) => (t: number) => Primitive, priority?: string): Transition<Datum>;

(This is similar to  similar to Transition.attrTween.)

First, the documentation states:

>>> The return value of tween must be an interpolator: a function that maps a parametric value t in the domain [0,1] 
>>>  to a color, number or arbitrary value.

Second, the source code of d3 3.5.5 has:

d3_transitionPrototype.styleTween = function(name, tween, priority) {
    if (arguments.length < 3) priority = "";
    function styleTween(d, i) {
      var f = tween.call(this, d, i, d3_window(this).getComputedStyle(this, null).getPropertyValue(name));
      return f && function(t) {
        this.style.setProperty(name, f(t), priority);
      };
    }
    return this.tween("style." + name, styleTween);
  };

Note the line "this.style.setProperty(name, f(t), priority);" where the result f of applying the tween is passed a parameter t. 

The only point of discussion might be the type of the return value of the tween's interpolator output. Is it Primitive or any? The documentation quoted above (incidentally the same for attrTween and styleTween) explicitly allows for an arbitrary value. I don't have enough D3 experience to know if this is a practically relevant possibility.

Many thanks for your great work on d3.d.ts!!! Especially the use of tweens and interpolators perfectly illustrates the benefits of Typescript.

Best wishes,

Matthias
2015-08-06 19:02:28 -04:00
Boris Yankov
383a3bc8e6 Merge pull request #5095 from aicioara/master
[d3] Correct interpolate() signature
2015-07-31 02:51:34 +03:00
Masahiro Wakame
0c120b7669 Merge pull request #5054 from fmilitao/master
[d3] added Transition.transition() and optional 'i' on Arc<T>
2015-07-29 00:10:17 +09:00
Andrei Cioara
f444210ac4 d3: Implemented all forgotten overloadings 2015-07-27 12:43:47 -07:00
Andrei Cioara
c703676114 d3: correct overloading of interpolate() 2015-07-27 12:40:41 -07:00
Filipe
64ccffcc3f fixed type of tween in Transition.attrTween to return interpolator function 2015-07-26 09:23:41 +01:00
Zoe Tsai
507917053c add third arugment to where needed 2015-07-24 16:46:17 -07:00
Filipe
5fef36255d added Transition.transitin() and optional 'i' on Arc<T> 2015-07-24 10:54:44 +01:00
Zoe Tsai
d268fbc77a update d3.d.ts 2015-07-21 15:16:13 -07:00
Zoe Tsai
b27d51b612 update d3.d.ts 2015-07-20 19:36:52 -07:00
mcliment
ba8f92a4f0 d3.js cluster links property should return a collection 2015-07-20 12:17:33 +02:00
Victor Pineda Gonzalez
e95209b243 node() function will return DOM Node 2015-07-15 18:03:01 -05:00
Stefan Steinhart
1e679617ab fixed multi time format 2015-07-10 09:39:20 +02:00
Stefan Steinhart
aaf2dcd5d6 + tickFormat also directly accepts a string parameter 2015-07-02 21:17:45 +02:00
Gildor
1740c40614 fix d3 bisector type signature 2015-06-23 18:03:16 -07:00
Alex Ford
cf09bf76ce Liberalize type of d3.event. Addresses #4590. 2015-06-11 16:09:10 -04:00
Justin Lan
8ab53b38cf Fix some errors in the d3 definitions
== Interval.offset() ==
Should take a number not a Date as the second parameter
(https://github.com/mbostock/d3/wiki/Time-Intervals#interval_offset)

== svg.line.defined() and svg.area.defined() ==
In two places setter signature for defined() wasn't listed.

== svg.symbol()'s index parameter is optional ==
https://github.com/mbostock/d3/wiki/SVG-Shapes#_symbol
2015-06-02 21:17:55 -07:00
Alex Ford
808f545d7e Merge branch 'master' of github.com:borisyankov/DefinitelyTyped
Conflicts:
	d3/d3.d.ts
2015-05-29 13:27:55 -04:00
Jordi Aranda
c514d8784a Fixes in callback type definition in xhr methods 2015-05-19 18:57:52 +02:00
Jordi Aranda
2dc99a0141 Callback type definition fix in xhr methods 2015-05-19 18:31:48 +02:00
Guillaume Mouron
b0289ac7a3 Insert and append can take functions returning a DOM element
This is specified in the d3 documentation :
- append : https://github.com/mbostock/d3/wiki/Selections#append
- insert : https://github.com/mbostock/d3/wiki/Selections#insert

Also visible in the code : https://github.com/mbostock/d3/blob/master/d3.js#L802 and https://github.com/mbostock/d3/blob/master/d3.js#L818
2015-05-18 12:07:28 +02:00
Daniel Beckwith
332ac5b1f4 Adds shiftKey property to D3Event. 2015-05-03 01:10:35 -04:00
hansrwindhoff
08ae0b1793 typing for Arbitrary Delimiters
https://github.com/mbostock/d3/wiki/CSV#arbitrary-delimiters
2015-04-20 11:32:59 -06:00
Masahiro Wakame
ebc03ee2d5 Merge pull request #4062 from gildorwang/d3-add-charge-distance
Add definition for D3 chargeDistance
2015-04-12 10:19:30 +09:00
Masahiro Wakame
3b78ba4850 Merge pull request #4057 from rcchen/master
Added interpolate typings for functions in svg.line/area
2015-04-12 08:38:17 +09:00
Gildor
e52779e5dc Add definition for D3 chargeDistance 2015-04-08 17:44:40 +08:00
Masahiro Wakame
f86c9e1080 Merge pull request #4005 from markwongsk/d3-keyboard-events
Added more keyboard events to d3.event
2015-04-07 23:08:14 +09:00