Open-source project
Yqnn/svg-path-editor avatar
Yqnn/svg-path-editor

svg-path-editor: a path data workbench, with the file handling left to you

Online editor to create and manipulate SVG paths

5,352 stars425 forksTypeScriptAGPL-3.0

At a glance

What is it?
A browser editor for SVG path data built on Angular 17, where the raw d string is the source of truth: commands are inserted by clicking the canvas, relative and absolute forms toggle with one click, and Round, Reverse and Optimize rewrite the whole string. The library behind it ships separately as an npm package.
Who is it for?
Use svg-path-editor when you already have path data and want to reshape it visually, or when you want the parsing and command manipulation code without writing it, since the same code is published as svg-path-editor-lib. Do not reach for it as a general SVG editor: there is no documented file open, export or raster step, and the app only ever sees the path string you paste.
Can I use it commercially?
Yes, with strict conditions. AGPL-3.0 is a network copyleft licence: if people use a modified version over a network, for example as a hosted service, you must offer them its source code under the same licence.
Is it still maintained?
Yes. The repository last received commits 8 days ago.
What is it written in?
Mainly TypeScript, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on November 23, 2026, and from our analysis. They are not legal advice.

From daily snapshots

Star history

  • Yqnn/svg-path-editor5,352 ★ · +28
Star history
Repository2026-09-232026-11-23
Yqnn/svg-path-editor5.3k5.4k

28 Stars in the last 61 days, measured from the daily GitHub snapshot. Compare with other projects

Editorial analysis

You paste the path string; the editor never opens a file

The whole workflow starts in the path field, where you paste or edit the raw path. From there, clicking + adds a new command: you pick a type, then click the destination on the canvas. Points move with drag and drop, and clicking a point opens a small menu that inserts a command right after the selected one, removes it, or changes its type. What is missing is everything around that field. No step in the documented flow opens an .SVG file, imports a drawing, or exports the result back to a file, so the tool is a workbench for path data rather than an editor for documents. You bring the d attribute yourself, and whatever you leave with is a string you copy out.

Relative is orange and absolute is purple, one click apart

Every command in the panel carries a colour that tells you which coordinate system it is in: relative command types are orange, absolute are purple, and clicking the type toggles between them. The same menu offers Delete, Insert after, and Convert to for changing the selected command into another type. Two of its entries are structural rather than cosmetic. Start Path From Here reorders the path so the selected command becomes first, and Start Subpath From Here does the same inside its own subpath, while Reverse Subpath flips the command order within that subpath. Reordering rewrites the sequence rather than the coordinates, so a path that looks identical can end up with a different string.

Round, Reverse and Optimize rewrite the entire string

The path operations act on the whole path: Scale, Translate and Rotate change geometry, Round rounds all coordinates of the current path, Convert to relative or Convert to absolute rewrites every command, Reverse flips the command order, and Optimize minimises the path length. The interesting one is Optimize, since a shorter path is easier to ship but no longer resembles the string you typed, and the page gives no preview, no numeric delta and no setting for how aggressive it is. Undo is available with ctrl+z or cmd+z, so a rewrite you did not want is recoverable.

Zoom to Fit reads the viewBox off the current path

The canvas has its own geometry controls. The mouse wheel zooms, or you click Zoom in and Zoom out, and drag and drop moves the viewBox around. Zoom to Fit sets the viewBox automatically depending on the current path, which is the one operation that derives values from your data instead of taking them from you. The other route is manual, through the x, y, width and height fields. Those four numbers are the only numeric view you get of the coordinate space the canvas is drawing in, and since the same viewBox applies to the path you paste, a wrong width or height makes the drawing appear at the wrong scale or in the wrong place without any error being raised.

The cancel shortcut is documented as echap

The shortcut map is dense, and one entry is misspelled. To insert a command after the selected one you press m, l, v, h, c, s, q, t, a or z, and adding shift converts the selected command to that type instead. Delete and backspace remove the selected command, ctrl+z and cmd+z undo, and ctrl+shift+z or cmd+shift+z redo. The key that cancels the command you are drawing, or undoes the dragging operation in progress, is written as echap rather than escape, and the sentence around it is garbled enough that it reads as a typo nobody caught. A reader searching the page for how to abandon a half placed point will not find it, which is exactly the moment when you need it.

The library builds through tsdown while the app builds through ng

There are two build systems in one repository. The app is Angular: npm start serves it, npm run build puts artifacts in dist/, and a build-prod variant passes a base href of /svg-path-editor/, which is why the hosted app sits under that path. The reusable half is separate. The engine behind the editor is published as a standalone npm package, svg-path-editor-lib, and it is built by a script that clears ./src/lib/dist and runs tsdown, driven by tsdown.config.ts, with deploy-lib.sh sitting alongside it in the tree. The app's own package.json is marked private at version 0.0.0, and the repository publishes no releases, so the versioning story lives entirely in the library package.

The Docker image runs the dev server and mounts your checkout

The Docker image runs the Angular development server on port 4200.

dockerfile
FROM node:22-slim

WORKDIR /app

COPY package.json package-lock.json ./
RUN npm ci

COPY . .

EXPOSE 4200
CMD ["npm", "start", "--", "--host", "0.0.0.0", "--port", "4200"]

Compose bind-mounts the checkout at `/app` and uses a separate volume for `/app/node_modules`. The running container picks up edits to the checkout while keeping its installed dependencies separate from the host.

Tests run through Karma, so they need a browser

npm test runs ng test, and the dev dependencies say what that means in practice: karma with karma-chrome-launcher, karma-jasmine, a coverage reporter and a jasmine html reporter, plus jasmine-core and @types/jasmine. Nothing in the page describes a headless setup or which browser binary is expected, so on a machine without Chrome the first test run fails before any assertion is evaluated. The version ranges are equally specific: Node v18.13 or higher, the Angular packages at ^17.3.2, TypeScript ~5.4.3, rxjs ~7.8.0 and zone.js ~0.14.4, with @angular/material and the service worker among the runtime dependencies. The project also carries a special thanks list of around thirty sponsor handles.

Editorial conclusion

Use svg-path-editor when you already have path data and want to reshape it visually, or when you want the parsing and command manipulation code without writing it, since the same code is published as svg-path-editor-lib. Do not reach for it as a general SVG editor: there is no documented file open, export or raster step, and the app only ever sees the path string you paste. Before depending on the library, check the Node v18.13 floor and the Angular 17 pins in package.json, and remember that the app repository publishes no releases, so the version you run is whatever the hosted page serves.

Frequently asked questions

What is an SVG path?

In this editor an SVG path is the raw path string you paste into the path field, made of commands such as m, l, v, h, c, s, q, t, a and z. Each command can hold relative or absolute coordinates, and the string can be rounded, reversed and shortened with the Optimize button.

How can I edit a .SVG file?

This tool does not document a file step. You paste or edit the raw path in the path field, click + to add a command, pick its type and click the destination, drag points to move them, and use the ... menu on a point to insert after, remove or change a command's type.

How to get path of SVG?

The documented workflow starts from path data you already have, since every step acts on the string in the path field. No step in the page opens an SVG file or extracts a path from one, and no export step is described either.

How can I convert an SVG file to path data?

What the editor can do is rewrite path data: Convert to relative and Convert to absolute change every command, Convert to changes the selected command's type, Round rounds all coordinates, Reverse flips the command order and Optimize minimises the path length. The parsing code behind those operations is published separately as the svg-path-editor-lib package.

Official sources

  1. Issues
  2. License: Apache-2.0
  3. Project website
  4. README
  5. Yqnn/svg-path-editor on GitHub

Was this useful?