{"id":13469565,"url":"https://github.com/Minibrams/svg-path-morph","last_synced_at":"2025-03-26T07:30:45.225Z","repository":{"id":39978563,"uuid":"499624201","full_name":"Minibrams/svg-path-morph","owner":"Minibrams","description":"Smoothly interpolate between variations of SVG paths.","archived":false,"fork":false,"pushed_at":"2023-06-02T23:25:15.000Z","size":195,"stargazers_count":733,"open_issues_count":0,"forks_count":18,"subscribers_count":12,"default_branch":"master","last_synced_at":"2024-10-01T12:35:23.625Z","etag":null,"topics":["interpolation","javascript","morph","path","svg","typescript"],"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/Minibrams.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}},"created_at":"2022-06-03T19:12:14.000Z","updated_at":"2024-09-29T10:33:19.000Z","dependencies_parsed_at":"2024-01-18T20:05:27.896Z","dependency_job_id":null,"html_url":"https://github.com/Minibrams/svg-path-morph","commit_stats":{"total_commits":24,"total_committers":3,"mean_commits":8.0,"dds":"0.45833333333333337","last_synced_commit":"cb77fbace094ce5e78fcae4ebb4670f1293467c3"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Minibrams%2Fsvg-path-morph","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Minibrams%2Fsvg-path-morph/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Minibrams%2Fsvg-path-morph/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Minibrams%2Fsvg-path-morph/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Minibrams","download_url":"https://codeload.github.com/Minibrams/svg-path-morph/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":222121829,"owners_count":16934973,"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":["interpolation","javascript","morph","path","svg","typescript"],"created_at":"2024-07-31T15:01:45.069Z","updated_at":"2024-10-29T22:31:19.911Z","avatar_url":"https://github.com/Minibrams.png","language":"TypeScript","readme":"# `svg-path-morph`\n![ci](https://github.com/Minibrams/svg-path-morph/workflows/ci/badge.svg)\n![coverage](https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/Minibrams/52a42b0e3eb35095e2f81e12d63dc374/raw/svg-path-morph__master.json)\n[![size](https://packagephobia.now.sh/badge?p=svg-path-morph)](https://packagephobia.now.sh/result?p=svg-path-morph)\n[![version](http://img.shields.io/npm/v/svg-path-morph.svg?style=flat)](https://www.npmjs.org/package/svg-path-morph)\n\nA simple library for morphing between variations of SVG paths.\nUse `svg-path-morph` to smoothly morph between X variations of the same SVG path (i.e. same commands, different values).\n\n# Installation\n```\nnpm install svg-path-morph\n```\n\n# Demo\n\nA live demo is also available on [my website](https://abrams.dk).\n\nhttps://user-images.githubusercontent.com/8108085/172227481-1e1e1e9b-6868-41f9-81e0-dfb52ec32e3d.mp4\n\n\u003e See [demo.html](./demo.html) and [src/demo.js](./src/demo.js) for the implementation of the above demonstration\n\n# Usage\n```typescript\n\nimport { compile, morph } from 'svg-path-morph'\n\n\n// Get the d attributes of the \u003cpath\u003e elements you want to morph between\nconst happy = document.getElemenyById('happy').getAttribute('d')\nconst angry = document.getElemenyById('angry').getAttribute('d')\n\n// Compile the morph base (average path embedding)\nconst compiled = compile([ \n  happy, \n  angry \n])\n\n// Morph between the happy/angry faces\nconst slightlyAngry = morph(\n  compiled,\n  [\n    0.80,  // 80% happy\n    0.20   // 20% angry\n  ]\n)\n\n// Use the face is the d attribute of a \u003cpath\u003e element\ndocument.getElementById('the-face').setAttribute('d', slightlyAngry)\n```\n","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMinibrams%2Fsvg-path-morph","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FMinibrams%2Fsvg-path-morph","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMinibrams%2Fsvg-path-morph/lists"}