- Welcome, Guest. Please Login or Register
MindFusion  
  Now beta testing first versions of our Scheduler and Virtual Keyboard components for HTML & JavaScript.  
  HomeHelpSearchLoginRegister   
     
     
   
 
Page Index Toggle Pages: 1 Send Topic Print  
Diagram - Load from Json
Read 79 times

Ghaith   Offline
YaBB Newbies
*
Posts: 21
I Love MindFusion!


   
     
 
Diagram - Load from Json
Nov 7th, 2017 at 5:27pm
 
Dear,

In my application, I am using

this.diagramView.LoadFromJson(json_value);

and it is working fine, BUT when it is a very big diagram (Json length=5,000,000 char) , it is just crashing.


"Exception thrown: 'System.ArgumentException' in System.Web.Extensions.dll

Additional information: Erreur lors de la sérialisation ou de la désérialisation à l'aide de JSON JavaScriptSerializer. La longueur de la chaîne dépasse la valeur définie dans la propriété maxJsonLength."


is it possible to divide loading the nodes?
or any other solution
 
 
 
IP Logged    
 
     

Slavcho   Offline
God Member
*****
Posts: 1253
Gender: male
tech.support


   
     
 
Re: Diagram - Load from Json
Reply #1 - Nov 8th, 2017 at 8:38am
 
You could load your data over web service and build diagram from it on client side. That should transfer far fewer bytes than full serialized diagram, and also shows the diagram faster if you transfer in several chunks and add to the diagram asynchronously. For example see OrgBrowser sample project - yours could do something similar, but request more nodes from a timer event handler instead of click event. Otherwise try setting larger maxJsonLength in web.config - that's an ASP.NET setting.

Regards,
Slavcho
 
 
 
IP Logged    
 
     

Ali Raza   Offline
YaBB Newbies
*
Posts: 1
I Love MindFusion!


   
     
 
Re: Diagram - Load from Json
Reply #2 - Nov 20th, 2017 at 8:01pm
 
Dear Slavcho,
How can we request more nodes from a timer event handler instead of click event(+/-)?
 
 
 
IP Logged    
 
     

Slavcho   Offline
God Member
*****
Posts: 1253
Gender: male
tech.support


   
     
 
Re: Diagram - Load from Json
Reply #3 - Nov 21st, 2017 at 12:16pm
 
Hi,

Instead of the nodeExpanded event handler shown in that example, run similar code from a setInterval handler. If your diagrams are trees as in the example, the web service could do something similar - return children of specified parent, and the client side adding a node's children on each response.

If it's an arbitrary graph, you could represent the graphs as adjacency list and transfer parts of the list, adding links and nodes with each response. E.g. your storage / database might look like linkId / sourceId / destId / texts / etc:

1: 1 -> 2
2: 1 -> 3
3: 2 -> 4
4: 3 -> 4
...

and you transfer only some rows of the full list. In the response handler you only create links between the nodes if nodes with specified IDs already exist, or otherwise also create nodes.

Regards,
Slavcho
 
 
 
IP Logged    
 
     
Page Index Toggle Pages: 1 Send Topic Print