d3plus-geomap
![Slack](https://img.shields.io/badge/Slack-Click%20to%20Join!-green.svg?style=social)
A reusable geo map built on D3 and Topojson
Installing
If you use NPM, npm install d3plus-geomap
. Otherwise, download the latest release. The released bundle supports AMD, CommonJS, and vanilla environments. Create a custom bundle using Rollup or your preferred bundler. You can also load directly from d3plus.org:
<script src="https://d3plus.org/js/d3plus-geomap.v0.2.full.min.js"></script>
API Reference
Geomap ⇐ Viz
Kind: global class
Extends: Viz
new Geomap()
Creates SVG paths and coordinate points based on an array of data. See this example for help getting started using the geomap generator.
Geomap.bounds([value])
If value is specified, filters the features used to calculate the initial projection fitExtent based on an ID, array of IDs, or filter function and returns the current class instance. If value is not specified, returns the current bounds filter.
Kind: static method of Geomap
Param | Type |
---|
[value] | Number | String | Array | function |
Geomap.ocean([value])
If value is specified, sets the ocean color and returns the current class instance. If value is not specified, returns the current ocean color.
Kind: static method of Geomap
Param | Type | Default |
---|
[value] | String | "#cdd1d3" |
Geomap.padding([value])
If value is specified, sets the topojson outer padding and returns the current class instance. If value is not specified, returns the current topojson outer padding.
Kind: static method of Geomap
Param | Type | Default |
---|
[value] | Number | 20 |
Geomap.point([value])
If value is specified, sets the point accessor to the specified function or array and returns the current class instance. Point values are expected in the format [longitude, latitude], which is in-line with d3's expected [x, y] mapping. If value is not specified, returns the current point accessor.
Kind: static method of Geomap
Param | Type |
---|
[value] | function | Array |
Geomap.pointSize([value])
If value is specified, sets the point size accessor to the specified function or number and returns the current class instance. If value is not specified, returns the current point size accessor.
Kind: static method of Geomap
Param | Type |
---|
[value] | function | Number |
Geomap.pointSizeMax([value])
If value is specified, sets the maximum point radius and returns the current class instance. If value is not specified, returns the current maximum point radius.
Kind: static method of Geomap
Param | Type | Default |
---|
[value] | Number | 10 |
Geomap.pointSizeMin([value])
If value is specified, sets the minimum point radius and returns the current class instance. If value is not specified, returns the current minimum point radius.
Kind: static method of Geomap
Param | Type | Default |
---|
[value] | Number | 5 |
Geomap.tiles([value])
If value is specified, toggles the map tiles and returns the current class instance. If value is not specified, returns the current tiling boolean.
Kind: static method of Geomap
Param | Type | Default |
---|
[value] | Boolean | true |
Geomap.topojson([value])
If value is specified, sets the topojson to be used and returns the current class instance. If value is not specified, returns the current topojson.
Kind: static method of Geomap
Param | Type |
---|
[value] | Boolean | Object |
Geomap.topojsonFilter([value])
If value is specified, filters the features used to calculate the initial projection fitExtent based on an ID, array of IDs, or filter function and returns the current class instance. If value is not specified, returns the current bounds filter.
Kind: static method of Geomap
Param | Type |
---|
[value] | Number | String | Array | function |
Geomap.topojsonKey([value])
If value is specified, sets the topojson object key to be used and returns the current class instance. If value is not specified, returns the current topojson object key.
Kind: static method of Geomap
Param | Type | Default |
---|
[value] | String | "countries" |
Geomap.zoom([value])
If value is specified, toggles the zoom behavior and returns the current class instance. If value is not specified, returns the current zoom behavior.
Kind: static method of Geomap
Param | Type | Default |
---|
[value] | Boolean | true |
Documentation generated on Tue, 20 Dec 2016 20:27:32 GMT