首页 > 解决方案 > 无法使用 Neovis.js 从 Neo4j 以角度呈现图形

问题描述

我是 Neo4j 的新手,我正在尝试使用 Neovis.js 库在角度组件中可视化 Neo4j 图形。它也没有在控制台中显示任何错误,也没有在屏幕上呈现任何内容。这是我在 component.ts 文件中的代码


Init() {

  let config = {
      container_id: "viz",
      server_url: "bolt://localhost:7687",
      server_user: "neo4j",
      server_password: "",
      labels: {
        //"Character": "name",
        "Character": {
          "caption": "name",
          "size": "pagerank",
          "community": "community"
          //"sizeCypher": "MATCH (n) WHERE id(n) = {id} MATCH (n)-[r]-() RETURN sum(r.weight) AS c"
        }
      },
      relationships: {
        "INTERACTS": {
          "thickness": "weight",
          "caption": false
        }
      },
      initial_cypher: "Match (n) return (n)"
    };
  var viz = new NeoVis(config);
  viz.render();
}

html代码:-

<head (load)="Init()">
  <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>

标签: angularjsangularneo4j

解决方案


推荐阅读