Live data from Hacker News

SVG can do that?

slides.com

141–150 of 202 posts

Re: SVG can do that?

#141

This showcases what's wrong with SVG: It does way too much! To be useful as a vector image format, there should be strict rules (and less cruft). Why is there no libsvg like libjpeg or libpng? Why have interaction as part of an image format? SVG lives in an uncanny valley between jpeg and flash/js. I think there is still a big need for a real vector interchange and display format. Right now people pick a "good" subse…

> It does way too much! And even so, it still has no hairline. All line widths are finite and change when zooming.

Only in IE/Edge. On other browsers you can prevent scaling of line-widths

Re: SVG can do that?

#143

This showcases what's wrong with SVG: It does way too much! To be useful as a vector image format, there should be strict rules (and less cruft). Why is there no libsvg like libjpeg or libpng? Why have interaction as part of an image format? SVG lives in an uncanny valley between jpeg and flash/js. I think there is still a big need for a real vector interchange and display format. Right now people pick a "good" subse…

also it does things weirdly and surprisingly - like right in the first codepen sample when she put width and height to be 100% of the viewport but the svg engine decided not to stretch it... ugh.

and that ignoring browser specific issues, for example svg and css filtering don't work on edge/ie11

but nice hacks I guess. the real takeaway are probably svg animations, those can make cool stuff without the keyframe weirdness.

Re: SVG can do that?

#144

This showcases what's wrong with SVG: It does way too much! To be useful as a vector image format, there should be strict rules (and less cruft). Why is there no libsvg like libjpeg or libpng? Why have interaction as part of an image format? SVG lives in an uncanny valley between jpeg and flash/js. I think there is still a big need for a real vector interchange and display format. Right now people pick a "good" subse…

> It does way too much! And even so, it still has no hairline. All line widths are finite and change when zooming.

It does, well, if following SVG 1.2 Tiny it does, at least. As far as I know it's implemented in Opera, FF, Chrome and Safari. Not sure about IE.

It's implemented as vector-effect: vector-effect="non-scaling-stroke"

There's an example here https://gist.github.com/lightjs/5372867

Re: SVG can do that?

#146
post #111
post #94

Earlier quoted context omitted.

This! I've started to look for usable vector image format for game development somewhere in 2004, now it's 2017 and there is still nothing available. For SVG you literally need to pull-in whole browser engine, which is most likely 2-3 times the size of your whole game.

One possible solution is to the same what XMPP did on XML, or JSON did on JavaScript: Define a "safe subset" of SVG, and stick to that. Perhaps use the "safe subset of XML" as a base (as defined e.g. in XMPP.) Use a library (or at least a validator) that works exactly on this subset, and fails for anything not strictly conforming to this. Of course, this is not as satisfying as a "clean slate" approach, but on the ot…

I've found librsvg to be pretty good. It's used for exactly this purpose in Gnome. You stick a Cairo surface behind it and it translates the operations to that.

https://github.com/GNOME/librsvg

However, admittedly, I use it in combination with a full blown browser because it doesn't need/handle text completely. I like SVG, but I too have accepted that if I want stuff to render properly, the only place to find a usable and complete SVG engine is in a web browser.

Re: SVG can do that?

#147

I use svg all the time to make tiny web interfaces for embedded systems. When the entire web app has to fit in 350k, you don't have space for gif's or jpg's.

interesting use case for super small performant applications. Can you give us a screenshot it would be nice to see it in the wild.

Re: SVG can do that?

#148
post #13

Earlier quoted context omitted.

What image format do you recommend that would work better on a screen reader?

The article is proposing SVG for rendering responsive text for articles. So the screen reader comment is valid.

It is not, is picked up by screen-readers without any issue.

Re: SVG can do that?

#149
post #117

Earlier quoted context omitted.

But GP's point is the opposite, that HTML/CSS/JS is being used too often for tasks that could be much more simply solved by SVG. I can think of a couple just in my current project.

Cool, could you please explain what are they? To me, personally, SVG is the last resort.

In brief, our product includes a web-based process flow component, typical nodes-and-edges kind of thing. Much better done with SVG IMHO, with first-class support for box & line modelling and styling. But the powers-that-be decreed we'd do it all in HTML & CSS.

Re: SVG can do that?

#150

We attempted to do a complex animation in SVG and the primary complaint was that it killed the browser in terms of CPU and memory usage. Are we doing something wrong?

lots of svg elements animated in conjunction will surely have a negative performance impact. At work we created a mind mapping tool, in where every node has events (drag, click, raggin, dragend, contextmenu, etc). After 200+ nodes the performance hit was very high. We had to stop redrawing the whole graph after every interaction. What a bummer.
Post reply on HN