addTooltips(
Plot.plot({
marginBottom : 50,
facet: { padding: -10, axis: null, text: 'trt'},
marks: [
Plot.frame({fill: "lightblue", opacity: .2}),
Plot.barY(housevotesall, {x: "year", y: d=>d.votes_perc, fill: "flag", dy: 10, fx: "x", fy: "y", opacity: .9, title: "label_votes"}),
Plot.text(housevotesall.slice(0,1), Plot.selectFirst({text: d=>"Year (->)", frameAnchor: "middle", textAnchor: "end", fontSize: 15, dx: -550, dy: -565, fx: "x", fy: "y", opacity: 1, fill: "gray", fontStyle: "italic"})),
Plot.text(housevotesall.slice(0,1), Plot.selectFirst({text: d=>"Votes % (->)", rotate: 270, frameAnchor: "middle", textAnchor: "end", fontSize: 15, dx: -630, dy: -670, fx: "x", fy: "y", opacity: 1, fill: "gray", fontStyle: "italic"})),
Plot.text(housevotesall, Plot.selectFirst({text: "state_po", frameAnchor: "top-left", fontSize: 20, dx: 30, dy: 6, fx: "x", fy: "y"})),
Plot.axisX({ tickSize: 0, fontSize: 0, label: ""}),
Plot.axisY({ tickSize: 0, fontSize: 0, label: ""}),
Plot.text(housevotesall.slice(0,1), Plot.selectFirst({text: d=>"US House Election Results", frameAnchor: "middle", textAnchor: "start",fontSize: 60, dx: -470, dy: -600, fx: "x", fy: "y", fontFamily: "oblique", fontWeight: "bold", fontStyle: "italic"})),
Plot.text(housevotesall.slice(0,1), Plot.selectFirst({text: d=>"U.S. House 1976–2022. MIT Election Data and Science Lab (MEDSL)", frameAnchor: "middle", textAnchor: "start", fontSize: 20, dx: -430, dy: -550, fx: "x", fy: "y"})),
Plot.text(housevotesall.slice(0,1), Plot.selectFirst({text: d=>"Design: Deepsha Menghani | Threads: IandLoveandData | Mastodon: Deepsha", frameAnchor: "middle", textAnchor: "end", fontSize: 17, dx: 40, dy: 180, fx: "x", fy: "y", opacity: 1, fill: "gray", fontStyle: "italic"}))
],
color: {type: "categorical", range: ["#00308f", "#b80f0a", "#ccc"], domain: ["Democrat", "Republican", "Other"], legend: true, style: {fontSize: "30px"} },
insetBottom: 20,
insetTop: 20,
height:900,
width: 1200,
}),
{ fill: "blue", opacity: 0.9, "stroke-width": "4px", stroke: "blue"}
)