Interface for rectangles aligned to the axes in 2D coordinate space with double precision coordinates.
Inheritance Hierarchy
Implemented Interfaces
This interface provides read access to the features of the rectangle only, however this does not mean that an instance that implements IRectangle
will always return the same values for its properties. Often times the instance provides a dynamic read access to the current state of a rectangle. It depends on the context whether it is allowed to or even necessary to copy the state of the properties or whether the reference to the instance should always be used to query the values. This interface does not declare any additional methods. It combines the IPoint interface that describes the upper left corner of the rectangle with the ISize interface that describes the width and height of the rectangle.
This is a convertible type that can be used with the following notation(s) in parameter lists, parameter objects or setters.
It is possible to specify an Object or plain Object to define the Rect:
[5, 5, 20, 20]
{ x: 5, y: 5, width: 20, height: 20 }
- yfiles module
- view-component
- yfiles-umd modules
- All view modules
- Legacy UMD name
- yfiles.geometry.IRectangle
Gets the coordinates of the bottom left corner of the rectangle as a Point.
Gets the coordinates of the bottom right corner of the rectangle as a Point.
Gets the coordinates of the center of the rectangle as a Point.
Gets the current height of this instance.
Depending on context the values returned may change over time.
Determines whether the specified rectangle is empty.
Gets the maximum X coordinate of the rectangle.
This is the x coordinate of the right side of the rectangle, or the left side if the rectangle is
isEmpty.
Gets the maximum Y coordinate of the rectangle.
This is the y coordinate of the bottom side of the rectangle, or the top side if the rectangle is
isEmpty.
Gets the coordinates of the top left corner of the rectangle as a Point.
Gets the coordinates of the top right corner of the rectangle as a Point.
Gets the current width of this instance.
Depending on context the values returned may change over time.
Gets the current x coordinate of this point.
Depending on context the values returned may change over time.
Gets the current y coordinate of this point.
Depending on context the values returned may change over time.
Determines whether the given rectangle contains the provided point.
options - Object
A map of options to pass to the method.
- point - IPoint
The point to test.
- ↪boolean
true
iff the point lies inside the rectangle.
Calculates the Euclidean distance between two points.
options - Object
A map of options to pass to the method.
- point2 - IPoint
The second point.
- ↪number
The distance between the two points.
Copies the current values of the coordinates of the point to a Point struct.
This method is useful to obtain a copy of the state and for making use of the various utility methods that are provided by
Point.
- ↪Point
The current values of the coordinates of the point.
Copies the current values of the rectangle to Rect struct.
This method can be used to obtain a copy of the current state of the rectangle and for using the utility methods that are available for the
Rect type.
- ↪Rect
A
Rect that holds the values of the
rectangle
at the time of the invocation.
Converts the ISize to a Size struct.
- ↪Size
A
Size struct that has been initialized with the current values of
size
.
Creates a Rect instance from the given rectangle-like object by performing automatic type conversion.
options - Object
A map of options to pass to the method.
- rectLike - Rect
The object to convert to a
Rect.
- ↪Rect
The given
rectLike
if it is already a
Rect, or a new instance initialized to the values found in
rectLike
.