Class DiagramRect
Represents the width, height, and position of a rectangle in a SfDiagramComponent.
Inheritance
Namespace: Syncfusion.Blazor.Diagram
Assembly: Syncfusion.Blazor.dll
Syntax
public class DiagramRect : Object
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(Nullable<Double>, Nullable<Double>, Nullable<Double>, Nullable<Double>)
Initializes a new instance of the DiagramRect class with specified coordinates, width, and height.
Declaration
public DiagramRect(Nullable<double> x, Nullable<double> y, Nullable<double> width, Nullable<double> height)
Parameters
Type | Name | Description |
---|---|---|
System.Nullable<System.Double> | x | The x-coordinate of the top-left corner of the rectangle. If |
System.Nullable<System.Double> | y | The y-coordinate of the top-left corner of the rectangle. If |
System.Nullable<System.Double> | width | The width of the rectangle. If |
System.Nullable<System.Double> | height | The height of the rectangle. If |
Properties
Bottom
Gets the y-coordinate of the rectangle's bottom side.
Declaration
public double Bottom { get; }
Property Value
Type | Description |
---|---|
System.Double | A System.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
public double Height { get; set; }
Property Value
Type | Description |
---|---|
System.Double | A System.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 |
---|---|
System.Double | A System.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 |
---|---|
System.Double | A System.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 |
---|---|
System.Double | A System.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
public double Width { get; set; }
Property Value
Type | Description |
---|---|
System.Double | A System.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
public double X { get; set; }
Property Value
Type | Description |
---|---|
System.Double | A System.Double representing the x-coordinate of the rectangle's starting point on the x-axis. The default value is System.Double.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
public double Y { get; set; }
Property Value
Type | Description |
---|---|
System.Double | A System.Double representing the y-coordinate of the rectangle's starting point on the y-axis. The default value is System.Double.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 |
---|---|
System.Object | A new DiagramRect object that is a clone of the original rectangle. |