Live data from Hacker News

Easy SVG sparklines

alexplescan.com

101–106 of 106 posts

Re: Easy SVG sparklines

#102

Earlier quoted context omitted.

Noticable differences between rendering engines for what? Sometimes type can be janky, but no moreso than in html/css, and in SVG you're generally turning type into vector outlines. For graphics rendering, it's completely accurate in any environment I've used it in, and that's working with very very fussy brands.

I mean I'd say this is pretty noticeable: https://imgur.com/e6TbXFj Same screen, same zoom levels. Viewbox properly set, height/width set, confirmed compliant units. Switching between img/object would get it unblurry but then lose the embedded image data. Switching to inline-svg would in turn get the image data working but the drop shadow was completely broken.

Yes-- filters and type aren't super consistent. I wouldn't rely on SVG to use either of them for significant elements.

Re: Easy SVG sparklines

#103

Earlier quoted context omitted.

How was it made?

Figma, and I got to the point of running it through SVGO and hand patching any constructs that had known issues with Safari. Going based off the types of bugs I was seeing alone I wouldn't trust SVGs for anything but the most basic shapes.

Quickly rifling through a the sites of some huge extremely valuable brands, Apple, Coca Cola, Walmart, Target, and Toyota all use SVG for their logos. SVG is not the right choice to lay out documents. It's not a replacement for PDF. It's a perfect choice for creating discrete vector graphics.

Re: Easy SVG sparklines

#105
post #71

I'm going to be the Smug Lisp Weenie here (I wonder who gets the reference), and comment on this: > One of my favourite things about creating sparklines like this is that I can create the SVGs entirely on the backend. I don’t need to worry about using a JavaScript charting library, or sending the “points” data to the frontend. The browser requests an SVG. The server returns it. Simple! Me, I don't care where I create…

> I wonder who gets the reference

https://news.ycombinator.com/user?id=kennytilton sure does. :D

Re: Easy SVG sparklines

#106
post #77
post #71

I'm going to be the Smug Lisp Weenie here (I wonder who gets the reference), and comment on this: > One of my favourite things about creating sparklines like this is that I can create the SVGs entirely on the backend. I don’t need to worry about using a JavaScript charting library, or sending the “points” data to the frontend. The browser requests an SVG. The server returns it. Simple! Me, I don't care where I create…

What's Clojure's WASM story like? That would be much more exciting than having to transpile to JS.

Wasm is not an good compile target for it. It's made for C/C++/Rust type static, native-code languages. You would basically have to build the same kind of runtime environment implementation as you'd need for a native-code managed VM.

(That's why for example Python works well on WebAssembly - it comes with its own interpreter written in portable C that compiles nicely to WebAssembly, and uses reference counting for GC instead of a fancy GC).

Since Clojure is mainly a hosted language, a more likely avenue would be one of its current platforms gaining WebAssembly support. A Wasm JVM, or Wasm GraalVM target, for example.

Post reply on HN