chart = Plot.plot({
width: width,
height: width,
clip: true,
facet:
{
data: array,
y: (d=>d.LONG_SHORT*-1),
x: (d=>d.LAT_SHORT*-1),
inset: 10,
},
fx: {
domain: [42,44,46,48,50,52,54,56,58,60,62,64,66,68,70,72,74,76,80],
reverse: true,
},
fy:
{
},
y: {
domain: [0,100],
clamp: true,
},
r: {
range: [1,10]
},
color: {
type: "categorical",
domain: (["BOL","BRA","COL","ECU","FR1","GUY","PER","SUR","VEN"]),
scheme: "tableau10",
},
marks: [
Plot.ruleY([0],{stroke:"gray"}),
Plot.rectY(array,
Plot.binX({y: "sum", thresholds: 52
},
{
x: "WEEKNUM",
y: d=>d.FIRES_COUNT,
sort: "doy",
fill: "#FA3817",
inset: -0.5,
})),
Plot.rectY(array,
Plot.binX({y: "sum", thresholds: 52
},
{
x: "WEEKNUM",
y: function(d)
{
return d.KMArea*10},
sort: "doy",
fill: "#e9ec59",
inset: -0.5,
})),
Plot.ruleX([49],{
stroke: "gray",
}
),
]
})