Dicing an Onion, the Mathematically Optimal Way

Data visualization + culinary math exploration with SVG/Svelte/D3

Check out the full article at The Pudding: https://pudding.cool/2025/08/onions

In 2021, food writer Kenji López-Alt shared some diagrams and mathematical analysis about the ideal method for dicing onions:

After seeing Kenji’s post, I recreated his onion cross-section diagrams as a mini web app:

This simple interactive version is live here: https://svelte-onion.netlify.app/

Originally all I wanted was just to get some more practice with Svelte/D3 and writing SVG by hand. Later I decided to dive deep into verifying Kenji’s claim using calculus and statistics. I pitched this as a freelance article for dataviz publication The Pudding, and we published it in August 2025. (Here’s the link again! https://pudding.cool/2025/08/onions)

Challenges included:

More projects