neo4j-contrib / neovis.js

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

Why the config doesn't make a diiference? #383

Closed xgh127 closed 2 months ago

xgh127 commented 2 months ago

Expected Behavior (Mandatory)

image I hope the label should inside the node

Actual Behavior (Mandatory)

image but it is outside the node

the config is:

 const config = {
      container_id: visRef.current.id,
      server_url: neo4jUri,
      server_user: neo4jUser,
      server_password: neo4jPassword,
      labels: generateLabelConfigs(),
      nodes: {
          shape: "ellipse",
          font: {
              size: 14,
              color: "black",
          },
      },
      arrows: true,

      initial_cypher: cypherQuery,
    };

Currently used versions 1.4

Versions

thebestnom commented 2 months ago

This is not an issue, please give a normal question

xgh127 commented 2 months ago

This is not an issue, please give a normal question

Sorry,I don't understand! What's the difference?

thebestnom commented 2 months ago

I don't think this is possible in 1.4, this library was not created to copy neo4j desktop graph but to embed using vis.js, in 2.x because you can config anything in vis you could probably do this

xgh127 commented 2 months ago

I don't think this is possible in 1.4, this library was not created to copy neo4j desktop graph but to embed using vis.js, in 2.x because you can config anything in vis you could probably do this

OK,I got it. But when i change the version.I encounter a new problem.

Failed to compile
./node_modules/neovis.js/dist/neovis.js 45600:31
Module parse failed: Unexpected token (45600:31)
File was processed with these loaders:
 * ./node_modules/babel-loader/lib/index.js
You may need an additional loader to handle the result of these loaders.
| 
|     function sB(t, e) {
>       if ("object" == typeof e?.properties) return (0, j.isInt)(e.properties[t]) ? eB(e.properties[t]) : e.properties[t];
|       throw new Error("Neo4j object is not properly constructed");
|     }

,Is this a version problem?

thebestnom commented 2 months ago

How old is your project 😅 Update babel and update preset-env

thebestnom commented 2 months ago

And update all you're presets

xgh127 commented 2 months ago

And update all you're presets Thanks, Followed you instruction,I’ve updated. Now my package.json is like this: `json { "name": "react-neovis-example", "version": "0.1.0", "private": true, "homepage": "./", "scripts": { "start": "set NODE_OPTIONS=--openssl-legacy-provider && react-scripts start", "build": "set NODE_OPTIONS=--openssl-legacy-provider && react-scripts build", "lint": "prettier --write '{,!(node_modules)/}*/.{js,jsx}'", "predeploy": "yarn run build", "deploy": "gh-pages -d build" }, "husky": { "hooks": { "pre-commit": "pretty-quick --staged" } }, "dependencies": { "@ant-design/icons": "^5.3.7", "ant-design": "^1.0.0", "antd": "^5.17.2", "neovis.js": "^2.1.0", "prop-types": "^15.7.2", "react": "^16.13.1", "react-dom": "^16.13.1", "react-resize-aware": "^3.0.1", "react-router-dom": "^6.23.1", "react-scripts": "3.4.3" }, "devDependencies": { "@babel/core": "^7.24.7", "@babel/preset-env": "^7.24.7", "gh-pages": "^2.1.1", "husky": "^3.0.3", "prettier": "^1.18.2", "pretty-quick": "^1.11.1" }, "browserslist": { "production": [ ">0.2%", "not dead", "not op_mini all" ], "development": [ "last 1 chrome version", "last 1 firefox version", "last 1 safari version" ] } }

but it still report error like this File was processed with these loaders:

./node_modules/neovis.js/dist/neovis.js 41468:31
Module parse failed: Unexpected token (41468:31)
File was processed with these loaders: