{"id":18595454,"url":"https://github.com/ericjang/graphjs","last_synced_at":"2025-04-10T16:31:27.826Z","repository":{"id":5501655,"uuid":"6701003","full_name":"ericjang/graphjs","owner":"ericjang","description":"Mathematical Graph representation in JavaScript","archived":false,"fork":false,"pushed_at":"2014-03-23T13:45:35.000Z","size":253,"stargazers_count":6,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-25T00:42:42.557Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"CoffeeScript","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/ericjang.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}},"created_at":"2012-11-15T07:25:47.000Z","updated_at":"2023-06-29T07:01:43.000Z","dependencies_parsed_at":"2022-07-15T20:46:52.272Z","dependency_job_id":null,"html_url":"https://github.com/ericjang/graphjs","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericjang%2Fgraphjs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericjang%2Fgraphjs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericjang%2Fgraphjs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericjang%2Fgraphjs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ericjang","download_url":"https://codeload.github.com/ericjang/graphjs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248252691,"owners_count":21072701,"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-11-07T01:19:47.005Z","updated_at":"2025-04-10T16:31:25.182Z","avatar_url":"https://github.com/ericjang.png","language":"CoffeeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cimg src=\"images/GraphJS-logo.svg\" alt=\"GraphJS logo\" style=\"display:block; margin-left:auto; margin-right:auto\"\u003e\n\nGraphJS is a framework for representing mathematical graphs in JavaScript. It is more or less a direct port of the popular \u003ca href='http://networkx.lanl.gov'\u003eNetworkX\u003c/a\u003e Python library. Such JavaScript, very math, etc. etc.\n\n## Features\n\n- Nodes can represent anything (e.g. text, atoms, people)\n- Edges can hold arbitrary data (e.g. weights, distances)\n- Standard graph algorithms included\n- API is similar to NetworkX, with support for core classes and algorithms.\n- Works in Node.JS and Browser\n- Open-source BSD License\n- Synchronous/Asynchronous APIs\n\n\n## Installation\n\nThe entire library ships in a single file. You can include this directly in Node.JS or within the Browser.\n\nnode.js:\n\n```\nnpm install GraphJS\nGraphJS = require('GraphJS'); // or require('./graph.min.js')\n```\n\nbrowser:\n```html\n\u003cscript src='graph.min.js'\u003e\u003c/script\u003e\n\u003cscript\u003e\n\tvar g = GraphJS.Graph();\n\u003c/script\u003e\n```\nNo external dependencies are required.\n\n## Building GraphJS from Source\n\nNote: this feature is not quite ready yet.\n\nThe source is written in CoffeeScript. If you only need a few classes/algorithms from GraphJS, you can build GraphJS to only include the features you want. \n\nTo compile for the browser, install \u003ca href=\"http://browserify.org/\"\u003ebrowserify\u003c/a\u003e and \u003ca href=\"https://github.com/jnordberg/coffeeify\"\u003ecoffeeify\u003c/a\u003e and build using the following:\n\n```\n$ browserify -t coffeeify --extension=\".coffee\" index.coffee \u003e graph.min.js\n```\n\n### GraphJS.structures\nChoose which type of graph is best suited for your application:\n\n- `Graph`: undirected graph with self-loops (basic)\n- `DiGraph`: directed graph with self-loops\n- `MultiGraph`: undirected graphs with self loops and parallel edges\n- `MultiDiGraph`: directed graph with self loops and parallel edges\n\n\u003ctable\u003e\n\t\u003ctr\u003e\n\t\t\u003ctd\u003e\n\t\t\t\u003cimg src=\"http://upload.wikimedia.org/wikipedia/commons/thumb/5/5b/6n-graf.svg/250px-6n-graf.svg.png\"\u003e\n\t\t\t\u003cp\u003eThis is a graph\u003c/p\u003e\n\t\t\u003c/td\u003e\n\t\t\u003ctd\u003e\n\t\t\t\u003cimg src=\"http://upload.wikimedia.org/wikipedia/commons/thumb/a/a7/Multigraph.svg/125px-Multigraph.svg.png\"\u003e\n\t\t\t\u003cp\u003eThis is a Multigraph\u003c/p\u003e\n\t\t\u003c/td\u003e\n\t\u003c/tr\u003e\n\n\u003c/table\u003e\n\n### Inheriting Graphs\nModeling a social network is easy:\n\n```JavaScript\n\nvar SocialNetworkClass = function() {\n\t// redefining nodes as people and edges as relationships\n\tthis.people = this.node;\n\tthis.relationships = this.adj;\t\n}\nSocialNetwork.prototype = new GraphJS.classes.Graph();\nSocialNetwork.prototype.constructor = SocialNetwork;\nvar exampleNetwork = new SocialNetwork();\n\n```\n\n## GraphJS-NetworkX Compatibility Notes\n\nTODO\n\n## How You Can Help\n\nGraphJS is developed in my spare time, and usually out of necessity for a graph algorithm or two in some other project of mine. \nYou can support this project in several ways:\n\n1. File issues, bug reports, feature requests.\n2. Contribute Code! \n\t- Source code is written in CoffeeScript, which is syntactically similar to Python.\n\t- Read \u003ca href='http://networkx.lanl.gov'\u003eNetworkX documentation\u003c/a\u003e to understand GraphJS's desired architecture. \n\t- Implement a feature or two and submit a pull request.\n3. You can buy me a donut! Here is a bitcoin donation link:\n\u003cscript src=\"http://coinwidget.com/widget/coin.js\"\u003e\u003c/script\u003e\n\u003cscript\u003e\nCoinWidgetCom.go({\n\twallet_address: \"1MLX2kMhTSRiq3Uz7R2JsECreuQEmofQy6\"\n\t, currency: \"bitcoin\"\n\t, counter: \"hide\"\n\t, alignment: \"bl\"\n\t, qrcode: true\n\t, auto_show: false\n\t, lbl_button: \"Donate\"\n\t, lbl_address: \"My Bitcoin Address:\"\n\t, lbl_count: \"donations\"\n\t, lbl_amount: \"BTC\"\n});\n\u003c/script\u003e","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fericjang%2Fgraphjs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fericjang%2Fgraphjs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fericjang%2Fgraphjs/lists"}