Skip to content

Commit

Permalink
bugfix: mobility map crashes after covid-sim upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
frievoe97 committed Nov 6, 2024
1 parent e3cf3e2 commit b8d76ff
Show file tree
Hide file tree
Showing 3 changed files with 8,413 additions and 12 deletions.
5 changes: 3 additions & 2 deletions src/components/MobilityMap.vue
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ export default defineComponent({
mounted() {
this.loadData(this.svnUrl + this.landkreiseUrl)
//this.loadBundesland(this.svnUrl + this.bundeslandUrl)
this.updateMap()
},
Expand Down Expand Up @@ -158,7 +157,6 @@ export default defineComponent({
var locations = []
var data = []
var names = []
var localActivity = this.activity
for (const [key, value] of Object.entries(this.landkreisData)) {
var id
id = this.mapping[key]
Expand Down Expand Up @@ -199,6 +197,9 @@ export default defineComponent({
this.data[0].z = data
this.data[0].featureidkey = 'properties.id_2'
this.data[0].text = names
// force update the data array...
// otherwise the map won't update
this.data = [...this.data]
}
}
} else {
Expand Down
14 changes: 4 additions & 10 deletions src/views/MobilityPageLandkreise.vue
Original file line number Diff line number Diff line change
Expand Up @@ -197,17 +197,14 @@ const i18n = {
},
}
import { Route } from 'vue-router'
import MarkdownIt from 'markdown-it'
import Papaparse from '@simwrapper/papaparse'
import VueSlider from 'vue-slider-component'
import YAML from 'yaml'
import Colophon from '@/components/Colophon.vue'
import MobilityPlot from '@/components/MobilityPlot.vue'
import MobilityPlotLandkreise from '@/components/MobilityPlotLandkreise.vue'
import MobilityMap from '@/components/MobilityMap.vue'
import 'vue-slider-component/theme/default.css'
type MobilityYaml = {
description?: string
Expand All @@ -216,7 +213,6 @@ type MobilityYaml = {
}
import { defineComponent } from 'vue'
import type { PropType } from 'vue'
const public_svn =
'https://svn.vsp.tu-berlin.de/repos/public-svn/matsim/scenarios/countries/de/episim/'
Expand All @@ -230,11 +226,8 @@ const markdownParser = new MarkdownIt({
export default defineComponent({
name: 'MobilityPageLandkreise',
i18n,
components: { VueSlider, Colophon, MobilityPlot, MobilityMap, MobilityPlotLandkreise },
props: {
// state: { type: Object, required: true },
// measure: { type: String, required: true },
},
components: { Colophon, MobilityPlot, MobilityMap, MobilityPlotLandkreise },
props: {},
data() {
return {
badPage: false,
Expand Down Expand Up @@ -583,7 +576,8 @@ export default defineComponent({
}
}
for (var i = 0; i < this.mobilityWeekly.length; i++) {
const minLength = Math.min(this.mobilityWeekly.length, this.rangeWeekly.length)
for (var i = 0; i < minLength; i++) {
var landkreis = this.mobilityWeekly[i].Landkreis
var date = this.rangeWeekly[i].date
var dailyRange = this.rangeWeekly[i].dailyRangePerPerson
Expand Down
Loading

0 comments on commit b8d76ff

Please sign in to comment.