# Node Size Constraints

Property | Value
--- | ---
Identifier: | `org.eclipse.elk.nodeSize.constraints`
Meta Data Provider: | `core.options.CoreOptions`
Value Type: | `java.util.EnumSet<org.eclipse.elk.core.options.SizeConstraint>`
Possible Values: | `PORTS` `PORT_LABELS` `NODE_LABELS` `MINIMUM_SIZE`
Default Value: | `EnumSet.noneOf(SizeConstraint)` (as defined in `org.eclipse.elk`)
Applies To: | nodes
Containing Group: | nodeSize

### Description

What should be taken into account when calculating a node’s size. Empty size constraints specify that a node’s size is already fixed and should not be changed.

## Additional Documentation

Size constraints basically restrict the freedom a layout algorithm has in resizing a node subject to its node labels, ports, and port labels. The different values have the following meanings:

Constraint | Meaning
--- | ---
`NODE_LABELS` | The node can be made large enough to place all node labels without violating spacing constraints.
`PORTS` | The node can be made large enough to place all of its ports without violating spacing constraints.
`PORT_LABELS` | If `Ports` is active, not only the ports themselves are considered, but also their labels.
`MINIMUM_SIZE` | The node must meet a given minimum size specified through the Node Size Minimum option.

### Examples

We start with an example of a node with empty size constraints, which means that automatic layout is not allowed to touch the node’s size in any way. Let us assume that the size is set such that the following drawing is produced:

We will now add all size constraints, one by one, to the node to see how we gradually end up with a node size that is calculated to take everything into account.

Adding the `NODE_LABELS` constraint resizes the node such that it is just large enough for the node’s label. Note how the ports and their labels are completely ignored.

Adding the `PORTS` constraint ensures that the node is large enough to leave the necessary spacing between the ports. Only the spacing between the ports is considered, though; their labels are not taken into account yet.

Adding the `PORT_LABELS` constraint as well ensures that the port spacing is applied between a port’s label and the next port.

Adding the `MINIMUM_SIZE` constraint, finally, ensures that the computed node size won’t fall below a minimum size configured for the node. In our example, the minimum size might be wider than what the algorithm would have computed.

- Algorithms
- Draw2D Layout
- ELK Box
- ELK DisCo
- ELK Fixed
- ELK Force
- ELK Layered
- ELK Mr. Tree
- ELK Radial
- ELK Randomizer
- ELK Rectangle Packing
- ELK SPOrE Compaction
- ELK SPOrE Overlap Removal
- ELK Stress
- ELK Top-down Packing
- ELK VertiFlex
- Graphviz Circo
- Graphviz Dot
- Graphviz FDP
- Graphviz Neato
- Graphviz Twopi
- Libavoid
- Layout Options
- Activate Inside Self Loops
- Adapt Port Positions
- Add Unnecessary Bendpoints
- Additional Port Space
- Additional Wedge Space
- Additional Wrapped Edges Spacing
- Alignment
- Allow Non-Flow Ports To Switch Sides
- Angle Penalty
- Animate
- Animation Time Factor
- Annulus Wedge Criteria
- Aspect Ratio
- Bend Points
- BK Edge Straightening
- BK Fixed Alignment
- Box Layout Mode
- Center On Root
- Child Area Height
- Child Area Width
- Cluster Crossing Penalty
- Comment Box
- Comment Comment Spacing
- Comment Node Spacing
- Compaction
- Compaction iterations
- Compaction Step Size
- Compaction Strategy
- Compaction Strategy
- Components Spacing
- Concentrate Edges
- Connected Components Compaction
- Connected Components Compaction Strategy
- Connected Components Layout Algorithm
- Consider Model Order
- Consider Model Order for Components
- Consider node model order
- Consider Port Order
- Content Alignment
- Correction Factor for Wrapping
- Cost Function for Spanning Tree
- Crossing Counter Node Order Influence
- Crossing Counter Port Order Influence
- Crossing Minimization Enforced Group Orders
- Crossing Minimization Group Ordering Strategy
- Crossing Minimization Strategy
- Crossing Penalty
- Current position of a node in the order of nodes
- Cutting Strategy
- Cycle Breaking Group Ordering Strategy
- Cycle Breaking Preferred Source Id
- Cycle Breaking Preferred Target Id
- Cycle Breaking Strategy
- DCGraph
- Debug Mode
- Default process timeout.
- Desired Edge Length
- Desired index of node
- Direction
- Direction Congruency
- Direction Priority
- Distance Model
- Distance Penalty When Improving Cuts
- Eades Repulsion
- Edge Center Label Placement Strategy
- Edge Coords
- Edge Edge Between Layer Spacing
- Edge End Texture Length
- Edge Label Placement
- Edge Label Side Selection
- Edge Label Spacing
- Edge layout strategy
- Edge Node Between Layers Spacing
- Edge Node Spacing
- Edge Routing
- Edge Routing Mode
- Edge Spacing
- Edge Thickness
- Edge Type
- Enable Hyperedges From Common Source
- Epsilon
- Expand Nodes
- Favor Straight Edges Over Balancing
- Feedback Edges
- Fill Polyominoes
- Fixed Graph Size
- Fixed Position
- Fixed Shared Path Penalty
- Fixed vertical position
- Font Name
- Font Size
- Force Model
- Force Node Model Order
- FR Temperature
- Generate Position and Layer IDs
- Graph Wrapping Strategy
- Greedy Switch Activation Threshold
- Greedy Switch Crossing Minimization
- Greedy Switch Crossing Minimization (hierarchical)
- Group ID of the Node Type
- Group ID of the Node Type
- Group ID of the Node Type
- Hierarchical Sweepiness
- Hierarchy Handling
- Hierarchy Handling (Graphviz Dot)
- High Degree Node Maximum Tree Height
- High Degree Node Threshold
- High Degree Node Treatment
- Horizontal spacing between Label and Port
- Hypernode
- Ideal Nudging Distance
- Improve Cuts
- Improve Hyperedge Routes
- Improve Hyperedge Routes Add/Delete
- Improve Wrapped Edges
- In Layer Predecessor of
- In Layer Successor of
- In new Row
- Individual Spacing
- Individual Spacing (ELK Layered)
- Inline Edge Labels
- Inside Self Loop
- Interactive
- interactive Layout
- Interactive Reference Point
- Iteration Limit
- Iterations
- Iterations Factor
- Junction Points
- Label Angle
- Label Distance
- Label Manager
- Label Manager
- Label Node Spacing
- Label Spacing
- Layer Bound
- Layer Choice Constraint
- Layer Constraint
- Layer distance
- Layer ID
- Layer Spacing Factor
- Layer Unzipping Strategy
- Layout Algorithm
- Layout Ancestors
- Layout Dimension
- Layout Partition
- Layout Partitioning
- Linear Segments Deflection Dampening
- List of Polyominoes
- Long Edge Ordering Strategy
- Manually Specified Cuts
- Margins
- Marks a node as a cluster
- Max Node Promotion Iterations
- Max. Iterations
- Maximal Animation Time
- Merge Edges
- Merge Hierarchy-Crossing Edges
- Minimal Animation Time
- Minimize Edge Length Heuristic
- MSD Freedom
- No Layout
- No Model Order
- Node arrangement strategy
- Node Flexibility
- Node Flexibility Default
- Node Label Padding
- Node Label Placement
- Node Layering Strategy
- Node Node Between Layers Spacing
- Node Placement Strategy
- Node Promotion Strategy
- Node Self Loop Spacing
- Node Size Constraints
- Node Size Minimum
- Node Size Options
- Node Spacing
- Nudge Orthogonal Segments
- Nudge Orthogonal Touching Colinear Segments
- Nudge Shared Paths With Common Endpoint
- Number of size categories
- Omit Node Micro Layout
- Optimization Goal
- Order ID
- Order nodes by height
- Orthogonal Compaction
- Outgoing Edge Angles
- Overlap Removal
- Padding
- Penalise Orthogonal Shared Paths
- Perform Unifying Nudging Preprocessing
- Polyomino Primary Sorting Criterion
- Polyomino Secondary Sorting Criterion
- Polyomino Traversal Strategy
- Port Alignment
- Port Alignment (East)
- Port Alignment (North)
- Port Alignment (South)
- Port Alignment (West)
- Port Anchor Offset
- Port Border Offset
- Port Constraints
- Port Direction Penalty
- Port Index
- Port Label Placement
- Port Labels Next to Port
- Port Side
- Port Sorting Strategy
- Port Spacing
- Position
- Position Choice Constraint
- Position Constraint
- Position Constraint
- Position ID
- Post Compaction Constraint Calculation
- Post Compaction Strategy
- Priority
- Priority (ELK Box)
- Priority (ELK Force)
- Priority (ELK Layered)
- Priority (ELK Mr. Tree)
- Progress Bar
- Radius
- Randomization Seed
- Repulsive Power
- Reset Alternation on Long Edges
- Resolved Layout Algorithm
- Reverse Direction Penalty
- Root node for spanning tree construction
- Root selection for spanning tree
- Rotate
- Row Height Reevaluation
- Scale Factor
- Search Order
- Segment Penalty
- Self-Loop Distribution
- Self-Loop Ordering
- Semi-Interactive Crossing Minimization
- Separate Connected Components
- Shape Buffer Distance
- Shape Coords
- Shift Last Placed.
- Shortness Priority
- Shortness Priority (ELK Layered)
- Sloped Edge Zone Width
- Sloppy Spline Layer Spacing Factor
- Softwrapping Fuzziness
- Sorter
- Spacing Base Value
- Spline Routing Mode
- Straightness Priority
- Stress Epsilon
- Structure Extraction Strategy
- Target Angle
- Target Width
- Thoroughness
- Topdown Hierarchical Node Aspect Ratio
- Topdown Hierarchical Node Width
- Topdown Layout
- Topdown Node Type
- Topdown Scale Cap
- Topdown Scale Factor
- Topdown Size Approximator
- Translation Optimization
- Treat Port Labels as Group
- Tree Construction Strategy
- Tree Level
- Try box layout first
- Underlying Layout Algorithm
- Unzipping Layer Split
- Upper Bound On Width [MinWidth Layerer]
- Upper Layer Estimation Scaling Factor [MinWidth Layerer]
- Upper limit for iterations of overlap removal
- Valid Indices for Wrapping
- Validate Graph
- Validate Options
- Validification Strategy
- Vertical spacing between Label and Port
- Weight of a node containing children for determining the graph size
- Weighting of Nodes
- Whether to run a supplementary scanline overlap check.
- White Space Approximation Strategy
- Whitespace elimination strategy
- Width Approximation Strategy
- Zoom to Fit
- Layout Option Groups
- box
- compaction
- compaction
- compaction.postCompaction
- componentCompaction
- considerModelOrder
- considerModelOrder.groupModelOrder
- crossingMinimization
- crossingMinimization.greedySwitch
- crossingMinimization.greedySwitchHierarchical
- cycleBreaking
- debug
- edge
- edgeLabels
- edgeLabels
- edgeRouting
- edgeRouting.polyline
- edgeRouting.splines
- edgeRouting.splines.sloppy
- font
- highDegreeNodes
- insideSelfLoops
- json
- layering
- layering.coffmanGraham
- layering.minWidth
- layering.nodePromotion
- layerUnzipping
- nodeArrangement
- nodeLabels
- nodePlacement
- nodePlacement.bk
- nodePlacement.linearSegments
- nodePlacement.networkSimplex
- nodePlacement.networkSimplex.nodeFlexibility
- nodeSize
- overlapRemoval
- packing
- packing.compaction
- partitioning
- polyomino
- port
- portAlignment
- portLabels
- priority
- processingOrder
- rotation
- spacing
- spacing
- structure
- topdown
- whiteSpaceElimination
- whitespaceElimination
- widthApproximation
- wrapping
- wrapping.cutting
- wrapping.cutting.msd
- wrapping.multiEdge
- wrapping.singleEdge
- wrapping.validify