Say I’ve written a simple app that draws circles in browser. Now I’d like to let people save their pictures. How would I store the data on the server? Which format would be the best option? Should I simply store the relevant html? What would be the case when I would want to make a custom format that is stored on the server and parsed back to html canvas when loaded?
Share
Since they are just circles, you probably just need starting coordinate, size, line thickness, and colour. Sounds like its easy enough to store with SQL.
What HTML? Drawings on canvas are not exposed in the DOM. That’s why canvas is (currently) awful for accessibility (unlike SVG).
I’d transport it as JSON and then loop over the dataset with JS to redraw it.