Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Style a Bivariate Map #4684

Closed
jdeboer-geoplan opened this issue May 5, 2017 · 2 comments
Closed

Style a Bivariate Map #4684

jdeboer-geoplan opened this issue May 5, 2017 · 2 comments

Comments

@jdeboer-geoplan
Copy link

Bivariate maps are occasionally useful see https://en.wikipedia.org/wiki/Bivariate_map

Is there a way to style them with mapbox gl? At the moment my plan is to include an additional attribute in my geoJSON that combines my two data points and I can use that in a property function. This is inelegant as I'd need to edit and reload my geoJSON when the user changes classifications.

Possibly this could be done with a change to property functions to take two properties

something like
{
"fill-color": {
"property": "temperature",
"bivariate-property": "population",
"stops": [
// temperature is low, population is low - blue
[{ value: 0, value2: 100}, 'blue'],
// temperature is low, population is high - cyan
[{ value: 0, value2: 10000}, 'cyan'],
//temperature is high, population is low - red
[{ value: 20, value2: 100},'red'],
//temperature is high, population is high - yellow
[{ value: 20, value2: 10000},'yellow'],
]
}
}

@jfirebaugh
Copy link
Contributor

include an additional attribute in my geoJSON that combines my two data points

This is the best current solution. #4077 tracks the request for property functions that can combine multiple data properties using arbitrary arithmetic expressions.

@jdeboer-geoplan
Copy link
Author

Ah smashing, thanks for that, I hadn't found that issue, I'll comment on that one with the bivariate map use case. thanks again great work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants