[HN Gopher] SVG.js v3.2
___________________________________________________________________
SVG.js v3.2
Author : eustoria
Score : 67 points
Date : 2025-11-23 17:38 UTC (5 hours ago)
(HTM) web link (svgjs.dev)
(TXT) w3m dump (svgjs.dev)
| emil-lp wrote:
| Anyone know a Python library for manipulating SVG images?
| WillAdams wrote:
| I've been meaning to look into:
|
| https://coderivers.org/blog/python-svg/
| monkmartinez wrote:
| You mean svgwrite (https://github.com/mozman/svgwrite) which
| looks like it is no longer maintained?
|
| I know of svg.py (https://github.com/orsinium-labs/svg.py)
| and drawsvg (https://github.com/cduck/drawsvg)... I have
| played with both a bit, no idea how they compare to others.
| beagle3 wrote:
| Not what you asked for, but something you might find useful:
| https://github.com/andy31lewis/brySVG
|
| A great SVG kit for Brython (browser Python)
| pyrolistical wrote:
| It's 10x slower than vanilla which makes this an ideal use case
| for transpilation.
|
| I bet you could just take one afternoon to write a vite plugin
| maxloh wrote:
| What is the use case of this library given that vanilla JS is
| 10x faster?
| aabhay wrote:
| Perhaps non-browser usage?
| elygre wrote:
| Maybe it's ease of development, and resulting readability?
|
| I did enjoy the example code, compared to the native
| javascript (both shown in the article): var
| draw = SVG().addTo('#drawing') , rect =
| draw.rect(100, 100).fill('#f06')
| bryanrasmussen wrote:
| why would the native JavaScript not be something like
| (probably errors here, so like, not necessarily this
| precisely)
|
| const div = document.getElementById('drawing');
|
| div.innerHTML = `<svg width="100%" height="100%"><rect
| width="100" height="100" fill="#f06"/></svg>`;
|
| obviously if the what is going in can have user input in
| some way then open to attack using innerHTML but otherwise
| it seems like the structure of the example native
| JavaScript is made in such a way as to make the SVG.js
| version seem super cool in comparison.
| jasonjmcghee wrote:
| > Obviously not as fast as vanilla js
|
| I had a similar question- why is it _obviously not_ as fast
| as vanilla js?
| cal85 wrote:
| Because it's written in vanilla JS.
| dagss wrote:
| I typically use d3 for any generated SVGs.
___________________________________________________________________
(page generated 2025-11-23 23:01 UTC)