parking1 = embedWithSpecificVersions({
$schema: 'https://vega.github.io/schema/vega/v5.json',
data:[
{
name: "streetsVan1",
url:
"https://gist.githubusercontent.com/drlynb/234c622e2f98da7c61393cbb33573bf8/raw/8e8fa5ae3dc76d94dcca3a50e3dce41b89eb7185/vanstreets.json",
format: { type: "json", feature: "vanstreets" },
transform: [
{
type: "geopath",
projection: "projection"
}
]
},
{
name: "disabilities1",
url: "https://gist.githubusercontent.com/StanisNowak/7432a7e657f857e1e98d2f0f10015db7/raw/8a211fcffbea75f7caa8583736048e096679727b/disabilityParking.geojson",
format: {
type: "json",
property: "features"
}
}],
"signals": [
{
"name": "hover",
"value": null,
"on": [
{"events": "symbol:mouseover", "update": "datum.properties"},
{"events": "symbol:mouseout", "update": "null"}
]
},
{
"name": "dparkspots",
"value": "Vancouver Disabled Parking Spaces",
"update": "hover ? hover.properties.NOTES + ' (' + hover + ')' + ': ' + hover: 'Vancouver Disabled Parking Spaces'"
}
],
projections: [{
name: "projection",
fit: {signal: "data('disabilities1')"},
size: {signal: "[800, 600]"},
type: "mercator",
center: d3.geoCentroid(Streets)
}],
marks: [
{
type: "shape",
from: {data: "disabilities1"},
encode: {
enter: {
opacity: {value: 0.50},
fill: {value: "blue"},
"tooltip":
{"signal": "{'Notes': datum.properties.NOTES, 'Location': datum.properties.LOCATION}"}
},
update: {
opacity: {value: 0.50},
fill: {value: "blue"}
},
hover: {"fill": {"value": "red"}}
},
transform: [
{
type: "geoshape",
projection: "projection",
pointRadius: 6
}
]
},
{
type: "path",
from: { data: "streetsVan1" },
encode: {
enter: {
stroke: { value: "#aaaaaa" }
},
update: {
path: { field: "path" }
}
}
},
{
"type": "text",
"interactive": false,
"encode": {
"enter": {
"x": {"signal": "width", "offset": -5},
"y": {"value": 0},
"fill": {"value": "black"},
"fontSize": {"value": 14},
"align": {"value": "right"}
},
"update": {
"text": {"signal": "dparkspots"}
}
}
}
]
})