CrimeMap = VegaLite({
vconcat:
[
{
width: 600,
height: 400,
layer: [
{
data: {
values: VanAreas,
format: {
type: "topojson",
feature: "VancouverAreasize"
},
},
projection: {
type: "mercator"
},
mark: "geoshape",
encoding: {
fill: {
field: "properties.density",
type: "quantitative",
title: "Density",
}
},
stroke: {value: "black"},
tooltip: [
{field: "properties.NAME", title: "Name"},
{field: "properties.density", title: "Population Density"}
]
}
},
{
data: {
values: vanCrime2
},
projection: {
type: "mercator']
},
mark: "circle",
encoding: {
longitude: {
field: "Ing",
type: "quantitative"
},
latitude: (
field: "lat", type: "quantitative"
ふ
size: (value: 12),
color: {
scale: {
domain: ["Non-vehicular",
"Vehicular"],
range: ['#ff0000*, *#00aaff"]
field: "Offense Type", title: "Offense Type", type: "nominal"
ふ
tooltip: [
(field: "Offense Type", title: "offense Type"}, (field: "offense", title: "offense"}, (field: "NEIGHBOURHOOD", title: "Neighbourhood"},
(field: "Date", title: "Date")
}
}
],
})