{"id":16125680,"url":"https://github.com/dy/svg-path-sdf","last_synced_at":"2025-10-23T17:47:22.432Z","repository":{"id":57375545,"uuid":"101232434","full_name":"dy/svg-path-sdf","owner":"dy","description":"Generate signed distance bitmap for an svg path","archived":false,"fork":false,"pushed_at":"2025-03-05T04:24:06.000Z","size":45,"stargazers_count":59,"open_issues_count":0,"forks_count":6,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-05-09T05:01:54.452Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dy.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-08-23T23:11:13.000Z","updated_at":"2025-05-04T16:07:26.000Z","dependencies_parsed_at":"2025-03-31T04:13:27.309Z","dependency_job_id":null,"html_url":"https://github.com/dy/svg-path-sdf","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dy%2Fsvg-path-sdf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dy%2Fsvg-path-sdf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dy%2Fsvg-path-sdf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dy%2Fsvg-path-sdf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dy","download_url":"https://codeload.github.com/dy/svg-path-sdf/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254518384,"owners_count":22084374,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-09T21:30:38.257Z","updated_at":"2025-10-23T17:47:22.328Z","avatar_url":"https://github.com/dy.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# svg-path-sdf [![experimental](https://img.shields.io/badge/stability-unstable-green.svg)](http://github.com/badges/stability-badges)\n\nCreate signed distance field for an svg path data.\n\n![svg-path-sdf](https://github.com/dy/svg-path-sdf/blob/master/preview.png?raw=true)\n\n## Usage\n\n[![npm install svg-path-sdf](https://nodei.co/npm/svg-path-sdf.png?mini=true)](https://npmjs.org/package/svg-path-sdf/)\n\n```js\nimport pathSdf from 'svg-path-sdf'\n\nconst arr = pathSdf('M40,0A40,40 0 1,1 0,-40A40,40 0 0,1 40,0Z', {\n\twidth: 200,\n\theight: 200\n})\n```\n\n`arr` has `200×200` elements with value from `0..1` range, corresponding to distance. The path is drawn at the center of the sdf fitting to the minimum side.\n\n## distances = pathSdf(path, options|shape?)\n\nOption | Meaning\n---|---\n`width`, `height` | Output sdf size in px, defaults to `200×200`.\n`cutoff`, `radius` | SDF parameters for [bitmap-sdf](https://github.com/dy/bitmap-sdf), by default detected from shape to fit min side.\n`viewbox` | View box for the path data. If not defined, it is detected as path bounds via [svg-path-bounds](https://github.com/dy/svg-path-bounds).\n`stroke` | Whether to stroke shape. Positive number will stroke outside the amount of pixels, negative number will stroke inside, `0`-ish will disable stroke.\n\n## License\n\n(c) 2017 Dmitry Iv. MIT License\n\nDevelopment supported by plot.ly.\n\n\u003cp align=center\u003e\u003ca href=\"https://github.com/krishnized/license/\"\u003e🕉\u003c/a\u003e\u003c/p\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdy%2Fsvg-path-sdf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdy%2Fsvg-path-sdf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdy%2Fsvg-path-sdf/lists"}