Retour au classement

neo4j-contrib/neovis.js

TypeScript

Neo4j + vis.js = neovis.js. Graph visualizations in the browser with data from Neo4j.

neo4jvisualizationnetwork-visualizationgraph-visualizationcypherjavascriptdata-visualization
Croissance des étoiles
Étoiles
1.8k
Forks
327
Croissance hebdomadaire
Issues
51
5001k1.5k
avr. 2016sept. 2019févr. 2023juil. 2026
Artefactsnpmnpm install neovis.js
README

neovis.js

Actions Build Statusnpm version

Graph visualizations powered by vis.js with data from Neo4j.

Features

  • Connect to Neo4j instance to get live data
  • User specified labels and property to be displayed
  • User specified Cypher query to populate
  • Specify node property for url of image for node
  • Specify edge property for edge thickness
  • Specify node property for community / clustering
  • Specify node property for node size
  • Configure popover

Install

Neovis.js can be installed via npm:

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


<script src="https://unpkg.com/neovis.js@2.0.2"></script>

Version without neo4j-driver dependency


<script src="https://unpkg.com/neovis.js@2.0.2/dist/neovis-without-dependencies.js"></script>

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. We'll load the Game of Thrones dataset, run:


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:


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:


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:

<!doctype html>
<html>
<head>
    <title>Neovis.js Simple Example</title>
    <style type="text/css">
        html, body {
            font: 16pt arial;
        }

        #viz {
            width: 900px;
            height: 700px;
            border: 1px solid lightgray;
            font: 22pt arial;
        }
    </style>
</head>
<body onload="draw()">
<div id="viz"></div>
</body>
</html>

We define some basic CSS to specify the boundaries of a div and then create a single div in the body. We also specify onload="draw()" so that the draw() function is called as soon as the body is loaded.

We need to pull in neovis.js:


<script src="https://unpkg.com/neovis.js@2.0.2"></script>

And define our draw() function:


<script type="text/javascript">

    let neoViz;

    function draw() {
        const config = {
            containerId: "viz",
            neo4j: {
                serverUrl: "bolt://localhost:7687",
                serverUser: "neo4j",
                serverPassword: "sorts-swims-burglaries",
            },
            labels: {
                Character: {
                    label: "name",
                    value: "pagerank",
                    group: "community",
                    [NeoVis.NEOVIS_ADVANCED_CONFIG]: {
                        function: {
                            title: (node) => viz.nodeToHtml(node, [
                                "name",
                                "pagerank"
                            ])
                        }
                    }
                }
            },
            relationships: {
                INTERACTS: {
                    value: "weight"
                }
            },
            initialCypher: "MATCH (n)-[r:INTERACTS]->(m) RETURN *"
        };

        neoViz = new NeoVis.default(config);
        neoViz.render();
    }
</script>

This function creates a config object that specifies how to connect to Neo4j, what data to fetch, and how to configure the visualization.

See simple-example.html for the full code.

module usage

you can also use it as module, but it would require you have a way to import css files

import NeoVis from 'neovis.js';

or you can import the version with bundled dependency

import NeoVis from 'neovis.js/dist/neovis.js';

Api Reference

Api Reference

Build

This project uses git submodules to include the dependencies for neo4j-driver and vis.js. This project uses webpack to build a bundle that includes all project dependencies. webpack.config.js contains the configuration for webpack. After cloning the repo:

npm install
npm run build
npm run typedoc

will build dist/neovis.js and dist/neovis-without-dependencies.js

Dépôts similaires
golang-migrate/migrate

Database migrations. CLI and Golang library.

GoGo ModulesOthergogolang
18.7k1.6k
neo4j/neo4j

Graphs for Everyone

JavaMavenGNU General Public License v3.0cyphergraphdb
neo4j.com
16.9k2.7k
blacklanternsecurity/bbot

The recursive internet scanner for hackers. 🧡

PythonPyPIGNU Affero General Public License v3.0hackingneo4j
blacklanternsecurity.com/bbot/
10.2k889
datawhalechina/all-in-rag

🔍大模型应用开发实战一:RAG 技术全栈指南,在线阅读地址:https://datawhalechina.github.io/all-in-rag/

PythonPyPIembeddingkimi-k2
datawhalechina.github.io/all-in-rag/
9.7k4.8k
xerrors/Yuxi

结合知识库、知识图谱管理的 多租户 Agent Harness 平台。 An agent harness that integrates a LightRAG knowledge base and knowledge graphs. Build with LangChain + Vue + FastAPI, support DeepAgents、MinerU PDF、Neo4j 、MCP.

PythonPyPIMIT Licensedockerkbqa
xerrors.github.io/Yuxi/
6.2k911
neo4j-labs/llm-graph-builder

Neo4j graph construction from unstructured data using LLMs

Jupyter NotebookApache License 2.0data-importgenai
llm-graph-builder.neo4jlabs.com
5k848
ruvnet/RuVector

RuVector is a High Performance, Real-Time, Self-Learning Ai, Vector GNN, Memory DB built in Rust.

Rustcrates.ioMIT Licenseaiai-ocr
cognitum.one/RuVector
4.4k584
kuzudb/kuzu

Embedded property graph database built for speed. Vector search and full-text search built in. Implements Cypher.

C++MIT Licensedatabasecypher
kuzudb.com
4k501
odedshimon/BruteShark

Network Analysis Tool

C#GNU General Public License v3.0hackingpcap-files
3.4k357
jm199504/Financial-Knowledge-Graphs

小型金融知识图谱构建流程(neo4j / python / cypher / KG)

Jupyter Notebookcypherdata-analysis
3.1k569
graphistry/pygraphistry

PyGraphistry is a Python library to quickly load, shape, embed, and explore big graphs with the GPU-accelerated Graphistry visual graph analyzer

PythonPyPIBSD 3-Clause "New" or "Revised" Licensegraphvisualization
2.5k231
nikmcfly/MiroFish-Offline

Offline multi-agent simulation & prediction engine. English fork of MiroFish with Neo4j + Ollama local stack.

PythonPyPIGNU Affero General Public License v3.0aineo4j
x.com/nikmcfly69/status/2033147482331390328
2.5k649