evaluate_layers = function(display_datapoints, display_boxplot) {
const layers = [];
if (display_datapoints == "On") {layers.push(vl.markPoint() .encode(
vl.x().fieldN("sampleName"),
vl.y().fieldQ(target),
vl.color().fieldN("sampleName"),
vl.shape().fieldN("organisation"),
vl.tooltip([
vl.fieldN("sampleName"),
{"field": target, "aggregate": "mean", "type": "quantitative"},
]),
))}
if (display_boxplot == "On") {layers.push(vl.markBoxplot() .encode(
vl.x().fieldN("sampleName"),
vl.y().fieldQ(target).scale({zero: false}),
vl.color().fieldN("sampleName"),
vl.shape().fieldN("organisation"),
vl.tooltip([
vl.fieldN("sampleName"),
vl.fieldQ(target),
]),
))}
return layers
}