Most active commenters
  • perilunar(3)

←back to thread

Nice things with SVG

(fuma-nama.vercel.app)
575 points fmerian | 14 comments | | HN request time: 0.777s | source | bottom
1. rckt ◴[] No.43666799[source]
SVG feels like a very underexplored and underused territory. You can do so many things with it. It really depends on your imagination. But you’ll possibly need to “hardcore” a lot of stuff, so yeah, depends on the use case as well.
replies(5): >>43666860 #>>43666997 #>>43667408 #>>43669839 #>>43670409 #
2. memhole ◴[] No.43666860[source]
I agree. I’m sure there’s limitations, but svg feels more like a wysiwyg for web design than css
3. wwweston ◴[] No.43666997[source]
Seems like it hits limits really fast — management/legibility gets difficult without groups and layers and performance doesn’t seem to scale well.
replies(1): >>43668311 #
4. WillAdams ◴[] No.43667408[source]
Two usages which I thought were interesting:

- adding toolpath information so as to use Flash as the engine for a Computer Aided Manufacturing tool: https://github.com/Jack000/PartKAM

- (this was my project along w/ Edward R. Ford) adding hyperlinks to part lists to highlight parts in an assembly diagram: https://github.com/shapeoko/Docs --- unfortunately, that doesn't seem to work anymore.

5. srid ◴[] No.43668311[source]

  without groups and layers
As distinct from `<g>`?
6. perilunar ◴[] No.43669839[source]
One thing i'd like to see is an entire site built with SVG and JS without any HTML at all. It's possible but i haven't seen anyone do it yet.
replies(2): >>43670634 #>>43700938 #
7. geokon ◴[] No.43670409[source]
It's a fun format that's easy to generate, but after trying to do complicated things with it.. you kind of understand why. It's underused b/c

- Complex graphics render different in different browsers. So you can't rely on it shows up the same (never had the same issue with a PDF for example)

- There are quite a few renderers but they typically don't implement large parts of SVG b/c it's too complex.. So you can never really be sure what parts are "safe" to use.

- Large complex graphics display extremely slowly (again, compared to a PDF)

- There is basically one editor.. Inkscape. And it's got it's own quirks and doesn't match Chrome/Firefox's behavior. Ex: You can add arrows to lines in Inkscape and they don't display in Firefox

It's also just got too many weird corner case limitations. For instance you can embed a SVG in another SVG (say to make a composite diagram). But you can't embed a SVG in to an SVG in to an SVG. On the web if you inline or link an SVG you also end up with different behaviors

replies(1): >>43670759 #
8. eMPee584 ◴[] No.43670634[source]
so how can you know it's actually possible?
replies(1): >>43670944 #
9. Springtime ◴[] No.43670759[source]
> There is basically one editor.. Inkscape.

Do you mean in terms of open source vector editors? As there a wide variety of tools with SVG authoring/editing capability, among the most well-known being Adobe Illustrator, Sketch, Affinity Photo/Designer, even some web apps are available that were made for online SVG editing (eg: SVGator).

Inkscape, like some tools such as Affinity's, adds its own XML namespace with custom attributes and values, though for arrows I would expect it to use native `marker` elements.

It's certainly true that with SVG's flexibility and particularly with cross-browser handling differences/bugs it can become its own task to get consistent presentation when doing more complex things with it. Still very fond of the format.

replies(1): >>43672362 #
10. perilunar ◴[] No.43670944{3}[source]
Browsers will render SVG files. SVG files can link to other SVG files. Just need to configure the server to serve SVG by default — most servers don't but it's an easy config change.
replies(1): >>43672217 #
11. perilunar ◴[] No.43672217{4}[source]
Actually just found one, via an old stack overflow post. Only a three page test, but proves the point:

https://svg.nicubunu.ro

replies(1): >>43687717 #
12. jarek-foksa ◴[] No.43672362{3}[source]
Inkscape is the only major vector graphics editor that relies on SVG as its native file format. Most other apps are merely allowing you to import/export SVG files which is often a lossy process (e.g. vector objects with filter effects might get rasterized).

SVGator is focused primarily on animation and it's rather pricey. Boxy SVG might be a better choice if you are looking for a web-based SVG editor (disclaimer: I'm the developer).

13. pcthrowaway ◴[] No.43687717{5}[source]
No javascript here though
14. efreak ◴[] No.43700938[source]
I've used SVG in the past to work around limitations in css alignment (cloth before and after new layouts made it unnecessary--I don't write CSS enough to remember how they work, but adding text to a quick drawing in inkscape is fairly trivial)