Vue2下使用neovis.js实现neo4j知识图谱可视化
neovis.js安装下载
// 下载依赖
npm install -save neovis.js
在vue中导入
// 依赖导入
import NeoVis from 'neovis.js';
知识图谱展示:
vue项目代码
// 依赖导入
<template>
<el-row class="MainArea">
<el-col :span="24" class="Mainleft" v-loading="fullscreenLoading">
<div class="left" id="viz1" ref="viz1"></div>
<el-divider></el-divider>
<div>
请输入查询语句: <textarea rows="4" cols=50 id="cypher"></textarea><br>
<el-button type="success" id="reload" @click="submit">提交</el-button>
<el-button type="warning" id="stabilize" @click="stabilize">锁定</el-button>
</div>
</el-col>
</el-row>
</template>
<script>
import NeoVis from 'neovis.js';
export default {
data() {
return {
viz: {
},
SQL: "MATCH p=()-->() RETURN p limit 100", //写自己的Cypher
driver: null,
cypherkeyword: false,
graphtable: false,
records: [],
clearAll: false,