{"id":28047837,"url":"https://github.com/cosmosgl/graph","last_synced_at":"2025-05-11T21:04:24.834Z","repository":{"id":37235063,"uuid":"481427289","full_name":"cosmosgl/graph","owner":"cosmosgl","description":"GPU-accelerated force graph layout and rendering","archived":false,"fork":false,"pushed_at":"2025-05-07T11:04:49.000Z","size":1330,"stargazers_count":933,"open_issues_count":12,"forks_count":59,"subscribers_count":10,"default_branch":"main","last_synced_at":"2025-05-07T11:37:07.125Z","etag":null,"topics":["embeddings","force","graph","network","simulation","visualization","webgl"],"latest_commit_sha":null,"homepage":"https://cosmosgl.github.io/graph","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/cosmosgl.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":null,"code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":".github/SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-04-14T01:30:14.000Z","updated_at":"2025-05-05T07:40:15.000Z","dependencies_parsed_at":"2023-09-29T07:05:42.102Z","dependency_job_id":"d089c4e7-9f7c-4c81-ba1d-2b8f4636c5d0","html_url":"https://github.com/cosmosgl/graph","commit_stats":{"total_commits":73,"total_committers":5,"mean_commits":14.6,"dds":"0.31506849315068497","last_synced_commit":"cd73a82ddafddf820eeff3c61d2c3532169f140c"},"previous_names":["cosmosgl/cosmos","cosmosgl/graph"],"tags_count":21,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cosmosgl%2Fgraph","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cosmosgl%2Fgraph/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cosmosgl%2Fgraph/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cosmosgl%2Fgraph/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cosmosgl","download_url":"https://codeload.github.com/cosmosgl/graph/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253633114,"owners_count":21939389,"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":["embeddings","force","graph","network","simulation","visualization","webgl"],"created_at":"2025-05-11T21:02:16.845Z","updated_at":"2025-05-11T21:04:24.720Z","avatar_url":"https://github.com/cosmosgl.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"\n\u003cp align=\"center\" style=\"color: #444\"\u003e\n  \u003ch1 align=\"center\"\u003e🌌 cosmos.gl\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.gl** 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. It enables real-time simulation of network graphs consisting of hundreds of thousands of points and links on modern hardware.\n\nThis engine powers 🪐 [Cosmograph](http://cosmograph.app) — a toolset for exploring complex networks and AI embeddings.\n\n\u003cvideo src=\"https://user-images.githubusercontent.com/755708/173392407-9b05cbb6-d39e-4c2c-ab41-50900cfda823.mp4\" autoplay controls alt=\"Demo of cosmos.gl GPU-accelerated Force Graph\"\u003e\n\u003c/video\u003e\n\n[📺 Comparison with other libraries](https://www.youtube.com/watch?v=HWk78hP8aEE)\n\n[🎮 Check out our storybook for examples](https://cosmosgl.github.io/cosmos/)\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.gl 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://cosmosgl.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://cosmosgl.github.io/cosmos/?path=/docs/welcome-to-cosmos--docs)\n- 🛠 [Configuration](https://cosmosgl.github.io/cosmos/?path=/docs/configuration--docs)\n- ⚙️ [API Reference](https://cosmosgl.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[GitHub Discussions](https://github.com/orgs/cosmosgl/discussions)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcosmosgl%2Fgraph","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcosmosgl%2Fgraph","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcosmosgl%2Fgraph/lists"}