Plot.plot({
marginTop: 80,
marginLeft: 150,
marginRight: 100,
r: {
type: "linear",
range: [5, 28]
},
color: {
scheme: "RdYlGn",
domain: [1, 5]
},
x: {
domain: fields,
axis: "top",
label: null,
tickSize: 0,
tickRotate: -35
},
y: {
domain: Array.from(new Set(data.map((d) => d.species))),
label: null,
tickSize: 0
},
marks: [
Plot.cell(data, {
x: "type",
y: "species",
fill: "value"
}),
Plot.ruleY(
[
data[data.map((d) => d.clade).findIndex((e) => e !== "dicots") - 1]
.species
],
{ dy: 5 }
),
Plot.ruleY(
[
data[
data
.map((d) => d.clade)
.findIndex((e) => e !== "dicots" && e !== "monocots") - 1
].species
],
{ dy: 5 }
)
],
width: 300,
height: 10000
})