neo4j-contrib / neovis.js

Neo4j + vis.js = neovis.js. Graph visualizations in the browser with data from Neo4j.
Apache License 2.0
1.61k stars 324 forks source link

fail to connect to Neo4j AuraDB #388

Open Liuz233 opened 1 month ago

Liuz233 commented 1 month ago

Here is my config in HTML When I try to load the draw the graph from Neo4j AuraDB, it failed and show nothing

console in web browser shows image But I have write my Neo4j AuraDB url, username, password in config. Why it still try to connect to localhost:7687?

How can I fix it?


    <!-- FIXME: load from dist -->
    <script type="text/javascript" src="../static/neovis.js"></script>

    <script
            src="https://code.jquery.com/jquery-3.2.1.min.js"
            integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4="
            crossorigin="anonymous"></script>

    <script type="text/javascript">
        // define config car
        // instantiate nodevis object
        // draw

        var viz;

        function draw() {
            var config = {
                containerId: "viz",
                neo4j: {
                server_url: "bolt://xx.xx.xx.xx:7687",
                server_user: "neo4j",
                server_password: "navigators-bowl-flake",
                },
                labels: {
                    Character: {
                        label: "name",
                        value: "pagerank",
                        group: "community"
                    }
                },
                relationships: {
                    INTERACTS: {
                        value: "weight"
                    }
                },
                initialCypher: "MATCH p=()-->() RETURN p"
            };

            viz = new NeoVis.default(config);
            viz.render();
            console.log(viz);

        }
    </script>
</head>
<body onload="draw()">
<div id="viz"></div>
prsfreal commented 4 weeks ago

your server_URL is using bolt - looking for a local instance. You want to connect to AuraDB - which should look something like this:

'neo4j+s://7e1dfa.databases.neo4j.io:7687'

This can be found in the Aura_db console.

Also be aware that if you are using the feee instance you may come across a bug where all nodes return but only one relationship. https://github.com/neo4j-contrib/neovis.js/issues/367

Switching to paid instance or local install fixes issue.

Liuz233 commented 4 weeks ago

your server_URL is using bolt - looking for a local instance. You want to connect to AuraDB - which should look something like this:

'neo4j+s://7e1dfa.databases.neo4j.io:7687'

This can be found in the Aura_db console.

Also be aware that if you are using the feee instance you may come across a bug where all nodes return but only one relationship. #367

Switching to paid instance or local install fixes issue.

Thank you. I try to build my local neo4j and face no bug.