Remote data binding - flow diagram, incomplete diagram

     Can you provide an example of remote data binding for a flow type of diagram (I have only found for hierarchical ones)? In my case, I access two endpoints which return two lists of nodes and connections. For some reason, not all connections are drawn on the diagram although the list of connections ( of type ConnectorModel ) is created correctly (it is complete), I am guessing that it is a data binding problem. What should I do?
     Thank you!

4 Replies

CR Cristina Radulescu June 4, 2020 07:18 AM UTC

I found the problem, the connector id's weren't unique.


AR Aravind Ravi Syncfusion Team June 4, 2020 07:30 AM UTC

Hi Cristina, 

Thanks for the update. Please let us know whether you need any further assistance on this. 

Regards 
Aravind Ravi 



EI ESRA INCE May 13, 2022 12:32 PM UTC

Hi, I want to bind nodemodel's width height property from out source data class. When I try to bind it like following it is not reflected, how can I solve it ? 



AR Aravind Ravi Syncfusion Team May 16, 2022 12:49 PM UTC

Hi Esra,


We have created a sample to bind the height and width of the nodemodel from external data. Diagram can be populated based on the user-defined JSON data (Local Data) by mapping the relevant data source fields. By using the DataManager we can able to bind the diagram from an external datasource. In the datasource’s doBinding bind the height and width of external data to the node’s height and width. Please refer to the below code snippet and sample


public Data: any = [

    {

      Name: 'Diagram',

      fillColor: '#916DAF',

      height: 150,

      width: 150,

    },

    {

      Name: 'Layout',

      Category: 'Diagram',

      height: 100,

      width: 100,

    },

    {

      Name: 'Tree Layout',

      Category: 'Layout',

      height: 75,

      width: 75,

    },

    {

      Name: 'Organizational Chart',

      Category: 'Layout',

      height: 75,

      width: 75,

    },

];

 

public data: Object = {

    //sets the fields to bind

    id: 'Name',

    parentId: 'Category',

    dataSource: new DataManager(this.Data),

    //binds the data with the nodes

    doBinding: (nodeModel: NodeModel, data: object, diagram: Diagram) => {

// Bind the height and width to node

      nodeModel.height = (data as any).height;

      nodeModel.width = (data as any).width;

    },

  };


Sample: https://stackblitz.com/edit/angular-frx78t


Regards

Aravind Ravi


Loader.
Up arrow icon