Public
Edited
Dec 1, 2024
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
chart = render({
data: {values: data},
mark: {type: 'bar'},
encoding: {
x: {field: "Sim Type", scale: {domain:["Dot Product", "Cosine Sim", "L2 Norm"]}, axis: {labelAngle: 0} },
y: {field: "Test Accuracy", type: "Q"},
xOffset: {field: "Model Type", scale: {domain:["bert-base-uncased", "GPT-4o", "human"]} },
color: {field: "Model Type", scale: {domain:["bert-base-uncased", "GPT-4o", "human"], range: colors} }
}
})
Insert cell
chart2 = render({
data: {values: data},
mark: { type: 'bar' },
"encoding": {
x: {field: "Sim Type", scale: {domain:["Dot Product", "Cosine Sim", "L2 Norm"]}, axis: {labelAngle: 0} },
y: {field: "Test Accuracy", type: "Q", scale: {domain:[0, 100]}},
xOffset: {field: "Model Type", scale: {domain:["bert-base-uncased", "GPT-4o", "human"]} },
color: {field: "Model Type", scale: {domain:["bert-base-uncased", "GPT-4o", "human"], range: colors} }
}
})
Insert cell
// viewof groupedBar = vl.markBar()
// .data(data)
// .encode(
// vl.column().fieldN("Sim Type"),
// vl.x().fieldN("Model Type").axis({ title: null }).scale({domain:["bert-base-uncased", 'human', "GPT-4o"]}),
// vl.y().fieldQ("Test Accuracy").scale({domain:[0,100]}),
// vl.color().fieldN("Model Type").scale({range: colors})
// )
// .render()
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more