{"id":16317944,"url":"https://github.com/jamesleesaunders/d3-interpolate-curve","last_synced_at":"2025-07-03T05:01:48.763Z","repository":{"id":38429994,"uuid":"196861635","full_name":"jamesleesaunders/d3-interpolate-curve","owner":"jamesleesaunders","description":"D3 Interpolate Curves","archived":false,"fork":false,"pushed_at":"2025-02-22T20:13:07.000Z","size":477,"stargazers_count":10,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-05T05:42:53.993Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/d3-interpolate-curve","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jamesleesaunders.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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":"2019-07-14T16:52:11.000Z","updated_at":"2025-02-22T20:13:10.000Z","dependencies_parsed_at":"2024-06-21T20:23:48.847Z","dependency_job_id":"7af670d8-11bd-41d0-96a9-268d00de161c","html_url":"https://github.com/jamesleesaunders/d3-interpolate-curve","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/jamesleesaunders/d3-interpolate-curve","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamesleesaunders%2Fd3-interpolate-curve","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamesleesaunders%2Fd3-interpolate-curve/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamesleesaunders%2Fd3-interpolate-curve/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamesleesaunders%2Fd3-interpolate-curve/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jamesleesaunders","download_url":"https://codeload.github.com/jamesleesaunders/d3-interpolate-curve/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamesleesaunders%2Fd3-interpolate-curve/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263264641,"owners_count":23439246,"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-10T22:09:35.794Z","updated_at":"2025-07-03T05:01:48.705Z","avatar_url":"https://github.com/jamesleesaunders.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# d3-interpolate-curve\n\nThis module provides a select of methods for generating number value interpolators from D3 curve functions.\n\nD3 has [d3-interpolate](https://github.com/d3/d3-interpolate) functions, for example \\`d3.interpolateBasis()\\`, for interpolating a series in numbers into a curve using the Basis interpolation algorithm.\n\nD3 also has [d3-curve](https://github.com/d3/d3-shape#curves) functions, like \\`d3.curveCardinal()\\` and \\`d3.curveMonotoneX()\\`, which can be used to quickly generate SVG curve paths.\n\nHowever, interpolate functions like \\`d3.interpolateCardinal()\\` and \\`d3.interpolateMonotoneX()\\` do not currently exist in D3, this limits us to to only be able to generate Cardinal and MonotoneX curves for SVG and not for things like X3D.\n\nThe [d3-interpolate-curve](https://github.com/jamesleesaunders/d3-interpolate-curve) plugin has been written to fill this gap to provide missing interpolation functions like \\`d3.interpolateCardinal()\\` and \\`d3.interpolateMonotoneX()\\` as well as \\`d3.interpolateFromCurve()\\`.\n\n## Installing\n\nIf you use NPM, `npm install d3-interpolate-curve`. \nOtherwise, download the [latest release](https://github.com/jamesleesaunders/d3-interpolate-curve/releases/latest).\nAlternativly in vanilla JS:\n\n```html\n\u003cscript src=\"https://raw.githack.com/jamesleesaunders/d3-interpolate-curve/dist/d3-interpolate.js\"\u003e\u003c/script\u003e\n\u003cscript\u003e\n\nvar interpolate = d3.interpolateFromCurve([1,2,7,2], d3.curveMonotoneX, 0.00001, 100);\n\n\u003c/script\u003e\n```\n\n## API Reference\n\n\u003ca name=\"interpolateFromCurve\" href=\"#interpolateFromCurve\"\u003e#\u003c/a\u003e d3.\u003cb\u003einterpolateFromCurve\u003c/b\u003e(\u003ci\u003evalues\u003c/i\u003e, \u003ci\u003ecurve\u003c/i\u003e, \u003ci\u003eepsilon\u003c/i\u003e, \u003ci\u003esamples\u003c/i\u003e) · [Source](https://github.com/jamesleesaunders/d3-interpolate-curve/blob/master/src/fromCurve.js), [Examples](https://observablehq.com/@jamesleesaunders/d3-interpolate-curve)\n\nReturns interpolator based on D3 curve function; d3.curveCardinal(), d3.curveLinear(), d3.curveMonotoneX() etc. \n\n```js\nvar interpolate = d3.interpolateFromCurve([1,2,7,2], d3.curveMonotoneX, 0.00001, 100);\n```\n\n\u003ca name=\"interpolateCardinal\" href=\"#interpolateCardinal\"\u003e#\u003c/a\u003e d3.\u003cb\u003einterpolateCardinal\u003c/b\u003e(\u003ci\u003evalues\u003c/i\u003e) · [Source](https://github.com/jamesleesaunders/d3-interpolate-curve/blob/master/src/cardinal.js), [Examples](https://observablehq.com/@jamesleesaunders/d3-interpolate-curve)\n\nReturns interpolator based on cubic Cardinal spline.\n\n```js\nvar interpolate = d3.interpolateCardinal([1,2,7,2]);\n```\n\n\u003ca name=\"interpolateCatmullRom\" href=\"#interpolateCatmullRom\"\u003e#\u003c/a\u003e d3.\u003cb\u003einterpolateCatmullRom\u003c/b\u003e(\u003ci\u003evalues\u003c/i\u003e) · [Source](https://github.com/jamesleesaunders/d3-interpolate-curve/blob/master/src/catmullRom.js), [Examples](https://observablehq.com/@jamesleesaunders/d3-interpolate-curve)\n\nReturns interpolator based on a cubic Catmull–Rom spline.\n\n```js\nvar interpolate = d3.interpolateCatmullRom([1,2,7,2]);\n```\n\n\u003ca name=\"interpolateMonotoneX\" href=\"#interpolateMonotoneX\"\u003e#\u003c/a\u003e d3.\u003cb\u003einterpolateMonotoneX\u003c/b\u003e(\u003ci\u003evalues\u003c/i\u003e) · [Source](https://github.com/jamesleesaunders/d3-interpolate-curve/blob/master/src/monotoneX.js), [Examples](https://observablehq.com/@jamesleesaunders/d3-interpolate-curve)\n\nReturns interpolator based on MonotoneX spline.\n\n```js\nvar interpolate = d3.interpolateMonotoneX([1,2,7,2]);\n```\n\n## Options\n\n- samples - Number of samples.\n- epsilon - Coordinate precision.\n\n## Credits\n\n* Andreas Plesch - hugh credit for goes to Andreas who came up with the original concept for this module.\n* Mike Bostock - for advice on converting SVG curves.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjamesleesaunders%2Fd3-interpolate-curve","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjamesleesaunders%2Fd3-interpolate-curve","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjamesleesaunders%2Fd3-interpolate-curve/lists"}