# neovis.js **Repository Path**: TechnicalXu/neovis.js ## Basic Information - **Project Name**: neovis.js - **Description**: No description available - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2024-05-30 - **Last Updated**: 2024-05-30 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # neovis.js []()[](https://badge.fury.io/js/neovis.js) Graph visualizations powered by vis.js with data from Neo4j.  ## Features - [x] Connect to Neo4j instance to get live data - [x] User specified labels and property to be displayed - [x] User specified Cypher query to populate - [x] Specify node property for url of image for node - [x] Specify edge property for edge thickness - [x] Specify node property for community / clustering - [x] Specify node property for node size - [x] Configure popover ## Install Neovis.js can be installed via npm: ```bash npm install --save neovis.js ``` you can also obtain neovis.js via CDN: ## CDN For ease of use Neovis.js can be obtained from Neo4jLabs CDN: *Most recent release* ```html ``` *Version without neo4j-driver dependency* ```html ``` ## Quickstart Example Let's go through the steps to reproduce this visualization:  ### Prepare Neo4j Start with a blank Neo4j instance, or spin up a blank [Neo4j Sandbox](https://neo4jsandbox.com). We'll load the Game of Thrones dataset, run: ```cypher LOAD CSV WITH HEADERS FROM 'https://raw.githubusercontent.com/mathbeveridge/asoiaf/master/data/asoiaf-all-edges.csv' AS row MERGE (src:Character {name: row.Source}) MERGE (tgt:Character {name: row.Target}) MERGE (src)-[r:INTERACTS]->(tgt) ON CREATE SET r.weight = toInteger(row.weight) ``` We've pre-calculated PageRank and ran a community detection algorithm to assign community ids for each Character. Let's load those next: ```cypher LOAD CSV WITH HEADERS FROM 'https://raw.githubusercontent.com/johnymontana/neovis.js/master/examples/data/got-centralities.csv' AS row MATCH (c:Character {name: row.name}) SET c.community = toInteger(row.community), c.pagerank = toFloat(row.pagerank) ``` Our graph now consists of `Character` nodes that are connected by an `INTERACTS` relationships. We can visualize the whole graph in Neo4j Browser by running: ```cypher MATCH p = (:Character)-[:INTERACTS]->(:Character) RETURN p ```  We can see characters that are connected and with the help of the force directed layout we can begin to see clusters in the graph. However, we want to visualize the centralities (PageRank) and community detection results that we also imported. Specifically we would like: * Node size to be proportional to the Character's `pagerank` score. This will allow us to quickly identify important nodes in the network. * Node color to determined by the `community` property. This will allow us to visualize clusters. * Relationship thickeness should be proportional to the `weight` property on the `INTERACTS` relationship. Neovis.js, by combining the JavaScript driver for Neo4j and the vis.js visualization library will allow us to build this visualization. ### index.html Create a new html file: ```html