Creates a LayoutGrid that matches a given table configuration of an IGraph and returns a LayoutGridData<TNode,TEdge,TNodeLabel,TEdgeLabel> for that grid.
Remarks
Type Details
- yFiles module
- view-layout-bridge
See Also
Constructors
Creates a new instance.
Parameters
A map of options to pass to the method.
- minimumTableDistance - number
- The minimum distance between two different table nodes. This option sets the minimumTableDistance property on the created object.
- compaction - boolean
- Whether size compaction for table nodes is enabled. This option sets the compaction property on the created object.
- horizontalLayout - boolean
- Whether the configurator will prepare its associated graph for a vertical (that is top-to-bottom or bottom-to-top) layout calculation or a horizontal (that is left-to-right or right-to-left) one. This option sets the horizontalLayout property on the created object.
- fromSketch - boolean
- Whether 'from sketch' mode is enabled. This option sets the fromSketch property on the created object.
Properties
Gets or sets whether size compaction for table nodes is enabled.
Remarks
If size compaction is enabled, the size of a column or row (or a table node for that matter) may be reduced due to layout calculation, but never below the column's or row's minimum size. If size compaction is disabled, columns and rows (and therefore table nodes) may only grow due to layout calculation.
The default value for this property is true
.
Gets or sets whether 'from sketch' mode is enabled.
Remarks
Gets the LayoutGrid created in the prepare method.
Methods
Returns the LayoutGridCellDescriptor assigned to the node
.
Remarks
Parameters
A map of options to pass to the method.
- node - INode
- The node to return the assigned cell for.
Returns
- ↪LayoutGridCellDescriptor?
- The LayoutGridCellDescriptor assigned to the
node
.
Returns the ITable the node
belongs to.
Remarks
The node to table association is resolved in prepare and is only valid before restore is called so an InvalidOperationError is thrown when this method isn't called between those two.
The associated table is the ITable provided by the node itself or one of its ancestors via lookup. If no associated table can be found, null
is returned.
Parameters
A map of options to pass to the method.
- node - INode
- The node to lookup the table for.
Returns
- ↪ITable?
Returns the LayoutGridColumn in the grid to which the leafColumn
is mapped.
Remarks
The columns are mapped to the grid in prepare and are only valid before restore is called so an InvalidOperationError is thrown when this method isn't called between those two.
Note that only leaf columns (columns with no childColumns) are mapped to grid columns so null
is returned for any other column.
Parameters
A map of options to pass to the method.
- leafColumn - IColumn
- The column to return the column descriptor for.
Returns
- ↪LayoutGridColumn?
- The LayoutGridColumn the
leafColumn
is mapped to.
Return the sizes of all leaf rows.
Remarks
originalTable
. You also need to call cleanUp explicitly if you don't need the TableLayoutConfigurator anymore.Parameters
A map of options to pass to the method.
Returns
- ↪number[]
- The sizes of all leaf rows in
originalTable
, in their natural order.
Returns the LayoutGridRow of the row in the grid to which the leafRow
is mapped.
Remarks
The rows are mapped to the grid in prepare and are only valid before restore is called so an InvalidOperationError is thrown when this method isn't called between those two.
Note that only leaf rows (rows with no childRows) are mapped to grid rows so null
is returned for any other row.
Parameters
A map of options to pass to the method.
- leafRow - IRow
- The row to return the row descriptor for.
Returns
- ↪LayoutGridRow?
- The LayoutGridRow the
leafRow
is mapped to.
Return the sizes of all leaf rows.
Remarks
originalTable
. You also need to call cleanUp explicitly if you don't need the TableLayoutConfigurator anymore.Parameters
A map of options to pass to the method.
Returns
- ↪number[]
- The sizes of all leaf rows in
originalTable
, in their natural order.
Returns the INode which provides the table
in its lookup.
Remarks
Parameters
A map of options to pass to the method.
- table - ITable
- The table for which the corresponding owner node is searched.
Returns
- ↪INode?
Setup layout grid information from a graph that contains table structures
Parameters
A map of options to pass to the method.
- graph - IGraph
- The graph to prepare a LayoutGridData<TNode,TEdge,TNodeLabel,TEdgeLabel> for.
Returns
- ↪LayoutGridData<INode,IEdge,ILabel,ILabel>?
- A LayoutGridData<TNode,TEdge,TNodeLabel,TEdgeLabel> instance for all tables in the graph, or
null
if no LayoutGrid is necessary.
Write back all information from the layout grid