sucheta
( Sucheta)
October 15, 2018, 7:00am
1
Information :
neo4j version - 3.4.7 Enterprise,
browser version - Version 3.4.7
what kind of API / driver do you use - I am using Neovis.js
With cypher query -
var cypherQuery =
"MATCH (n) OPTIONAL MATCH (n)-[r]->(m) RETURN n,r,m LIMIT 10";
I get proper response -
Issue - I get an error message
ERROR TypeError: Cannot read property 'constructor' of null
when my Limit in the cypher query increases beyond 10.
(say )- var cypherQuery =
"MATCH (n) OPTIONAL MATCH (n)-[r]->(m) RETURN n,r,m LIMIT 15";
complete log of error -
ERROR TypeError: Cannot read property 'constructor' of null
at neovis.js:36514
at Record.forEach (neovis.js:33630)
at Object.onNext (neovis.js:36511)
at _RunObserver.onNext (neovis.js:33014)
at Connection._handleMessage (neovis.js:31442)
at Dechunker.Connection._dechunker.onmessage (neovis.js:31392)
at Dechunker._onHeader (neovis.js:30537)
at Dechunker.AWAITING_CHUNK (neovis.js:30490)
at Dechunker.write (neovis.js:30548)
at WebSocketChannel.self._ch.onmessage (neovis.js:31365)
Please help.
Source code -
const url = 'bolt://localhost:11001';
const username = 'neo4j';
const password = 'Viralabc';
const encrypted = true;
var cypherQuery = "MATCH (n) OPTIONAL MATCH (n)-[r]->(m) RETURN n,r,m LIMIT 15";
var config = {
container_id: "viz",
server_url: "bolt://localhost:11001",
server_user: "neo4j",
server_password: "Virtuallib1",
labels: {
"Banking": {
"caption": "name",
"size": "pagerank",
"community": "community"
}
},
relationships: {
"cc": {
"thickness": "weight",
"caption": false
}
},
initial_cypher:cypherQuery ,
arrows: true,
hierarchical_layout:true,
hierarchical_sort_method:"directed",
};
this.viz = new NeoVis.default(config);
this.viz.render();
console.log(this.viz);
lyonwj
(William Lyon)
October 15, 2018, 12:44pm
2
I'm not certain, but it looks like neovis.js may not be properly handling nulls returned in the Cypher query as a result of using OPTIONAL MATCH
.
Could you please create a Github issue here and we will investigate further and fix: Issues · neo4j-contrib/neovis.js · GitHub
1 Like
sucheta
( Sucheta)
October 16, 2018, 4:00am
3
Hi William,
I have included the issue in github . Link -
opened 03:59AM - 16 Oct 18 UTC
closed 01:54PM - 08 Oct 19 UTC
Information:
neo4j version - 3.4.7 Enterprise,
browser version - Version 3.4… .7
what kind of API / driver do you use - I am using Neovis.js
With cypher query -
var cypherQuery =
"MATCH (n) OPTIONAL MATCH (n)-[r]->(m) RETURN n,r,m LIMIT 10";
**I get proper response -**
![neovis-1](https://user-images.githubusercontent.com/37062796/46991410-7b731400-d123-11e8-9e0f-eb9df0025914.png)
**Issue is - I get an error message**
ERROR TypeError: Cannot read property 'constructor' of null
when my Limit in the cypher query increases beyond 10.
(say )- var cypherQuery =
"MATCH (n) OPTIONAL MATCH (n)-[r]->(m) RETURN n,r,m LIMIT 15";
**complete log of error -**
ERROR TypeError: Cannot read property 'constructor' of null
at neovis.js:36514
at Record.forEach (neovis.js:33630)
at Object.onNext (neovis.js:36511)
at _RunObserver.onNext (neovis.js:33014)
at Connection._handleMessage (neovis.js:31442)
at Dechunker.Connection._dechunker.onmessage (neovis.js:31392)
at Dechunker._onHeader (neovis.js:30537)
at Dechunker.AWAITING_CHUNK (neovis.js:30490)
at Dechunker.write (neovis.js:30548)
at WebSocketChannel.self._ch.onmessage (neovis.js:31365)
Please help.
**Source code -**
const url = 'bolt://localhost:11001';
const username = 'neo4j';
const password = 'Vab1';
const encrypted = true;
MATCH (n) OPTIONAL MATCH (n)-[r]->(m) RETURN n,r,m LIMIT 30
var cypherQuery = "";
var config = {
container_id: "viz",
server_url: "bolt://localhost:11001",
server_user: "neo4j",
server_password: "Vr123",
labels: {
"Banking": {
"caption": "name",
"size": "pagerank",
"community": "community"
}
},
relationships: {
"cc": {
"thickness": "weight",
"caption": false
}
},
RETURN cc",
initial_cypher: cypherQuery ,
arrows: true,
hierarchical_layout:true,
hierarchical_sort_method:"directed",
};
this.viz = new NeoVis.default(config);
this.viz.render();
console.log(this.viz);
}
lyonwj
(William Lyon)
October 16, 2018, 9:21pm
4
Great - thanks! Let's track the problem there and I'll try to get it fixed soon, I think I see what is going on.