Built with blockbuilder.org
Last active
March 5, 2018 21:16
Star
You must be signed in to star a gist
VL Issue #3467
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
license: mit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html xmlns="http://www.w3.org/1999/xhtml"> | |
<head> | |
<script src="https://cdn.jsdelivr.net/npm/vega@3"></script> | |
<script src="https://cdn.jsdelivr.net/npm/vega-lite@2"></script> | |
<script src="https://cdn.jsdelivr.net/npm/vega-embed@3"></script> | |
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/vega-tooltip@0/build/vega-tooltip.min.css"> | |
<script src="https://cdn.jsdelivr.net/npm/vega-tooltip@0"></script> | |
</head> | |
<body> | |
<div id="visMap"></div> | |
<script> | |
var map2 = { | |
"$schema": "https://vega.github.io/schema/vega-lite/v2.1.json", | |
"description": "the population per state, engineers per state, and hurricanes per state", | |
"repeat": { "row": ["Asthma Hospitalizations (Children 5 to 14 Yrs Old) - Rate 1998","Asthma Hospitalizations (Children 5 to 14 Yrs Old) - Rate 2008","Asthma Hospitalizations (Children 5 to 14 Yrs Old) - Rate 2009"] }, | |
"resolve": { | |
"scale": { | |
"color": "independent" | |
} | |
}, | |
"spec": { | |
"width": 800, | |
"height": 300, | |
"data": { | |
"url": "http://a816-dohbesp.nyc.gov/IndicatorPublic/files/Data.json", | |
}, | |
"transform": [ | |
{ | |
"lookup": "Geo Entity ID", | |
"from": { | |
"data": { | |
"url": "http://a816-dohbesp.nyc.gov/IndicatorPublic/files/UHF42.json", | |
"format": { | |
"type": "topojson", | |
"feature": "collection" | |
} | |
}, | |
"key": "id", | |
}, | |
"as": "geo" | |
}, | |
], | |
"projection": { | |
"type": "mercator" | |
}, | |
"mark": "geoshape", | |
"encoding": { | |
// "tooltip": { "field": "row", "type": "quantitative" }, | |
"shape": { | |
"field": "geo", | |
"type": "geojson" | |
}, | |
"color": { | |
"field": { "repeat": "row" }, | |
"type": "quantitative", | |
"bin": { "maxbins": 5 }, | |
} | |
} | |
}, | |
"config": { | |
"legend": { | |
titleLimit: "5000" | |
} | |
} | |
} | |
var opt = { | |
mode: "vega-lite", | |
"renderer": "svg", | |
actions: false | |
}; | |
vegaEmbed('#visMap', map2, opt).then(function (result) { | |
vegaTooltip.vegaLite(result.view, map2); | |
}).catch(console.error); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment