From bffcb83f7ec54c26ae602245da8c9c69c9ad1c65 Mon Sep 17 00:00:00 2001 From: Hugues Stefanski Date: Thu, 22 Mar 2018 21:20:07 +0100 Subject: [PATCH 1/2] d3-geo v1.10 : added projection.angle method --- types/d3-geo/d3-geo-tests.ts | 3 +++ types/d3-geo/index.d.ts | 10 +++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/types/d3-geo/d3-geo-tests.ts b/types/d3-geo/d3-geo-tests.ts index c4508351a0..5124694378 100644 --- a/types/d3-geo/d3-geo-tests.ts +++ b/types/d3-geo/d3-geo-tests.ts @@ -395,6 +395,9 @@ constructedProjection = constructedProjection.translate([480, 250]); const center: [number, number] = constructedProjection.center(); constructedProjection = constructedProjection.center([0, 0]); +const angle = constructedProjection.angle(); +constructedProjection = constructedProjection.angle(45); + const rotate: [number, number, number] = constructedProjection.rotate(); constructedProjection = constructedProjection.rotate([0, 0]); constructedProjection = constructedProjection.rotate([0, 0, 0]); diff --git a/types/d3-geo/index.d.ts b/types/d3-geo/index.d.ts index 7efbb72010..a7fc0e9094 100644 --- a/types/d3-geo/index.d.ts +++ b/types/d3-geo/index.d.ts @@ -887,7 +887,15 @@ export interface GeoProjection extends GeoStreamWrapper { * @param precision A numeric value in pixels to use as the threshold for the projection’s adaptive resampling. */ precision(precision: number): this; - + /** + * Returns the projection’s current angle, which defaults to 0°. + */ + angle(): number; + /** + * Sets the projection’s post-projection planar rotation angle to the specified angle in degrees and returns the projection. + * @param angle The new rotation angle of the projection. + */ + angle(angle: number): this; /** * Returns the current rotation [lambda, phi, gamma] specifying the rotation angles in degrees about each spherical axis. * (These correspond to yaw, pitch and roll.) which defaults [0, 0, 0]. From 8a2283e0e6f36f88c708407511e5f5093bad634b Mon Sep 17 00:00:00 2001 From: Hugues Stefanski Date: Thu, 22 Mar 2018 21:23:19 +0100 Subject: [PATCH 2/2] d3-geo version increase --- types/d3-geo/index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/d3-geo/index.d.ts b/types/d3-geo/index.d.ts index a7fc0e9094..d9f0931269 100644 --- a/types/d3-geo/index.d.ts +++ b/types/d3-geo/index.d.ts @@ -1,10 +1,10 @@ -// Type definitions for D3JS d3-geo module 1.9 +// Type definitions for D3JS d3-geo module 1.10 // Project: https://github.com/d3/d3-geo/ // Definitions by: Hugues Stefanski , Tom Wanzek , Alex Ford , Boris Yankov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 -// Last module patch version validated against: 1.9.0 +// Last module patch version validated against: 1.10.0 import * as GeoJSON from 'geojson';