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 (for loading via script tags),
extensionsTS (UMD modules), or
extensionsJSM (ES6 modules) folders. See the Extensions intro page for more information.
Create a minimal layout that only positions Nodes that do not have a location.
Optional initialization properties.
This read-only property returns the number of columns in this TableLayout. This value is only valid after the layout has been performed.
Gets or sets the alignment to use by default for Parts in rows (vertically) and in columns (horizontally).
The default value is Spot.Default. Setting this property does not raise any events.
Gets or sets whether Parts should be stretched in rows (vertically) and in columns (horizontally).
The default value is GraphObject.Default. Setting this property does not raise any events.
This read-only property returns the number of rows in this TableLayout. This value is only valid after the layout has been performed.
Copies properties to a cloned Layout.
Returns the cell at a given x-coordinate in document coordinates. This information is only valid when this layout has been performed and Layout.isValidLayout is true.
If the point is to left of the column 0, this method returns -1. If the point to to the right of the last column, this returns the last column + 1.
a zero-based integer
Returns the row at a given y-coordinate in document coordinates. This information is only valid when this layout has been performed and Layout.isValidLayout is true.
If the point is above row 0, this method returns -1. If the point below the last row, this returns the last row + 1.
a zero-based integer
Gets the RowColumnDefinition for a particular column in this TableLayout. If you ask for the definition of a column at or beyond the columnCount, it will automatically create one and return it.
the non-negative zero-based integer column index.
Gets the RowColumnDefinition for a particular row in this TableLayout. If you ask for the definition of a row at or beyond the rowCount, it will automatically create one and return it.
the non-negative zero-based integer row index.
This Layout positions non-Link Parts into a table according to the values of GraphObject.row, GraphObject.column, GraphObject.rowSpan, GraphObject.columnSpan, GraphObject.alignment, GraphObject.stretch. If the value of GraphObject.stretch is not GraphObject.None, the Part will be sized according to the available space in the cell(s).
You can specify constraints for whole rows or columns by calling getRowDefinition or getColumnDefinition and setting one of the following properties: RowColumnDefinition.alignment, RowColumnDefinition.height, RowColumnDefinition.width, RowColumnDefinition.maximum, RowColumnDefinition.minimum, RowColumnDefinition.stretch.
The defaultAlignment and defaultStretch properties apply to all parts if not specified on the individual Part or in the corresponding row or column definition.
At the current time, there is no support for separator lines (RowColumnDefinition.separatorStroke, RowColumnDefinition.separatorStrokeWidth, and RowColumnDefinition.separatorDashArray properties) nor background (RowColumnDefinition.background and RowColumnDefinition.coversSeparators properties). There is no support for RowColumnDefinition.sizing, either.
If you want to experiment with this extension, try the Table Layout sample.