-
Notifications
You must be signed in to change notification settings - Fork 57
/
Copy pathApp.vue
62 lines (58 loc) · 1.76 KB
/
App.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
<template>
<div id="app">
<l-map :center="[-23.752961, -57.854357]" :zoom="6" style="height: 500px;" :options="mapOptions">
<l-choropleth-layer :data="pyDepartmentsData" titleKey="department_name" idKey="department_id" :value="value" :extraValues="extraValues" geojsonIdKey="dpto" :geojson="paraguayGeojson" :colorScale="colorScale">
<template slot-scope="props">
<l-info-control :item="props.currentItem" :unit="props.unit" title="Department" placeholder="Hover over a department"/>
<l-reference-chart title="Girls school enrolment" :colorScale="colorScale" :min="props.min" :max="props.max" position="topright"/>
</template>
</l-choropleth-layer>
</l-map>
</div>
</template>
<script>
import { InfoControl, ReferenceChart, ChoroplethLayer } from 'vue-choropleth'
import { geojson } from './data/py-departments-geojson'
import paraguayGeojson from './data/paraguay.json'
import { pyDepartmentsData } from './data/py-departments-data'
import {LMap} from 'vue2-leaflet';
export default {
name: "app",
components: {
LMap,
'l-info-control': InfoControl,
'l-reference-chart': ReferenceChart,
'l-choropleth-layer': ChoroplethLayer
},
data() {
return {
pyDepartmentsData,
paraguayGeojson,
colorScale: ["e7d090", "e9ae7b", "de7062"],
value: {
key: "amount_w",
metric: "% girls"
},
extraValues: [{
key: "amount_m",
metric: "% boys"
}],
mapOptions: {
attributionControl: false
},
currentStrokeColor: '3d3213'
}
},
}
</script>
<style>
@import "../node_modules/leaflet/dist/leaflet.css";
body {
background-color: #e7d090;
margin-left: 100px;
margin-right: 100px;
}
#map {
background-color: #eee;
}
</style>