display = {
const width = 1200, height = 610;
const svg = d3.create("svg")
.attr("viewBox", [0, 0, width, height]);
var projection = d3.geoMiller().fitSize([width-100, height-100], municipalities);
var background = svg.append("g");
var diagram = svg.append("g");
var diagram = svg.selectAll("circle");
var title = svg.append("g");
var description = svg.append("g");
var info = svg.append("g");
background.selectAll("path")
.data(municipalities.features).enter().append("path")
.style("fill", "pink");
background.selectAll("path1")
.data(water.features).enter().append("path")
.style("fill", "lightblue");
diagram.selectAll("circle")
.data(places).enter().append("circle")
.attr("cx", function(d) {return projection([d.Longitude,d.Latitude])[0]})
.attr("cy", function(d) {return projection([d.Longitude,d.Latitude])[1]})
.attr('r',3)
.style("fill", "black");
title.append("text")
.text('Passport to Seoul');
description.append("text")
.text('Collection of dream trip spots');
svg.selectAll("text")
.style('font-family', 'roboto+slab');
background.selectAll("path")
.attr("d", d3.geoPath().projection(projection))
.attr("transform", `translate(100, 50)`)
.style("stroke", "white")
diagram.selectAll("path")
.attr("d", d3.geoPath().projection(projection))
.attr("transform", `translate(100, 50)`)
.style("stroke", "white")
.on('mouseover', showInfo)
.on('mouseout', hideInfo);
function showInfo (event,d) {
info.append("line")
.attr('x1', width - 375)
.attr('y1', 130)
.attr('x2', projection(d.geometry.coordinates)[0])
.attr('y2', projection(d.geometry.coordinates)[1])
.style('stroke-width', '1')
.style("stroke", "purple")
.style('stroke-dasharray', '6 4');
info.append("path")
.datum([[width - 375, 100], [width - 375, 160]])
.attr("d", polyline.polyline().attr("points", d => d))
.style("stroke", "purple")
.style("stroke-width", "3");
info.append("text")
.attr('class', 'title')
.text(d.properties.name);
info.append("text")
.attr('class', 'description')
.attr('x', width - 350).attr('y', 150)
.text(d.properties.description);
info.selectAll("text.title")
.attr('x', width - 350).attr('y', 125)
.style('font-size', '24px')
.style('font-weight', 'bold')
.style('fill', "purple")
.each(function(d) {wrap_text(d3.select(this), 150)});
info.selectAll("text.description")
.style('font-size', '16px')
.style('font-weight', 'regu')
.style('fill', "purple")
.each(function(d) {wrap_text(d3.select(this), 200)});
}
function hideInfo() {
info.selectAll('line').remove();
info.selectAll('path').remove();
info.selectAll('text').remove();
}
title.selectAll("text")
.attr('x', '50').attr('y', '100')
.style('font-size', '32px')
.style('font-weight', 'bold')
.style('fill', "white")
.each(function(d) {wrap_text(d3.select(this), 150)});
description.selectAll("text")
.attr('x', '50').attr('y', '130')
.style('font-size', '16px')
.style('font-weight', 'regular')
.style('fill', "white")
.each(function(d) {wrap_text(d3.select(this), 200)});
return svg.node();
}