Plot.plot({
caption: "Home runs last 4 years",
marginLeft:100,
marginRight:50,
width,
x: {
grid: true,
label: "# Home Runs"
},
y: {
label: null
},
color: {
domain: ["Los Angeles Dodgers", "Minnesota Twins", ],
range: ["#0A5794", "#D21F4E"],
legend: true
},
marks: [
Plot.barX(filter_date_select, {x: "homeRuns", y: "playerName", fill: "currentTeam", tip: true, sort: {y: "x", reverse: true}}),
Plot.text(filter_date_select, {x:"homeRuns", y: "playerName", text: "homeRuns", textAnchor: "start", dx: 10}),
Plot.ruleX([0])
]
})