{"id":13553762,"url":"https://github.com/n-yousefi/Arg-Graph","last_synced_at":"2025-04-03T05:31:29.810Z","repository":{"id":133177357,"uuid":"127751975","full_name":"n-yousefi/Arg-Graph","owner":"n-yousefi","description":"a simple JQuery library to create or edit directed graphs.","archived":false,"fork":false,"pushed_at":"2022-09-27T10:11:55.000Z","size":80,"stargazers_count":14,"open_issues_count":0,"forks_count":5,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-29T09:21:54.193Z","etag":null,"topics":["diagram","directed-graphs","flowchart","free","graph","html","javascript","jquery","svg"],"latest_commit_sha":null,"homepage":"","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/n-yousefi.png","metadata":{"files":{"readme":"README.md","changelog":"History/arg-graph-1.0.0/Demo/Example1.html","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2018-04-02T12:16:35.000Z","updated_at":"2022-09-28T07:16:44.000Z","dependencies_parsed_at":null,"dependency_job_id":"114ee905-b499-4cbd-a29b-897472e52b56","html_url":"https://github.com/n-yousefi/Arg-Graph","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/n-yousefi%2FArg-Graph","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/n-yousefi%2FArg-Graph/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/n-yousefi%2FArg-Graph/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/n-yousefi%2FArg-Graph/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/n-yousefi","download_url":"https://codeload.github.com/n-yousefi/Arg-Graph/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246944377,"owners_count":20858773,"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":["diagram","directed-graphs","flowchart","free","graph","html","javascript","jquery","svg"],"created_at":"2024-08-01T12:02:32.753Z","updated_at":"2025-04-03T05:31:26.268Z","avatar_url":"https://github.com/n-yousefi.png","language":"JavaScript","funding_links":[],"categories":["JavaScript","jquery"],"sub_categories":[],"readme":"# Note: This repository is no longer in active development or maintenance.\n# We highly encourage you to consider [connect-it](https://github.com/n-yousefi/connect-it) instead.\n\n\n## Arg-Graph\n\n[Arg](https://en.wikipedia.org/wiki/Arg_e_Bam)-Graph is a simple free library for creating dynamic Directed Graph using JQuery which enables you to draw SVG based connectors (lines, arrows) between DOM nodes via drag and drop.\n\n![Directed Javascript graph](https://github.com/n-yousefi/Arg-Graph/blob/master/demo.png)\n## Examples/Demos\nThe best way to become acquainted with the library is to see [Demos](https://n-yousefi.github.io/Arg-Graph/arg-graph-1.1/Example1.html)\n\n## How it works\n### Creating digraph:\nYou can create a digraph (directed graph) easily by calling the \"ArgGraph\" function.\n```html\n\u003cdiv class=\"arg-Graph\"\u003e\n\u003c/div\u003e\n```\n```javascript\nvar argGraph=$('.arg-Graph').ArgGraph();\n```\n### Adding new nodes:\n#### Append html code\nYou can append new items to the container div, as html code. like this:\n```html\n\u003cdiv class=\"arg-Graph\"\u003e\n     \u003cdiv id=\"item1\" class=\"arg-Graph_item\" data-neighbors=\"item2,item3\" style=\"left: 259px; top: 22px;\"\u003e\n        Title\n        \u003cspan class=\"arg-Graph_connector-handler\"\u003e\u003c/span\u003e\n        \u003cspan class=\"arg-Graph_delete-item\"\u003e\u003c/span\u003e\n    \u003c/div\u003e\n    \u003cdiv id=\"item2\" class=\"arg-Graph_item\" style=\"left: 159px; top: 212px;\"\u003e\n        Title\n        \u003cspan class=\"arg-Graph_connector-handler\"\u003e\u003c/span\u003e\n        \u003cspan class=\"arg-Graph_delete-item\"\u003e\u003c/span\u003e\n    \u003c/div\u003e\n\u003c/div\u003e\n```\nNow you must refresh the graph by calling 'refresh' function.\n```javascript\nargGraph.refresh()\n```\n#### import new item/s\nCreating a JavaScript object and import that to the graph:\n```javascript\nnewItem = {\n        \"id\": \"item1\",\n        \"text\": \"Start\",\n        \"position\": {\n            \"left\": \"259px\",\n            \"top\": \"22px\"\n        },\n        \"neighbors\": [\n            \"item2\",\n            \"item3\"\n        ]\n    }\nargGraph.import(newItem)\n```\nNote: You can append multiple items as array object using \"import\" function.\n#### import JSON object\nYou can import this object as JSON format by calling \"importJson\" function.\n```javascript\nvar json=JSON.stringify(newItem,null,4);\nargGraph.importJson(json);\n```\n\n### Output\nBy calling \"export\"/\"exportJson\" function you can get a JavaScript/JSON object similar to the import object format:\n```javascript\nvar json = argGraph.exportJson();\n\nresult:\n[\n    {\n        \"id\": \"item7\",\n        \"text\": \"Test\",\n        \"position\": {\n            \"left\": \"531.328px\",\n            \"top\": \"406px\"\n        },\n        \"neighbors\": [\n            \"item8\"\n        ]\n    },\n    {\n        \"id\": \"item8\",\n        \"text\": \"Deployment\",\n        \"position\": {\n            \"left\": \"373.328px\",\n            \"top\": \"463px\"\n        },\n        \"neighbors\": [\n            \"item9\"\n        ]\n    },\n    {\n        \"id\": \"item9\",\n        \"text\": \"Test\",\n        \"position\": {\n            \"left\": \"239.328px\",\n            \"top\": \"515px\"\n        },\n        \"neighbors\": \"\"\n    }\n]\n```\n\n\n## Author\nNaser Yousefi\n     \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fn-yousefi%2FArg-Graph","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fn-yousefi%2FArg-Graph","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fn-yousefi%2FArg-Graph/lists"}