News for hackers. Stuff that matters.
Re:SVG: The Good, the Bad and the Ugly by marcodiego on Friday February 12, 2021 @11:04AM (#26115086)
Article mentions svg supports <script> tag... Coolest use of it: https://www.xul.fr/svgtetris.svg
Re:SVG: The Good, the Bad and the Ugly by rapidlua on Friday February 12, 2021 @08:41PM (#26120699)
FlameGraph [1] renders profiling results into svg. Profile is essentially hierarchical; a user can zoom into subtree by clicking an element. Probably not an inspiring use of script in svg; but boy, how handy this feature is!

https://gist.githack.com/mejedi/90eac4f11f794f43808f90e38b1a...

[1] http://www.brendangregg.com/flamegraphs.html

Re:SVG: The Good, the Bad and the Ugly by sjbrown on Friday February 12, 2021 @02:27PM (#26117532)
Here's a full-on dice roller / Virtual Tabletop that takes advantage of this: https://github.com/sjbrown/togetherness
Re:SVG: The Good, the Bad and the Ugly by schaefer on Friday February 12, 2021 @11:22AM (#26115290)
Tetris in an SVG?!? I am in awe.

I'm feeling equal parts: "this is beautiful", "this is perverse", and "I want to do this too"

Re:SVG: The Good, the Bad and the Ugly by marcodiego on Friday February 12, 2021 @11:28AM (#26115365)
Re:SVG: The Good, the Bad and the Ugly by ComputerGuru on Friday February 12, 2021 @11:37AM (#26115448)
It seems like the French have a passion for dynamic SVGs.
Re:SVG: The Good, the Bad and the Ugly by edoceo on Friday February 12, 2021 @11:38AM (#26115451)
Space Invaders! Amazing!
Re:SVG: The Good, the Bad and the Ugly by kgwxd on Friday February 12, 2021 @11:52AM (#26115608)
Is that an example of SVG including a script tag or just manipulating the SVG DOM through javascript? I think that's 2 separate concerns. Browsers already understand both, I think the article puts it under "The Bad" category because if you're building a renderer from scratch, you'd need to also handle javascript and DOM stuff.
Re:SVG: The Good, the Bad and the Ugly by Eisfunke on Friday February 12, 2021 @12:39PM (#26116239)
Wow. I'm unsure whether I should be impressed or horrified. I've added the link to the article, thank you.
Re:SVG: The Good, the Bad and the Ugly by ROARosen on Friday February 12, 2021 @12:52PM (#26116402)
I'm both
Re:SVG: The Good, the Bad and the Ugly by nayuki on Friday February 12, 2021 @03:08PM (#26117978)
Less impressively, a clock: https://www.nayuki.io/res/full-screen-clock-javascript/full-... (50 lines of code)
Re:SVG: The Good, the Bad and the Ugly by m463 on Saturday February 13, 2021 @12:12AM (#26121579)
I liked this one, hiding on wikipedia:

https://upload.wikimedia.org/wikipedia/commons/6/6c/Morphing...

A morphing digital clock

Re:SVG: The Good, the Bad and the Ugly by shaftway on Friday February 12, 2021 @06:44PM (#26119957)
Oh man. Way back in the long long ago I worked at Adobe. I was a test engineer on the SVG <script> tag, mostly making sure that the DOM methods all worked properly. Lots and lots of interesting micro-projects there.

The one I was proudest of was a 3d chemical viewer where you could grab the molecule and spin it. SVG was only used because it was convenient to do the visualization. All of the 3d transforms were done in Javascript. But to have Javascript that could fluidly spin a 3d model was pretty amazing in 2000.

Re:SVG: The Good, the Bad and the Ugly by amenod on Sunday February 14, 2021 @03:52PM (#26136153)
Cool, thanks for sharing!

FYI, the OP posted an update with a reply to you:

> This article was posted on Hacker News... > In the comments there somebody mentioned an interesting use of the <script> tag in SVG. I’m unsure though whether I should be impressed or horrified :D

Re:SVG: The Good, the Bad and the Ugly by dallamaneni on Friday February 12, 2021 @12:13PM (#26115916)
Wow this is super amazing (and little horrifying). Never knew SVG can contain Javascript. Always thought of it as just a little safe vector graphics markup.