render({
mark: { type: 'circle', size: 80 },
data: { url: antibiotics },
transform: [
{
calculate: 'split(datum.Bacteria, " ")[0]',
as: 'Split'
},
{
calculate: 'indexof(["Salmonella", "Staphylococcus", "Streptococcus"], datum.Split) >= 0 ? datum.Split : "Other"',
as: 'Genus'
}
],
encoding: {
x: {
field: 'Neomycin', type: 'Q',
scale: { type: 'log', domain: [0.001, 1000] }, sort: 'descending',
axis: { tickCount: 5 },
title: 'Neomycin MIC (μg/ml, reverse log scale)'
},
y: {
field: 'Penicillin', type: 'Q',
scale: { type: 'log', domain: [0.001, 1000] }, sort: 'descending',
axis: { tickCount: 5 },
title: 'Penicillin MIC (μg/ml, reverse log scale)'
},
color: {
field: 'Genus', type: 'O',
scale: {
domain: ['Salmonella', 'Staphylococcus', 'Streptococcus', 'Other'],
range: ['rgb(76,120,168)', 'rgb(84,162,75)', 'rgb(228,87,86)', 'rgb(121,112,110)']
}
}
},
width: 250,
height: 250
})