alexa
menu

Blazor

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Search Results for

    Show / Hide Table of Contents

    Class DiagramRect

    Represents the width, height, and position of a rectangle in a SfDiagramComponent.

    Inheritance
    object
    DiagramRect
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Syncfusion.Blazor.Diagram
    Assembly: Syncfusion.Blazor.dll
    Syntax
    public class DiagramRect
    Remarks

    This class provides functionality to define and work with rectangular boundaries within a diagram.

    Objects of this class can interact with other components within the diagram to provide spatial definitions and positional data.

    Examples
    <SfDiagramComponent @ref = "diagram" Width="1000px" Height="1000px" @bind-Nodes="Nodes">
    </SfDiagramComponent>    
    @code
    {
        SfDiagramComponent diagram;
        private async Task PageBounds()
        {
            DiagramRect bounds = diagram.GetPageBounds();
        }
    }

    Constructors

    DiagramRect()

    Initializes a new instance of the DiagramRect.

    Declaration
    public DiagramRect()

    DiagramRect(DiagramRect)

    Initializes a new instance of the DiagramRect class using the specified src.

    Declaration
    public DiagramRect(DiagramRect src)
    Parameters
    Type Name Description
    DiagramRect src

    A DiagramRect from which the new instance is created. It should not be null.

    DiagramRect(double?, double?, double?, double?)

    Initializes a new instance of the DiagramRect class with specified coordinates, width, and height.

    Declaration
    public DiagramRect(double? x, double? y, double? width, double? height)
    Parameters
    Type Name Description
    double? x

    The x-coordinate of the top-left corner of the rectangle. If x is null, the default is MaxValue.

    double? y

    The y-coordinate of the top-left corner of the rectangle. If y is null, the default is MaxValue.

    double? width

    The width of the rectangle. If width is null, the default value is 0.

    double? height

    The height of the rectangle. If height is null, the default value is 0.

    Properties

    Bottom

    Gets the y-coordinate of the rectangle's bottom side.

    Declaration
    public double Bottom { get; }
    Property Value
    Type Description
    double

    A double representing the y-coordinate, calculated as Y + Height. The default value is 0.

    Remarks

    This property is essential for determining the vertical extent of the rectangle.

    Height

    Gets or sets the rectangle's height.

    Declaration
    [JsonPropertyName("height")]
    public double Height { get; set; }
    Property Value
    Type Description
    double

    A double representing the height of the rectangle. No default value is specified for this property.

    Remarks

    The height determines the vertical extent of the rectangle. Ensure that this value is positive for a valid rectangle.

    Left

    Gets the x-coordinate of the rectangle's left side.

    Declaration
    public double Left { get; }
    Property Value
    Type Description
    double

    A double representing the x-coordinate. The default value is 0.

    Remarks

    This property defines the horizontal starting point of the rectangle.

    Right

    Gets the x-coordinate of the rectangle's right side.

    Declaration
    public double Right { get; }
    Property Value
    Type Description
    double

    A double representing the x-coordinate, calculated as X + Width. The default value is 0.

    Remarks

    This property is used to determine the boundary for horizontal alignment.

    Top

    Gets the y-coordinate of the rectangle's top side.

    Declaration
    public double Top { get; }
    Property Value
    Type Description
    double

    A double representing the y-coordinate. The default value is 0.

    Remarks

    This property defines the vertical starting point of the rectangle.

    Width

    Gets or sets the rectangle's width.

    Declaration
    [JsonPropertyName("width")]
    public double Width { get; set; }
    Property Value
    Type Description
    double

    A double representing the width of the rectangle. No default value is specified for this property.

    Remarks

    The width determines the horizontal extent of the rectangle. Ensure that this value is positive for a valid rectangle.

    X

    Gets or sets the x-axis value on the rectangle's left side.

    Declaration
    [JsonPropertyName("x")]
    public double X { get; set; }
    Property Value
    Type Description
    double

    A double representing the x-coordinate of the rectangle's starting point on the x-axis. The default value is MaxValue.

    Remarks

    This property defines the horizontal position of the rectangle.

    Y

    Gets or sets the y-axis value on the rectangle's top side.

    Declaration
    [JsonPropertyName("y")]
    public double Y { get; set; }
    Property Value
    Type Description
    double

    A double representing the y-coordinate of the rectangle's starting point on the y-axis. The default value is MaxValue.

    Remarks

    This property defines the vertical position of the rectangle.

    Methods

    Clone()

    Creates a new DiagramRect that is a copy of the current rectangle.

    Declaration
    public object Clone()
    Returns
    Type Description
    object

    A new DiagramRect object that is a clone of the original rectangle.

    In this article
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved