Errors in Diagram functionalities after package update from 22.1.34 to 23.2.7 version

Hi,

After changing the version package from 22.1.34 to 23.2.7 we are facing with errors in Diagram functionalities, that were ok before updating, without any code changes.

This is the error we are getting:

Image_5402_1702391725675

The Diagram  is not showing at all. We are using LayoutType type = LayoutType.ComplexHierarchicalTree. Here is a part from our code ( how we define the Diagram):

public SfDiagramComponent Diagram;

    DiagramObjectCollection<Node> nodes = new DiagramObjectCollection<Node>();

    DiagramObjectCollection<Connector> connectors = new DiagramObjectCollection<Connector>();

    public string enterPosition{ get; set; }

    DiagramInteractions DiagramTool = DiagramInteractions.ZoomPan;

    ScrollLimitMode scrollLimit { get; set; } = ScrollLimitMode.Diagram;

    bool multiplePage = false;

    bool showPageBreak = false;

    DiagramPrintExportRegion region = DiagramPrintExportRegion.PageSettings;

    Syncfusion.Blazor.Diagram.PageOrientation orientation1 = Syncfusion.Blazor.Diagram.PageOrientation.Landscape;


    DiagramRect FocusRect;

    double top = 5;

    double bottom = 5;

    double right = 5;

    double left = 1;

    bool add = true;

    bool delete = true;

    LayoutType type = LayoutType.ComplexHierarchicalTree;

    LayoutOrientation orientation = LayoutOrientation.LeftToRight;

    HorizontalAlignment horizontalAlignment = HorizontalAlignment.Left;

    Syncfusion.Blazor.Diagram.VerticalAlignment verticalAlignment =  Syncfusion.Blazor.Diagram.VerticalAlignment.Top;

    int horizontalSpacing = 50;

    int verticalSpacing = 50;

    private string fixedNode = null;

   <SfDiagramComponent @ref="@Diagram" ID="Diagram1" Height="700px" Width="100%"   Connectors="@connectors" Nodes="@nodes" NodeCreating="@NodeCreating"  >

               <Syncfusion.Blazor.Diagram.Layout @bind-Type="@type" @bind-HorizontalSpacing="@horizontalSpacing" @bind-FixedNode="@fixedNode"  @bind-Orientation="@orientation" @bind-VerticalSpacing="@verticalSpacing" @bind-HorizontalAlignment="@horizontalAlignment" @bind-VerticalAlignment="@verticalAlignment">

                     <LayoutMargin  @bind-Top="@top" @bind-Bottom="@bottom" @bind-Right="@right" @bind-Left="@left"></LayoutMargin>

                </Syncfusion.Blazor.Diagram.Layout>

                    </SfDiagramComponent> 

<div class="col-lg-4" style=" width:600px; padding:0px;right:0px;bottom:5px;border: #eeeeee;border-style: solid;box-shadow: 0px 2px 2px rgba(0,0,0,0.3); background:#f7f7f7;position:absolute">

        <div style="top:100px" >

           <SfDiagramOverviewComponent Height="150px" SourceID="Diagram1"></SfDiagramOverviewComponent>

        </div>

        </div>

 

We tried to solve the error and add  SamePoint="true" LinearArrangement="true" (that we found in the examples from the documentation) to the definition of the Diagram. With that change the Diagram displays, but not as before. Here is the picture how it was displayed before:

Image_6533_1702393375888  This is how is displayed  now,  with the same settings:

Image_2684_1702393272832

When Linear Arrangement is not included or the value is false, the component throws exception

Image_1280_1702392644363

Also, the tooltip is not shown, nodes and connectors can not be selected/ drag/ drop  which was working before. When pointer events are included in node constraints there’s also an exception :

Image_6030_1702392745528

This is the code where we create nodes:
Node node11 = new Node()

                {

                    ID = jazol.idPozicija.ToString(),

                    OffsetX = 55 + x,

                    OffsetY = 78 + y,

                    Annotations = new DiagramObjectCollection<ShapeAnnotation>()

                    {

                        new ShapeAnnotation

                        {

                            Content = jazol.grupenBroj,

                            // Sets the offset for an annotation's content.

                            Offset = new DiagramPoint() { X = 0.5, Y = 0.5 }

                        },

                        new ShapeAnnotation

                        {

                            Content = jazol.imePozicija, Visibility = false,

                            Offset = new DiagramPoint() { X = 0.5, Y = 0.5 }

                        },

                        new ShapeAnnotation

                        {

                            Content = jazol.OpisNaRabota, Visibility = false,

                            Offset = new DiagramPoint() { X = 0.5, Y = 0.5 }

                        },

                        new ShapeAnnotation()

                        {

                            Content = jazol.duration, Offset = new DiagramPoint() { X = 0.1, Y = 0.1 }

                        },

                        new ShapeAnnotation()

                        {

                            Content = jazol.eStart.ToString(), Offset = new DiagramPoint() { X = 0.3, Y = 0.3 }

                        },

                        new ShapeAnnotation()

                        {

                            Content = jazol.eEnd.ToString(), Offset = new DiagramPoint() { X = 0.7, Y = 0.3 }

                        },

                        new ShapeAnnotation()

                        {

                            Content = jazol.lStart.ToString(), Offset = new DiagramPoint() { X = 0.3, Y = 0.7 }

                        },

                        new ShapeAnnotation()

                        {

                            Content = jazol.lEnd.ToString(), Offset = new DiagramPoint() { X = 0.7, Y = 0.7 } ,

                        }                      

                    },                

                    Tooltip = new DiagramTooltip() { Content = @L["Opis"] + ":  " + jazol.imePozicija + "<br>" + @L["Vremetraenje"] + ":  " + jazol.duration + "<br>" + @L["ES"] + ":  " + jazol.eStart + "<br>" + @L["EF"] + ":  " + jazol.eEnd + "<br>" + @L["LS"] + ":  " + jazol.lStart + "<br>" + @L["LF"] + ":  " + jazol.lEnd + "<br>"  + @L["StartPositionDate"] + ":  " + jazol.startPositionDate.ToShortDateString() + "<br>"  + @L["EndPositionDate"] + ":  " + jazol.endPositionDate.ToShortDateString(), Position = Syncfusion.Blazor.Popups.Position.RightCenter, OpensOn = "Click" , ShowTipPointer = true  },                 

                    

 Constraints = NodeConstraints.InConnect| NodeConstraints.OutConnect | NodeConstraints.Tooltip|NodeConstraints.Select | NodeConstraints.AllowDrop | NodeConstraints.Drag |NodeConstraints.Inherit

                };

            nodes.Add(node11);


When the constraints are defined like this, there’s no exception, but they don’t do do function that should do. If  they are defined using ~  :
                    Constraints =
NodeConstraints.InConnect| NodeConstraints.OutConnect |~ NodeConstraints.Tooltip|NodeConstraints.Select | NodeConstraints.AllowDrop | NodeConstraints.Drag |NodeConstraints.Inherit

The component throws this exception:


Image_5377_1702392978087


Sorry for the long explanation. I hope you will give us a solution.


Thanks in advance.


Regards,


1 Reply

SU Sumathi Uthayakumar Syncfusion Team December 13, 2023 11:45 AM UTC

Hi Ana-li,


Please find the response to your query


Query

Response

When Linear Arrangement is not included or the value is false, the component throws exception

We have prepared a simple sample based on the shared screenshot. We did not encounter any issues when we set LinearArrangement as false or when we did not set LinearArrangement and set SamePoint as true. We have shared the sample that we tried at our end.

 

Could you please replicate your issue in the shared sample or share a sample that replicates your issue?

Also, the tooltip is not shown, nodes and connectors can not be selected/ drag/ drop  which was working before. When pointer events are included in node constraints there’s also an exception :

We did not face any issues when including PointerEvents in the node's constraints. We have shared a sample for your reference.

When the constraints are defined like this, there’s no exception, but they don’t do do function that should do. If  they are defined using ~  :
                    Constraints = 
NodeConstraints.InConnect| NodeConstraints.OutConnect |~ NodeConstraints.Tooltip|NodeConstraints.Select | NodeConstraints.AllowDrop | NodeConstraints.Drag |NodeConstraints.Inherit

In the shared code snippet, you attempted to include node constraints, but you need to add constraints as shown below:

 

// Enable the tooltip constraints for the node.

node.Constraints = NodeConstraints.Default | NodeConstraints.Tooltip;

 

Additionally, you can remove constraints from the node as shown below:

 

// Removing multiple constraints from default.

NodeConstraints NodeConstraints = NodeConstraints.Default & ~(NodeConstraints.Select | NodeConstraints.Drag);

 

We have shared a User Guide link for your reference.

UG link: https://blazor.syncfusion.com/documentation/diagram/constraints#node-constraints




Regards,

Sumathi U.




Attachment: ComplexHierarchicalTree_e37f23e2.zip

Loader.
Up arrow icon