We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Custom shapes in diagram control

Thread ID:

Created:

Updated:

Platform:

Replies:

148624 Oct 28,2019 12:55 PM UTC Oct 29,2019 11:55 AM UTC Blazor 1
loading
Tags: Diagram
Wolfgang Steinert
Asked On October 28, 2019 12:55 PM UTC

Hi there,

I am trying out the diagram control in Blazor and wanted to ask whether it is possible to customize the complete appearance of a diagram node, and if it is possible: how? :)

For example, imagine I wanted a node to look like this: https://ibb.co/hLSBPvB

Is it possible to achieve this?

Thank you,
Wolfgang

Shyam G [Syncfusion]
Replied On October 29, 2019 11:55 AM UTC

Hi Wolfgang, 
 
Yes, you can use our group node to customize the appearance of a diagram node similar to your shared link. We have created a sample in which we have rendered a group node similar to your shared link. Please refer to a code example and sample below. 
 
Code example: 
@*create diagram*@ 
<EjsDiagram Width="100%" Height="800px"> 
   @*create nodes collection*@ 
        <DiagramNodes> 
            @*create node*@ 
            <DiagramNode Id="nodeA" Height="100" Width="400" OffsetX="500" OffsetY="300"> 
                @*set node style*@ 
                <NodeShapeStyle StrokeWidth="5"></NodeShapeStyle> 
                @*create node annotations*@ 
                <DiagramNodeAnnotations> 
                    @*set annotation content*@ 
                    <DiagramNodeAnnotation Content="Cluster Node B"> 
                        @*change annotation style*@ 
                        <NodeAnnotationStyle Bold="true"></NodeAnnotationStyle> 
                        @*change annotation offset*@ 
                        <NodeAnnotationOffset X="0.5" Y="0.5"></NodeAnnotationOffset> 
                    </DiagramNodeAnnotation> 
                </DiagramNodeAnnotations> 
            </DiagramNode> 
            <DiagramNode Id="nodeB" Height="100" Width="100" OffsetX="350" OffsetY="200"> 
                 . . . 
                  . . . 
            </DiagramNode> 
            <DiagramNode Id="nodeC" Height="100" Width="300" OffsetX="550" OffsetY="200"> 
              . . .  
              . . . 
            </DiagramNode> 
            @*create group node*@ 
            <DiagramNode Id="firstGroup" Children="@firstGroupChildren"> 
            </DiagramNode> 
</DiagramNodes> 
</EjsDiagram> 
 
 
@functions{ 
    @*set children for group node*@ 
    private string[] firstGroupChildren { get; set; } = new string[] { "nodeA", "nodeB", "nodeC" }; 
} 
 
 
 
Note: 
 
In blazor, we can render static diagram with basic interaction such as zooming and panning. We have planned to provide interaction support in the diagram for our volume 4, release which is scheduled to release by the month of December, 2019. 
 
 
Regards, 
Shyam G 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon