{"id":18863691,"url":"https://github.com/owlsdepartment/owd-path-builder","last_synced_at":"2025-04-14T13:06:43.769Z","repository":{"id":52777385,"uuid":"130864135","full_name":"owlsdepartment/owd-path-builder","owner":"owlsdepartment","description":" Generate SVG path data declarative way. Made by http://www.owlsdepartment.com/","archived":false,"fork":false,"pushed_at":"2023-05-07T19:15:40.000Z","size":215,"stargazers_count":9,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-12T05:02:59.918Z","etag":null,"topics":["javascript-library","svg","svg-path","svg-paths"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/owlsdepartment.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":"2018-04-24T14:07:56.000Z","updated_at":"2023-09-22T09:47:39.000Z","dependencies_parsed_at":"2024-11-08T04:38:20.966Z","dependency_job_id":null,"html_url":"https://github.com/owlsdepartment/owd-path-builder","commit_stats":{"total_commits":6,"total_committers":2,"mean_commits":3.0,"dds":"0.16666666666666663","last_synced_commit":"ea705ec8fa27629f669de7747423a5df436b2488"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/owlsdepartment%2Fowd-path-builder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/owlsdepartment%2Fowd-path-builder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/owlsdepartment%2Fowd-path-builder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/owlsdepartment%2Fowd-path-builder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/owlsdepartment","download_url":"https://codeload.github.com/owlsdepartment/owd-path-builder/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248550634,"owners_count":21122933,"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":["javascript-library","svg","svg-path","svg-paths"],"created_at":"2024-11-08T04:38:14.134Z","updated_at":"2025-04-14T13:06:43.478Z","avatar_url":"https://github.com/owlsdepartment.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# owd-path-builder\n\nGenerate SVG path data declarative way. API inspired by https://github.com/andrewgrewell/svg-path-builder\n\n## Installation\n```bash\n$ npm install owd-path-builder\n```\n\n## Usage\n```javascript\nimport { PathBuilder } from 'owd-path-builder';\n\nconst pathData = new PathBuilder()\n    .absolute()\n    .moveTo(10, 10)\n    .line(20, 20)\n    .relative()\n    .horizontalLine(10)\n    .verticalLine(10)\n    .curve(10, 0, 10, 10, 10, 10)\n    .quadraticCurve(10, 0, 10, 10)\n    .symmetricCurve(10, 20, 15, 15)\n    .arc(30, 50, -45, 0, 1, 215.1, 109.9)\n    .close()\n    .toString();\n```\n\nThe above call will produce `M10 10 L20 20 h10 v10 c10 0 10 10 10 10 q10 0 10 10 s10 20 15 15 a30 50 -45 0 1 215.1 109.9 Z`. You can learn more about the details of SVG paths from https://css-tricks.com/svg-path-syntax-illustrated-guide/\n\n## API\n\n### Classes\n\nYou can instantiate new builder instance by calling `new PathBuilder()`.\n\n### Methods\n\n* `absolute()` - switch next nodes to absolute mode\n* `relative()` - switch next nodes to relative mode (default)\n* `moveTo(x, y)` - move to position\n* `line(x, y)` - draw line to position\n* `horizontalLine(x)` - draw horizontal line to position\n* `verticalLine(y)` - draw vertical line to position\n* `curve(x1, y1, x2, y2, x3, y3)` - draw berier curve\n* `quadraticCurve(x1, y1, x2, y2)` - draw quadratic curve\n* `symmetricCurve(x1, y1, x2, y2)` - draw symmetric curve\n* `arc(x1, y1, rotation, arc, sweep, x2, y2)` - draw arc\n* `close()` - close the path\n* `toString()` - export path into string in SVG compatibile format\n\n## Contributing\n\nThis package is experimental and was made primarily to be used in our team's internal projects. If you find this useful and want to improve the package, then contributions welcome. Please submit all pull requests against the master branch. Please include tests covering your improvements.\n\n## Author\n\nJakub Przyborowski, Owls Department\n* \u003ckuba@owlsdepartment.com\u003e \n* http://github.com/przyb\n* http://github.com/owlsdepartment\n* http://www.owlsdepartment.com/\n\n## License\n\n - **MIT** : http://opensource.org/licenses/MIT","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fowlsdepartment%2Fowd-path-builder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fowlsdepartment%2Fowd-path-builder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fowlsdepartment%2Fowd-path-builder/lists"}