Plot.plot({
width: 600,
height: 400,
x: { label: "Estimated Cost per Serving ($)" },
y: { label: "Cooking Time (Minutes)", grid: true },
marks: [
Plot.ruleY([0]),
Plot.image(fixedRecipeData, {
x: (d) => {
const cost = parseFloat(d["Estimated Cost per Serving: "]);
console.log("Estimated Cost: ", cost);
return isNaN(cost) ? 0 : cost;
},
y: (d) => {
const cookingTimeInMinutes = d["Cooking Time:"].split(":")[1];
console.log("Cooking Time: ", cookingTimeInMinutes);
return parseInt(cookingTimeInMinutes, 10);
},
src: (d) => {
console.log("Image URL: ", d.ImageURL);
return d.ImageURL;
},
r: 20,
title: "Name"
})
]
});