maximum call stack size exceeded jquery cytoscape
up vote
0
down vote
favorite
I am working with cytoscape and jquery with large data. My html code is
<script src="jquery.js"></script>
<script src="jquery.qtip.js"></script>
<script src="cytoscape.js"></script>
<script src="cytoscape-qtip.js"></script>
<script src="my_java_script.js"></script>`
My java script code is
$(function(){ //
var cy = cytoscape({
container: document.getElementById('cy'),
boxSelectionEnabled: false,
autounselectify: true,
style: cytoscape.stylesheet()
.selector('node')
.css({'label': 'data(label)',
'width': '60px','height': '60px', })
.selector('edge')
.css({'width': '10px','line-color':'#000000'})
.selector("#22").css({"line-color":"red"})
.selector("#44").css({"line-color":"red"})
.selector("#55").css({"line-color":"red"})
I have almost 20000 selectors. Because of such large data I am getting following error in Chrome 70 browser:
Uncaught RangeError: Maximum call stack size exceeded
at k (jquery.js:2)
at Object.fireWith [as resolveWith] (jquery.js:2)
at Function.ready (jquery.js:2)
at HTMLDocument.D (jquery.js:2)
How can I get rid of this ?
jquery cytoscape.js
add a comment |
up vote
0
down vote
favorite
I am working with cytoscape and jquery with large data. My html code is
<script src="jquery.js"></script>
<script src="jquery.qtip.js"></script>
<script src="cytoscape.js"></script>
<script src="cytoscape-qtip.js"></script>
<script src="my_java_script.js"></script>`
My java script code is
$(function(){ //
var cy = cytoscape({
container: document.getElementById('cy'),
boxSelectionEnabled: false,
autounselectify: true,
style: cytoscape.stylesheet()
.selector('node')
.css({'label': 'data(label)',
'width': '60px','height': '60px', })
.selector('edge')
.css({'width': '10px','line-color':'#000000'})
.selector("#22").css({"line-color":"red"})
.selector("#44").css({"line-color":"red"})
.selector("#55").css({"line-color":"red"})
I have almost 20000 selectors. Because of such large data I am getting following error in Chrome 70 browser:
Uncaught RangeError: Maximum call stack size exceeded
at k (jquery.js:2)
at Object.fireWith [as resolveWith] (jquery.js:2)
at Function.ready (jquery.js:2)
at HTMLDocument.D (jquery.js:2)
How can I get rid of this ?
jquery cytoscape.js
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I am working with cytoscape and jquery with large data. My html code is
<script src="jquery.js"></script>
<script src="jquery.qtip.js"></script>
<script src="cytoscape.js"></script>
<script src="cytoscape-qtip.js"></script>
<script src="my_java_script.js"></script>`
My java script code is
$(function(){ //
var cy = cytoscape({
container: document.getElementById('cy'),
boxSelectionEnabled: false,
autounselectify: true,
style: cytoscape.stylesheet()
.selector('node')
.css({'label': 'data(label)',
'width': '60px','height': '60px', })
.selector('edge')
.css({'width': '10px','line-color':'#000000'})
.selector("#22").css({"line-color":"red"})
.selector("#44").css({"line-color":"red"})
.selector("#55").css({"line-color":"red"})
I have almost 20000 selectors. Because of such large data I am getting following error in Chrome 70 browser:
Uncaught RangeError: Maximum call stack size exceeded
at k (jquery.js:2)
at Object.fireWith [as resolveWith] (jquery.js:2)
at Function.ready (jquery.js:2)
at HTMLDocument.D (jquery.js:2)
How can I get rid of this ?
jquery cytoscape.js
I am working with cytoscape and jquery with large data. My html code is
<script src="jquery.js"></script>
<script src="jquery.qtip.js"></script>
<script src="cytoscape.js"></script>
<script src="cytoscape-qtip.js"></script>
<script src="my_java_script.js"></script>`
My java script code is
$(function(){ //
var cy = cytoscape({
container: document.getElementById('cy'),
boxSelectionEnabled: false,
autounselectify: true,
style: cytoscape.stylesheet()
.selector('node')
.css({'label': 'data(label)',
'width': '60px','height': '60px', })
.selector('edge')
.css({'width': '10px','line-color':'#000000'})
.selector("#22").css({"line-color":"red"})
.selector("#44").css({"line-color":"red"})
.selector("#55").css({"line-color":"red"})
I have almost 20000 selectors. Because of such large data I am getting following error in Chrome 70 browser:
Uncaught RangeError: Maximum call stack size exceeded
at k (jquery.js:2)
at Object.fireWith [as resolveWith] (jquery.js:2)
at Function.ready (jquery.js:2)
at HTMLDocument.D (jquery.js:2)
How can I get rid of this ?
jquery cytoscape.js
jquery cytoscape.js
asked Nov 14 at 7:33
user10340258
168
168
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
accepted
Consider using classes for your selectors and not unique id's, the way you use them is not the way you are supposed to do that. Especially if the selectors are just a line color, you can always define the selector with a more dynamic option:
style: [
{
selector: 'node',
style: {
'shape': 'data(faveShape)',
'content': 'data(DisplayName)',
'height': 'data(faveHeight)',
'width': 'data(faveWidth)',
'background-color': 'data(faveColor)',
'line-color': 'data(faveLineColor)',
'font-family': 'data(faceFontFam)',
'font-size': 'data(faveFontSize)'
}
},
...
]
And when you add nodes/edges, use the logic from your python code and get the color of the element, after that, just put that variable in the cy.add() and you are good to go:
cy.add({
data: {
id: 'yourId',
...
faveLineColor: 'yourLineColor',
...
},
...
});
Thanks @Stephan T. for your reply. I have different types of nodes and edges to be highlighted in different color. Can you please help me how to group them ?
– user10340258
Nov 15 at 5:03
If you do it like in my answer, there will be no need of grouping them, you just have to add a color field in the data part of your nodes/edges. I don't know what your data looks like (the data used for adding the nodes and edges to cy), if you can provide some sort of example that would be great :)#
– Stephan T.
Nov 15 at 5:12
I am adding data like this ,elements:{nodes:[{ data: { id:"n0",label:"A2" } },.....and for edges edges:[{"data": {"id": "e0","source": "n2","target": "n0"}},
– user10340258
Nov 15 at 5:29
And how do you know which color each element has? Which criteria is responsible for that?
– Stephan T.
Nov 15 at 5:33
I am defining color by .selector. I have a python code which prints .selector commands in .js file. At present I am using .selector("#e19,#e2,#e5,#e4,#e9,#e15").css({"line-color":"blue"}) which is also not working for large data.
– user10340258
Nov 15 at 5:36
|
show 4 more comments
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
accepted
Consider using classes for your selectors and not unique id's, the way you use them is not the way you are supposed to do that. Especially if the selectors are just a line color, you can always define the selector with a more dynamic option:
style: [
{
selector: 'node',
style: {
'shape': 'data(faveShape)',
'content': 'data(DisplayName)',
'height': 'data(faveHeight)',
'width': 'data(faveWidth)',
'background-color': 'data(faveColor)',
'line-color': 'data(faveLineColor)',
'font-family': 'data(faceFontFam)',
'font-size': 'data(faveFontSize)'
}
},
...
]
And when you add nodes/edges, use the logic from your python code and get the color of the element, after that, just put that variable in the cy.add() and you are good to go:
cy.add({
data: {
id: 'yourId',
...
faveLineColor: 'yourLineColor',
...
},
...
});
Thanks @Stephan T. for your reply. I have different types of nodes and edges to be highlighted in different color. Can you please help me how to group them ?
– user10340258
Nov 15 at 5:03
If you do it like in my answer, there will be no need of grouping them, you just have to add a color field in the data part of your nodes/edges. I don't know what your data looks like (the data used for adding the nodes and edges to cy), if you can provide some sort of example that would be great :)#
– Stephan T.
Nov 15 at 5:12
I am adding data like this ,elements:{nodes:[{ data: { id:"n0",label:"A2" } },.....and for edges edges:[{"data": {"id": "e0","source": "n2","target": "n0"}},
– user10340258
Nov 15 at 5:29
And how do you know which color each element has? Which criteria is responsible for that?
– Stephan T.
Nov 15 at 5:33
I am defining color by .selector. I have a python code which prints .selector commands in .js file. At present I am using .selector("#e19,#e2,#e5,#e4,#e9,#e15").css({"line-color":"blue"}) which is also not working for large data.
– user10340258
Nov 15 at 5:36
|
show 4 more comments
up vote
0
down vote
accepted
Consider using classes for your selectors and not unique id's, the way you use them is not the way you are supposed to do that. Especially if the selectors are just a line color, you can always define the selector with a more dynamic option:
style: [
{
selector: 'node',
style: {
'shape': 'data(faveShape)',
'content': 'data(DisplayName)',
'height': 'data(faveHeight)',
'width': 'data(faveWidth)',
'background-color': 'data(faveColor)',
'line-color': 'data(faveLineColor)',
'font-family': 'data(faceFontFam)',
'font-size': 'data(faveFontSize)'
}
},
...
]
And when you add nodes/edges, use the logic from your python code and get the color of the element, after that, just put that variable in the cy.add() and you are good to go:
cy.add({
data: {
id: 'yourId',
...
faveLineColor: 'yourLineColor',
...
},
...
});
Thanks @Stephan T. for your reply. I have different types of nodes and edges to be highlighted in different color. Can you please help me how to group them ?
– user10340258
Nov 15 at 5:03
If you do it like in my answer, there will be no need of grouping them, you just have to add a color field in the data part of your nodes/edges. I don't know what your data looks like (the data used for adding the nodes and edges to cy), if you can provide some sort of example that would be great :)#
– Stephan T.
Nov 15 at 5:12
I am adding data like this ,elements:{nodes:[{ data: { id:"n0",label:"A2" } },.....and for edges edges:[{"data": {"id": "e0","source": "n2","target": "n0"}},
– user10340258
Nov 15 at 5:29
And how do you know which color each element has? Which criteria is responsible for that?
– Stephan T.
Nov 15 at 5:33
I am defining color by .selector. I have a python code which prints .selector commands in .js file. At present I am using .selector("#e19,#e2,#e5,#e4,#e9,#e15").css({"line-color":"blue"}) which is also not working for large data.
– user10340258
Nov 15 at 5:36
|
show 4 more comments
up vote
0
down vote
accepted
up vote
0
down vote
accepted
Consider using classes for your selectors and not unique id's, the way you use them is not the way you are supposed to do that. Especially if the selectors are just a line color, you can always define the selector with a more dynamic option:
style: [
{
selector: 'node',
style: {
'shape': 'data(faveShape)',
'content': 'data(DisplayName)',
'height': 'data(faveHeight)',
'width': 'data(faveWidth)',
'background-color': 'data(faveColor)',
'line-color': 'data(faveLineColor)',
'font-family': 'data(faceFontFam)',
'font-size': 'data(faveFontSize)'
}
},
...
]
And when you add nodes/edges, use the logic from your python code and get the color of the element, after that, just put that variable in the cy.add() and you are good to go:
cy.add({
data: {
id: 'yourId',
...
faveLineColor: 'yourLineColor',
...
},
...
});
Consider using classes for your selectors and not unique id's, the way you use them is not the way you are supposed to do that. Especially if the selectors are just a line color, you can always define the selector with a more dynamic option:
style: [
{
selector: 'node',
style: {
'shape': 'data(faveShape)',
'content': 'data(DisplayName)',
'height': 'data(faveHeight)',
'width': 'data(faveWidth)',
'background-color': 'data(faveColor)',
'line-color': 'data(faveLineColor)',
'font-family': 'data(faceFontFam)',
'font-size': 'data(faveFontSize)'
}
},
...
]
And when you add nodes/edges, use the logic from your python code and get the color of the element, after that, just put that variable in the cy.add() and you are good to go:
cy.add({
data: {
id: 'yourId',
...
faveLineColor: 'yourLineColor',
...
},
...
});
edited Nov 15 at 5:56
answered Nov 14 at 8:11
Stephan T.
535420
535420
Thanks @Stephan T. for your reply. I have different types of nodes and edges to be highlighted in different color. Can you please help me how to group them ?
– user10340258
Nov 15 at 5:03
If you do it like in my answer, there will be no need of grouping them, you just have to add a color field in the data part of your nodes/edges. I don't know what your data looks like (the data used for adding the nodes and edges to cy), if you can provide some sort of example that would be great :)#
– Stephan T.
Nov 15 at 5:12
I am adding data like this ,elements:{nodes:[{ data: { id:"n0",label:"A2" } },.....and for edges edges:[{"data": {"id": "e0","source": "n2","target": "n0"}},
– user10340258
Nov 15 at 5:29
And how do you know which color each element has? Which criteria is responsible for that?
– Stephan T.
Nov 15 at 5:33
I am defining color by .selector. I have a python code which prints .selector commands in .js file. At present I am using .selector("#e19,#e2,#e5,#e4,#e9,#e15").css({"line-color":"blue"}) which is also not working for large data.
– user10340258
Nov 15 at 5:36
|
show 4 more comments
Thanks @Stephan T. for your reply. I have different types of nodes and edges to be highlighted in different color. Can you please help me how to group them ?
– user10340258
Nov 15 at 5:03
If you do it like in my answer, there will be no need of grouping them, you just have to add a color field in the data part of your nodes/edges. I don't know what your data looks like (the data used for adding the nodes and edges to cy), if you can provide some sort of example that would be great :)#
– Stephan T.
Nov 15 at 5:12
I am adding data like this ,elements:{nodes:[{ data: { id:"n0",label:"A2" } },.....and for edges edges:[{"data": {"id": "e0","source": "n2","target": "n0"}},
– user10340258
Nov 15 at 5:29
And how do you know which color each element has? Which criteria is responsible for that?
– Stephan T.
Nov 15 at 5:33
I am defining color by .selector. I have a python code which prints .selector commands in .js file. At present I am using .selector("#e19,#e2,#e5,#e4,#e9,#e15").css({"line-color":"blue"}) which is also not working for large data.
– user10340258
Nov 15 at 5:36
Thanks @Stephan T. for your reply. I have different types of nodes and edges to be highlighted in different color. Can you please help me how to group them ?
– user10340258
Nov 15 at 5:03
Thanks @Stephan T. for your reply. I have different types of nodes and edges to be highlighted in different color. Can you please help me how to group them ?
– user10340258
Nov 15 at 5:03
If you do it like in my answer, there will be no need of grouping them, you just have to add a color field in the data part of your nodes/edges. I don't know what your data looks like (the data used for adding the nodes and edges to cy), if you can provide some sort of example that would be great :)#
– Stephan T.
Nov 15 at 5:12
If you do it like in my answer, there will be no need of grouping them, you just have to add a color field in the data part of your nodes/edges. I don't know what your data looks like (the data used for adding the nodes and edges to cy), if you can provide some sort of example that would be great :)#
– Stephan T.
Nov 15 at 5:12
I am adding data like this ,elements:{nodes:[{ data: { id:"n0",label:"A2" } },.....and for edges edges:[{"data": {"id": "e0","source": "n2","target": "n0"}},
– user10340258
Nov 15 at 5:29
I am adding data like this ,elements:{nodes:[{ data: { id:"n0",label:"A2" } },.....and for edges edges:[{"data": {"id": "e0","source": "n2","target": "n0"}},
– user10340258
Nov 15 at 5:29
And how do you know which color each element has? Which criteria is responsible for that?
– Stephan T.
Nov 15 at 5:33
And how do you know which color each element has? Which criteria is responsible for that?
– Stephan T.
Nov 15 at 5:33
I am defining color by .selector. I have a python code which prints .selector commands in .js file. At present I am using .selector("#e19,#e2,#e5,#e4,#e9,#e15").css({"line-color":"blue"}) which is also not working for large data.
– user10340258
Nov 15 at 5:36
I am defining color by .selector. I have a python code which prints .selector commands in .js file. At present I am using .selector("#e19,#e2,#e5,#e4,#e9,#e15").css({"line-color":"blue"}) which is also not working for large data.
– user10340258
Nov 15 at 5:36
|
show 4 more comments
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53295111%2fmaximum-call-stack-size-exceeded-jquery-cytoscape%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown