Skip to content

Commit

Permalink
Merge pull request #213 from msathis/master
Browse files Browse the repository at this point in the history
Fix center and add pointRadius, innerRef
  • Loading branch information
hshoff authored Dec 11, 2017
2 parents 581160f + 5262db0 commit 73cdf53
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/vx-geo/src/projections/Projection.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ export default function Projection({
graticuleLines,
graticuleOutline,
className,
innerRef,
pointRadius,
...restProps
}) {
const currProjection = projectionMapping[projection]();
Expand All @@ -47,14 +49,16 @@ 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);
if (fitSize) currProjection.fitSize(...fitSize);

const path = geoPath().projection(currProjection);

if (pointRadius) path.pointRadius(pointRadius);

return (
<Group className={`vx-geo`}>
{graticule &&
Expand All @@ -75,6 +79,7 @@ export default function Projection({
<path
className={cx(`vx-geo-${projection}`, className)}
d={path(feature)}
ref={innerRef && innerRef(feature, i)}
{...additionalProps(restProps, {
...feature,
index: i,
Expand Down

0 comments on commit 73cdf53

Please sign in to comment.