{"id":22814799,"url":"https://github.com/seonglae/to-smooth","last_synced_at":"2025-04-22T18:49:51.350Z","repository":{"id":36988602,"uuid":"380108741","full_name":"seonglae/to-smooth","owner":"seonglae","description":"Chaikin's smoothing algorithm extended to a multidimensional library","archived":false,"fork":false,"pushed_at":"2024-12-05T23:44:12.000Z","size":157,"stargazers_count":10,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-12-06T00:27:30.765Z","etag":null,"topics":["algorithm","chaikin","geojson","line","linestring","multilinestring","path","points","polyline","round","shape","smooth","smoother","smoothing","subdivide","svg"],"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/seonglae.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["seonglae"],"custom":["https://paypal.me/seonglae","https://www.buymeacoffee.com/seongland"]}},"created_at":"2021-06-25T03:02:03.000Z","updated_at":"2024-12-05T23:44:15.000Z","dependencies_parsed_at":"2023-10-16T16:38:37.826Z","dependency_job_id":"495c351c-f625-4ef5-977c-b94baf0bba84","html_url":"https://github.com/seonglae/to-smooth","commit_stats":{"total_commits":88,"total_committers":6,"mean_commits":"14.666666666666666","dds":0.6704545454545454,"last_synced_commit":"c7eff7592ed45d3760ac3c419ad34588ea7403c2"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seonglae%2Fto-smooth","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seonglae%2Fto-smooth/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seonglae%2Fto-smooth/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seonglae%2Fto-smooth/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/seonglae","download_url":"https://codeload.github.com/seonglae/to-smooth/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":229388348,"owners_count":18065252,"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":["algorithm","chaikin","geojson","line","linestring","multilinestring","path","points","polyline","round","shape","smooth","smoother","smoothing","subdivide","svg"],"created_at":"2024-12-12T13:10:40.206Z","updated_at":"2024-12-12T13:10:40.973Z","avatar_url":"https://github.com/seonglae.png","language":"TypeScript","funding_links":["https://github.com/sponsors/seonglae","https://paypal.me/seonglae","https://www.buymeacoffee.com/seongland"],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003eTo Smooth\u003c/h1\u003e\n\u003ch3 align=\"center\"\u003e\nMake your lines to curves\u003c/h3\u003e\n\u003cp align=\"center\"\u003e\n \u003ca href=\"https://www.npmjs.com/package/to-smooth\"\u003e\u003cimg alt=\"downloads\" src=\"https://img.shields.io/npm/d18m/to-smooth\"/\u003e\n \u003c/a\u003e\n\u003cp\u003e\n\n[Chaikin's smoothing algorithm](http://www.idav.ucdavis.edu/education/CAGDNotes/Chaikins-Algorithm/Chaikins-Algorithm.html) for polylines of any dimensions.\nImpressed by [chaikin-smooth](https://github.com/Jam3/chaikin-smooth) but, to-smooth is dimension generalized version of [chaikin-smooth](https://github.com/Jam3/chaikin-smooth) with iteration option.\n \nYou can use to-smooth instead of chaikin-smooth\n\n \n \n\u003ch1 align=\"center\"\u003e\u003ca href=\"https://openlayers.org/en/latest/examples/chaikin.html\"\u003eDemo\u003c/a\u003e\u003c/h1\u003e\n\n\u003ch3 align=\"center\"\u003e\nFrom\u003c/h3\u003e\n\n\u003cp align=\"center\"\u003e\n \u003cimg src=\"https://user-images.githubusercontent.com/27716524/123362217-4e04e680-d5ab-11eb-842d-4fe9d586bbe1.png\"/\u003e\n \u003c/img\u003e\n\u003cp\u003e\n\n\n\u003ch3 align=\"center\"\u003e\nTo\n\u003c/h3\u003e\n\u003cp align=\"center\"\u003e\n \u003cimg src=\"https://user-images.githubusercontent.com/27716524/123362234-51986d80-d5ab-11eb-95ec-f748cdb5f822.png\"/\u003e\n \u003c/img\u003e\n\u003cp\u003e\n \n\u003cbr/\u003e\n \n# Usage\n```js\nimport smooth from 'to-curve'\nimport geojson from 'geojson.json'\n\n\nif (geojson.geometry.type === 'LineString')\n  geojson.geometry.coordinates = smooth(geojson.geometry.coordinates)\nelse if (geojson.geometry.type === 'MultiLineString')\n  geojson.geometry.coordinates = geojson.geometry.coordinates.map(points =\u003e smooth(points))\n```\n\n\u003cbr/\u003e\n \n# Docs\nexport default function\n`smooth(points, options: {iteration, factor} = {iteration: 1, factor: 0.75})`\n\n\n### points\nsame dimension point array like LineString Coordinates\n\n- type - `Array\u003cArray\u003cnumber\u003e\u003e`\n\n### options\n- `iteration`\n  - default - 1\n  - description - if this increase, more smoother line return\n  - iteration how many algorithm applied\n- `factor`\n  - default - 0.75\n  - range - 0.5 - 1\n  - do not have to change or assign\n\n\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fseonglae%2Fto-smooth","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fseonglae%2Fto-smooth","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fseonglae%2Fto-smooth/lists"}