{"id":13594189,"url":"https://github.com/cosmograph-org/cosmos","last_synced_at":"2025-04-09T07:31:02.529Z","repository":{"id":37235063,"uuid":"481427289","full_name":"cosmograph-org/cosmos","owner":"cosmograph-org","description":"GPU-accelerated force graph layout and rendering","archived":false,"fork":false,"pushed_at":"2024-09-09T09:49:54.000Z","size":696,"stargazers_count":812,"open_issues_count":11,"forks_count":53,"subscribers_count":9,"default_branch":"main","last_synced_at":"2024-09-09T11:42:53.712Z","etag":null,"topics":["force","graph","network","simulation","visualization","webgl"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cosmograph-org.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-04-14T01:30:14.000Z","updated_at":"2024-09-01T19:54:25.000Z","dependencies_parsed_at":"2023-09-29T07:05:42.102Z","dependency_job_id":"d089c4e7-9f7c-4c81-ba1d-2b8f4636c5d0","html_url":"https://github.com/cosmograph-org/cosmos","commit_stats":{"total_commits":73,"total_committers":5,"mean_commits":14.6,"dds":"0.31506849315068497","last_synced_commit":"cd73a82ddafddf820eeff3c61d2c3532169f140c"},"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cosmograph-org%2Fcosmos","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cosmograph-org%2Fcosmos/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cosmograph-org%2Fcosmos/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cosmograph-org%2Fcosmos/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cosmograph-org","download_url":"https://codeload.github.com/cosmograph-org/cosmos/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223375200,"owners_count":17135323,"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":["force","graph","network","simulation","visualization","webgl"],"created_at":"2024-08-01T16:01:29.969Z","updated_at":"2025-04-09T07:31:02.510Z","avatar_url":"https://github.com/cosmograph-org.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"\n\u003cp align=\"center\" style=\"color: #444\"\u003e\n  \u003ch1 align=\"center\"\u003e🌌 Cosmos\u003c/h1\u003e\n\u003c/p\u003e\n\u003cp align=\"center\" style=\"font-size: 1.2rem;\"\u003eGPU-accelerated Force Graph\u003c/p\u003e\n\n**Cosmos** is a WebGL Force Graph layout algorithm and rendering engine. All the computations and drawing are happening on the GPU in fragment and vertex shaders, avoiding expensive memory operations.\n\nIt enables real-time simulation of network graphs consisting of hundreds of thousands of points and links on modern hardware.\n\n\u003cvideo src=\"https://user-images.githubusercontent.com/755708/173392407-9b05cbb6-d39e-4c2c-ab41-50900cfda823.mp4\" autoplay controls alt=\"Demo of Cosmos GPU-accelerated Force Graph\"\u003e\n\u003c/video\u003e\n\n[📺 Comparison with other libraries](https://www.youtube.com/watch?v=HWk78hP8aEE)\n\n[🎮 Try Cosmos on StackBlitz](https://stackblitz.com/edit/how-to-use-cosmos?file=src%2Fmain.ts)\n\n---\n\n### Quick Start\n\nInstall the package:\n\n```bash\nnpm install @cosmograph/cosmos\n```\n\nGet the data, [configure](../?path=/docs/configuration--docs) the graph and run the simulation:\n\n```javascript\nimport { Graph } from '@cosmograph/cosmos'\n\nconst div = document.querySelector('div')\nconst config = {\n  spaceSize: 4096,\n  simulationFriction: 0.1, // keeps the graph inert\n  simulationGravity: 0, // disables gravity\n  simulationRepulsion: 0.5, // increases repulsion between points\n  curvedLinks: true, // curved links\n  fitViewDelay: 1000, // wait 1 second before fitting the view\n  fitViewPadding: 0.3, // centers the graph width padding of ~30% of screen\n  disableRescalePositions: false, // rescale positions\n  enableDrag: true, // enable dragging points\n  onClick: pointIndex =\u003e { console.log('Clicked point index: ', pointIndex) },\n  /* ... */\n}\n\nconst graph = new Graph(div, config)\n\n// Points: [x1, y1, x2, y2, x3, y3]\nconst pointPositions = new Float32Array([\n  0.0, 0.0,    // Point 1 at (0,0)\n  1.0, 0.0,    // Point 2 at (1,0)\n  0.5, 1.0,    // Point 3 at (0.5,1)\n]);\n\ngraph.setPointPositions(pointPositions)\n\n// Links: [sourceIndex1, targetIndex1, sourceIndex2, targetIndex2]\nconst links = new Float32Array([\n  0, 1,    // Link from point 0 to point 1\n  1, 2,    // Link from point 1 to point 2\n  2, 0,    // Link from point 2 to point 0\n]);\n\ngraph.setLinks(links)\n\ngraph.render()\n```\n\n---\n\n### What's New in v2.0?\n\nCosmos v2.0 introduces significant improvements in performance and data handling:\n\n- Enhanced data structures with WebGL-compatible formats.\n- Methods like `setPointPositions` and `setLinks` replace `setData` for improved efficiency.\n- Direct control over point and link attributes via Float32Array (e.g., colors, sizes, widths).\n- Updated event handling based on indices instead of objects.\n- New Clustering Feature (`setPointClusters`, `setClusterPositions` and `setPointClusterStrength`).\n- Ability to drag points.\n\nCheck the [Migration Guide](./cosmos-2-0-migration-notes.md) for details.\n\n---\n\n### Examples\n\n- [Basic Set-Up](https://cosmograph-org.github.io/cosmos/?path=/story/examples-beginners--basic-set-up)\n\n---\n\n### Showcase (via [cosmograph.app](https://cosmograph.app))\n\n- [Silk Road Case: Bitcoin Transactions](https://cosmograph.app/run/?data=https://cosmograph.app/data/184R7cFG-4lv.csv) ([📄 Read more](https://medium.com/@cosmograph.app/visualizing-darknet-6846dec7f1d7))\n- [ABACUS Shell](https://cosmograph.app/run/?data=https://cosmograph.app/data/ABACUS_shell_hd.csv) ([source](http://sparse.tamu.edu/Puri/ABACUS_shell_hd))\n- [The MathWorks, Inc: symmetric positive definite matrix](https://cosmograph.app/run/?data=https://cosmograph.app/data/Kuu.csv) ([source](https://sparse.tamu.edu/MathWorks/Kuu))\n\n---\n\n### Known Issues\n\n- Starting from version 15.4, iOS has stopped supporting the key WebGL extension powering our Many-Body force implementation (`EXT_float_blend`). We're investigating this issue and exploring solutions.\n\n---\n\n### Documentation\n- 🧑‍💻 [Quick Start](https://cosmograph-org.github.io/cosmos/?path=/docs/welcome-to-cosmos--docs)\n- 🛠 [Configuration](https://cosmograph-org.github.io/cosmos/?path=/docs/configuration--docs)\n- ⚙️ [API Reference](https://cosmograph-org.github.io/cosmos/?path=/docs/api-reference--docs)\n- 🚀 [Migration Guide](./cosmos-2-0-migration-notes.md)\n\n---\n\n### License\n\n**MIT**\n\n---\n\n### Contact\n\n[📩 hi@cosmograph.app](mailto:hi@cosmograph.app)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcosmograph-org%2Fcosmos","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcosmograph-org%2Fcosmos","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcosmograph-org%2Fcosmos/lists"}