Top
Best
New

Posted by sadiq 12/11/2025

An SVG is all you need(jon.recoil.org)
347 points | 148 commentspage 4
CupricTea 12/12/2025|
A few years ago I learned just enough d3 to show an interactive 2D lollipop graph. Later I learned just enough SVG to get a small diagram out for a college class. I think going back if I were to redo that first interactive graph I'd probably just do it in raw SVG.
lucid-dev 12/11/2025||
This is going to really transform some data visualization things I've been thinking about. I've always loved SVG since working with Illustrator and Inkscape back in the day, but I didn't realize how much it could tie in with the modern web and interactivity. Thank you!
some_guy_nobel 12/11/2025||
SVG has been transforming web-experiences (particularly for viz) for quite some time now, see:

- https://mlu-explain.github.io/neural-networks/

- https://www.nytimes.com/spotlight/graphics

- https://pudding.cool/

tetris11 12/11/2025||
Surely D3 is what you're referring to
anilakar 12/12/2025||
I remember making an .svg spirit thermometer that polled our local weather station and scaled the red bar accordingly some 12 years ago. A nice gimmick but I didn't see any real use for it. We joked about making a single-image SCADA monitor screen.
anilakar 12/12/2025|
Can't edit the previous message anymore, but I just vibecoded a functional replica while waiting for a pipeline to run: https://prkele.prk.tky.fi/~anilakar/thermo.svg
felineflock 12/12/2025||
"SVG Considered Harmful"

https://www.cloudflare.com/cloudforce-one/research/svgs-the-...

tomalbrc 12/12/2025||
First off, what kind of SVG reader does cloudflare assume to just open SVGs and Willy nilly run contained js? Is that a windows os feature? Second, do they not know about Content Security Policies?

And as a side note: Cloudflare itself is considered harmful

perilunar 12/12/2025||
"Since SVGs are essentially code, they can embed JavaScript"

Odd thing to say. Everything on a computer is "essentially code", executable or not.

giamma 12/12/2025||
I believe that would result in non accessible content, I believe screen readers cannot properly assist impaired users with SVG content.

As such I think it's not a good idea for a document that should have a large audience.

james-bcn 12/12/2025|
Is there any appropriate solution for complex interactive charts and graphs?
giamma 12/12/2025||
Good question. In general charts are not accessible because visually impaired users cannot use a mouse.

You would need an interacting charting library that works with a keyboard and that is readable by a screen reader.

tanx16 12/11/2025||
Here's a fun older thread on a similar topic - SVG is Turing Complete:

https://news.ycombinator.com/item?id=20980837

morshu9001 12/11/2025||
An SVG and JS, right? It's not interactive on its own.
avsm 12/11/2025|
The JS is embedded within the SVG file and not exposed outside it
zamadatix 12/12/2025|||
The JS is exposed in the full page's context the same as if you included a <script> under a <div> instead of <svg>. In much the same way, whether the <script> is before or after the <svg> tag doesn't matter - it's just a script working on a single DOM (with different namespaces for certain elements) either way.
morshu9001 12/12/2025||
I guess the point is you can give a single .svg file with the js inside. But you can also give a single .html with svg and js inside.
strickinato 12/11/2025|||
Sort of... the SVG is referencing `svgscript.js` which is being fetched from the server (https://jon.recoil.org/blog/2025/12/svgscript.js)
myjumpingsocks 12/12/2025||
heck yeah. bring back the hype over SVGs. the amount of things you can do has always amazed me. just using SVG filters, interactions, accessibility...
drewg123 12/11/2025|
I hate that slack doesn't support svg. So we end up taking screenshots of svg flame graphs when discussing things.
dorfsmay 12/12/2025|
Have you created an issue/suggestion?

I believe Slack is an electron app so it might be easy to implement.

More comments...