{
const colors = ({dark: '#505459', light: '#fff'})
const plot = Plot.plot({
marginRight: 130,
marginLeft: 65,
marginBottom: 0,
marginTop: 25,
width: 900,
height: 300,
style: {
color: colors.dark
},
y: {
label: NaN,
tickSize: 0,
axis: 'right'
},
x: {
label: NaN,
tickSize: 0,
axis: 'top'
},
color: {
type: "linear",
scheme: "rdgy",
},
marks:[
Plot.cell(instituciones_polarizacion, {
x: '1',
y: '2',
fill: 'valor',
insetLeft: -6,
insetBottom: 2,
fillOpacity: d => Math.abs(d.valor) == 1 ? 0 : d.valor > 0 ? .5 : 1.,
sort: {
y: 'fill',
x: 'fill',
reduce: 'first',
reverse: true
}
}),
Plot.text(instituciones_polarizacion, {
x: '1',
y: '2',
text: 'valor',
fill: colors.light,
})
]
})
return plot
}