Live data from Hacker News

SVG can do that?

slides.com

41–50 of 202 posts

Re: SVG can do that?

#41

SVG works so fantastically well with React -- it's just part of the DOM, after all. Unless there are performance concerns, that reason alone would make me choose it over Canvas every time. Shameless plug, one of my first experiments with SVG+react (+cljs): https://polymeris.github.io/carlos/ Done in one day, without knowing the tech.

Agreed. Going with SVG instead of something else to render the Jenkins pipeline graph has made our lives much easier when it comes time to make changes since we introduced it.

For anybody interested in some example code mixing React and SVG the PipelineGraph component is here: https://github.com/jenkinsci/blueocean-plugin/blob/master/je...

Re: SVG can do that?

#42

Earlier quoted context omitted.

> I do miss Flash's editor for these types of content, though. It's still here! It's now branded Animate CC[1], and (naturally) focuses on other output formats. [1] http://www.adobe.com/products/animate.html

Right! But is it SVG or only Canvas?

Canvas, WebGL, or "a potentially limitless number of platforms with the new Custom Platform Support SDK" (https://helpx.adobe.com/animate/how-to/publish-multiple-plat...)

The product itself can export to SVG (https://helpx.adobe.com/animate/how-to/export-image-svg.html), but I get the impression that's only for individual frames.

Edit: https://blogs.adobe.com/creativecloud/export-svg-animations-... exports SVG animations, but only, it seems, for special types of documents ("From here you simply create a new “Snap.svg Animator” document type and begin creating content s you would normally. Publishing your content then generates a boilerplate HTML file along with all the assets you need, giving you an example of how to embed your animation into a webpage.")

Re: SVG can do that?

#45
post #36

It's always been a curiosity of mine why SVG didn't get more attention from browsers through the years to solve the performance issues. It's open source, cross platform, "dynamic" in a sense AKA no compiling needed, light weight, supports shapes and text, offers immediate responsiveness, etc. Why the lack of love while we pour ever increasing energy into mangling HTML and CSS and every six months a new JS framework/m…

[deleted]

Re: SVG can do that?

#47
post #25

Earlier quoted context omitted.

I just spent all day trying to manually wrangle SVG in the browser. I'd be happy with a good static SVG editor to be honest.

Inkscape is what I always use for editing static SVGs. Not using it enough to become familiar with it myself, the interface is usually intuitive enough for me to guess my way to success.

My biggest gripe with inkscape is that it suffers from some sort of floating point precision error, when you do certain copy/paste/transformation operations it mercilessly outputs more digits of significance than are necessary, which bloats the text and peeves off someone who must obsessively keep their ml clean

Re: SVG can do that?

#48

SVG has the opposite performance profile of Canvas. SVG hits a performance ceiling as number of elements increases. Canvas, since it's rasterized image can handle a rasterized representation of millions of SVG elements. However as Canvas dimension increase, it will hit a performance ceiling.

In my experience, canvas 2D also has a number-of-elements performance ceiling if you're drawing things rather than using images, which feels like it defeats the purpose. For example, try drawing hundreds of coloured rectangles per frame. Easy, right? If you're using WebGL, or any sensible graphics API, yes. If you're using canvas, the web-browser will parse and re-parse your colour expression CSS n times per frame. E…

> has a number-of-elements performance ceiling if you're drawing things rather than using images, which feels like it defeats the purpose.

Well you can generate your imagery programmatically and then render it to canvas as a raster image. Canvas is not purely for implementing a web based drawing app.

Re: SVG can do that?

#49
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" subset of SVG. Or even fallback to fonts.

My dream vector format:

- Pixel perfect across implementations at 50%,100%,200% renderings. At least grid aligned lines.

- Lossless roundtrip across apps. Start in Illustrator, edit parts in Inkscape, other parts in Animate, untouched things stay exactly the same.

- Standard zero dependency C reference implementation: Stream in, bitmap out.

Re: SVG can do that?

#50
post #21

Earlier quoted context omitted.

That's very interesting. Would be cool to see a generalized example of the kinds of interfaces you're building.

The most impressive rabbit I've pulled out of the SVG hat in this regard is being given a 2.1MB logo and told that it had to appear full screen during the log in and be "crisp and not all jaggy". Did it in about 900 bytes .

With inkscape?
Post reply on HN