viewof graphResult = {
if (separate) {
return Plot.plot({
grid: true,
x: {
domain: [1.3, 2.2]
},
y: {
label: null
},
facet: {
data:selectedAthletes,
y:"sport",
},
marks: [
Plot.rectY(selectedAthletes, Plot.binX({y: "count"}, {x: "height", fill: "sport"})),
Plot.ruleY([0])
]
})
} else {
return Plot.plot({
grid: true,
x: {
domain: [1.3, 2.2]
},
marks: [
Plot.rectY(selectedAthletes, Plot.binX({y: "count"}, {x: "height", fill: "sport", mixBlendMode: "multiply"})),
Plot.ruleY([0])
]
})
}
}