map = {
const svg = d3.select(DOM.svg(width, height)).style("background", "#d8d8d8");
const mapGroup = svg.append("g");
const paths = mapGroup
.selectAll("path")
.data(topojson.feature(laus, laus.objects["austriaFeatures"]).features)
.enter()
.append("path")
.attr("fill", (d, i) => {
const mb = d.properties.GISCO_ID;
var durationItem = austrianData.filter((item) => item.id == mb);
var item = durationItem[0];
if (item) return colorInterpolated(item.duration / (9 * 3600));
else {
return colorInterpolated(8985 / (9 * 3600));
}
})
.attr("stroke", "white")
.attr("stroke-width", 0.4)
.attr("stroke-linejoin", "round")
.attr("d", d3.geoPath(projection))
.on("mouseover", (e, d) => {
mutable selectedPlace = d.properties.LAU_NAME;
const mb = d.properties.GISCO_ID;
var durationItem = austrianData.filter((item) => item.id == mb);
var item = durationItem[0];
if (!item) mutable travelTime = 8985;
else mutable travelTime = durationItem[0].duration;
var hours = Math.floor(mutable travelTime / 60 / 60);
var minutes = (mutable travelTime / 60) % 60;
mutable travelTime = `${hours}h ${minutes.toFixed(0)}m`;
});
return svg.node();
}