by pizza · 1y ago · 0 comments
Say you want to come up with, eg, a diagram depicting clustering with k-nearest neighbors:
1. Ask Claude: 'please generate an SVG diagram depicting clustering in k-nearest neighbors, make it look like <details>'
2. Take a screenshot of the generated diagram. Paste it into your next response to ground Claude by letting it see how the code actually rendered. Also, give your:
- what changes you want next for next round, eg style this differently, use more colors, replace x with y, etc
- what you like and want to keep, or even explore further
3. Do this iteration several times
4. Once you get somewhere ~80% close to where you want, save the code into a .svg file
5. Open it in Inkscape, manually make edits to close the gap
The nice thing about this is that many illustrations are actually somewhat tree-structured - they have different parts in them, ie there are child sub-diagrams inside the whole diagram. So, you can recursively do this process again for each additional 'sub-diagram' you would like to put in the illustration, basically doing breadth-first search to build up the illustration.
Note: this one is actually just un-edited directly from Claude, I made this when I just had discovered Claude is reasonably decent at svg, and before I figured out the whole editable pipeline workflow.