From afc61736f91637767be398743a1f1fbab8fdf7f7 Mon Sep 17 00:00:00 2001 From: Stephan Krusche Date: Sat, 9 Nov 2024 16:07:47 +0100 Subject: [PATCH] Allow graph creation with empty nodes and links --- projects/swimlane/ngx-graph/src/lib/graph/graph.component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 a90e36ff..208ccd88 100644 --- a/projects/swimlane/ngx-graph/src/lib/graph/graph.component.ts +++ b/projects/swimlane/ngx-graph/src/lib/graph/graph.component.ts @@ -271,7 +271,7 @@ export class GraphComponent implements OnInit, OnChanges, OnDestroy, AfterViewIn if (layoutSettings) { this.setLayoutSettings(this.layoutSettings); } - if (this.layout && this.nodes.length && this.links.length) { + if (this.layout && this.nodes && this.links) { this.update(); } }