https://github.com/consbio/dm-quickstart
Dimensional Mapping - Quickstart
https://github.com/consbio/dm-quickstart
Last synced: about 2 months ago
JSON representation
Dimensional Mapping - Quickstart
- Host: GitHub
- URL: https://github.com/consbio/dm-quickstart
- Owner: consbio
- License: bsd-3-clause
- Created: 2015-09-28T18:08:57.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2015-09-28T18:09:04.000Z (almost 11 years ago)
- Last Synced: 2023-03-30T10:29:04.207Z (over 3 years ago)
- Language: JavaScript
- Size: 309 KB
- Stars: 0
- Watchers: 10
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Dimensional Mapping - Quickstart
This project is intended to make it easier to start up a new project to do
dimensional mapping of features from a topojson file plus associated attributes
in a CSV file.
## Work in progress!
Pretty much anything is subject to change at this point.
## Basic assumptions
* features are contained in a topojson file, and contain an 'id' field set for
each feature (not in properties, use feature-level id field instead)
* attributes are contained in a CSV file, and are joined one to one to features
using the 'id' field.
* one to many attributes can be represented shorthand format in the CSV:
'first_key:first_value|second_key:second_value'. These will be parsed into
## Config
You must provide a config file (`static/config.json`) with the data structure
for your project.
Example:
```
{
"data": {
"file": "attributes.csv", // filename of attributes CSV, in /static
"fieldConfig": [ // List any fields that require aliases or parsers
{
"field": "field1",
"alias": "First Field"
},
{
"field": "field2",
"alias": "Second Field",
"parser": "map" // Only special parser at present. Uses shorthand form of one to many key:value pairs
}
],
"dimensions": ["field1"] // specifies the dimensions that will be used for dimensional filtering
},
"features": {
"file": "features.json" // filename of features topojson, in /static
},
"map": {
"basemap": "ESRI Topo", // default basemap; will default to 'ESRI Topo' if not provided
"geonamesUser": "your.username" // Geonames username; required to use Leaflet.Geonames widget (will not be added if this is username is not specfied)
}
}
```
## Dependencies
* Leaflet
* D3
* dc.js
* lodash
* crossfilter
* [Leaflet.ZoomBox](https://github.com/consbio/Leaflet.ZoomBox)
* [Leaflet.Geonames](https://github.com/consbio/Leaflet.Geonames)