{"id":24569604,"url":"https://github.com/gordonlesti/dynamic-time-warping","last_synced_at":"2025-04-22T19:50:11.184Z","repository":{"id":43130745,"uuid":"63719063","full_name":"GordonLesti/dynamic-time-warping","owner":"GordonLesti","description":"Dynamic time warping for JavaScript","archived":false,"fork":false,"pushed_at":"2017-01-05T15:51:04.000Z","size":9,"stargazers_count":51,"open_issues_count":2,"forks_count":11,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-13T05:03:41.962Z","etag":null,"topics":["dynamic-time-warping","javascript"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/GordonLesti.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-07-19T18:40:56.000Z","updated_at":"2024-07-25T18:28:20.000Z","dependencies_parsed_at":"2022-08-30T16:11:35.877Z","dependency_job_id":null,"html_url":"https://github.com/GordonLesti/dynamic-time-warping","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GordonLesti%2Fdynamic-time-warping","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GordonLesti%2Fdynamic-time-warping/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GordonLesti%2Fdynamic-time-warping/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GordonLesti%2Fdynamic-time-warping/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GordonLesti","download_url":"https://codeload.github.com/GordonLesti/dynamic-time-warping/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250313506,"owners_count":21410239,"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":["dynamic-time-warping","javascript"],"created_at":"2025-01-23T15:55:06.099Z","updated_at":"2025-04-22T19:50:11.156Z","avatar_url":"https://github.com/GordonLesti.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# dynamic-time-warping\n\n[![Latest Version on npm][ico-version]][link-npm]\n[![Software License][ico-license]](LICENSE.md)\n[![Build Status][ico-travis]][link-travis]\n[![Coverage Status][ico-coverall]][link-coveralls]\n[![Total Downloads][ico-downloads]][link-downloads]\n\n[Dynamic time warping](https://en.wikipedia.org/wiki/Dynamic_time_warping) for JavaScript. A simple usecase would be\n[Touch signature identification with JavaScript](https://gordonlesti.com/touch-signature-identification-with-javascript/)\nfor example.\n\n## Install\n\nSeveral quick start options are available:\n* [Download the latest release](https://github.com/GordonLesti/dynamic-time-warping/releases/latest).\n* Clone the repo: `git clone https://github.com/GordonLesti/dynamic-time-warping.git`.\n* Install with [npm](https://www.npmjs.com/): `npm install dynamic-time-warping`.\n* Install with [Bower](http://bower.io): `bower install dynamic-time-warping`.\n\nInclude script (unless you are packaging scripts somehow else):\n\n```html\n\u003cscript src=\"/path/to/dynamic-time-warping.js\"\u003e\u003c/script\u003e\n```\n\nThe plugin can also be loaded as AMD or Node module.\n\n## Usage\n\n### Initialization\n\n`DynamicTimeWarping` needs two arrays containing objects of the the same type and function that calculates the distance\nbetween two objects and returns a float.\n\n```javascript\nvar ser1 = [ 9, 93, 15, 19, 24 ];\nvar ser2 = [ 31, 97, 81, 82, 39 ];\nvar distFunc = function( a, b ) {\n    return Math.abs( a - b );\n};\n\nvar dtw = new DynamicTimeWarping(ser1, ser2, distFunc);\n```\n\n### getDistance\n\nWill return the distance of the dynamic time warping as float.\n\n```javascript\n// 108\nvar dist = dtw.getDistance();\n```\n\n### getPath\n\nWill return the path of the dynamic time warping as array of arrays with two integers.\n\n```javascript\n// [ [ 0, 0 ], [ 1, 1 ], [ 1, 2 ], [ 1, 3 ], [ 2, 4 ], [ 3, 4 ], [ 4, 4 ] ]\nvar dist = dtw.getPath();\n```\n\n## Change log\n\nPlease see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.\n\n## Testing\n\n``` bash\n$ grunt\n```\n\n## Contributing\n\nPlease see [CONTRIBUTING](CONTRIBUTING.md) and [CONDUCT](CONDUCT.md) for details.\n\n## Security\n\nIf you discover any security related issues, please email info@gordonlesti.com instead of using the issue tracker.\n\n## Credits\n\n- [Gordon Lesti][link-author]\n- [All Contributors][link-contributors]\n\n## License\n\nThe MIT License (MIT). Please see [License File](LICENSE.md) for more information.\n\n[ico-version]: https://img.shields.io/npm/v/dynamic-time-warping.svg?style=flat-square\n[ico-license]: https://img.shields.io/github/license/GordonLesti/dynamic-time-warping.svg?style=flat-square\n[ico-travis]: https://img.shields.io/travis/GordonLesti/dynamic-time-warping/master.svg?style=flat-square\n[ico-coverall]: https://img.shields.io/coveralls/GordonLesti/dynamic-time-warping/master.svg?style=flat-square\n[ico-downloads]: https://img.shields.io/npm/dt/dynamic-time-warping.svg?style=flat-square\n\n[link-npm]: https://www.npmjs.com/package/dynamic-time-warping\n[link-travis]: https://travis-ci.org/GordonLesti/dynamic-time-warping\n[link-coveralls]: https://coveralls.io/r/GordonLesti/dynamic-time-warping\n[link-downloads]: https://www.npmjs.com/package/dynamic-time-warping\n[link-author]: https://gordonlesti.com/\n[link-contributors]: ../../contributors\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgordonlesti%2Fdynamic-time-warping","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgordonlesti%2Fdynamic-time-warping","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgordonlesti%2Fdynamic-time-warping/lists"}