Options
All
  • Public
  • Public/Protected
  • All
Menu

Class PanelLayoutFlow

This is an extension and not part of the main GoJS library. Note that the API for this class may change at any time. If you intend to use an extension in production, you should copy the code to your own source directory. Extensions can be found in the GoJS kit under the extensions or extensionsTS folders. See the Extensions intro page for more information.

Hierarchy

A custom PanelLayout that arranges panel elements in rows or columns. A typical use might be:

$(go.Node,
  ...
  $(go.Panel, "Flow",
    ... the elements to be laid out in rows with no space between them ...
  )
  ...
)

A customized use might be:

$(go.Node,
  ...
  $(go.Panel,
    $(PanelLayoutFlow, { spacing: new go.Size(5, 5), direction: 90 }),
    ... the elements to be laid out in columns ...
  )
  ...
)

The direction property determines whether the elements are arranged in rows (if 0 or 180) or in columns (if 90 or 270).

Use the spacing property to control how much space there is between elements in a row or column as well as between rows or columns.

This layout respects the GraphObject.visible, GraphObject.stretch, and GraphObject.alignment properties on each element, along with the Panel's Panel.defaultStretch, Panel.defaultAlignment, and Panel.padding properties.

If you want to experiment with this extension, try the Flow PanelLayout sample.

Index

Constructors

Properties

Methods

Constructors

constructor

  • Constructs a PanelLayoutFlow that lays out elements in rows with no space between the elements or between the rows.

    Returns PanelLayoutFlow

Properties

direction : number

  • Gets or sets the initial direction in which elements are laid out. The value must be 0 or 180, which results in rows, or 90 or 270, which results in columns.

    The default value is 0, resulting in rows that go rightward. A value of 90 results in columns that go downward.

    Setting this property does not notify about any changed event, nor does a change in value automatically cause the panel layout to be performed again.

spacing : Size

  • Gets or sets the space between adjacent elements in the panel and the space between adjacent rows or columns.

    The default value is (0, 0). The size is in the panel's coordinate system.

    Setting this property does not notify about any changed event, nor does a change in value automatically cause the panel layout to be performed again.

Methods

Override arrange

Override measure

  • measure(panel: Panel, width: number, height: number, elements: GraphObject[], union: Rect, minw: number, minh: number): void
  • Parameters

    • panel: Panel
    • width: number
    • height: number
    • elements: GraphObject[]
    • union: Rect
    • minw: number
    • minh: number

    Returns void