documentationfor yFiles for HTML 2.6

Represents the size of a rectangular object with a given width and height.

Inheritance Hierarchy
Size
Implemented Interfaces

Remarks

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 Size:

[20, 20] // width, height
{ width: 20, height: 20 }

Examples

The following example shows a few ways to use Size:
// Create a new size
const size = new Size(10, 15)

console.log(
  `The size has width ${size.width} and height ${size.height} representing an area of ${size.area}`
)

// Create another size
const size2 = new Size(5, 17)

// Enlarge it by multiplying with a factor
const larger = size2.multiply(1.5)

// Make the first size only half as large
const half = size.multiply(0.5)

Type Details

yfiles module
view-component
yfiles-umd modules
All view modules
Legacy UMD name
yfiles.geometry.Size

Sample Graphs

Constructors

Properties

Methods

Constants

Static Methods