I have a map image with a lot of repeating symbols, so I put them inside an SVG symbol tag, so that the same drawing instructions don't have to be repeated over and over again. The result of the code generation process is just a one long code block (sometimes divided into several render functions), which does not take advantage of the fact that the exact same drawing instructions could be grouped together as functions. This way it would be easier to make changes in the code. It would also make the code shorter (the same symbols wouldn't have to be repeated). The only problem with this solution is that you have to keep in mind that each symbol instance may have different matrix transformations, but it shouldn't be too hard to code up (I did it with my generator and it worked well).
I have a map image with a lot of repeating symbols, so I put them inside an SVG symbol tag, so that the same drawing instructions don't have to be repeated over and over again. The result of the code generation process is just a one long code block (sometimes divided into several render functions), which does not take advantage of the fact that the exact same drawing instructions could be grouped together as functions. This way it would be easier to make changes in the code. It would also make the code shorter (the same symbols wouldn't have to be repeated). The only problem with this solution is that you have to keep in mind that each symbol instance may have different matrix transformations, but it shouldn't be too hard to code up (I did it with my generator and it worked well).