diff --git a/packages/vx-demo/static/docs/vx-bounds.html b/packages/vx-demo/static/docs/vx-bounds.html index c51014bb1..8ea631275 100644 --- a/packages/vx-demo/static/docs/vx-bounds.html +++ b/packages/vx-demo/static/docs/vx-bounds.html @@ -35,7 +35,7 @@

@vx/bounds

npm install --save @vx/bounds
-

withBoundingRects HOC

+

withBoundingRects HOC

It's often useful to determine whether elements (e.g., tooltips) overflow the bounds of their parent container and adjust positioning accordingly. The withBoundingRects higher-order component is meant to simplify this computation by passing in a component's bounding rect as well as its parent's bounding rect.

Example usage

Example usage with a <Tooltip /> component

diff --git a/packages/vx-demo/static/docs/vx-geo.html b/packages/vx-demo/static/docs/vx-geo.html index e0f428908..a11ca644f 100644 --- a/packages/vx-demo/static/docs/vx-geo.html +++ b/packages/vx-demo/static/docs/vx-geo.html @@ -43,6 +43,7 @@

Installation

diff --git a/packages/vx-geo/Readme.md b/packages/vx-geo/Readme.md index 14b4228c0..f0841ea32 100644 --- a/packages/vx-geo/Readme.md +++ b/packages/vx-geo/Readme.md @@ -18,6 +18,7 @@ npm install --save @vx/geo - [Graticule](#graticule-) - [Albers](#albers-) + - [EqualEarth](#equalearth-) - [Mercator](#mercator-) - [NaturalEarth](#naturalearth-) - [Orthographic](#orthographic-) @@ -44,6 +45,11 @@ npm install --save @vx/geo All props pass through to `` +

<EqualEarth />

+ +All props pass through to `` + +

<Mercator />

All props pass through to `` diff --git a/packages/vx-geo/docs/api.md b/packages/vx-geo/docs/api.md index b65f6b44f..edd29b313 100644 --- a/packages/vx-geo/docs/api.md +++ b/packages/vx-geo/docs/api.md @@ -15,6 +15,11 @@ All props pass through to `` +

<EqualEarth />

+ +All props pass through to `` + +

<Mercator />

All props pass through to `` diff --git a/packages/vx-geo/docs/docs.md b/packages/vx-geo/docs/docs.md index 14b4228c0..f0841ea32 100644 --- a/packages/vx-geo/docs/docs.md +++ b/packages/vx-geo/docs/docs.md @@ -18,6 +18,7 @@ npm install --save @vx/geo - [Graticule](#graticule-) - [Albers](#albers-) + - [EqualEarth](#equalearth-) - [Mercator](#mercator-) - [NaturalEarth](#naturalearth-) - [Orthographic](#orthographic-) @@ -44,6 +45,11 @@ npm install --save @vx/geo All props pass through to `` +

<EqualEarth />

+ +All props pass through to `` + +

<Mercator />

All props pass through to `` diff --git a/packages/vx-geo/package.json b/packages/vx-geo/package.json index eb8615330..a89ba593f 100644 --- a/packages/vx-geo/package.json +++ b/packages/vx-geo/package.json @@ -38,7 +38,7 @@ "dependencies": { "@vx/group": "0.0.183", "classnames": "^2.2.5", - "d3-geo": "^1.6.4", + "d3-geo": "^1.11.3", "prop-types": "^15.5.10" }, "devDependencies": { diff --git a/packages/vx-geo/src/index.js b/packages/vx-geo/src/index.js index 1c33fe17b..6c9476ff9 100644 --- a/packages/vx-geo/src/index.js +++ b/packages/vx-geo/src/index.js @@ -2,4 +2,5 @@ export { default as Albers } from './projections/Albers'; export { default as Mercator } from './projections/Mercator'; export { default as Orthographic } from './projections/Orthographic'; export { default as NaturalEarth } from './projections/NaturalEarth'; +export { default as EqualEarth } from './projections/EqualEarth'; export { default as Graticule } from './graticule/Graticule'; diff --git a/packages/vx-geo/src/projections/EqualEarth.js b/packages/vx-geo/src/projections/EqualEarth.js new file mode 100644 index 000000000..34bd50c39 --- /dev/null +++ b/packages/vx-geo/src/projections/EqualEarth.js @@ -0,0 +1,9 @@ +import React from 'react'; +import Projection from './Projection'; + +/** + * All props pass through to `` + */ +export default function EqualEarth(props) { + return ; +} diff --git a/packages/vx-geo/src/projections/Projection.js b/packages/vx-geo/src/projections/Projection.js index f9a276300..26eea33a4 100644 --- a/packages/vx-geo/src/projections/Projection.js +++ b/packages/vx-geo/src/projections/Projection.js @@ -3,14 +3,22 @@ import PropTypes from 'prop-types'; import cx from 'classnames'; import { Group } from '@vx/group'; import Graticule from '../graticule/Graticule'; -import { geoOrthographic, geoAlbers, geoMercator, geoNaturalEarth1, geoPath } from 'd3-geo'; +import { + geoOrthographic, + geoAlbers, + geoMercator, + geoNaturalEarth1, + geoEqualEarth, + geoPath +} from 'd3-geo'; // TODO: Implement all projections of d3-geo const projectionMapping = { orthographic: () => geoOrthographic(), albers: () => geoAlbers(), mercator: () => geoMercator(), - naturalEarth: () => geoNaturalEarth1() + naturalEarth: () => geoNaturalEarth1(), + equalEarth: () => geoEqualEarth() }; Projection.propTypes = { @@ -89,10 +97,12 @@ export default function Projection({ return ( {graticule && !graticule.foreground && path(g)} {...graticule} />} - {graticuleLines && - !graticuleLines.foreground && path(g)} {...graticuleLines} />} - {graticuleOutline && - !graticuleOutline.foreground && path(g)} {...graticuleOutline} />} + {graticuleLines && !graticuleLines.foreground && ( + path(g)} {...graticuleLines} /> + )} + {graticuleOutline && !graticuleOutline.foreground && ( + path(g)} {...graticuleOutline} /> + )} {features.map((feature, i) => { return ( @@ -111,10 +121,12 @@ export default function Projection({ {projectionFunc && projectionFunc(currProjection)} {graticule && graticule.foreground && path(g)} {...graticule} />} - {graticuleLines && - graticuleLines.foreground && path(g)} {...graticuleLines} />} - {graticuleOutline && - graticuleOutline.foreground && path(g)} {...graticuleOutline} />} + {graticuleLines && graticuleLines.foreground && ( + path(g)} {...graticuleLines} /> + )} + {graticuleOutline && graticuleOutline.foreground && ( + path(g)} {...graticuleOutline} /> + )} ); } diff --git a/packages/vx-geo/test/EqualEarth.test.js b/packages/vx-geo/test/EqualEarth.test.js new file mode 100644 index 000000000..1206103c0 --- /dev/null +++ b/packages/vx-geo/test/EqualEarth.test.js @@ -0,0 +1,9 @@ +import React from 'react'; +import { shallow } from 'enzyme'; +import { EqualEarth } from '../src'; + +describe('', () => { + test('it should be defined', () => { + expect(EqualEarth).toBeDefined(); + }); +}); \ No newline at end of file