chart = {
const width = 1000,
height = 900;
const svg = d3.create("svg")
.attr("viewBox", [50, 50, width-100, height-80]);
var projection = d3
.geoMercator()
.fitSize([width - 60, height - 50], bbox);
var path1 = d3.geoPath().projection(projection);
var path2 = d3.geoPath().projection(projection);
var path3 = d3.geoPath().projection(projection);
var g = svg.append("g").attr("id", "paths");
g.selectAll("path2")
.data(streets.features)
.enter()
.append("path")
.attr('class','outlines')
.attr("d", path2)
.style("fill", "none")
.style('stroke-opacity','.5')
.style("stroke-width", '.2')
.style("stroke", "rgb(0,0,0)")
g.selectAll("path3")
.data(portlandBoundary.features)
.enter()
.append("path")
.attr('class','outlines')
.attr("d", path3)
.style("fill", "floralwhite")
.style("fill-opacity", '.2')
.style('stroke-opacity','.6')
.style("stroke-width", '1')
.style("stroke", "rgb(119,94,148)")
g.selectAll("path3")
.data(parks.features)
.enter()
.append("path")
.attr('class','outlines')
.attr("d", path3)
.style("fill", "darkslateblue")
.style("fill-opacity", ".075")
.style('stroke-opacity','1')
.style("stroke-width", '.6')
.style("stroke", "lightslategrey")
g.selectAll("path3")
.data(water.features)
.enter()
.append("path")
.attr('class','outlines')
.attr("d", path3)
.style("fill", "slategrey")
.style("fill-opacity", ".1")
.style('stroke-opacity','.5')
.style("stroke-width", '1')
.style("stroke", "lightslategrey")
g.selectAll("path3")
.data(sideWater.features)
.enter()
.append("path")
.attr('class','outlines')
.attr("d", path3)
.style("fill", "slategrey")
.style("fill-opacity", ".05")
.style('stroke-opacity','.1')
.style("stroke-width", '.1')
.style("stroke", "black")
var c = svg.selectAll("circle")
.data(locs)
.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',4)
.attr('fill',colorType)
.style('fill-opacity','2')
.style('stroke','rgb(119,94,148)')
.style('stroke-width','1')
.on('mouseover', spotText)
.on('mouseout', removespotText)
function colorType(d,i){
var color = 'lemonchiffon'
if(d.type=='morgue'){color = 'lemonchiffon'}
if(d.type=='house'){color = 'lemonchiffon'}
if(d.type=='house'){color = 'lemonchiffon'}
if(d.type=='house'){color = 'lemonchiffon'}
if(d.type=='saloon'){color = 'lemonchiffon'}
if(d.type=='scow'){color = 'lemonchiffon'}
return color
}
function spotText(event,d){
d3.select(this).attr('fill','lavenderblush')
.attr('r', 6)
.style('stroke', 'mediumslateblue')
.style("stroke-opacity",'.5')
.style("stroke-width", '5')
svg.append('text')
.attr('class','spots')
.attr('x', '550')
.attr('y','730')
.attr('font-family','Helvetica')
.attr('font-size', '.7em')
.attr('text.anchor','start')
.attr('font-weight', 'bold')
.text(d.name)
svg.append('text')
.attr('class','spots')
.attr('x', '550')
.attr('y','750')
.attr('font-family','Helvetica')
.attr('font-size', '.65em')
.attr('text.anchor','start')
.attr('font-weight', 'normal')
.text(d.description)
svg.append('line')
.attr('class','spotLine')
.attr('x1', '550')
.attr('y1', '738')
.attr('x2', projection([d.longitude, d.latitude])[0])
.attr('y2', '738')
.style('stroke-width','.5')
.style('stroke','black')
.style('stroke-dasharray','2 2')
svg.append('line')
.attr('class','spotLine')
.attr('x1', projection([d.longitude, d.latitude])[0])
.attr('y1', '738')
.attr('x2', projection([d.longitude, d.latitude])[0])
.attr('y2', projection([d.longitude, d.latitude])[1])
.style('stroke-width','.7')
.style('stroke','darkblue')
.style('stroke-dasharray','2 2')
}
function removespotText(event,d){
d3.select(this).attr('fill',colorType)
d3.select(this).attr('r', 4)
d3.select(this).style('stroke-opacity','.65')
d3.select(this).style('stroke-width', '1')
d3.selectAll('text.spots').remove()
d3.selectAll('line.spotLine').remove()
}
svg.append("rect")
.attr("x", 750)
.attr("y", 100)
.attr("width", 172)
.attr("height", 60)
.attr('fill', 'white')
.style('fill-opacity','.8')
.style('stroke', 'rgb(119,94,148)')
.style('stroke-width', '1.5')
svg.append('image')
.attr('href',jamesTurk)
.attr('class','spotImage')
.attr('x', '715')
.attr('y','60')
.attr('width', 100)
.attr('height', 150)
.on('mouseover', spotProfile1)
.on('mouseout', removespotProfile1)
svg.append('image')
.attr('href',bridgetGrant)
.attr('class','spotImage')
.attr('x', '765')
.attr('y','58')
.attr('width', 95)
.attr('height', 150)
.on('mouseover', spotProfile2)
.on('mouseout', removespotProfile2)
svg.append('image')
.attr('href',larrySullivan)
.attr('class','spotImage')
.attr('x', '800')
.attr('y','60')
.attr('width', 99)
.attr('height', 150)
.on('mouseover', spotProfile3)
.on('mouseout', removespotProfile3)
svg.append('image')
.attr('href',buncoKelly)
.attr('class','spotImage')
.attr('x', '830')
.attr('y','60')
.attr('width', 105)
.attr('height', 150)
.on('mouseover', spotProfile)
.on('mouseout', removespotProfile)
function spotProfile(event,d){
d3.select(this).attr('fill','lavenderblush')
svg.append("rect")
.attr('class','whitebox')
.attr("x", 350)
.attr("y", 100)
.attr("height", 154)
.attr("width", 300)
.attr('stroke','mediumslateblue')
.attr("stroke-width", '.5')
.attr('stroke-opacity', '1')
.style("fill", 'white');
svg.append('image')
.attr('href',joeBuncoKelly)
.attr('class','spotProfile')
.attr('x', '350')
.attr('y','103')
.attr('width', 300)
.attr('height', 150)
}
function removespotProfile(event,d){
d3.select(this).attr('fill',colorType)
d3.selectAll('image.spotProfile').remove()
d3.selectAll('rect.whitebox').remove()
}
function spotProfile1(event,d){
d3.select(this).attr('fill','lavenderblush')
svg.append("rect")
.attr('class','whitebox')
.attr("x", 350)
.attr("y", 100)
.attr("height", 154)
.attr("width", 300)
.attr('stroke','mediumslateblue')
.attr("stroke-width", '.5')
.attr('stroke-opacity', '1')
.style("fill", 'white');
svg.append('image')
.attr('href',jamesTurkProfile)
.attr('class','spotProfile1')
.attr('x', '355')
.attr('y','103')
.attr('width', 295)
.attr('height', 145)
}
function removespotProfile1(event,d){
d3.select(this).attr('fill',colorType)
d3.selectAll('image.spotProfile1').remove()
d3.selectAll('rect.whitebox').remove()
}
function spotProfile2(event,d){
d3.select(this).attr('fill','lavenderblush')
svg.append("rect")
.attr('class','whitebox')
.attr("x", 350)
.attr("y", 100)
.attr("height", 154)
.attr("width", 300)
.attr('stroke','mediumslateblue')
.attr("stroke-width", '.5')
.attr('stroke-opacity', '1')
.style("fill", 'white');
svg.append('image')
.attr('href',grantProfile)
.attr('class','spotProfile2')
.attr('x', '355')
.attr('y','103')
.attr('width', 295)
.attr('height', 145)
}
function removespotProfile2(event,d){
d3.select(this).attr('fill',colorType)
d3.selectAll('image.spotProfile2').remove()
d3.selectAll('rect.whitebox').remove()
}
function spotProfile3(event,d){
d3.select(this).attr('fill','lavenderblush')
svg.append("rect")
.attr('class','whitebox')
.attr("x", 350)
.attr("y", 100)
.attr("height", 154)
.attr("width", 300)
.attr('stroke','mediumslateblue')
.attr("stroke-width", '.5')
.attr('stroke-opacity', '1')
.style("fill", 'white');
svg.append('image')
.attr('href',larryProfile)
.attr('class','spotProfile3')
.attr('x', '355')
.attr('y','103')
.attr('width', 295)
.attr('height', 145)
}
function removespotProfile3(event,d){
d3.select(this).attr('fill',colorType)
d3.selectAll('image.spotProfile3').remove()
d3.selectAll('rect.whitebox').remove()
}
return svg.node();
}
chart = {
const width = 120,
height = 60;
const svg = d3.create("svg")
.attr("viewBox", [50, 50, width-100, height-80]);
var projection = d3
.geoMercator()
.fitSize([width - 60, height - 50], bbox);
var path1 = d3.geoPath().projection(projection);
var path2 = d3.geoPath().projection(projection);
var path3 = d3.geoPath().projection(projection);
var g = svg.append("g").attr("id", "paths");
g.selectAll("path2")
.data(streets.features)
.enter()
.append("path")
.attr('class','outlines')
.attr("d", path2)
.style("fill", "none")
.style('stroke-opacity','.5')
.style("stroke-width", '.2')
.style("stroke", "rgb(0,0,0)")
return svg.node();
}