Skip to content

spencermountain/somehow-maps

Repository files navigation

somehow-maps
— part of somehow
WIP svelte infographics

npm install somehow-maps

this library just hoodwinks some d3 projection methods into Svelte components -

  • so that basic SVG maps can be made in a leisurely way.
  • work-in-progress!
<script>
  import { Globe, Line, Graticule, Dot, Latitude } from 'somehow-map'
</script>

<Globe rotate={30} tilt={-10}>
  <Graticule />
  <Countries stroke="grey" />
  <Latitude at={40} />
  <Line from="toronto" to='jamaica' />
  <Dot at={[90, 0]} color="lightblue" radius={50} />
</Globe>

image

Components

these two are the containers, and should be mostly interchangeable

  • <Globe/>
  • <Map/> both of these accept a 'focus' param, what zooms the map projection to fit a geojson object.

these are the basic primitives

  • <Line from={[lat, lng]} to={'city-name'}/>

  • <Shape shape={geojson}/>

  • <Dot radius={4} at={'chicago'}/>

    these are continual lines around the whole world:

  • <Latitude/>

  • <Longitude/>

    these are some helpers

  • <Countries/>

  • <Graticule/>

  • <Intersections/>

Misc

to generate ad-hoc topojson shapes (without using QGIS):


to generate ad-hoc topojson shapes from openstreetmap:

See also

MIT

Releases

No releases published

Packages

No packages published

Languages