{"id":17722804,"url":"https://github.com/bramp/svg_path","last_synced_at":"2025-03-31T13:25:46.512Z","repository":{"id":223733304,"uuid":"761384819","full_name":"bramp/svg_path","owner":"bramp","description":"Pure dart library for parsing and manipulating SVG paths.","archived":false,"fork":false,"pushed_at":"2024-02-22T19:57:59.000Z","size":50,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-25T18:51:10.691Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bramp.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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},"funding":{"github":"bramp","buy_me_a_coffee":"bramp"}},"created_at":"2024-02-21T19:13:17.000Z","updated_at":"2024-12-08T18:53:42.000Z","dependencies_parsed_at":"2024-02-21T20:05:01.995Z","dependency_job_id":"5bb8b84e-87b5-408e-837c-7f88820ac78d","html_url":"https://github.com/bramp/svg_path","commit_stats":null,"previous_names":["bramp/svg_path"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bramp%2Fsvg_path","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bramp%2Fsvg_path/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bramp%2Fsvg_path/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bramp%2Fsvg_path/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bramp","download_url":"https://codeload.github.com/bramp/svg_path/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246473273,"owners_count":20783236,"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-25T15:39:25.180Z","updated_at":"2025-03-31T13:25:46.491Z","avatar_url":"https://github.com/bramp.png","language":"Dart","funding_links":["https://github.com/sponsors/bramp","https://buymeacoffee.com/bramp"],"categories":[],"sub_categories":[],"readme":"Pure dart library for parsing and manipulating SVG paths.\n\n[![Pub package](https://img.shields.io/pub/v/svg_path_transform.svg)](https://pub.dev/packages/svg_path_transform)\n[![Pub publisher](https://img.shields.io/pub/publisher/svg_path_transform.svg)](https://pub.dev/publishers/bramp.net/packages)\n[![Dart Analysis](https://github.com/bramp/svg_path/actions/workflows/dart.yml/badge.svg)](https://github.com/bramp/svg_path/actions/workflows/dart.yml)\n\n## Features\n\n* Parse a SVG path\n* Translate the path\n* Rotate the path around a point\n* Mirror the path across an axis\n* Scale the path\n* Reverse (e.g clockwise to counter-clockwise)\n\nDoes not depend on [Flutter](https://api.flutter.dev/index.html) or [dart:ui](https://api.flutter.dev/flutter/dart-ui/dart-ui-library.html), but these Path objects can easily be converted to dart:ui [Path objects](https://api.flutter.dev/flutter/dart-ui/Path-class.html).\n\n## Usage\n\n```shell\ndart pub add svg_path_transform\n```\n\n```dart\nimport 'package:svg_path_transform/svg_path_transform.dart';\n\nvoid main() {\n  // Read a path from a SVG path string.\n  final path = Path.fromString('M 10 10 H 90 V 90 H 10 L 10 10 Z');\n\n  // Translate the path 10 units in the x and y direction.\n  final p0 = path.translate(10, 10);\n\n  // Rotate the path 45 degrees around the point (50, 50).\n  final p1 = path.rotate(pi / 4, 50, 50);\n\n  // Reverse the path (drawing from the end to the start)\n  final p2 = path.reverse();\n\n  // Mirror the path across the X axis.\n  final p3 = path.mirror(Axis.x);\n\n  // Scale the path by 2 in the x direction, and 0.5 in the y direction.\n  final p4 = path.scale(2, 0.5);\n\n  // Print out the paths as SVG path strings.\n  print(p0.toString());\n  print(p1.toString());\n  print(p2.toString());\n  print(p3.toString());\n  print(p4.toString());\n}\n```\n\n## Limitations\n\n* All SVG commands are normalised to the absolute versions of moveTo, lineTo or\n  curveTo. The resulting image is identical, but the path string may be longer.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbramp%2Fsvg_path","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbramp%2Fsvg_path","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbramp%2Fsvg_path/lists"}