11 ms·
What’s the usual practice — do people code in SVG directly or they draw in for example Figma and generate a SVG file?
by mi_lk 3y ago
What’s the usual practice — do people code in SVG directly or they draw in for example Figma and generate a SVG file?
- WillAdams 3y agoI was trained as a graphic designer, so I either drew stuff in Inkscape, or imported it from some other program. Had to do quite a bit of work to get filesizes down to something reasonable for: http://shapeoko.github.io/Docs/ http://shapeoko.github.io/Docs/ One late development was working up a mechanism where an image could be clicked on to open it in a new window: http://shapeoko.github.io/Docs/content/tPictures/PS20028-100.svg http://shapeoko.github.io/Docs/content/tPictures/PS20028-100... and then the part names in the parts list could be clicked on to highlight the matching part in the diagram.
- chefandy 3y agoAlso having a formal GD background, I tend to do the same... Trying get things like type polished enough for proper design work without using a graphical editor is a fool's errand. Depending on the use case, I often end up using the results inline. That way, I can easily modify/animate/script it with my code editor without having to jump back-and-forth between environments, and things like element IDs stay consistent.
- sampullman 3y agoDesign people will use their editor of choice - Illustrator/Sketch/Inkscape/etc. Some coders might tweak things using that software, but usually I'll edit the SVG directly, especially if there's interactivity. For complicated shapes/curves I'll sometimes run it through an online editor to help visualize, this is a good one: https://yqnn.github.io/svg-path-editor/ https://yqnn.github.io/svg-path-editor/
- jarek-foksa 3y agoThere is also Boxy SVG (https://boxy-svg.com https://boxy-svg.com) which combines both designer and developer oriented functionality and uses SVG as its native file format. Unlike Illustrator/Sketch/Inkscape it can also create and manipulate SVG animation elements (https://boxy-svg.com/blog/21 https://boxy-svg.com/blog/21) - a very powerful feature which is now supported by all major browsers.
- sampullman 3y agoLooks great! I vaguely recall checking it out at some point but must have forgotten to bookmark. It seems like a fairly straightforward mapping of UI -> SVG features, which must have taken a ton of effort. I'll have to take a closer look at the animation tool, I've often wondered if web technologies would ever get close to Flash's capabilities.
- allan_s 3y agoI dont mean to be rude but is there a reason why firefox is not supported ? Is it " it will never work there because the mandatory feature X is missing and will never be implemented in firefox " or "some features are broken " in which case a disclaimer "we dont test in firefox so use at your own peril" would be great :)
- jarek-foksa 3y agoFirefox support is tracked on https://boxy-svg.com/ideas/227/firefox-browser-support https://boxy-svg.com/ideas/227/firefox-browser-support, I think it will be added next year.
- HunorBorbely 3y agoFor more complex graphics you would probably still use a designer tool. But for some simple ones, you can probably code them yourself. Like if you need an arrow or a hamburger menu icon, you can just jump straight into code. Sometimes I also just start with pen and paper and then figure out the coordinates from there, and adjust till it looks good enough.
- solardev 3y agoAs a frontend dev who also works in UX and graphics from time to time, I find it helpful to be able to do both, looking at SVGs as both a vector graphics format and a human-readable XML. IME the workflow depends more on whether any SVG is meant to be illustrative (like art) or quantitative (like charts) or interactive and animated/mutable (like a game). For something like this bell example (https://svg-tutorial.com/svg/bell https://svg-tutorial.com/svg/bell), you can certainly hand-code it if you're really math-inclined and can estimate the formulas of curves just by looking at them, but for us mere mortals, it's easier to just draw out the curves in a graphics app (like https://youtu.be/5x2uHUB_pzw?si=fSLjRKlZNgVKVcOx&t=123 https://youtu.be/5x2uHUB_pzw?si=fSLjRKlZNgVKVcOx&t=123 for Figma) then export as an SVG. And for things like the ringer (is that what you call it? the orange ball thing at the bottom of the bell that strikes the bell to make the sound), being able to visually draw it on a canvas, change its size, drag it around and play with its colors and dimensions, etc. is really helpful. Figma is fine for simpler graphics, but it's really more of a UX tool than a graphic design tool, and Illustrator is a lot more powerful. Inkscape is a FOSS option. In other circumstances, though, manipulating the SVG XML directly is also very helpful. Let's say you want to programatically generate a bar chart. If you have a big dataset, it's going to take a designer forever to manually plot them and change them every time the data changes. But it's easy for a dev to use Javascript (or any language) to draw each rectangle, programmatically adjust their heights and colors based on the data, add tooltips, etc. And that way you can dynamically update them in real-time whenever the data changes (like if the user selects a different date range, or new events come in). A lot of this is made easier by libs like https://frappe.io/charts https://frappe.io/charts or https://apexcharts.com https://apexcharts.com. But before you take that approach, you should know that for complex charts, sometimes Canvas rendering (or just generating graphics in the backend) can be more performant than SVG. SVGs can also be animated and interactive, not just with CSS transitions but by directly manipulating the XML geometries, like http://snapsvg.io/demos/ http://snapsvg.io/demos/ or https://www.svgator.com/ https://www.svgator.com/ or https://codepen.io/collection/XpwMLO/ https://codepen.io/collection/XpwMLO/. This is fine for product pages and such, but for really graphics-intensive apps (full games) it's probably slower than other rendering pipelines. (Not my specialty, won't speculate too much.) TLDR Drawing them in a graphics app is usually easier for the designers, but the XML can be programmatically manipulated afterward to great effect. The ideal workflow depends on what you're trying to accomplish, and also who you have on your team.
- Minor49er 3y agoIn projects I've worked on, I've used Inkscape to create or edit files, then link them in like a typical image. On occasion, I've had a few static pages that needed a unique graphic that would be embedded into the page, though the graphics in those cases were not very complex
- JacobThreeThree 3y agoWith these new transformer-based vector models, like Adobe's (https://www.adobe.com/products/illustrator/text-to-vector-graphic.html https://www.adobe.com/products/illustrator/text-to-vector-gr...), generating SVG will become easier than ever.