1.0.1 • Published 2 years ago
tractstack-neo4jd3 v1.0.1
neo4jd3.js
Neo4j graph visualization using D3.js.
!Forked from neo3jd3.js
Features
- Compaptible with the Neo4j data format and the D3.js data format.
- Force simulation.
- Compatible with D3.js v7.
Documentation
var neo4jd3 = new Neo4jd3('.selector', options);
Options
Parameter | Type | Description |
---|---|---|
neo4jData | object | Graph data in Neo4j data format. |
neo4jDataUrl | string | URL of the endpoint that serves the graph data in Neo4j data format. |
JavaScript API
Function | Description |
---|---|
neo4jDataToD3Data(data) | Converts data from Neo4j data format to D3.js data format. |
size() | Returns the number of nodes and relationships.Example:{ nodes: 25, relationships: 50 } |
| version() | Returns the version of neo4jd3.js.Example: '0.0.1'
|
Documentation
D3.js data format
{
"nodes": [
{
"id": "1",
"labels": ["User"],
"properties": {
"userId": "eisman"
}
},
{
"id": "8",
"labels": ["Project"],
"properties": {
"name": "neo4jd3",
"title": "neo4jd3.js",
"description": "Neo4j graph visualization using D3.js.",
"url": "https://eisman.github.io/neo4jd3"
}
}
],
"relationships": [
{
"id": "7",
"type": "DEVELOPES",
"startNode": "1",
"endNode": "8",
"properties": {
"from": 1470002400000
},
"source": "1",
"target": "8",
"linknum": 1
}
]
}
Neo4j data format
{
"results": [
{
"columns": ["user", "entity"],
"data": [
{
"graph": {
"nodes": [
{
"id": "1",
"labels": ["User"],
"properties": {
"userId": "eisman"
}
},
{
"id": "8",
"labels": ["Project"],
"properties": {
"name": "neo4jd3",
"title": "neo4jd3.js",
"description": "Neo4j graph visualization using D3.js.",
"url": "https://eisman.github.io/neo4jd3"
}
}
],
"relationships": [
{
"id": "7",
"type": "DEVELOPES",
"startNode": "1",
"endNode": "8",
"properties": {
"from": 1470002400000
}
}
]
}
}
]
}
],
"errors": []
}
1.0.1
2 years ago