{"id":16979765,"url":"https://github.com/williamluke4/naph","last_synced_at":"2025-03-22T15:30:32.743Z","repository":{"id":57308082,"uuid":"227780385","full_name":"williamluke4/Naph","owner":"williamluke4","description":"React Component for rendering Node Graphs.","archived":false,"fork":false,"pushed_at":"2020-08-18T15:19:16.000Z","size":4528,"stargazers_count":23,"open_issues_count":1,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-14T18:54:44.424Z","etag":null,"topics":["nodegraph","react","typescript"],"latest_commit_sha":null,"homepage":"https://naph-4ytx8vosc.now.sh/","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/williamluke4.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-12-13T07:20:44.000Z","updated_at":"2023-05-18T19:14:27.000Z","dependencies_parsed_at":"2022-09-12T11:44:27.055Z","dependency_job_id":null,"html_url":"https://github.com/williamluke4/Naph","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/williamluke4%2FNaph","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/williamluke4%2FNaph/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/williamluke4%2FNaph/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/williamluke4%2FNaph/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/williamluke4","download_url":"https://codeload.github.com/williamluke4/Naph/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244978335,"owners_count":20541836,"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":["nodegraph","react","typescript"],"created_at":"2024-10-14T01:47:00.078Z","updated_at":"2025-03-22T15:30:32.032Z","avatar_url":"https://github.com/williamluke4.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Naph\n\n## Experimental - _Use at your own peril!_\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"./Naph.png\"/\u003e\n\u003c/p\u003e\n\n[![npm version](https://badge.fury.io/js/naph.svg)](https://badge.fury.io/js/naph)\n[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/williamluke4/Naph)\n=======\n\n\n## Install\n\n#### NPM:\n\n```sh\nnpm install --save naph\n```\n\n## Usage\n\n```jsx\nimport NaphGraph, { NaphProvider } from \"naph\";\n\nconst example = {\n  nodes: [\n    {\n      nid: 1,\n      title: \"User\",\n      x: 50,\n      y: 50,\n      fields: [\n        { name: \"id\", type: \"@id\" },\n        { name: \"firstname\", type: \"String\" },\n        { name: \"surname\", type: \"String\" },\n        { name: \"posts\", type: \"Post[]\" },\n        { name: \"comments\", type: \"Comment[ ]\" }\n      ]\n    },\n    {\n      nid: 3,\n      title: \"Comment\",\n      x: 500,\n      y: 300,\n      fields: [\n        { name: \"id\", type: \"@id\" },\n        { name: \"post\", type: \"Post\" },\n        { name: \"user\", type: \"User\" },\n        { name: \"data\", type: \"String\" }\n      ]\n    },\n    {\n      nid: 2,\n      title: \"Post\",\n      x: 400,\n      y: 100,\n      fields: [\n        { name: \"id\", type: \"@id\" },\n        { name: \"user\", type: \"User\" },\n        { name: \"comments\", type: \"Comment[]\" },\n        { name: \"data\", type: \"String\" }\n      ]\n    }\n  ],\n  connections: [\n    {\n      from_node_id: 1,\n      from_field_name: \"posts\",\n      to_node_id: 2,\n      to_field_name: \"user\"\n    },\n    {\n      from_node_id: 1,\n      from_field_name: \"comments\",\n      to_node_id: 3,\n      to_field_name: \"user\"\n    },\n    {\n      from_node_id: 2,\n      from_field_name: \"comments\",\n      to_node_id: 3,\n      to_field_name: \"post\"\n    }\n  ]\n};\n\nexport const Naph = () =\u003e (\n  \u003cNaphProvider data={example}\u003e\n    \u003cNaphGraph\n      onNodeMove={(nid, pos) =\u003e onNodeMove(nid, pos)}\n      onNodeStartMove={nid =\u003e onNodeStartMove(nid)}\n      onNewConnector={(n1, o, n2, i) =\u003e onNewConnector(n1, o, n2, i)}\n      onRemoveConnector={connector =\u003e onRemoveConnector(connector)}\n      onNodeSelect={nid =\u003e {\n        handleNodeSelect(nid);\n      }}\n      onNodeDeselect={nid =\u003e {\n        handleNodeDeselect(nid);\n      }}\n    /\u003e\n  \u003c/NaphProvider\u003e\n);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwilliamluke4%2Fnaph","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwilliamluke4%2Fnaph","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwilliamluke4%2Fnaph/lists"}