Commit Graph

227 Commits

Author SHA1 Message Date
Tom Wanzek
c1832fdfe5 [types-2.0] D3 dependencies and d3-format (#12325)
* [fix](d3-format)
* Add apostrophe to permissible thousands separators to accomodate e.g. Switzerland, Liechtenstein

* [chore](d3) Pin down versions
* Added package.json to pin down the minor versions of the D3 modules forming part of the standard bundle
* The pinned major.minor versions correspond to D3 v4.2 of the standard bundle (patches  are not pinnable, major version is too coarse)
* Changes tsconfig.json to used pinned dependencies

* Fixed tsconfig.json:
* Needed to leave type-resolution related options in the tsconfig.json. So that d3-test can find the d3 definition itself.
* packages in dependency are still used to pin down D3 modules
2016-10-29 07:45:05 -07:00
Tom Wanzek
0500bd3558 Replace D3 Legacy (#12256)
* Replace D3 v3 definition with D3 v4 (bundle)
* Replaces the legacy D3 v3 definitions in `d3` with a definition file representing the D3 version 4 standard bundle
* Add `package.json` file with legacy dependency to @types/d3 version >=3.5.36 <4.0.0

* Updated tsconfig.json, package.json, versions
* Updated tsconfig.json to control typings resolution for D3 v3
* Updated package.json to use caret notation of D3 typings
* Updated certain affected definitions header comments with version numbers, where version number was missing buit seemed reasonably ascertainable as latest.
* Added comments to each affected definition file with TODO once upgrade to D3 v4 is considered

* Chore changes as per review.

* Removed TODO "upgrade-to-v4" comments

* Removed added empty lines.
2016-10-27 13:35:57 -07:00
zhengbli
84a760de85 Merge branch 'types-2.0' of https://github.com/DefinitelyTyped/DefinitelyTyped into types-2.0 2016-09-14 18:45:04 -07:00
zhengbli
c2a54db3e9 Merge branch 'master' into types-2.0
# Conflicts:
#	amcharts/AmCharts.d.ts
#	angular-gettext/angular-gettext.d.ts
#	angular-jwt/angular-jwt.d.ts
#	angular-material/angular-material.d.ts
#	angularjs/angular.d.ts
#	auth0-js/auth0-js.d.ts
#	aws-lambda/aws-lambda.d.ts
#	aws-sdk/aws-sdk.d.ts
#	azure-mobile-apps/azure-mobile-apps.d.ts
#	azure-mobile-services-client/AzureMobileServicesClient.d.ts
#	blessed/blessed-tests.ts
#	blessed/blessed.d.ts
#	bootbox/bootbox.d.ts
#	bowser/bowser.d.ts
#	cache-manager/cache-manager.d.ts
#	chai-things/chai-things.d.ts
#	colors/colors.d.ts
#	cordova/cordova-tests.ts
#	cordova/plugins/Contacts.d.ts
#	cordova/plugins/FileSystem.d.ts
#	couchbase/couchbase.d.ts
#	cucumber/cucumber-tests.ts
#	cucumber/cucumber.d.ts
#	d3/d3.d.ts
#	dojo/dojo.d.ts
#	dustjs-linkedin/dustjs-linkedin.d.ts
#	esprima/esprima.d.ts
#	express-serve-static-core/express-serve-static-core.d.ts
#	express-session/express-session.d.ts
#	fetch-mock/fetch-mock.d.ts
#	fs-extra/fs-extra.d.ts
#	fullCalendar/fullCalendar.d.ts
#	github-electron/github-electron.d.ts
#	gulp-uglify/gulp-uglify.d.ts
#	gulp/gulp.d.ts
#	highcharts/highcharts.d.ts
#	imap/imap.d.ts
#	incremental-dom/incremental-dom.d.ts
#	inversify/inversify.d.ts
#	ionic/ionic.d.ts
#	ioredis/ioredis.d.ts
#	isomorphic-fetch/isomorphic-fetch-tests.ts
#	jake/jake.d.ts
#	joi/joi.d.ts
#	jquery-mockjax/jquery-mockjax.d.ts
#	jquery/jquery.d.ts
#	js-data-http/js-data-http-tests.ts
#	js-data-http/js-data-http.d.ts
#	js-data/js-data.d.ts
#	jsdom/jsdom.d.ts
#	jsts/jsts-tests.ts
#	knex/knex.d.ts
#	koa-favicon/koa-favicon.d.ts
#	koa-router/koa-router-tests.ts
#	koa-router/koa-router.d.ts
#	lodash/lodash.d.ts
#	mailparser/mailparser.d.ts
#	maquette/maquette.d.ts
#	material-ui/material-ui.d.ts
#	matter-js/matter-js.d.ts
#	moment/moment.d.ts
#	mongoose-promise/mongoose-promise-tests.ts
#	mongoose/mongoose-tests.ts
#	mongoose/mongoose.d.ts
#	multer/multer.d.ts
#	ncp/ncp.d.ts
#	nock/nock.d.ts
#	node/node-tests.ts
#	node/node.d.ts
#	nvd3/nvd3.d.ts
#	object-assign/object-assign.d.ts
#	openlayers/openlayers.d.ts
#	parse/parse.d.ts
#	pdf/pdf.d.ts
#	pdfkit/pdfkit.d.ts
#	pg/pg.d.ts
#	pixi.js/pixi.js.d.ts
#	progress/progress.d.ts
#	pusher-js/pusher-js.d.ts
#	quill/quill-tests.ts
#	quill/quill.d.ts
#	radium/radium.d.ts
#	ravenjs/ravenjs-tests.ts
#	react-dropzone/react-dropzone.d.ts
#	react-mdl/react-mdl.d.ts
#	react-native/react-native.d.ts
#	react-notification-system/react-notification-system.d.ts
#	react-router/history-tests.ts
#	react-router/react-router-tests.tsx
#	react-router/react-router.d.ts
#	react-select/react-select-tests.tsx
#	react-select/react-select.d.ts
#	react/react.d.ts
#	redux-form/redux-form.d.ts
#	request-promise/request-promise.d.ts
#	resolve-from/resolve-from.d.ts
#	riot-api-nodejs/riot-api-nodejs.d.ts
#	sanitize-html/sanitize-html.d.ts
#	segment-analytics/segment-analytics.d.ts
#	simple-assign/simple-assign-tests.ts
#	simple-assign/simple-assign.d.ts
#	slate-irc/slate-irc.d.ts
#	soap/soap.d.ts
#	socket.io/socket.io.d.ts
#	sql.js/sql.js-tests.ts
#	sql.js/sql.js.d.ts
#	steam/steam.d.ts
#	stylus/stylus.d.ts
#	swiper/swiper.d.ts
#	tedious/tedious.d.ts
#	threejs/three.d.ts
#	twilio/twilio.d.ts
#	underscore/underscore.d.ts
#	ws/ws.d.ts
#	yeoman-generator/yeoman-generator.d.ts
2016-09-14 18:44:24 -07:00
Nicolas Thiebaud
6e2f2280ef Add tick() to d3.layout.Force 2016-09-06 17:57:44 -07:00
Tom Wanzek
af4a0bddab d3 legacy
* Added version number 3.5.17 to legacy definitions, so they are identifiable as v3 related for now.
2016-09-01 21:49:49 -04:00
Ryan Cavanaugh
f55497c988 Merge remote-tracking branch 'upstream/master' into merge_7_25
# Conflicts:
#	convict/convict.d.ts
#	multer/multer.d.ts
#	nodemailer/nodemailer.d.ts
#	react-bootstrap-table/react-bootstrap-table.d.ts
#	react-dnd/react-dnd-tests.ts
#	react-native/index.d.ts
#	request/request.d.ts
#	restify/index.d.ts
#	webpack/webpack.d.ts
#	ws/ws.d.ts
2016-07-27 16:12:49 -07:00
jamescoward
68ede31087 Removed additional line 2016-07-27 14:14:01 +01:00
jamescoward
45948d0956 Added missing histogram.range() method
histogram.range([range]) accepts a two element array representing the minimum and maximum of the range as well as a function that returns a two element array.

See: https://github.com/d3/d3-3.x-api-reference/blob/master/Histogram-Layout.md 

I have added then method to the histogram typing
2016-07-27 14:12:18 +01:00
Ryan Cavanaugh
a4f5ae3098 Merge commit 'upstream/master~250' into merge_7_25 2016-07-26 18:03:56 -07:00
Ryan Cavanaugh
c73630c9a3 Merge commit 'upstream/master~400' into merge_7_25
# Conflicts:
#	angular-translate/angular-translate.d.ts
#	knex/knex.d.ts
#	redux-logger/index.d.ts
#	simplestorage.js/index.d.ts
#	underscore/underscore.d.ts
#	yargs/yargs.d.ts
2016-07-26 13:53:00 -07:00
Ryan Cavanaugh
e94e9a8630 Merge commit 'upstream/master~450' into merge_7_25 2016-07-26 13:40:56 -07:00
Ryan Cavanaugh
11d624e656 Merge commit 'upstream/master~500' into merge_7_25 2016-07-26 12:17:32 -07:00
Ryan Cavanaugh
5e9440c8ad Merge commit 'upstream/master~700' into merge_7_25
# Conflicts:
#	angular-ui-router/angular-ui-router.d.ts
#	bookshelf/bookshelf-tests.ts
#	bookshelf/bookshelf.d.ts
#	enzyme/enzyme-tests.tsx
#	enzyme/enzyme.d.ts
#	escodegen/escodegen-tests.ts
#	helmet/helmet.d.ts
#	joi/joi.d.ts
#	knex/knex-tests.ts
#	moment/index.d.ts
#	mongoose/index.d.ts
#	pg/pg.d.ts
#	react-select/react-select-tests.tsx
#	soap/index.d.ts
#	ssh2/ssh2.d.ts
#	turf/turf-tests.ts
#	underscore.string/underscore.string.d.ts
2016-07-25 16:10:34 -07:00
Ryan Cavanaugh
9d7d5a209a Getting types-2.0 passing CI 2016-07-14 18:13:43 -07:00
Ryan Cavanaugh
a5f4d50ccc Fix tsconfig files for new option name / behavior.
Also fixes some inconsistent whitespace.
2016-07-12 13:54:56 -07:00
Raghav Katyal
395c4e1639 Turning on consistent casing flag and fixing failures 2016-06-30 15:14:49 -07:00
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
Ryan Cavanaugh
c89c74f407 Fix d3 2016-05-12 18:07:15 -07:00
Ryan Cavanaugh
bfd400a8f8 Add noEmit to all config files 2016-05-10 12:24:49 -07:00
Ryan Cavanaugh
e808e8e062 Remove unneeded references 2016-05-10 12:22:25 -07:00
Ryan Cavanaugh
50387d4046 Change relative reference paths to types references. Errors incoming... 2016-05-09 18:06:27 -07:00
Ryan Cavanaugh
49b1ac6a38 Rename all entry points to index.d.ts and explicitify all file lists 2016-05-09 17:29:10 -07:00
Ryan Cavanaugh
ab2b4191c5 Add typesRoot to all config files 2016-05-09 13:52:25 -07:00
Ryan Cavanaugh
ded70421be Turn off strict null checks 2016-05-04 15:08:38 -07:00
Ryan Cavanaugh
69d1929d8a Add tsconfig.json files 2016-05-04 14:14:39 -07:00
Ryan Cavanaugh
e7c111c4b7 Merge remote-tracking branch 'upstream/master' into types2.0
Add tsconfig files everywhere

# Conflicts:
#	azure-mobile-services-client/AzureMobileServicesClient.d.ts
#	bookshelf/bookshelf.d.ts
#	hapi/hapi.d.ts
#	helmet/helmet.d.ts
#	mongodb/mongodb.d.ts
#	nock/nock.d.ts
#	react-bootstrap/react-bootstrap.d.ts
#	react-helmet/react-helmet.d.ts
#	restify/restify.d.ts
#	sequelize/sequelize.d.ts
2016-04-27 20:40:21 -07: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