Published
Edited
Jul 22, 2021
Insert cell
Insert cell
ingredientCount = 1000
Insert cell
Insert cell
Insert cell
function makeIngredients() {
return d3.range(ingredientCount).flatMap(i => {
return {
i,
cost: '$' + chance.floating({ min: 0, max: 10, fixed: 2 }),
primaryDescriptor: chance.pickone(primaryFlavorList),
secondaryDescriptor: chance.pickone(secondaryFlavorList),
tth: chance.floating({ min: 0, max: 1 }),
oi: chance.floating({ min: 0, max: 1 }),
solubility: chance.floating({ min: 0, max: 1 }),
occurence: chance.integer({ min: 0, max: 1000 }),
rfci: chance.floating({ min: 0, max: 1 }),
natural: chance.bool({ likelihood: 15 }),
halal: chance.bool({ likelihood: 1 }),
name: makeIngredientName(),
carbonFootprint: '$' + chance.floating({ min: 0, max: 1, fixed: 2 }),
color: chance.color({ format: 'rgb' })
};
});
}
Insert cell
makeIngredients()
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
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