{"_id":"@elie222/neo4jd3","_rev":"1-c1039cb3793fa2dde8a97d3ada791cf3","name":"@elie222/neo4jd3","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@elie222/neo4jd3","version":"0.1.0","description":"Neo4jD3","main":"dist/neo4jd3.js","bugs":{"url":"https://github.com/elie222/neo4jd3/issues"},"homepage":"https://github.com/elie222/neo4jd3","directories":{"test":"test"},"scripts":{"start":"gulp","test":"gulp test"},"keywords":["neo4j","d3.js","graph visualization"],"author":{"name":"Elie Steinbock","email":"elie@dappworks.co","url":"https://github.com/elie222"},"repository":{"type":"git","url":"git+https://github.com/elie222/neo4jd3.git"},"license":"MIT","dependencies":{"d3":"^4.2.1"},"devDependencies":{"angular-mocks":"^1.5.7","bootstrap":"^3.3.7","browserify":"^13.0.1","browserify-shim":"^3.8.12","chai":"^3.5.0","del":"^2.2.1","ecstatic":"^2.1.0","font-awesome":"^4.6.3","gulp":"^3.9.1","gulp-autoprefixer":"^3.1.0","gulp-cache":"^0.4.5","gulp-concat":"^2.6.0","gulp-connect":"^5.0.0","gulp-cssnano":"^2.1.2","gulp-derequire":"^2.1.0","gulp-embedlr":"^0.5.2","gulp-if":"^2.0.1","gulp-imagemin":"^3.0.2","gulp-jshint":"^2.0.1","gulp-livereload":"^3.8.1","gulp-mocha":"^2.2.0","gulp-notify":"^2.2.0","gulp-plumber":"^1.1.0","gulp-rename":"^1.2.2","gulp-ruby-sass":"^2.1.0","gulp-uglify":"^2.0.0","gulp-uncache":"^0.4.0-beta1","gulp-util":"^3.0.7","http-server":"^0.9.0","jshint":"^2.9.3","karma":"^0.13.22","karma-bamboo-reporter":"^0.1.2","karma-browserify":"^5.0.5","karma-chai-plugins":"^0.7.0","karma-coverage":"^1.0.0","karma-mocha":"^1.0.1","karma-mocha-reporter":"^2.0.4","karma-phantomjs-launcher":"^1.0.0","karma-sinon":"^1.0.4","lodash":"^4.13.1","node-notifier":"^4.6.0","phantomjs":"^2.1.1","proxyquire":"^1.7.9 ","proxyquireify":"^3.2.0","run-sequence":"^1.2.2","tiny-lr":"^0.2.1","twemoji":"^2.2.0","vinyl-buffer":"^1.0.0","vinyl-source-stream":"^1.1.0","vinyl-transform":"^1.0.0","wallabify":"^0.0.14","watchify":"^3.7.0","wrench":"^1.5.9"},"gitHead":"7e47e188ee2ebe0798792c319dfdebcd5dfdf9d5","_id":"@elie222/neo4jd3@0.1.0","_npmVersion":"6.4.1","_nodeVersion":"10.1.0","_npmUser":{"name":"elie222","email":"eliesteinbock@gmail.com"},"dist":{"integrity":"sha512-msfXU4TBxUEPFQKYAfY2ncL6OLQPi0a3mDjkVXVXosWPNalzpIKlveBh9vX2kMz+0iYy7qSisebRcb6SccdJTw==","shasum":"252d27b84a58e00e0420aac7a8f0a8e8629cd88a","tarball":"https://registry.npmjs.org/@elie222/neo4jd3/-/neo4jd3-0.1.0.tgz","fileCount":2807,"unpackedSize":8962908,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJchmhFCRA9TVsSAnZWagAADFMQAIutGxqjXo5gtZAkXGxZ\nNbu9Dp4IP13qwLHakuQo7R1YzNArZrRMYIIBZh4Hlm32te9RmAdxm0Nqn/g1\nG9XLTUMSb5zYyg6xP74FazKR6vR37Z2lFMiB23WVyla069QTz0ZjKaUBs/iR\niXnk/X6uf9qGbYojCSfrujSMjRbQcT0QXTlKsru3P7ve1ON+fpani7u6BjQT\nZz0VVqikd0ffR5pNsuCxVp+Ka8Bg51CmMNBhhrFzlxrCbVPjw6TDqobEgc1d\nLx0Jb/Oe2JrV5nkVVTr9Vbx6YuCMV9SlwJVxXsjB8ypnhjHe7t/WAQlVfd+G\nySy8QYmDkr3nh0Yf9WtVt8M/GUF2Vhde1YqsRFbWqlvrLw2yxHSSondg+0CE\nmBQ47h8kBc5Lre33h2eIIx4fg8fhQlvkz/v9vNEIUagRuU3RS61OOHQjXOwA\n3L2x4X7mJdThlUEGxNqdH6FsHwaBo9KQNSMT42y4DgnKcqQSmR9AQRRr+3WF\neqqgNnKDTbJRkUDvCtrePf4cWLXGx74yLUy3pYWAznm59QVbiTyMlGn8fyiK\nstWM8XdMLUnto1u2DZkldRUqeIuf36/kSNU9pNRdyNZDL9JGSdsGCjAq0vlH\nd/6oCPNN3ogTHPvOKZnsX/WWDfo590/vu6F3UZI1xBpbtXvlp3daKM6QeejC\nUbJk\r\n=1QF8\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHHOtWaxqRsLRoK4iDz92LGr63VoCUQS58NPt7Ra6psrAiEA4cdGc40YKxteoYPfwOVt4vh9YdFKULBLLRN/rtWct+4="}]},"maintainers":[{"name":"elie222","email":"eliesteinbock@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/neo4jd3_0.1.0_1552312388163_0.9296424372205532"},"_hasShrinkwrap":false}},"time":{"created":"2019-03-11T13:53:07.983Z","0.1.0":"2019-03-11T13:53:08.402Z","modified":"2022-04-05T07:11:43.149Z"},"maintainers":[{"name":"elie222","email":"eliesteinbock@gmail.com"}],"description":"Neo4jD3","homepage":"https://github.com/elie222/neo4jd3","keywords":["neo4j","d3.js","graph visualization"],"repository":{"type":"git","url":"git+https://github.com/elie222/neo4jd3.git"},"author":{"name":"Elie Steinbock","email":"elie@dappworks.co","url":"https://github.com/elie222"},"bugs":{"url":"https://github.com/elie222/neo4jd3/issues"},"license":"MIT","readme":"# neo4jd3.js\r\n\r\nThis is a fork of the following package: [https://github.com/eisman/neo4jd3](https://github.com/eisman/neo4jd3).\r\n\r\n[Neo4j](https://github.com/neo4j) graph visualization using [D3.js](https://github.com/d3/d3).\r\n\r\n![neo3jd3.js](https://eisman.github.io/neo4jd3/img/neo4jd3.jpg?v=0.0.5)\r\n\r\n## Features\r\n\r\n- Compaptible with the [Neo4j data format](#neo4j-data-format) and the [D3.js data format](#d3js-data-format).\r\n- Force simulation.\r\n- Info panel that shows nodes and relationships information on hover.\r\n- Double click callbacks.\r\n- Custom node colors by node type.\r\n- Text nodes + [Font Awesome](http://fontawesome.io/) icon nodes + SVG image nodes (e.g. using [Twitter Emoji](https://github.com/twitter/twemoji))).\r\n- Sticky nodes (drag to stick, single click to unstick).\r\n- Dynamic graph update (e.g. double click a node to expand it).\r\n- Highlight nodes on init.\r\n- Relationship auto-orientation.\r\n- Zoom, pan, auto fit.\r\n- Compatible with D3.js v4.\r\n\r\n## Running\r\n\r\nFirst of all, make sure you have ruby and sass gem installed. Then, clone the repository, install all dependencies, build and serve the project.\r\n\r\n```bash\r\n> gem install sass\r\n> git clone https://github.com/eisman/neo4jd3.git\r\n> npm install\r\n> gulp\r\n```\r\n\r\nOpen `http://localhost:8080` in your favorite browser.\r\n\r\n## Documentation\r\n\r\n```javascript\r\nvar neo4jd3 = new Neo4jd3(\".selector\", options);\r\n```\r\n\r\n### Options\r\n\r\n| Parameter                     | Type       | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |\r\n| ----------------------------- | ---------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\r\n| **highlight**                 | _array_    | Highlight several nodes of the graph.<br>Example:<br>`[`<br>&nbsp;&nbsp;&nbsp;&nbsp;`{`<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`class: 'Project',`<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`property: 'name',`<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`value: 'neo4jd3'`<br>&nbsp;&nbsp;&nbsp;&nbsp;`}`<br>`]`                                                                                                                                                                                            |\r\n| **icons**                     | _object_   | Map node labels to [Font Awesome icons](http://fontawesome.io/icons).<br>Example:<br>`{`<br>&nbsp;&nbsp;&nbsp;&nbsp;`'BirthDate': 'birthday-cake',`<br>&nbsp;&nbsp;&nbsp;&nbsp;`'Password': 'lock',`<br>&nbsp;&nbsp;&nbsp;&nbsp;`'Phone': 'phone',`<br>&nbsp;&nbsp;&nbsp;&nbsp;`'User': 'user'`<br>`}`.                                                                                                                                                                                                                                      |\r\n| **images**                    | _object_   | Map node labels to SVG images (e.g. using [Twitter Emoji](https://github.com/twitter/twemoji)).<br>Example:<br>`{`<br>&nbsp;&nbsp;&nbsp;&nbsp;`'Address': 'img/twemoji/1f3e0.svg',`<br>&nbsp;&nbsp;&nbsp;&nbsp;`'BirthDate': 'img/twemoji/1f382.svg',`<br>&nbsp;&nbsp;&nbsp;&nbsp;`'Password': 'img/twemoji/1f511.svg',`<br>&nbsp;&nbsp;&nbsp;&nbsp;`'Project': 'img/twemoji/2198.svg',`<br>&nbsp;&nbsp;&nbsp;&nbsp;`'Project\\|name\\|neo4jd3': 'img/twemoji/2196.svg',`<br>&nbsp;&nbsp;&nbsp;&nbsp;`'User': 'img/twemoji/1f600.svg'`<br>`}`. |\r\n| **infoPanel**                 | _boolean_  | Show the information panel: `true`, `false`. Default: `true`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |\r\n| **minCollision**              | _int_      | Minimum distance between nodes. Default: 2 \\* _nodeRadius_.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |\r\n| **neo4jData**                 | _object_   | Graph data in [Neo4j data format](#neo4j-data-format).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |\r\n| **neo4jDataUrl**              | _string_   | URL of the endpoint that serves the graph data in [Neo4j data format](#neo4j-data-format).                                                                                                                                                                                                                                                                                                                                                                                                                                                   |\r\n| **nodeRadius**                | _int_      | Radius of nodes. Default: 25.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |\r\n| **onNodeClick**               | _function_ | Callback function to be executed when the user clicks a node.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |\r\n| **onNodeDoubleClick**         | _function_ | Callback function to be executed when the user double clicks a node.                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |\r\n| **onNodeDragEnd**             | _function_ | Callback function to be executed when the user finishes dragging a node.                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |\r\n| **onNodeDragStart**           | _function_ | Callback function to be executed when the user starts dragging a node.                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |\r\n| **onNodeMouseEnter**          | _function_ | Callback function to be executed when the mouse enters a node.                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |\r\n| **onNodeMouseLeave**          | _function_ | Callback function to be executed when the mouse leaves a node.                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |\r\n| **onRelationshipDoubleClick** | _function_ | Callback function to be executed when the user double clicks a relationship.                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |\r\n| **zoomFit**                   | _boolean_  | Adjust the graph to the container once it has been loaded: `true`, `false`. Default: `false`.                                                                                                                                                                                                                                                                                                                                                                                                                                                |\r\n\r\n### JavaScript API\r\n\r\n| Function                                              | Description                                                                                                                                                     |\r\n| ----------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- |\r\n| **appendRandomDataToNode**(_d_, _maxNodesToGenerate_) | Generates between 1 and _maxNodesToGenerate_ random nodes connected to node _d_ and updates the graph data.                                                     |\r\n| **neo4jDataToD3Data**(_data_)                         | Converts data from [Neo4j data format](#neo4j-data-format) to [D3.js data format](#d3js-data-format).                                                           |\r\n| **randomD3Data**(_d_, _maxNodesToGenerate_)           | Generates between 1 and _maxNodesToGenerate_ random nodes connected to node _d_.                                                                                |\r\n| **size**()                                            | Returns the number of nodes and relationships.<br>Example:<br>`{`<br>&nbsp;&nbsp;&nbsp;&nbsp;`nodes: 25,`<br>&nbsp;&nbsp;&nbsp;&nbsp;`relationships: 50`<br>`}` |\r\n| **updateWithD3Data**(_d3Data_)                        | Updates the graph data using the [D3.js data format](#d3js-data-format).                                                                                        |\r\n| **updateWithNeo4jData**(_neo4jData_)                  | Updates the graph data using the [Neo4j data format](#neo4j-data-format).                                                                                       |\r\n| **version**()                                         | Returns the version of neo4jd3.js.<br>Example: `'0.0.1'`                                                                                                        |\r\n\r\n### Documentation\r\n\r\n#### D3.js data format\r\n\r\n```\r\n{\r\n    \"nodes\": [\r\n        {\r\n            \"id\": \"1\",\r\n            \"labels\": [\"User\"],\r\n            \"properties\": {\r\n                \"userId\": \"eisman\"\r\n            }\r\n        },\r\n        {\r\n            \"id\": \"8\",\r\n            \"labels\": [\"Project\"],\r\n            \"properties\": {\r\n                \"name\": \"neo4jd3\",\r\n                \"title\": \"neo4jd3.js\",\r\n                \"description\": \"Neo4j graph visualization using D3.js.\",\r\n                \"url\": \"https://eisman.github.io/neo4jd3\"\r\n            }\r\n        }\r\n    ],\r\n    \"relationships\": [\r\n        {\r\n            \"id\": \"7\",\r\n            \"type\": \"DEVELOPES\",\r\n            \"startNode\": \"1\",\r\n            \"endNode\": \"8\",\r\n            \"properties\": {\r\n                \"from\": 1470002400000\r\n            },\r\n            \"source\": \"1\",\r\n            \"target\": \"8\",\r\n            \"linknum\": 1\r\n        }\r\n    ]\r\n}\r\n```\r\n\r\n#### Neo4j data format\r\n\r\n```\r\n{\r\n    \"results\": [\r\n        {\r\n            \"columns\": [\"user\", \"entity\"],\r\n            \"data\": [\r\n                {\r\n                    \"graph\": {\r\n                        \"nodes\": [\r\n                            {\r\n                                \"id\": \"1\",\r\n                                \"labels\": [\"User\"],\r\n                                \"properties\": {\r\n                                    \"userId\": \"eisman\"\r\n                                }\r\n                            },\r\n                            {\r\n                                \"id\": \"8\",\r\n                                \"labels\": [\"Project\"],\r\n                                \"properties\": {\r\n                                    \"name\": \"neo4jd3\",\r\n                                    \"title\": \"neo4jd3.js\",\r\n                                    \"description\": \"Neo4j graph visualization using D3.js.\",\r\n                                    \"url\": \"https://eisman.github.io/neo4jd3\"\r\n                                }\r\n                            }\r\n                        ],\r\n                        \"relationships\": [\r\n                            {\r\n                                \"id\": \"7\",\r\n                                \"type\": \"DEVELOPES\",\r\n                                \"startNode\": \"1\",\r\n                                \"endNode\": \"8\",\r\n                                \"properties\": {\r\n                                    \"from\": 1470002400000\r\n                                }\r\n                            }\r\n                        ]\r\n                    }\r\n                }\r\n            ]\r\n        }\r\n    ],\r\n    \"errors\": []\r\n}\r\n```\r\n\r\n### Example\r\n\r\nLive example @ [https://eisman.github.io/neo4jd3/](https://eisman.github.io/neo4jd3/)\r\n\r\n```javascript\r\nvar neo4jd3 = new Neo4jd3(\"#neo4jd3\", {\r\n  highlight: [\r\n    {\r\n      class: \"Project\",\r\n      property: \"name\",\r\n      value: \"neo4jd3\"\r\n    },\r\n    {\r\n      class: \"User\",\r\n      property: \"userId\",\r\n      value: \"eisman\"\r\n    }\r\n  ],\r\n  icons: {\r\n    Api: \"gear\",\r\n    BirthDate: \"birthday-cake\",\r\n    Cookie: \"paw\",\r\n    Email: \"at\",\r\n    Git: \"git\",\r\n    Github: \"github\",\r\n    Ip: \"map-marker\",\r\n    Issues: \"exclamation-circle\",\r\n    Language: \"language\",\r\n    Options: \"sliders\",\r\n    Password: \"asterisk\",\r\n    Phone: \"phone\",\r\n    Project: \"folder-open\",\r\n    SecurityChallengeAnswer: \"commenting\",\r\n    User: \"user\",\r\n    zoomFit: \"arrows-alt\",\r\n    zoomIn: \"search-plus\",\r\n    zoomOut: \"search-minus\"\r\n  },\r\n  images: {\r\n    Address: \"img/twemoji/1f3e0.svg\",\r\n    BirthDate: \"img/twemoji/1f5d3.svg\",\r\n    Cookie: \"img/twemoji/1f36a.svg\",\r\n    CreditCard: \"img/twemoji/1f4b3.svg\",\r\n    Device: \"img/twemoji/1f4bb.svg\",\r\n    Email: \"img/twemoji/2709.svg\",\r\n    Git: \"img/twemoji/1f5c3.svg\",\r\n    Github: \"img/twemoji/1f5c4.svg\",\r\n    icons: \"img/twemoji/1f38f.svg\",\r\n    Ip: \"img/twemoji/1f4cd.svg\",\r\n    Issues: \"img/twemoji/1f4a9.svg\",\r\n    Language: \"img/twemoji/1f1f1-1f1f7.svg\",\r\n    Options: \"img/twemoji/2699.svg\",\r\n    Password: \"img/twemoji/1f511.svg\",\r\n    \"Project|name|d3\": \"img/twemoji/32-20e3.svg\",\r\n    \"Project|name|neo4j\": \"img/twemoji/33-20e3.svg\",\r\n    \"Project|name|neo4jd3\": \"img/twemoji/31-20e3.svg\",\r\n    User: \"img/twemoji/1f600.svg\"\r\n  },\r\n  minCollision: 60,\r\n  neo4jDataUrl: \"json/neo4jData.json\",\r\n  nodeRadius: 25,\r\n  onNodeDoubleClick: function(node) {\r\n    switch (node.id) {\r\n      case \"25\":\r\n        // Google\r\n        window.open(node.properties.url, \"_blank\");\r\n        break;\r\n      default:\r\n        var maxNodes = 5,\r\n          data = neo4jd3.randomD3Data(node, maxNodes);\r\n        neo4jd3.updateWithD3Data(data);\r\n        break;\r\n    }\r\n  },\r\n  zoomFit: true\r\n});\r\n```\r\n\r\n## What's coming?\r\n\r\n- Toolbar.\r\n- More than one relationship between two nodes.\r\n- Markers.\r\n- Performance optimization.\r\n- Testing.\r\n\r\n## Copyright and license\r\n\r\nCode and documentation copyright 2016 the author. Code released under the [MIT license](LICENSE). Docs released under [Creative Commons](docs/LICENSE).\r\n","readmeFilename":"README.md"}