Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot use NEOVIS_ADVANCED_CONFIG #358

Open
leema2345 opened this issue Jul 20, 2023 · 3 comments
Open

Cannot use NEOVIS_ADVANCED_CONFIG #358

leema2345 opened this issue Jul 20, 2023 · 3 comments

Comments

@leema2345
Copy link

leema2345 commented Jul 20, 2023

Hi. I'm trying to use NEOVIS_ADVANCED_CONFIG and have searched all over this forum to try and decipher what i'm doing wrong

I first got neovis by doing
<script type="text/javascript" src="https://cdn.neo4jlabs.com/neovis.js/v1.2.1/neovis.js"></script>
This allows me to connect to the database and outputs the graph......But i want to choose my relationship colors, so i realised i need a newer version with NEOVIS_ADVANCED_CONFIG

I cloned the latest version repo and wrote this script

<script type="text/javascript" src="./static/js/neovis.js/dist/neovis.js"></script>

followed by

<script type="module"> import NeoVis, {NEOVIS_ADVANCED_CONFIG} from "./static/js/neovis.js/dist/neovis.js"; </script>
but now i'm getting two errors ...................

Uncaught` SyntaxError: The requested module './static/js/neovis.js/dist/neovis.js' does not provide an export named 'NEOVIS_ADVANCED_CONFIG' (at (index):59:21)

and when i try to draw the graph, i get

neovis.ts:294 Neo4jError: The client is unauthorized due to authentication failure.

I also get this authentication error if i cdn
<script src="https://unpkg.com/neovis.js@2.0.2"></script>

In MY draw() function I have the correct password and username, so i'm unsure why i'm getting an authentication error.

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

i get

(index):93 Uncaught ReferenceError: NeoVis is not defined
at draw ((index):93:19)
at HTMLButtonElement.onclick ((index):164:203)

ANY idea how to get around these?

@thebestnom
Copy link
Collaborator

For the second error you are probably trying to connect http from https or the other way around, the third error is probably you run your draw before the neovis downloaded
Anyway best way to use the package is of course using npm
As for the first I didn't create a module js, you have to use webpack or other of that kind to import it es6 style

@sysu17363055
Copy link

hello, have you solved this problem?

@FStriewski
Copy link

For the first problem, check the example from this repo for how it is done:
https://github.com/neo4j-contrib/neovis.js/blob/master/examples/advanced-example.html

@neo4j-contrib neo4j-contrib deleted a comment from sysu17363055 Aug 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants