{"id":16711055,"url":"https://github.com/ianmackenzie/elm-geometry-svg","last_synced_at":"2025-03-21T20:33:14.657Z","repository":{"id":57675118,"uuid":"65864443","full_name":"ianmackenzie/elm-geometry-svg","owner":"ianmackenzie","description":"Render 2D elm-geometry types as SVG","archived":false,"fork":false,"pushed_at":"2023-10-13T19:09:15.000Z","size":323,"stargazers_count":46,"open_issues_count":4,"forks_count":7,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-14T20:13:08.108Z","etag":null,"topics":["elm","geometry","svg","transformations"],"latest_commit_sha":null,"homepage":"http://package.elm-lang.org/packages/ianmackenzie/elm-geometry-svg/latest","language":"Elm","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ianmackenzie.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":"2016-08-17T01:00:41.000Z","updated_at":"2024-05-30T16:55:01.000Z","dependencies_parsed_at":"2024-10-12T20:10:39.417Z","dependency_job_id":null,"html_url":"https://github.com/ianmackenzie/elm-geometry-svg","commit_stats":{"total_commits":328,"total_committers":3,"mean_commits":"109.33333333333333","dds":0.009146341463414642,"last_synced_commit":"7f2c72e48f5b226b8f5c18d1ba379700cb6ca93a"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ianmackenzie%2Felm-geometry-svg","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ianmackenzie%2Felm-geometry-svg/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ianmackenzie%2Felm-geometry-svg/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ianmackenzie%2Felm-geometry-svg/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ianmackenzie","download_url":"https://codeload.github.com/ianmackenzie/elm-geometry-svg/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244866229,"owners_count":20523484,"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":["elm","geometry","svg","transformations"],"created_at":"2024-10-12T20:10:37.759Z","updated_at":"2025-03-21T20:33:14.317Z","avatar_url":"https://github.com/ianmackenzie.png","language":"Elm","funding_links":[],"categories":[],"sub_categories":[],"readme":"# elm-geometry-svg\n\nThis [Elm](http://elm-lang.org) package provides functions to create and\nmanipulate SVG elements using the [`elm-geometry`](http://package.elm-lang.org/packages/ianmackenzie/elm-geometry/latest)\ndata types. You can:\n\n  - Draw 2D `elm-geometry` objects as SVG\n  - Apply `elm-geometry`-based 2D transformations to arbitrary SVG elements\n  - Convert SVG between different coordinate systems\n\n## Drawing\n\nThe `lineSegment2d`, `triangle2d`, `polyline2d`, `polygon2d`, `circle2d`,\n`ellipse2d`, `arc2d`, `ellipticalArc2d`, `quadraticSpline2d`, `cubicSpline2d`,\n`rectangle2d` and `boundingBox2d` functions all produce standard [`Svg msg`](http://package.elm-lang.org/packages/elm-lang/svg/latest/Svg#Svg)\nvalues that can be included in any SVG diagram:\n\n![lineSegment2d](https://ianmackenzie.github.io/elm-geometry-svg/2.0.0/images/lineSegment2d.svg)\n![triangle2d](https://ianmackenzie.github.io/elm-geometry-svg/2.0.0/images/triangle2d.svg)\n![polyline2d](https://ianmackenzie.github.io/elm-geometry-svg/2.0.0/images/polyline2d.svg)\n![polygon2d](https://ianmackenzie.github.io/elm-geometry-svg/2.0.0/images/polygon2d.svg)\n![circle2d](https://ianmackenzie.github.io/elm-geometry-svg/2.0.0/images/circle2d.svg)\n\nThe appearance of the resulting elements can be customized by adding SVG\nattributes such as `fill` and `stroke`.\n\n## Transformation\n\nThe `scaleAbout`, `rotateAround`, `translateBy` and `mirrorAcross` functions\nbehave just like their standard `elm-geometry` counterparts. You can use them to do\nthings that would be difficult to do using just SVG, such as mirror a fragment\nof SVG across an arbitrary axis:\n\n![scaleAbout](https://ianmackenzie.github.io/elm-geometry-svg/2.0.0/images/scaleAbout.svg)\n![rotateAround](https://ianmackenzie.github.io/elm-geometry-svg/2.0.0/images/rotateAround.svg)\n![translateBy](https://ianmackenzie.github.io/elm-geometry-svg/2.0.0/images/translateBy.svg)\n![mirrorAcross](https://ianmackenzie.github.io/elm-geometry-svg/2.0.0/images/mirrorAcross.svg)\n\nNote that these functions will work on *any* `Svg msg`, value, not just ones\nthat happen to have been produced with this package! So you can use them as a\nconvenient way to transform SVG that you've produced in some other way.\n\n## Coordinate conversion\n\nThe `relativeTo` and `placeIn` functions allow you to take SVG defined in one\ncoordinate system and convert it to another. For example, you can take SVG\ndefined in a model coordinate system where (0,0) is the center and positive Y is\nup, and use `relativeTo` to convert it into SVG in window coordinates for\ndisplay, where (0,0) is the top left corner and positive Y is down.\n\n`placeIn` is useful for 'instancing' or 'stamping' a fragment of SVG in many\ndifferent positions with different orientations:\n\n![placeIn](https://ianmackenzie.github.io/elm-geometry-svg/2.0.0/images/placeIn.svg)\n\n## Installation\n\nAssuming you have [installed Elm](https://guide.elm-lang.org/install.html) and\nstarted a new project, you can install `elm-geometry-svg` by running\n\n```\nelm install ianmackenzie/elm-geometry-svg\n```\n\nin a command prompt inside your project directory.\n\n## Documentation\n\n[Full API documentation](http://package.elm-lang.org/packages/ianmackenzie/elm-geometry-svg/latest/Geometry-Svg)\nis available.\n\n\n## Climate action\n\nI would like for the projects I work on to be as helpful as possible in\naddressing the climate crisis. If\n\n- you are working on a project that helps address the climate crisis (clean\n  energy, public transit, reforestation, sustainable agriculture etc.) either as\n  an individual, as part of an non-profit organization or even as part of a\n  for-profit company, and\n- there is a new feature you would find helpful for that work (or a bug you need\n  fixed) in any of my open-source projects, then\n\nplease [open a new issue](https://github.com/ianmackenzie/elm-geometry-svg/issues),\ndescribe briefly what you're working on and I will treat that issue as high\npriority.\n\n\n## Questions? Comments?\n\nPlease [open a new issue](https://github.com/ianmackenzie/elm-geometry-svg/issues)\nif you run into a bug, if any documentation is missing/incorrect/confusing, or\nif there's a new feature that you would find useful (although note that this\npackage is not meant to be general-purpose full-blown SVG package, more just a\nconvenient way to render `elm-geometry` values). For general questions about\nusing this package, try:\n\n  - Joining the **#geometry** or **#svg** channels on the [Elm Slack](http://elmlang.herokuapp.com/),\n    or sending me (**@ianmackenzie**) a message - even if you don't have any\n    particular questions right now, it would be great to know what you're hoping\n    to do with the package!\n  - Posting to the [Elm Discourse](https://discourse.elm-lang.org/) forums\n\nYou can also find me on Twitter ([@ianemackenzie](https://twitter.com/ianemackenzie)),\nwhere I occasionally post `elm-geometry`-related stuff like demos or new\nreleases. Have fun, and don't be afraid to ask for help!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fianmackenzie%2Felm-geometry-svg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fianmackenzie%2Felm-geometry-svg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fianmackenzie%2Felm-geometry-svg/lists"}