treant-js
treant-js copied to clipboard
Error: <path> attribute d: Expected number, "M,0,0" when collapsed=true
Hi, when my JSon configuration file contains nodes with the collapsed attibute set to true, I get a lot of errors in the raphael library (see attached image).
I noted that the same error is present in some demo example (collapsed, timeline, ecc).
Is there a way to resolve?
Thank
you in advance
Maurizio
Issue is not with Raphael JS.
It seems that function positionNodes is not able to connect the nodes
hence this.setConnectionToParent(node, hidePoint); // skip the root node is calling it with X and Y as 0,0
This only happens when the node db count is more than 167+
Thanks in Advance Team
Hi, i get the same issue, and only have 15 nodes that need to be rendered... Seems like the functionality is all in tact, its just that it generates a lot of console errors.
Edit: I had someone on my team have a look, and he found that the issue is caused by not resetting the x & y coordinates in the reset function of the TreeNode (added via the prototype).
reset: function(nodeStructure, id, parentId, tree, stackParentId) {
this.id = id;
this.parentId = parentId;
.....
this.X = 0;
this.Y = 0;
return this;
}
@kairynners Were you able to solve it?
@kairynners.... Later I found that it's not about the number of nodes... In my scenario it was giving about the dept of the child nodes... It was failing after depth level goes above 100 ..
Did you found any work around ?
More hack than work arond, but yes. It's actually @kairynners 's solution. Find following function:
reset: function( nodeStructure, id, parentId, tree, stackParentId ) {
And just before return this;
add following code:
this.X = 0;
this.Y = 0;
Probably not the best solution, but it solved my problem FOR NOW.
may i know where exactly should i add it to at my code please? at the config object as a property?
i had
new Treant( my_chart_config );
now , thanks
@LorincJuraj
@Carson12345 unfortunately you have to modify treant file Treant.js
. You have to add
this.X = 0;
this.Y = 0;
Here: https://github.com/fperucic/treant-js/blob/master/Treant.js#L1356 It worked for me with a bit older version of Treant , but it should work with current version too.
@LorincJuraj it works thanks so much for explaining!
@Carson12345 unfortunately you have to modify treant file
Treant.js
. You have to addthis.X = 0;
this.Y = 0;
Here: https://github.com/fperucic/treant-js/blob/master/Treant.js#L1356 It worked for me with a bit older version of Treant , but it should work with current version too.
It worked thx
Thank you @LorincJuraj ! :)
@Carson12345 please advise if I have to create treant script file and reference it in my _layout file? I am new to JS and I am getting this error when my object results suppose to populate morris graphs. here is my code snippet :
@manamelatumelo I don't know about MOrris Graphs, but console says M
or m
, but received Z
.
Maybe you can search for this Z
value and try to use M
or m
.
The other error was solved on previous comment.