Skip to content

Commit

Permalink
improvement: one dot per city (#1247)
Browse files Browse the repository at this point in the history
License: MIT
Signed-off-by: Henrique Dias <hacdias@gmail.com>
  • Loading branch information
hacdias committed Oct 11, 2019
1 parent 533ee06 commit 120744e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion src/bundles/peer-locations.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,12 @@ export default function (opts) {
'selectPeerLocationsForSwarm',
peers => {
if (!peers) return []
return peers.map(p => p.coordinates).filter(arr => !!arr)
const allCoord = peers
.map(p => p.coordinates)
.filter(arr => !!arr)

const unique = new Set(allCoord.map(JSON.stringify))
return Array.from(unique).map(JSON.parse)
}
),

Expand Down
2 changes: 1 addition & 1 deletion src/peers/WorldMap/WorldMap.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const WorldMap = ({ t, className }) => {
let width = availableWidth * svgWidthOversizeFactor
// if the map gets too big the dots get lost in the dot grid, also it just overloads the viewers brain.
if (width > 3000) {
width = 3300
width = 3000
}
// if the map gets too small it becomes illegible. There will be some map cropping on mobile.
if (width < 700) {
Expand Down

0 comments on commit 120744e

Please sign in to comment.