{"id":21973865,"url":"https://github.com/holybasil/neo4jforcemap","last_synced_at":"2026-01-20T11:07:07.913Z","repository":{"id":44071298,"uuid":"208727804","full_name":"Holybasil/Neo4jForceMap","owner":"Holybasil","description":"realize Neo4j map with d3-force.","archived":false,"fork":false,"pushed_at":"2023-01-04T10:40:54.000Z","size":417,"stargazers_count":2,"open_issues_count":15,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-10T01:56:39.017Z","etag":null,"topics":["d3-force","neo4j"],"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/Holybasil.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-09-16T06:38:27.000Z","updated_at":"2025-02-08T14:05:09.000Z","dependencies_parsed_at":"2023-02-02T09:00:42.011Z","dependency_job_id":null,"html_url":"https://github.com/Holybasil/Neo4jForceMap","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Holybasil/Neo4jForceMap","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Holybasil%2FNeo4jForceMap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Holybasil%2FNeo4jForceMap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Holybasil%2FNeo4jForceMap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Holybasil%2FNeo4jForceMap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Holybasil","download_url":"https://codeload.github.com/Holybasil/Neo4jForceMap/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Holybasil%2FNeo4jForceMap/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28602175,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-20T10:46:13.255Z","status":"ssl_error","status_checked_at":"2026-01-20T10:42:51.865Z","response_time":117,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["d3-force","neo4j"],"created_at":"2024-11-29T15:35:16.188Z","updated_at":"2026-01-20T11:07:07.898Z","avatar_url":"https://github.com/Holybasil.png","language":"JavaScript","readme":"# Neo4jForceMap\n\n## 介绍\n基于d3-force，将Neo4j数据可视化。\n\n## 效果\n![image.png](https://i.loli.net/2019/09/17/ktR8QpMEgmsObiq.png)\n\n## 特点\n* 不同类型的节点有不同的颜色\n* 节点和关系线均有选中样式\n* 节点拖拽固定\n* 两个节点之前的多关系\n* 平移和缩放\n\n## 使用文档\n\n### 安装\n```sh\nnpm install holy-relationship-map --save\n```\n\n### 使用\n```js\nimport HolyRelationshipMap from \"holy-relationship-map \"\n\nconst graph = new HolyRelationshipMap(\".forceMap\", options)\n```\n\n### 文档\n\n**options**\n\n| 参数 | 类型 | 描述 |默认值|\n| --------- | ---- | ----------- |------- |\n| nodeRadius | number | 节点的半径 |16|\n| arrowSize | number | 关系指向箭头的大小 |10|\n| nodeKey | string | 节点的key，关系中的source和target值对应节点数据中的哪个key的值 |id|\n| nodeTextKey | string | 节点的文本key |label|\n| nodeTextSize | number | 节点文本的字体大小 |14|\n| nodeTextColor | string | 节点文本的颜色 |#333|\n| linkKey | string | 关系的key |id|\n| linkTextKey | string | 关系文本key，同时默认为渲染文本 |type|\n| linkTextMap | string | 关系文本的映射表，即linkTextMap[linkTextKey]才是需要渲染的文本 |无|\n| linkTextSize | number | 关系文本字体大小 |12|\n| linkTextColor | string | 关系文本的颜色 |#333|\n| linkColor | string | 关系线的颜色 |#a5abb6|\n| linkHighlightColor | string | 关系高亮时文本key |#ff9300|\n| arrowSize | number | 关系指向箭头的大小 |10|\n| data | object | 图谱数据，拥有nodes数组和links数组，必填。 |无|\n| onNodeClick | function | 节点左键点击事件。 |无|\n| onNodeDBClick | function | 节点双击事件。 |无|\n| onNodeMouseenter | function | 节点鼠标移入事件。 |无|\n| onNodeMouseleave | function | 节点鼠标移出事件。 |无|\n| onLinkClick | function | 关系连线点击事件。 |无|\n\n**API**\n| 方法 | 参数 | 描述 |\n| ----- | ----- | ---- | \n| updateGraph | object | 更新节点和关系 | \n\n\n## 注意\n* 不同类型的节点是通过node对象上的type:number决定的，现在仅支持最多六种颜色（即type的取值范围为[1,6]），后续会增加更多配色/类型。\n* 关系的唯一标识符默认为id。\n\n## 例子\n```html\n\u003cdiv class=\"forceMap\"\u003e\u003c/div\u003e\n```\n```js\nconst data = {\n    nodes: [\n        {\n            id: 1,\n            properties: {},\n            type: 1,\n            label: \"魏无羡\"\n        },\n        {\n            id: 2,\n            properties: {},\n            type: 1,\n            label: \"江澄\"\n        },\n        ...\n    ]，\n    links:[\n        {\n            id: 1,\n            source: 1,\n            target: 2,\n            type: \"对不起我食言了\",\n            properties: {}\n        },\n        {\n            id: 2,\n            source: 2,\n            target: 1,\n            type: \"我做你的家主\",\n            properties: {}\n        },\n        ...\n    ]\n}\n```\n```js\nconst svg = new HolyNeo4j(\".forceMap\", {\n    data,\n    onNodeClick: d =\u003e {\n        if (!isPanelShow) {\n            isPanelShow = true;\n        }\n        property = { ...d.properties };\n    },\n    // onNodeDBClick: d =\u003e {\n    //   getMoreData();\n    // },\n    onLinkClick: d =\u003e {\n        if (!isPanelShow) {\n           isPanelShow = true;\n        }\n        property = { ...d.properties };\n    }\n});\n```\n\n\n## TODO\n- [x] 动态更新节点和关系\n- [x] 关系标识文字保持从左到右\n- [ ] 节点支持图片\n- [ ] 自定义节点不同类型的颜色\n- [ ] 节点操作工具栏\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fholybasil%2Fneo4jforcemap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fholybasil%2Fneo4jforcemap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fholybasil%2Fneo4jforcemap/lists"}