在 Neo4j 中使用 Neovis.js 时出现此错误。 - neovis_js_dist_neovis_js__WEBPACK_IMPORTED_MODULE_4___default.a.default 不是构造函数
Getting this error while using Neovis.js with Neo4j. - neovis_js_dist_neovis_js__WEBPACK_IMPORTED_MODULE_4___default.a.default is not a constructor
我正在尝试使用 Neovis
库在网页中可视化 Neo4j
图形数据。
在Component.ts
import NeoVis from 'neovis.js/dist/neovis.js';
ngOnInit() {
this.draw();
}
draw() {
const config = {
container_id: 'viz',
server_url: 'bolt://localhost',
server_user: 'neo4j',
server_password: 'test'
};
const viz = new NeoVis.default(config);
viz.render();
}
<div id="viz"></div>
但是我在应用加载时遇到这个错误
ERROR TypeError: neovis_js_dist_neovis_js__WEBPACK_IMPORTED_MODULE_4___default.a.default is not a constructor
删除 default
成功了。添加密码查询图后工作
draw() {
const config = {
container_id: 'viz',
server_url: 'bolt://localhost',
server_user: 'neo4j',
server_password: 'test',
initial_cypher: 'Match (n)-[r]->(m) return n,r,m'
};
const viz = new NeoVis(config);
console.log(viz);
viz.render();
}
我正在尝试使用 Neovis
库在网页中可视化 Neo4j
图形数据。
在Component.ts
import NeoVis from 'neovis.js/dist/neovis.js';
ngOnInit() {
this.draw();
}
draw() {
const config = {
container_id: 'viz',
server_url: 'bolt://localhost',
server_user: 'neo4j',
server_password: 'test'
};
const viz = new NeoVis.default(config);
viz.render();
}
<div id="viz"></div>
但是我在应用加载时遇到这个错误
ERROR TypeError: neovis_js_dist_neovis_js__WEBPACK_IMPORTED_MODULE_4___default.a.default is not a constructor
删除 default
成功了。添加密码查询图后工作
draw() {
const config = {
container_id: 'viz',
server_url: 'bolt://localhost',
server_user: 'neo4j',
server_password: 'test',
initial_cypher: 'Match (n)-[r]->(m) return n,r,m'
};
const viz = new NeoVis(config);
console.log(viz);
viz.render();
}