{"id":13554334,"url":"https://github.com/patrickfuller/jgraph","last_synced_at":"2026-01-03T14:24:38.473Z","repository":{"id":6829462,"uuid":"8077728","full_name":"patrickfuller/jgraph","owner":"patrickfuller","description":"An embeddable webGL graph visualization library.","archived":false,"fork":false,"pushed_at":"2018-06-10T08:50:44.000Z","size":1760,"stargazers_count":136,"open_issues_count":8,"forks_count":31,"subscribers_count":12,"default_branch":"master","last_synced_at":"2025-03-16T00:14:13.577Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://patrickfuller.github.io/jgraph","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/patrickfuller.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-02-07T17:29:19.000Z","updated_at":"2025-02-23T12:13:29.000Z","dependencies_parsed_at":"2022-09-18T11:53:10.752Z","dependency_job_id":null,"html_url":"https://github.com/patrickfuller/jgraph","commit_stats":null,"previous_names":["patrickfuller/igraph"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patrickfuller%2Fjgraph","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patrickfuller%2Fjgraph/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patrickfuller%2Fjgraph/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patrickfuller%2Fjgraph/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/patrickfuller","download_url":"https://codeload.github.com/patrickfuller/jgraph/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246722567,"owners_count":20823313,"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-08-01T12:02:45.295Z","updated_at":"2026-01-03T14:24:38.406Z","avatar_url":"https://github.com/patrickfuller.png","language":"JavaScript","funding_links":[],"categories":["JavaScript","others"],"sub_categories":[],"readme":"jgraph\n======\n\nAn embeddable webGL graph visualization library.\nhttp://patrickfuller.github.io/jgraph/\n\nExamples\n========\n\n * [IPython notebook](http://patrickfuller.github.io/jgraph/examples/ipython.html)\n * [les misérables](http://patrickfuller.github.io/jgraph/examples/miserables.html)\n * [github connections](http://patrickfuller.github.io/jgraph/examples/github.html)\n\nIPython\n=======\n\nThe IPython notebook is an open-source tool poised to replace MATLAB in many\napplications. As a scientist of sorts, I'm all about it. Therefore, I made\nhandles to use jgraph with the notebook. Install through pip:\n\n```\npip install jgraph\n```\n\nOpen a new notebook and test the setup by typing:\n\n```python\nimport jgraph\njgraph.draw([(1, 2), (2, 3), (3, 4), (4, 1), (4, 5), (5, 2)])\n```\n\ninto a notebook cell. You should get a paddlewheel graph as an output. You can\nuse this in conjunction with other code for educational purposes (try generating\na red-black tree!). There are three commands and some optional parameters to\ncheck out. Read the docstrings and check out the [associated\nexample](http://patrickfuller.github.io/jgraph/examples/ipython.html) for more.\n\nJavascript\n==========\n\nYou can install through [npm](https://www.npmjs.com/):\n\n```\nnpm install jgraph\n```\n\nOnce installed, you can use with:\n\n```javascript\njgraph.create('my-selector');\njgraph.draw(myGraph);\n```\n\nwhere `'my-selector'` is where you want to place jgraph, and `myGraph` is a\njavascript object. See below for more on the object structure, or just check out\nthe included example. The `jgraph.create()` method takes a few optional\nparameters, specifying the sizes and colors of nodes, as well as force-directed\noptimization.\n\n```javascript\noptions = {\n    directed: true, // Toggles edge arrows\n    nodeSize: 2.0, // Default node size\n    edgeSize: 0.25, // Edge connection diameter\n    arrowSize: 1.0, // If drawn, edge arrow size\n    defaultNodeColor: 0xaaaaaa, // Color for nodes without a \"color\" property\n    defaultEdgeColor: 0x777777, // Color for edges without a \"color\" property\n    shader: \"toon\", // three.js shader to use, can be \"toon\", \"basic\", \"phong\", or \"lambert\"\n    runOptimization: true // Runs a force-directed-layout algorithm on the graph\n};\n```\n\nGraph Data Format\n=================\n\njgraph takes input graph data structures as plain objects. Here's the most\nboring graph in the world:\n\n```javascript\n{\n    nodes: {\n        jane: { },\n        bob: { },\n        mike: { },\n        sally: { }\n    },\n    edges: [\n        { source: \"jane\", target: \"bob\" },\n        { source: \"bob\", target: \"mike\" },\n        { source: \"mike\", target: \"sally\" }\n    ]\n}\n```\n\nNodes require no information outside of their keys. However, there are useful\noptional parameters that can be specified.\n\n```javascript\n{\n    color: 0xffffff, // Color for this node\n    size: 1.0, // Scaling factor for this node's size\n    location: [0.0, 0.0, 0.0] // Starting location of node. Useful for pre-rendering.\n}\n```\n\nBy default, the algorithm runs a force-directed layout on the graph. When\nenabled, the \"location\" field is optional. However, for larger graphs, you will\nwant to disable this feature and pre-render the locations. Use the associated\nPython library (`jgraph.generate`) to do so.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpatrickfuller%2Fjgraph","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpatrickfuller%2Fjgraph","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpatrickfuller%2Fjgraph/lists"}