diff --git a/packages/geo/doc/choropleth-canvas.png b/packages/geo/doc/choropleth-canvas.png index c73da0b27..e5c3a8503 100644 Binary files a/packages/geo/doc/choropleth-canvas.png and b/packages/geo/doc/choropleth-canvas.png differ diff --git a/packages/geo/doc/choropleth.png b/packages/geo/doc/choropleth.png index 8c6c2d77d..3e6d79483 100644 Binary files a/packages/geo/doc/choropleth.png and b/packages/geo/doc/choropleth.png differ diff --git a/website/src/assets/icons.png b/website/src/assets/icons.png index 55d8a53f9..4700eb71e 100644 Binary files a/website/src/assets/icons.png and b/website/src/assets/icons.png differ diff --git a/website/src/assets/icons/choropleth-grey.png b/website/src/assets/icons/choropleth-grey.png index 1a8b56955..8e0ac3459 100644 Binary files a/website/src/assets/icons/choropleth-grey.png and b/website/src/assets/icons/choropleth-grey.png differ diff --git a/website/src/assets/icons/choropleth-red.png b/website/src/assets/icons/choropleth-red.png index a2938fc1c..662e58e94 100644 Binary files a/website/src/assets/icons/choropleth-red.png and b/website/src/assets/icons/choropleth-red.png differ diff --git a/website/src/assets/icons/geomap-grey.png b/website/src/assets/icons/geomap-grey.png index e31f580fe..861c23d8e 100644 Binary files a/website/src/assets/icons/geomap-grey.png and b/website/src/assets/icons/geomap-grey.png differ diff --git a/website/src/assets/icons/geomap-red.png b/website/src/assets/icons/geomap-red.png index 5d1ea7ec6..8f15e8d17 100644 Binary files a/website/src/assets/icons/geomap-red.png and b/website/src/assets/icons/geomap-red.png differ diff --git a/website/src/assets/icons@2x.png b/website/src/assets/icons@2x.png index 4ed0d8fd0..59373ece8 100644 Binary files a/website/src/assets/icons@2x.png and b/website/src/assets/icons@2x.png differ diff --git a/website/src/components/icons/ChoroplethIcon.js b/website/src/components/icons/ChoroplethIcon.js index 037063d69..43ae171ce 100644 --- a/website/src/components/icons/ChoroplethIcon.js +++ b/website/src/components/icons/ChoroplethIcon.js @@ -7,92 +7,66 @@ * file that was distributed with this source code. */ import React, { Fragment } from 'react' -import { Choropleth } from '@nivo/geo' import choroplethGreyImg from '../../assets/icons/choropleth-grey.png' import choroplethRedImg from '../../assets/icons/choropleth-red.png' -import { ICON_SIZE, Icon } from './styled' -import world from '../charts/geo/world_countries' - -const includeCountries = ['DZA', 'NER', 'BFA', 'MLI', 'MRT'] -const features = world.features.filter(f => includeCountries.includes(f.id)) - -const data = [ - { id: 'DZA', value: 3 }, - { id: 'NER', value: 6 }, - { id: 'BFA', value: 1 }, - { id: 'MLI', value: 12 }, - { id: 'MRT', value: 7 }, - { id: 'COD', value: 9 }, -] - -const chartProps = { - width: ICON_SIZE, - height: ICON_SIZE, - features, - data, - projectionScale: 166, - projectionTranslation: [0.8, 1.2], - isInteractive: false, - borderWidth: 1, -} +import { Icon } from './styled' +import MapIcon from './MapIcon' const ChoroplethIcon = () => ( - - - -
- -
+ <> + + - - -
- -
+ + -
+ ) export default ChoroplethIcon diff --git a/website/src/components/icons/GeoMapIcon.js b/website/src/components/icons/GeoMapIcon.js index 7a199b41f..4a092d9e9 100644 --- a/website/src/components/icons/GeoMapIcon.js +++ b/website/src/components/icons/GeoMapIcon.js @@ -6,76 +6,31 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ -import React, { Fragment } from 'react' -import { GeoMap } from '@nivo/geo' -import {} from 'd3-geo' +import React from 'react' import geomapGreyImg from '../../assets/icons/geomap-grey.png' import geomapRedImg from '../../assets/icons/geomap-red.png' -import { ICON_SIZE, Icon } from './styled' -import world from '../charts/geo/world_countries' - -const includeCountries = ['DZA', 'NER', 'BFA', 'MLI', 'MRT'] -const features = world.features.filter(f => includeCountries.includes(f.id)) - -const chartProps = { - width: ICON_SIZE, - height: ICON_SIZE, - features, - projectionScale: 166, - projectionTranslation: [0.8, 1.2], - isInteractive: false, - borderWidth: 1, -} +import { Icon } from './styled' +import MapIcon from './MapIcon' const GeoMapIcon = () => ( - - - -
- -
+ <> + + - - -
- -
+ + -
+ ) export default GeoMapIcon diff --git a/website/src/components/icons/Icons.js b/website/src/components/icons/Icons.js index fc5caa2f7..0158d1364 100644 --- a/website/src/components/icons/Icons.js +++ b/website/src/components/icons/Icons.js @@ -24,6 +24,7 @@ import ParallelCoordinatesIcon from './ParallelCoordinatesIcon' const Icons = () => ( + @@ -36,7 +37,6 @@ const Icons = () => ( - ) diff --git a/website/src/components/icons/MapIcon.js b/website/src/components/icons/MapIcon.js new file mode 100644 index 000000000..23a0937ba --- /dev/null +++ b/website/src/components/icons/MapIcon.js @@ -0,0 +1,107 @@ +/* + * This file is part of the nivo project. + * + * (c) 2016 Raphaƫl Benitte + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ +import React from 'react' +import { ICON_SIZE } from './styled' + +const size = ICON_SIZE +const line = 5 + +const outlinePath = ` + M${line / 2},${size * 0.2} + L${size * 0.33},${size * 0.1} + L${size * 0.66},${size * 0.2} + L${size - line / 2},${size * 0.1} + L${size - line / 2},${size * 0.8} + L${size * 0.66},${size * 0.9} + L${size * 0.33},${size * 0.8} + L${line / 2},${size * 0.9} + Z +` + +const rects = [ + [0, 0, size * 0.5, size * 0.2], + [0, size * 0.2, size * 0.5, size * 0.1], + [size * 0.5, 0, size * 0.7, size * 0.3], + [0, size * 0.3, size * 0.3, size * 0.1], + [0, size * 0.4, size * 0.3, size * 0.2], + [size * 0.3, size * 0.3, size * 0.4, size * 0.3], + [size * 0.7, size * 0.3, size * 0.3, size * 0.3], + [0, size * 0.6, size * 0.6, size * 0.2], + [0, size * 0.8, size * 0.6, size * 0.2], + [size * 0.6, size * 0.6, size * 0.4, size * 0.1], + [size * 0.6, size * 0.7, size * 0.4, size * 0.3], +] + +const MapIcon = ({ stroke, fill, colors = [] }) => { + return ( + + + + + + + + {rects.map((r, i) => { + return ( + + ) + })} + + + + + + + + + + ) +} + +export default MapIcon diff --git a/website/src/styles/icons.css b/website/src/styles/icons.css index dccd2cabe..e5c6ed7bf 100644 --- a/website/src/styles/icons.css +++ b/website/src/styles/icons.css @@ -1,4 +1,4 @@ -/* glue: 0.13 hash: 955823c265 */ +/* glue: 0.13 hash: ff68cfe4da */ .sprite-icons-waffle-red, .sprite-icons-waffle-grey, .sprite-icons-voronoi-red,