diff --git a/projects/swimlane/ngx-graph/src/lib/graph/graph.component.ts b/projects/swimlane/ngx-graph/src/lib/graph/graph.component.ts index 411e83e2..38924117 100644 --- a/projects/swimlane/ngx-graph/src/lib/graph/graph.component.ts +++ b/projects/swimlane/ngx-graph/src/lib/graph/graph.component.ts @@ -657,10 +657,10 @@ export class GraphComponent implements OnInit, OnChanges, OnDestroy, AfterViewIn } if (this.nodeMaxHeight) { - node.dimension.height = Math.max(node.dimension.height, this.nodeMaxHeight); + node.dimension.height = Math.min(node.dimension.height, this.nodeMaxHeight); } if (this.nodeMinHeight) { - node.dimension.height = Math.min(node.dimension.height, this.nodeMinHeight); + node.dimension.height = Math.max(node.dimension.height, this.nodeMinHeight); } if (this.nodeWidth) { @@ -697,10 +697,10 @@ export class GraphComponent implements OnInit, OnChanges, OnDestroy, AfterViewIn } if (this.nodeMaxWidth) { - node.dimension.width = Math.max(node.dimension.width, this.nodeMaxWidth); + node.dimension.width = Math.min(node.dimension.width, this.nodeMaxWidth); } if (this.nodeMinWidth) { - node.dimension.width = Math.min(node.dimension.width, this.nodeMinWidth); + node.dimension.width = Math.max(node.dimension.width, this.nodeMinWidth); } }); }