{"id":13692135,"url":"https://github.com/saehm/DruidJS","last_synced_at":"2025-05-02T19:31:30.930Z","repository":{"id":40563783,"uuid":"204689950","full_name":"saehm/DruidJS","owner":"saehm","description":"A JavaScript Library for Dimensionality Reduction","archived":false,"fork":false,"pushed_at":"2024-09-26T16:42:50.000Z","size":6483,"stargazers_count":112,"open_issues_count":12,"forks_count":10,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-11-08T13:06:15.058Z","etag":null,"topics":["clustering","dimensionality-reduction","fastmap","isomap","javascript-library","lle","ltsa","matrix","mds","pca","t-sne","umap","unsupervised-learning"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/saehm.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2019-08-27T11:37:10.000Z","updated_at":"2024-10-17T15:13:42.000Z","dependencies_parsed_at":"2022-08-23T11:01:31.890Z","dependency_job_id":null,"html_url":"https://github.com/saehm/DruidJS","commit_stats":{"total_commits":122,"total_committers":5,"mean_commits":24.4,"dds":"0.28688524590163933","last_synced_commit":"a8c3d973d427068e4ee01a4685c87a4d0f8b20c6"},"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saehm%2FDruidJS","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saehm%2FDruidJS/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saehm%2FDruidJS/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saehm%2FDruidJS/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/saehm","download_url":"https://codeload.github.com/saehm/DruidJS/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224328520,"owners_count":17293272,"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":["clustering","dimensionality-reduction","fastmap","isomap","javascript-library","lle","ltsa","matrix","mds","pca","t-sne","umap","unsupervised-learning"],"created_at":"2024-08-02T17:00:54.045Z","updated_at":"2024-11-12T18:30:25.866Z","avatar_url":"https://github.com/saehm.png","language":"JavaScript","funding_links":[],"categories":["JavaScript Libraries","JavaScript","[↑](#contents) Data Analytics"],"sub_categories":[],"readme":"## DruidJS — A JavaScript Library for Dimensionality Reduction.\n\n\u003ca href=\"#\"\u003e\u003cimg src=\"icon.svg\" width=80 align=\"left\" hspace=\"10\" vspace=\"6\"\u003e\u003c/a\u003e\n\nDruidJS is a JavaScript library for dimensionality reduction. \nWith dimesionality reduction you can project high-dimensional data to a lower dimensionality while keeping method-specific properties of the data.\nDruidJS makes it easy to project a dataset with the implemented dimensionality reduction methods.\n\n\u003cbr\u003e\n\n### Resources\n```\n@inproceedings{cutura2020druid,\n  title={{DRUIDJS — A JavaScript Library for Dimensionality Reduction}},\n  author={Cutura, Rene and Kralj, Christoph and Sedlmair, Michael},\n  booktitle={2020 IEEE Visualization Conference (VIS)},\n  pages={111--115},\n  year={2020},\n  organization={IEEE}\n}\n```\n\n- [Documentation](https://saehm.github.io/DruidJS/index.html) \n- [Demo](https://renecutura.eu/druid_demo)\n- [Conference Talk](https://youtu.be/bi6FfsWV_9k?t=2463) [IEEEVIS2020](http://ieeevis.org/year/2020/welcome)\n\n### Installation\nIf you use npm, install with `npm install @saehrimnir/druidjs`, and use it with\n```js\nimport * as druid from \"@saehrimnir/druidjs\";\n```\n\nOtherwise download the files [here](https://github.com/saehm/DruidJS/releases/latest), or use for instance [unpkg](https://unpkg.com/@saehrimnir/druidjs) this way:\n\n```html\n\u003cscript src=\"https://unpkg.com/@saehrimnir/druidjs\"\u003e\u003c/script\u003e\n```\n\n### Matrix\nDruidJS uses internally the Matrix class for storing data. You can use it by creating a `druid.Matrix` object for instance with the function `from`, in example:\n```js\n    import * as druid from '@saehrimnir/druidjs';\n\n    let data = [[...], [...], ...];\n    let matrix = druid.Matrix.from(data);\n```\nYou can create a `druid.Matrix` object programmatically by:\n```js\n    let fn = (row, col) =\u003e row == col ? 1 : 0;\n    let matrix = new druid.Matrix(rows, columns, fn);\n```\nIf `rows == columns`, then `matrix` would be a identity matrix.\nA shortcut for a identity matrix is:\n```js\n    let matrix = new druid.Matrix(rows, columns, \"I\");\n    // or\n    let matrix = new druid.Matrix(rows, columnbs, \"identity\");\n```\nThere are more shortcuts for creating matrices:\n```js\n    let matrix = new druid.Matrix(3, 3, \"zeros\"); // matrix would be a 3x3 matrix with zeroes\n    let matrix = new druid.Matrix(3, 3, \"center\"); // matrix would be a 3x3 center matrix;\n    let number = 12;\n    let matrix = new druid.Matrix(3, 3, number); // matrix would b a 3x3 matrix filled with 'number'\n```\n\nIf you want to use a `druid.Matrix` object, for instance, with [d3](https://d3js.org), you can use either the `to2dArray` property, the `iterate_rows` generator function, or just use the `druid.Matrix` object as an iterable (works with d3 since version 6).\n```js\n    let data = await d3.csv(\"data.csv\");\n    let matrix = druid.Matrix.from(data);\n    d3.selectAll(\"datapoints\").data(matrix.to2dArray)//...\n    d3.selectAll(\"datapoints\").data(matrix.iterate_rows())//...\n    d3.selectAll(\"datapoints\").data(matrix)//...\n```\n### DR methods\n\n#### Transform\n[Example](https://observablehq.com/@saehrimnir/hello-druidjs)\n\n#### Generator\n[Example](https://observablehq.com/@saehrimnir/hello-druidjs/2)\n\n#### TopoMap Example\n[Example](https://observablehq.com/@saehrimnir/topomap)\n...\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaehm%2FDruidJS","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsaehm%2FDruidJS","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaehm%2FDruidJS/lists"}