From 12c535e91598e0f6658d39f9cc4383a39aac749f Mon Sep 17 00:00:00 2001 From: sathis Date: Mon, 11 Dec 2017 08:40:45 +0530 Subject: [PATCH 1/3] Add innerRef, pointRadius and fix typo in center --- packages/vx-geo/src/projections/Projection.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/vx-geo/src/projections/Projection.js b/packages/vx-geo/src/projections/Projection.js index f61199ece..c6d38d09c 100644 --- a/packages/vx-geo/src/projections/Projection.js +++ b/packages/vx-geo/src/projections/Projection.js @@ -39,6 +39,8 @@ export default function Projection({ graticuleLines, graticuleOutline, className, + innerRef, + pointRadius, ...restProps }) { const currProjection = projectionMapping[projection](); @@ -47,7 +49,7 @@ export default function Projection({ if (clipExtent) currProjection.clipExtent(clipExtent); if (scale) currProjection.scale(scale); if (translate) currProjection.translate(translate); - if (center) currProjection.translate(center); + if (center) currProjection.center(center); if (rotate) currProjection.rotate(rotate); if (precision) currProjection.rotate(precision); if (fitExtent) currProjection.fitExtent(...fitExtent); @@ -55,6 +57,9 @@ export default function Projection({ const path = geoPath().projection(currProjection); + if (pointRadius) path.pointRadius(pointRadius); + + return ( {graticule && @@ -75,6 +80,7 @@ export default function Projection({ innerRef && innerRef(ref, feature, i)} {...additionalProps(restProps, { ...feature, index: i, From 0495e9ff5fd1b697948b744c5e54adf0c7ce4ee3 Mon Sep 17 00:00:00 2001 From: sathis Date: Mon, 11 Dec 2017 08:44:20 +0530 Subject: [PATCH 2/3] Remove extra line --- packages/vx-geo/src/projections/Projection.js | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/vx-geo/src/projections/Projection.js b/packages/vx-geo/src/projections/Projection.js index c6d38d09c..7dbfbc77f 100644 --- a/packages/vx-geo/src/projections/Projection.js +++ b/packages/vx-geo/src/projections/Projection.js @@ -59,7 +59,6 @@ export default function Projection({ if (pointRadius) path.pointRadius(pointRadius); - return ( {graticule && From 5262db00a868f3c76ad49bf3e76ee03756829f8c Mon Sep 17 00:00:00 2001 From: sathis Date: Mon, 11 Dec 2017 08:48:44 +0530 Subject: [PATCH 3/3] Make innerRef same as other props --- packages/vx-geo/src/projections/Projection.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/vx-geo/src/projections/Projection.js b/packages/vx-geo/src/projections/Projection.js index 7dbfbc77f..e6bbe7628 100644 --- a/packages/vx-geo/src/projections/Projection.js +++ b/packages/vx-geo/src/projections/Projection.js @@ -79,7 +79,7 @@ export default function Projection({ innerRef && innerRef(ref, feature, i)} + ref={innerRef && innerRef(feature, i)} {...additionalProps(restProps, { ...feature, index: i,