ngx-relationship-visualiser 2.0.4 → 2.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (15) hide show
  1. package/esm2022/projects/ngx-relationship-visualiser-lib/lib/db/graphDatabase.mjs +6 -2
  2. package/esm2022/projects/ngx-relationship-visualiser-lib/lib/visualiser/context-menus/context-menus.component.mjs +13 -24
  3. package/esm2022/projects/ngx-relationship-visualiser-lib/lib/visualiser/modals/abstract-modal-form-handler.mjs +3 -3
  4. package/esm2022/projects/ngx-relationship-visualiser-lib/lib/visualiser/modals/modals.component.mjs +17 -15
  5. package/esm2022/projects/ngx-relationship-visualiser-lib/lib/visualiser/services/dagre-layout.service.mjs +10 -4
  6. package/esm2022/projects/ngx-relationship-visualiser-lib/lib/visualiser/services/visualiser-graph.service.mjs +211 -151
  7. package/esm2022/projects/ngx-relationship-visualiser-lib/lib/visualiser/visualiser-graph/visualiser-graph.component.mjs +136 -90
  8. package/fesm2022/ngx-relationship-visualiser.mjs +389 -282
  9. package/fesm2022/ngx-relationship-visualiser.mjs.map +1 -1
  10. package/package.json +1 -1
  11. package/projects/ngx-relationship-visualiser-lib/lib/visualiser/context-menus/context-menus.component.d.ts +2 -4
  12. package/projects/ngx-relationship-visualiser-lib/lib/visualiser/modals/modals.component.d.ts +18 -7
  13. package/projects/ngx-relationship-visualiser-lib/lib/visualiser/services/dagre-layout.service.d.ts +1 -1
  14. package/projects/ngx-relationship-visualiser-lib/lib/visualiser/services/visualiser-graph.service.d.ts +31 -13
  15. package/projects/ngx-relationship-visualiser-lib/lib/visualiser/visualiser-graph/visualiser-graph.component.d.ts +23 -14
@@ -26,8 +26,6 @@ class ContextMenusComponent {
26
26
  createLinkContextMenuEvent = new EventEmitter();
27
27
  editLinkLabelContextMenuEvent = new EventEmitter();
28
28
  editLinksContextMenuEvent = new EventEmitter();
29
- currentMatchingLink = null;
30
- currentItem = null;
31
29
  editNode() {
32
30
  this.editNodeContextMenuEvent.emit(true);
33
31
  }
@@ -37,25 +35,26 @@ class ContextMenusComponent {
37
35
  createNode() {
38
36
  this.findCreateNodesContextMenuEvent.emit('createNode');
39
37
  }
40
- createLink() {
41
- if (!this.currentItem) {
42
- console.error('Selected graph data is required to create a link.');
38
+ createLink(item) {
39
+ if (!item || item.selectedNodes.length !== 2) {
40
+ console.error('Exactly two selected nodes are required to create a link.');
43
41
  return;
44
42
  }
45
43
  const payload = {
46
44
  open: true,
47
- data: this.currentItem.selectedNodes
45
+ data: item.selectedNodes
48
46
  };
49
47
  this.createLinkContextMenuEvent.emit(payload);
50
48
  }
51
49
  editLinkLabel() {
52
50
  this.editLinkLabelContextMenuEvent.emit(true);
53
51
  }
54
- editLinks() {
55
- if (this.currentMatchingLink) {
52
+ editLinks(item) {
53
+ const matchingLink = this.checkLinkBetweenSelectedNodes(item);
54
+ if (matchingLink) {
56
55
  this.editLinksContextMenuEvent.emit({
57
56
  open: true,
58
- data: this.currentMatchingLink
57
+ data: matchingLink
59
58
  });
60
59
  }
61
60
  else {
@@ -63,19 +62,10 @@ class ContextMenusComponent {
63
62
  }
64
63
  }
65
64
  linksExist = (item) => {
66
- this.currentItem = item;
67
65
  const matchingLink = this.checkLinkBetweenSelectedNodes(item);
68
- if (matchingLink) {
69
- this.currentMatchingLink = matchingLink;
70
- return true;
71
- }
72
- else {
73
- this.currentMatchingLink = null;
74
- return false;
75
- }
66
+ return matchingLink !== null;
76
67
  };
77
68
  linksDoNotExist = (item) => {
78
- this.currentItem = item;
79
69
  const matchingLink = this.checkLinkBetweenSelectedNodes(item);
80
70
  if (!matchingLink) {
81
71
  return true;
@@ -85,8 +75,7 @@ class ContextMenusComponent {
85
75
  }
86
76
  };
87
77
  checkLinkBetweenSelectedNodes(payload) {
88
- if (!payload || !payload.selectedNodes) {
89
- console.warn("Payload or selectedNodes is undefined.");
78
+ if (!payload || payload.selectedNodes.length !== 2) {
90
79
  return null;
91
80
  }
92
81
  const selectedNodes = payload.selectedNodes;
@@ -104,11 +93,11 @@ class ContextMenusComponent {
104
93
  }
105
94
  }
106
95
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: ContextMenusComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
107
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: ContextMenusComponent, selector: "app-context-menus", outputs: { editNodeContextMenuEvent: "editNodeContextMenuEvent", findCreateNodesContextMenuEvent: "findCreateNodesContextMenuEvent", createLinkContextMenuEvent: "createLinkContextMenuEvent", editLinkLabelContextMenuEvent: "editLinkLabelContextMenuEvent", editLinksContextMenuEvent: "editLinksContextMenuEvent" }, viewQueries: [{ propertyName: "editNodeContextMenu", first: true, predicate: ["editNodeContextMenu"], descendants: true }, { propertyName: "findCreateNodesContextMenu", first: true, predicate: ["findCreateNodesContextMenu"], descendants: true }, { propertyName: "createEditLinkContextMenu", first: true, predicate: ["createEditLinkContextMenu"], descendants: true }, { propertyName: "editLinkLabelContextMenu", first: true, predicate: ["editLinkLabelContextMenu"], descendants: true }], ngImport: i0, template: "<context-menu #editNodeContextMenu>\n <ng-template contextMenuItem let-item (execute)=\"editNode()\">\n Edit Node...\n </ng-template>\n</context-menu>\n\n<context-menu #findCreateNodesContextMenu>\n <ng-template contextMenuItem let-item (execute)=\"findNodes()\">\n Search Nodes...\n </ng-template>\n <ng-template contextMenuItem let-item (execute)=\"createNode()\">\n Create Node...\n </ng-template>\n</context-menu>\n\n<context-menu #createEditLinkContextMenu>\n <ng-template [visible]=\"linksDoNotExist\" contextMenuItem let-item (execute)=\"createLink()\">\n Create Link...\n </ng-template>\n <ng-template [visible]=\"linksExist\" (execute)=\"editLinks()\" contextMenuItem let-item>\n Edit Links...\n </ng-template>\n</context-menu>\n\n<context-menu #editLinkLabelContextMenu>\n <ng-template contextMenuItem let-item (execute)=\"editLinkLabel()\">\n Edit Link label...\n </ng-template>\n</context-menu>", dependencies: [{ kind: "component", type: i2.ContextMenuComponent, selector: "context-menu", inputs: ["menuClass", "autoFocus", "useBootstrap4", "disabled"], outputs: ["close", "open"] }, { kind: "directive", type: i2.ContextMenuItemDirective, selector: "[contextMenuItem]", inputs: ["subMenu", "divider", "enabled", "passive", "visible"], outputs: ["execute"] }] });
96
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: ContextMenusComponent, selector: "app-context-menus", outputs: { editNodeContextMenuEvent: "editNodeContextMenuEvent", findCreateNodesContextMenuEvent: "findCreateNodesContextMenuEvent", createLinkContextMenuEvent: "createLinkContextMenuEvent", editLinkLabelContextMenuEvent: "editLinkLabelContextMenuEvent", editLinksContextMenuEvent: "editLinksContextMenuEvent" }, viewQueries: [{ propertyName: "editNodeContextMenu", first: true, predicate: ["editNodeContextMenu"], descendants: true }, { propertyName: "findCreateNodesContextMenu", first: true, predicate: ["findCreateNodesContextMenu"], descendants: true }, { propertyName: "createEditLinkContextMenu", first: true, predicate: ["createEditLinkContextMenu"], descendants: true }, { propertyName: "editLinkLabelContextMenu", first: true, predicate: ["editLinkLabelContextMenu"], descendants: true }], ngImport: i0, template: "<context-menu #editNodeContextMenu>\n <ng-template contextMenuItem let-item (execute)=\"editNode()\">\n Edit Node...\n </ng-template>\n</context-menu>\n\n<context-menu #findCreateNodesContextMenu>\n <ng-template contextMenuItem let-item (execute)=\"findNodes()\">\n Search Nodes...\n </ng-template>\n <ng-template contextMenuItem let-item (execute)=\"createNode()\">\n Create Node...\n </ng-template>\n</context-menu>\n\n<context-menu #createEditLinkContextMenu>\n <ng-template [visible]=\"linksDoNotExist\" contextMenuItem let-item (execute)=\"createLink($event.item)\">\n Create Link...\n </ng-template>\n <ng-template [visible]=\"linksExist\" (execute)=\"editLinks($event.item)\" contextMenuItem let-item>\n Edit Links...\n </ng-template>\n</context-menu>\n\n<context-menu #editLinkLabelContextMenu>\n <ng-template contextMenuItem let-item (execute)=\"editLinkLabel()\">\n Edit Link label...\n </ng-template>\n</context-menu>", dependencies: [{ kind: "component", type: i2.ContextMenuComponent, selector: "context-menu", inputs: ["menuClass", "autoFocus", "useBootstrap4", "disabled"], outputs: ["close", "open"] }, { kind: "directive", type: i2.ContextMenuItemDirective, selector: "[contextMenuItem]", inputs: ["subMenu", "divider", "enabled", "passive", "visible"], outputs: ["execute"] }] });
108
97
  }
109
98
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: ContextMenusComponent, decorators: [{
110
99
  type: Component,
111
- args: [{ selector: 'app-context-menus', template: "<context-menu #editNodeContextMenu>\n <ng-template contextMenuItem let-item (execute)=\"editNode()\">\n Edit Node...\n </ng-template>\n</context-menu>\n\n<context-menu #findCreateNodesContextMenu>\n <ng-template contextMenuItem let-item (execute)=\"findNodes()\">\n Search Nodes...\n </ng-template>\n <ng-template contextMenuItem let-item (execute)=\"createNode()\">\n Create Node...\n </ng-template>\n</context-menu>\n\n<context-menu #createEditLinkContextMenu>\n <ng-template [visible]=\"linksDoNotExist\" contextMenuItem let-item (execute)=\"createLink()\">\n Create Link...\n </ng-template>\n <ng-template [visible]=\"linksExist\" (execute)=\"editLinks()\" contextMenuItem let-item>\n Edit Links...\n </ng-template>\n</context-menu>\n\n<context-menu #editLinkLabelContextMenu>\n <ng-template contextMenuItem let-item (execute)=\"editLinkLabel()\">\n Edit Link label...\n </ng-template>\n</context-menu>" }]
100
+ args: [{ selector: 'app-context-menus', template: "<context-menu #editNodeContextMenu>\n <ng-template contextMenuItem let-item (execute)=\"editNode()\">\n Edit Node...\n </ng-template>\n</context-menu>\n\n<context-menu #findCreateNodesContextMenu>\n <ng-template contextMenuItem let-item (execute)=\"findNodes()\">\n Search Nodes...\n </ng-template>\n <ng-template contextMenuItem let-item (execute)=\"createNode()\">\n Create Node...\n </ng-template>\n</context-menu>\n\n<context-menu #createEditLinkContextMenu>\n <ng-template [visible]=\"linksDoNotExist\" contextMenuItem let-item (execute)=\"createLink($event.item)\">\n Create Link...\n </ng-template>\n <ng-template [visible]=\"linksExist\" (execute)=\"editLinks($event.item)\" contextMenuItem let-item>\n Edit Links...\n </ng-template>\n</context-menu>\n\n<context-menu #editLinkLabelContextMenu>\n <ng-template contextMenuItem let-item (execute)=\"editLinkLabel()\">\n Edit Link label...\n </ng-template>\n</context-menu>" }]
112
101
  }], propDecorators: { editNodeContextMenu: [{
113
102
  type: ViewChild,
114
103
  args: ['editNodeContextMenu']
@@ -444,8 +433,8 @@ class AbstractModalFormHandler {
444
433
  this.createNodeForm.setControl('label', this.fb.array(data.label.map(label => this.fb.group({ label: [label, Validators.required] }))));
445
434
  }
446
435
  iconOrImageValidator(control) {
447
- const imageUrl = control.get('imageUrl').value;
448
- const icon = control.get('icon').value;
436
+ const imageUrl = control.get('imageUrl')?.value;
437
+ const icon = control.get('icon')?.value;
449
438
  if ((imageUrl && icon) || (!imageUrl && !icon)) {
450
439
  return { 'iconOrImage': true };
451
440
  }
@@ -474,7 +463,11 @@ class DexieService extends Dexie {
474
463
  await this.graphData.put(data);
475
464
  }
476
465
  async getGraphData(dataId) {
477
- return await this.graphData.get(dataId);
466
+ const data = await this.graphData.get(dataId);
467
+ if (!data) {
468
+ throw new Error(`Graph data "${dataId}" was not found.`);
469
+ }
470
+ return data;
478
471
  }
479
472
  async deleteGraphData(dataId) {
480
473
  await this.graphData.delete(dataId);
@@ -492,7 +485,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImpo
492
485
  class ModalsComponent extends AbstractModalFormHandler {
493
486
  modalService;
494
487
  dexieService;
495
- editNodeData;
488
+ editNodeData = null;
496
489
  editLinksData = null;
497
490
  closeModalEvent = new EventEmitter();
498
491
  createEditLinkEvent = new EventEmitter();
@@ -508,10 +501,10 @@ class ModalsComponent extends AbstractModalFormHandler {
508
501
  fontAwesomeIcons = fontAwesomeIcons;
509
502
  sourceLabels = [];
510
503
  targetLabels = [];
511
- sourceImageUrl;
512
- targetImageUrl;
513
- sourceIcon;
514
- targetIcon;
504
+ sourceImageUrl = '';
505
+ targetImageUrl = '';
506
+ sourceIcon = '';
507
+ targetIcon = '';
515
508
  // virtual scroll
516
509
  loading = false;
517
510
  iconsBuffer = [];
@@ -533,11 +526,14 @@ class ModalsComponent extends AbstractModalFormHandler {
533
526
  this.populateEditNodeForm(this.editNodeData);
534
527
  }
535
528
  }
536
- openModal(template) {
529
+ openModal(template, editLinksData) {
537
530
  if (!template) {
538
531
  console.error('Template is required to open a modal.');
539
532
  return null;
540
533
  }
534
+ if (editLinksData !== undefined) {
535
+ this.editLinksData = editLinksData;
536
+ }
541
537
  if (template === this.editLinksModal &&
542
538
  this.editLinksData &&
543
539
  !Array.isArray(this.editLinksData)) {
@@ -545,8 +541,9 @@ class ModalsComponent extends AbstractModalFormHandler {
545
541
  this.findEditLabelsAndImagesfromIDs();
546
542
  this.populateEditLinkForm(this.editLinksData);
547
543
  }
548
- if (template === this.createLinkModal && this.editLinksData) {
544
+ if (template === this.createLinkModal) {
549
545
  this.resetLinksForm();
546
+ void this.findEditLabelsAndImagesfromIDs();
550
547
  }
551
548
  if (template === this.createNodeModal) {
552
549
  this.resetNodeForm();
@@ -598,10 +595,8 @@ class ModalsComponent extends AbstractModalFormHandler {
598
595
  this.sourceIcon = '';
599
596
  this.targetIcon = '';
600
597
  }
601
- closeModal(modalRef) {
602
- if (this[modalRef]) {
603
- this[modalRef].hide();
604
- }
598
+ closeModal(_modalRef) {
599
+ this[_modalRef]?.hide();
605
600
  }
606
601
  createEditLink(source) {
607
602
  if (this.createLinkForm.valid) {
@@ -645,7 +640,7 @@ class ModalsComponent extends AbstractModalFormHandler {
645
640
  this.closeModal('modalRef');
646
641
  }
647
642
  clearImageUrl() {
648
- this.createNodeForm.get('imageUrl').setValue('');
643
+ this.createNodeForm.get('imageUrl')?.setValue('');
649
644
  }
650
645
  trackByFn(item) {
651
646
  return item.id;
@@ -670,11 +665,11 @@ class ModalsComponent extends AbstractModalFormHandler {
670
665
  this.iconsBuffer = this.iconsBuffer.concat(more);
671
666
  }
672
667
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: ModalsComponent, deps: [{ token: i1.BsModalService }, { token: i2$1.FormBuilder }, { token: DexieService }], target: i0.ɵɵFactoryTarget.Component });
673
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: ModalsComponent, selector: "app-modals", inputs: { editNodeData: "editNodeData", editLinksData: "editLinksData" }, outputs: { closeModalEvent: "closeModalEvent", createEditLinkEvent: "createEditLinkEvent", createEditNodeEvent: "createEditNodeEvent", deleteLinkEvent: "deleteLinkEvent", deleteNodeEvent: "deleteNodeEvent" }, viewQueries: [{ propertyName: "editNodeModal", first: true, predicate: ["editNodeModal"], descendants: true }, { propertyName: "createNodeModal", first: true, predicate: ["createNodeModal"], descendants: true }, { propertyName: "createLinkModal", first: true, predicate: ["createLinkModal"], descendants: true }, { propertyName: "editLinksModal", first: true, predicate: ["editLinksModal"], descendants: true }], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<!--EDIT NODE MODAL-->\n<ng-template #editNodeModal>\n <div class=\"modal-header\">\n <h4 class=\"modal-title pull-left\">Edit Node</h4>\n <button type=\"button\" class=\"btn-close close pull-right\" aria-label=\"Close\" (click)=\"closeModal('modalRef')\">\n <span aria-hidden=\"true\" class=\"visually-hidden\">&times;</span>\n </button>\n </div>\n <div class=\"modal-body\">\n <form [formGroup]=\"createNodeForm\">\n <div class=\"form-group\">\n <label for=\"iconType\">Icon Type</label>\n <div>\n <input type=\"radio\" id=\"imageUrl\" formControlName=\"iconType\" value=\"url\"> Image URL\n <input class=\"ml-5\" type=\"radio\" id=\"iconTypeSelect\" formControlName=\"iconType\" value=\"select\"> Choose Icon\n </div>\n </div>\n <div class=\"form-group\" *ngIf=\"createNodeForm.get('iconType').value === 'url'\">\n <label for=\"imageUrl\">Image URL</label>\n <div class=\"input-group\">\n <input type=\"text\" id=\"imageUrl\" formControlName=\"imageUrl\" class=\"form-control\" placeholder=\"Image URL\">\n <button type=\"button\" class=\"btn btn-outline-secondary\" (click)=\"clearImageUrl()\">Clear</button>\n </div>\n </div>\n <div class=\"form-group\" *ngIf=\"createNodeForm.get('iconType').value === 'select'\">\n <label for=\"nodeIcon\">Choose Icon</label>\n <ng-select\n formControlName=\"icon\"\n [items]=\"iconsBuffer\"\n [virtualScroll]=\"true\"\n [loading]=\"loading\"\n bindLabel=\"name\"\n bindValue=\"icon\"\n [editableSearchTerm]=\"true\"\n placeholder=\"Select icon\"\n appendTo=\"body\"\n [trackByFn]=\"trackByFn\"\n (scroll)=\"onScroll($event)\"\n (scrollToEnd)=\"onScrollToEnd()\"\n >\n <ng-template ng-header-tmp>\n <small class=\"form-text text-muted\"\n >Loaded {{ iconsBuffer.length }} of {{ fontAwesomeIcons.length }}</small\n >\n </ng-template>\n <ng-template ng-option-tmp let-item=\"item\">\n <i class=\"fa fa-light\">{{item.icon}}</i>\n <span class=\"ml-3\">{{ item.name }}</span>\n </ng-template>\n </ng-select>\n </div>\n <div *ngIf=\"createNodeForm.errors?.iconOrImage\" class=\"text-danger\">\n Please provide either an Image URL or choose an Icon, but not both.\n </div>\n <div class=\"form-group\">\n <label for=\"label\">Labels</label>\n <div formArrayName=\"label\">\n <div *ngFor=\"let label of nodeLabelArray.controls; let i = index\" [formGroupName]=\"i\"\n class=\"d-flex flex-column align-items-start\">\n <div class=\"d-flex align-items-center w-100\">\n <input formControlName=\"label\" class=\"form-control mb-2\" placeholder=\"Label\" [id]=\"'node-label-' + i\">\n <button type=\"button\" class=\"btn btn-danger ml-2\" (click)=\"removeNodeLabel(i)\" [disabled]=\"nodeLabelArray.length <= 1\">Remove</button>\n </div>\n </div>\n </div>\n <button type=\"button\" class=\"btn btn-secondary mt-2\" (click)=\"addNodeLabel()\">Add Label</button>\n </div>\n <div class=\"form-group\">\n <label for=\"nodeAdditionalIcon\">Additional icon</label>\n <ng-select\n formControlName=\"additionalIcon\"\n [items]=\"iconsBuffer\"\n [virtualScroll]=\"true\"\n [loading]=\"loading\"\n bindLabel=\"name\"\n bindValue=\"icon\"\n [editableSearchTerm]=\"true\"\n placeholder=\"Select icon\"\n appendTo=\"body\"\n [trackByFn]=\"trackByFn\"\n (scroll)=\"onScroll($event)\"\n (scrollToEnd)=\"onScrollToEnd()\"\n >\n <ng-template ng-header-tmp>\n <small class=\"form-text text-muted\"\n >Loaded {{ iconsBuffer.length }} of {{ fontAwesomeIcons.length }}</small\n >\n </ng-template>\n <ng-template ng-option-tmp let-item=\"item\">\n <i class=\"fa fa-light\">{{item.icon}}</i>\n <span class=\"ml-3\">{{ item.name }}</span>\n </ng-template>\n </ng-select>\n </div>\n </form>\n </div>\n <div class=\"modal-footer\">\n <button type=\"button\" class=\"btn btn-secondary\" (click)=\"closeModal('modalRef')\">Cancel</button>\n <button type=\"button\" class=\"btn btn-primary\" (click)=\"createEditNode('editNodeModal')\" [disabled]=\"!createNodeForm.valid\">Save Changes</button>\n <button type=\"button\" class=\"btn btn-danger\" (click)=\"deleteNode()\">Delete Node</button>\n </div>\n</ng-template>\n<!-- ./MODAL-->\n\n<!--CREATE NODE MODAL-->\n<ng-template #createNodeModal>\n <div class=\"modal-header\">\n <h4 class=\"modal-title pull-left\">Create Node</h4>\n <button type=\"button\" class=\"btn-close close pull-right\" aria-label=\"Close\" (click)=\"closeModal('modalRef')\">\n <span aria-hidden=\"true\" class=\"visually-hidden\">&times;</span>\n </button>\n </div>\n <div class=\"modal-body\">\n <form [formGroup]=\"createNodeForm\">\n <div class=\"form-group\">\n <label for=\"iconType\">Icon Type</label>\n <div>\n <input type=\"radio\" id=\"imageUrl\" formControlName=\"iconType\" value=\"url\"> Image URL\n <input class=\"ml-5\" type=\"radio\" id=\"iconTypeSelect\" formControlName=\"iconType\" value=\"select\"> Choose Icon\n </div>\n </div>\n <div class=\"form-group\" *ngIf=\"createNodeForm.get('iconType').value === 'url'\">\n <label for=\"imageUrl\">Image URL</label>\n <div class=\"input-group\">\n <input type=\"text\" id=\"imageUrl\" formControlName=\"imageUrl\" class=\"form-control\" placeholder=\"Image URL\">\n <button type=\"button\" class=\"btn btn-outline-secondary\" (click)=\"clearImageUrl()\">Clear</button>\n </div>\n </div>\n <div class=\"form-group\" *ngIf=\"createNodeForm.get('iconType').value === 'select'\">\n <label for=\"nodeIcon\">Choose Icon</label>\n <ng-select\n formControlName=\"icon\"\n [items]=\"iconsBuffer\"\n [virtualScroll]=\"true\"\n [loading]=\"loading\"\n bindLabel=\"name\"\n bindValue=\"icon\"\n [editableSearchTerm]=\"true\"\n placeholder=\"Select icon\"\n appendTo=\"body\"\n [trackByFn]=\"trackByFn\"\n (scroll)=\"onScroll($event)\"\n (scrollToEnd)=\"onScrollToEnd()\"\n >\n <ng-template ng-header-tmp>\n <small class=\"form-text text-muted\"\n >Loaded {{ iconsBuffer.length }} of {{ fontAwesomeIcons.length }}</small\n >\n </ng-template>\n <ng-template ng-option-tmp let-item=\"item\">\n <i class=\"fa fa-light\">{{item.icon}}</i>\n <span class=\"ml-3\">{{ item.name }}</span>\n </ng-template>\n </ng-select>\n </div>\n <div *ngIf=\"createNodeForm.errors?.iconOrImage\" class=\"text-danger\">\n Please provide either an Image URL or choose an Icon, but not both.\n </div>\n <div class=\"form-group\">\n <label for=\"label\">Labels</label>\n <div formArrayName=\"label\">\n <div *ngFor=\"let label of nodeLabelArray.controls; let i = index\" [formGroupName]=\"i\"\n class=\"d-flex flex-column align-items-start\">\n <div class=\"d-flex align-items-center w-100\">\n <input formControlName=\"label\" class=\"form-control mb-2\" placeholder=\"Label\" [id]=\"'node-label-' + i\">\n <button type=\"button\" class=\"btn btn-danger ml-2\" (click)=\"removeNodeLabel(i)\" [disabled]=\"nodeLabelArray.length <= 1\">Remove</button>\n </div>\n </div>\n </div>\n <button type=\"button\" class=\"btn btn-secondary mt-2\" (click)=\"addNodeLabel()\">Add Label</button>\n </div>\n <div class=\"form-group\">\n <label for=\"nodeAdditionalIcon\">Additional icon</label>\n <ng-select\n formControlName=\"additionalIcon\"\n [items]=\"iconsBuffer\"\n [virtualScroll]=\"true\"\n [loading]=\"loading\"\n bindLabel=\"name\"\n bindValue=\"icon\"\n [editableSearchTerm]=\"true\"\n placeholder=\"Select icon\"\n appendTo=\"body\"\n [trackByFn]=\"trackByFn\"\n (scroll)=\"onScroll($event)\"\n (scrollToEnd)=\"onScrollToEnd()\"\n >\n <ng-template ng-header-tmp>\n <small class=\"form-text text-muted\"\n >Loaded {{ iconsBuffer.length }} of {{ fontAwesomeIcons.length }}</small\n >\n </ng-template>\n <ng-template ng-option-tmp let-item=\"item\">\n <i class=\"fa fa-light\">{{item.icon}}</i>\n <span class=\"ml-3\">{{ item.name }}</span>\n </ng-template>\n </ng-select>\n </div>\n </form>\n </div>\n <div class=\"modal-footer\">\n <button type=\"button\" class=\"btn btn-secondary\" (click)=\"closeModal('modalRef')\">Cancel</button>\n <button type=\"button\" class=\"btn btn-primary\" (click)=\"createEditNode('createNodeModal')\" [disabled]=\"!createNodeForm.valid\">Create Node</button>\n </div>\n</ng-template>\n<!-- ./MODAL-->\n\n<!--EDIT LINKS MODAL-->\n<ng-template #editLinksModal>\n <div class=\"modal-header\">\n <h4 class=\"modal-title pull-left\">Edit Links</h4>\n <button type=\"button\" class=\"btn-close close pull-right\" aria-label=\"Close\" (click)=\"closeModal('modalRef')\">\n <span aria-hidden=\"true\" class=\"visually-hidden\">&times;</span>\n </button>\n </div>\n <div class=\"modal-body\">\n <form [formGroup]=\"createLinkForm\">\n <div class=\"col-sm-12 d-flex flex-column\">\n <div class=\"d-flex mb-3\">\n <div class=\"iconImage\">\n <span><i class=\"fas fa-arrow-left\"></i></span>\n <span class=\"arrow\">\n <input type=\"checkbox\" id=\"sourceArrow\" formControlName=\"sourceArrow\" class=\"form-check-input\">\n <label class=\"d-none form-check-label\" for=\"leftArrow\"></label>\n </span>\n </div>\n <div class=\"iconImage ml-3\">\n <ng-container *ngIf=\"targetImageUrl; else targetIconTemplate\">\n <img class=\"imageUrl\" [src]=\"targetImageUrl\" />\n </ng-container>\n <ng-template #targetIconTemplate>\n <i class=\"fa-solid fa-2x\">{{targetIcon}}</i>\n </ng-template>\n </div>\n <div\n [ngClass]=\"{\n 'link-line-solid': createLinkForm.get('lineStyle').value === 'Solid',\n 'link-line-dotted': createLinkForm.get('lineStyle').value === 'Dotted'\n }\"\n >\n </div>\n <div class=\"iconImage mr-3\">\n <ng-container *ngIf=\"sourceImageUrl; else sourceIconTemplate\">\n <img class=\"imageUrl\" [src]=\"sourceImageUrl\" />\n </ng-container>\n <ng-template #sourceIconTemplate>\n <i class=\"fa-solid fa-2x\">{{sourceIcon}}</i>\n </ng-template>\n </div>\n <div class=\"iconImage\">\n <span><i class=\"fas fa-arrow-right\"></i></span>\n <span class=\"arrow\">\n <input type=\"checkbox\" id=\"targetArrow\" formControlName=\"targetArrow\" class=\"form-check-input\">\n <label class=\"form-check-label\" for=\"rightArrow\"></label>\n </span>\n </div>\n </div>\n <div class=\"d-flex justify-content-between mb-3\">\n <div class=\"text-left d-block font-weight-bold\" style=\"font-size: 12px\">\n <span class=\"d-block\" *ngFor=\"let label of targetLabels\">{{ label }}</span>\n </div>\n <div class=\"text-right d-block font-weight-bold\" style=\"font-size: 12px\">\n <span class=\"d-block\" *ngFor=\"let label of sourceLabels\">{{ label }}</span>\n </div>\n </div>\n <div *ngIf=\"createLinkForm.get('label')?.value?.length\" class=\"labelPosition text-center\">\n <span *ngFor=\"let label of createLinkForm.get('label').value\">\n <span class=\"d-block\">{{ label.label }} <span style=\"color: #856404;\" *ngIf=\"label.linkIcon\"><i class=\"fas fa-link\"></i></span></span>\n </span>\n </div>\n </div>\n <div class=\"form-group\">\n <label for=\"lineStyle\">Line Style</label>\n <select id=\"lineStyle\" formControlName=\"lineStyle\" class=\"form-control\">\n <option value=\"Solid\">Solid</option>\n <option value=\"Dotted\">Dotted</option>\n </select>\n </div>\n\n <div class=\"form-group\">\n <label for=\"label\">Labels</label>\n <div formArrayName=\"label\">\n <div *ngFor=\"let label of labelArray.controls; let i = index\" [formGroupName]=\"i\"\n class=\"d-flex flex-column align-items-start\">\n <div class=\"d-flex align-items-center w-100\">\n <input formControlName=\"label\" class=\"form-control\" placeholder=\"Label\" [id]=\"'label-' + i\">\n <button type=\"button\" class=\"btn btn-danger ml-2\" (click)=\"removeLabel(i)\" [disabled]=\"labelArray.length <= 1\">Remove</button>\n </div>\n <div class=\"form-group form-check\">\n <input type=\"checkbox\" formControlName=\"linkIcon\" class=\"form-check-input\" [id]=\"'linkIcon-' + i\">\n <label [for]=\"'linkIcon-' + i\">Link Icon?</label>\n </div>\n </div>\n </div>\n <button type=\"button\" class=\"btn btn-secondary mt-2\" (click)=\"addLabel()\">Add Label</button>\n </div>\n </form>\n </div>\n <div class=\"modal-footer\">\n <button type=\"button\" class=\"btn btn-secondary\" (click)=\"closeModal('modalRef')\">Cancel</button>\n <button type=\"button\" class=\"btn btn-primary\" (click)=\"createEditLink('editLinkModal')\" [disabled]=\"!createLinkForm.valid\">Save Changes</button>\n <button type=\"button\" class=\"btn btn-danger\" (click)=\"deleteLink()\">Delete Link</button>\n </div>\n</ng-template>\n<!-- ./MODAL-->\n\n\n<!--CREATE LINK MODAL-->\n<ng-template #createLinkModal>\n <div class=\"modal-header\">\n <h4 class=\"modal-title pull-left\">Create Link</h4>\n <button type=\"button\" class=\"btn-close close pull-right\" aria-label=\"Close\" (click)=\"closeModal('modalRef')\">\n <span aria-hidden=\"true\" class=\"visually-hidden\">&times;</span>\n </button>\n </div>\n <div class=\"modal-body\">\n <form [formGroup]=\"createLinkForm\">\n <div class=\"col-sm-12 d-flex flex-column\">\n <div class=\"d-flex mb-3\">\n <div class=\"iconImage\">\n <span><i class=\"fas fa-arrow-left\"></i></span>\n <span class=\"arrow\">\n <input type=\"checkbox\" id=\"sourceArrow\" formControlName=\"sourceArrow\" class=\"form-check-input\">\n <label class=\"d-none form-check-label\" for=\"leftArrow\"></label>\n </span>\n </div>\n <div class=\"iconImage ml-3\">\n <ng-container *ngIf=\"targetImageUrl; else targetIconTemplate\">\n <img class=\"imageUrl\" [src]=\"targetImageUrl\" />\n </ng-container>\n <ng-template #targetIconTemplate>\n <i class=\"fa-solid fa-2x\">{{targetIcon}}</i>\n </ng-template>\n </div>\n <div\n [ngClass]=\"{\n 'link-line-solid': createLinkForm.get('lineStyle').value === 'Solid',\n 'link-line-dotted': createLinkForm.get('lineStyle').value === 'Dotted'\n }\"\n >\n </div>\n <div class=\"iconImage mr-3\">\n <ng-container *ngIf=\"sourceImageUrl; else sourceIconTemplate\">\n <img class=\"imageUrl\" [src]=\"sourceImageUrl\" />\n </ng-container>\n <ng-template #sourceIconTemplate>\n <i class=\"fa-solid fa-2x\">{{sourceIcon}}</i>\n </ng-template>\n </div>\n <div class=\"iconImage\">\n <span><i class=\"fas fa-arrow-right\"></i></span>\n <span class=\"arrow\">\n <input type=\"checkbox\" id=\"targetArrow\" formControlName=\"targetArrow\" class=\"form-check-input\">\n <label class=\"form-check-label\" for=\"rightArrow\"></label>\n </span>\n </div>\n </div>\n <div class=\"d-flex justify-content-between mb-3\">\n <div class=\"text-left d-block font-weight-bold\" style=\"font-size: 12px\">\n <span class=\"d-block\" *ngFor=\"let label of targetLabels\">{{ label }}</span>\n </div>\n <div class=\"text-right d-block font-weight-bold\" style=\"font-size: 12px\">\n <span class=\"d-block\" *ngFor=\"let label of sourceLabels\">{{ label }}</span>\n </div>\n </div>\n <div *ngIf=\"createLinkForm.get('label')?.value?.length\" class=\"labelPosition text-center\">\n <span *ngFor=\"let label of createLinkForm.get('label').value\">\n <span class=\"d-block\">{{ label.label }} <span style=\"color: #856404;\" *ngIf=\"label.linkIcon\"><i class=\"fas fa-link\"></i></span></span>\n </span>\n </div>\n </div>\n <div class=\"form-group\">\n <label for=\"lineStyle\">Line Style</label>\n <select id=\"lineStyle\" formControlName=\"lineStyle\" class=\"form-control\">\n <option value=\"Solid\">Solid</option>\n <option value=\"Dotted\">Dotted</option>\n </select>\n </div>\n\n <div class=\"form-group\">\n <label for=\"label\">Labels</label>\n <div formArrayName=\"label\">\n <div *ngFor=\"let label of labelArray.controls; let i = index\" [formGroupName]=\"i\"\n class=\"d-flex flex-column align-items-start\">\n <div class=\"d-flex align-items-center w-100\">\n <input formControlName=\"label\" class=\"form-control\" placeholder=\"Label\" [id]=\"'label-' + i\">\n <button type=\"button\" class=\"btn btn-danger ml-2\" (click)=\"removeLabel(i)\" [disabled]=\"labelArray.length <= 1\">Remove</button>\n </div>\n <div class=\"form-group form-check\">\n <input type=\"checkbox\" formControlName=\"linkIcon\" class=\"form-check-input\" [id]=\"'linkIcon-' + i\">\n <label [for]=\"'linkIcon-' + i\">Link Icon?</label>\n </div>\n </div>\n </div>\n <button type=\"button\" class=\"btn btn-secondary mt-2\" (click)=\"addLabel()\">Add Label</button>\n </div>\n </form>\n </div>\n <div class=\"modal-footer\">\n <button type=\"button\" class=\"btn btn-secondary\" (click)=\"closeModal('modalRef')\">Cancel</button>\n <button type=\"button\" class=\"btn btn-primary\" (click)=\"createEditLink('createLinkModal')\" [disabled]=\"!createLinkForm.valid\">Create Link</button>\n </div>\n</ng-template>\n<!-- ./MODAL-->", styles: [".imageUrl{max-width:30px}.labelPosition{position:relative;top:-55px;margin-right:30px;margin-left:30px}.link-line-solid{width:100%;position:relative;margin:15px;border-top:2px solid #777}.link-line-dotted{width:100%;position:relative;margin:15px;background-image:repeating-linear-gradient(to right,#cacaca,#cacaca 7px,transparent 7px,transparent 15px);height:2px}.iconImage{position:relative;top:4px}.arrow{position:absolute;top:20px;left:20px}\n"], dependencies: [{ kind: "directive", type: i4.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2$1.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i2$1.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i2$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2$1.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i2$1.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i2$1.RadioControlValueAccessor, selector: "input[type=radio][formControlName],input[type=radio][formControl],input[type=radio][ngModel]", inputs: ["name", "formControlName", "value"] }, { kind: "directive", type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i2$1.FormGroupName, selector: "[formGroupName]", inputs: ["formGroupName"] }, { kind: "directive", type: i2$1.FormArrayName, selector: "[formArrayName]", inputs: ["formArrayName"] }, { kind: "component", type: i5.NgSelectComponent, selector: "ng-select", inputs: ["bindLabel", "bindValue", "markFirst", "placeholder", "notFoundText", "typeToSearchText", "addTagText", "loadingText", "clearAllText", "appearance", "dropdownPosition", "appendTo", "loading", "closeOnSelect", "hideSelected", "selectOnTab", "openOnEnter", "maxSelectedItems", "groupBy", "groupValue", "bufferAmount", "virtualScroll", "selectableGroup", "selectableGroupAsModel", "searchFn", "trackByFn", "clearOnBackspace", "labelForId", "inputAttrs", "tabIndex", "readonly", "searchWhileComposing", "minTermLength", "editableSearchTerm", "keyDownFn", "typeahead", "multiple", "addTag", "searchable", "clearable", "isOpen", "items", "compareWith", "clearSearchOnAdd", "deselectOnClick"], outputs: ["blur", "focus", "change", "open", "close", "search", "clear", "add", "remove", "scroll", "scrollToEnd"] }, { kind: "directive", type: i5.NgOptionTemplateDirective, selector: "[ng-option-tmp]" }, { kind: "directive", type: i5.NgHeaderTemplateDirective, selector: "[ng-header-tmp]" }] });
668
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: ModalsComponent, selector: "app-modals", inputs: { editNodeData: "editNodeData", editLinksData: "editLinksData" }, outputs: { closeModalEvent: "closeModalEvent", createEditLinkEvent: "createEditLinkEvent", createEditNodeEvent: "createEditNodeEvent", deleteLinkEvent: "deleteLinkEvent", deleteNodeEvent: "deleteNodeEvent" }, viewQueries: [{ propertyName: "editNodeModal", first: true, predicate: ["editNodeModal"], descendants: true }, { propertyName: "createNodeModal", first: true, predicate: ["createNodeModal"], descendants: true }, { propertyName: "createLinkModal", first: true, predicate: ["createLinkModal"], descendants: true }, { propertyName: "editLinksModal", first: true, predicate: ["editLinksModal"], descendants: true }], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<!--EDIT NODE MODAL-->\n<ng-template #editNodeModal>\n <div class=\"modal-header\">\n <h4 class=\"modal-title pull-left\">Edit Node</h4>\n <button type=\"button\" class=\"btn-close close pull-right\" aria-label=\"Close\" (click)=\"closeModal('modalRef')\">\n <span aria-hidden=\"true\" class=\"visually-hidden\">&times;</span>\n </button>\n </div>\n <div class=\"modal-body\">\n <form [formGroup]=\"createNodeForm\">\n <div class=\"form-group\">\n <label for=\"iconType\">Icon Type</label>\n <div>\n <input type=\"radio\" id=\"imageUrl\" formControlName=\"iconType\" value=\"url\"> Image URL\n <input class=\"ml-5\" type=\"radio\" id=\"iconTypeSelect\" formControlName=\"iconType\" value=\"select\"> Choose Icon\n </div>\n </div>\n <div class=\"form-group\" *ngIf=\"createNodeForm.get('iconType')?.value === 'url'\">\n <label for=\"imageUrl\">Image URL</label>\n <div class=\"input-group\">\n <input type=\"text\" id=\"imageUrl\" formControlName=\"imageUrl\" class=\"form-control\" placeholder=\"Image URL\">\n <button type=\"button\" class=\"btn btn-outline-secondary\" (click)=\"clearImageUrl()\">Clear</button>\n </div>\n </div>\n <div class=\"form-group\" *ngIf=\"createNodeForm.get('iconType')?.value === 'select'\">\n <label for=\"nodeIcon\">Choose Icon</label>\n <ng-select\n formControlName=\"icon\"\n [items]=\"iconsBuffer\"\n [virtualScroll]=\"true\"\n [loading]=\"loading\"\n bindLabel=\"name\"\n bindValue=\"icon\"\n [editableSearchTerm]=\"true\"\n placeholder=\"Select icon\"\n appendTo=\"body\"\n [trackByFn]=\"trackByFn\"\n (scroll)=\"onScroll($event)\"\n (scrollToEnd)=\"onScrollToEnd()\"\n >\n <ng-template ng-header-tmp>\n <small class=\"form-text text-muted\"\n >Loaded {{ iconsBuffer.length }} of {{ fontAwesomeIcons.length }}</small\n >\n </ng-template>\n <ng-template ng-option-tmp let-item=\"item\">\n <i class=\"fa fa-light\">{{item.icon}}</i>\n <span class=\"ml-3\">{{ item.name }}</span>\n </ng-template>\n </ng-select>\n </div>\n <div *ngIf=\"createNodeForm.errors?.iconOrImage\" class=\"text-danger\">\n Please provide either an Image URL or choose an Icon, but not both.\n </div>\n <div class=\"form-group\">\n <label for=\"label\">Labels</label>\n <div formArrayName=\"label\">\n <div *ngFor=\"let label of nodeLabelArray.controls; let i = index\" [formGroupName]=\"i\"\n class=\"d-flex flex-column align-items-start\">\n <div class=\"d-flex align-items-center w-100\">\n <input formControlName=\"label\" class=\"form-control mb-2\" placeholder=\"Label\" [id]=\"'node-label-' + i\">\n <button type=\"button\" class=\"btn btn-danger ml-2\" (click)=\"removeNodeLabel(i)\" [disabled]=\"nodeLabelArray.length <= 1\">Remove</button>\n </div>\n </div>\n </div>\n <button type=\"button\" class=\"btn btn-secondary mt-2\" (click)=\"addNodeLabel()\">Add Label</button>\n </div>\n <div class=\"form-group\">\n <label for=\"nodeAdditionalIcon\">Additional icon</label>\n <ng-select\n formControlName=\"additionalIcon\"\n [items]=\"iconsBuffer\"\n [virtualScroll]=\"true\"\n [loading]=\"loading\"\n bindLabel=\"name\"\n bindValue=\"icon\"\n [editableSearchTerm]=\"true\"\n placeholder=\"Select icon\"\n appendTo=\"body\"\n [trackByFn]=\"trackByFn\"\n (scroll)=\"onScroll($event)\"\n (scrollToEnd)=\"onScrollToEnd()\"\n >\n <ng-template ng-header-tmp>\n <small class=\"form-text text-muted\"\n >Loaded {{ iconsBuffer.length }} of {{ fontAwesomeIcons.length }}</small\n >\n </ng-template>\n <ng-template ng-option-tmp let-item=\"item\">\n <i class=\"fa fa-light\">{{item.icon}}</i>\n <span class=\"ml-3\">{{ item.name }}</span>\n </ng-template>\n </ng-select>\n </div>\n </form>\n </div>\n <div class=\"modal-footer\">\n <button type=\"button\" class=\"btn btn-secondary\" (click)=\"closeModal('modalRef')\">Cancel</button>\n <button type=\"button\" class=\"btn btn-primary\" (click)=\"createEditNode('editNodeModal')\" [disabled]=\"!createNodeForm.valid\">Save Changes</button>\n <button type=\"button\" class=\"btn btn-danger\" (click)=\"deleteNode()\">Delete Node</button>\n </div>\n</ng-template>\n<!-- ./MODAL-->\n\n<!--CREATE NODE MODAL-->\n<ng-template #createNodeModal>\n <div class=\"modal-header\">\n <h4 class=\"modal-title pull-left\">Create Node</h4>\n <button type=\"button\" class=\"btn-close close pull-right\" aria-label=\"Close\" (click)=\"closeModal('modalRef')\">\n <span aria-hidden=\"true\" class=\"visually-hidden\">&times;</span>\n </button>\n </div>\n <div class=\"modal-body\">\n <form [formGroup]=\"createNodeForm\">\n <div class=\"form-group\">\n <label for=\"iconType\">Icon Type</label>\n <div>\n <input type=\"radio\" id=\"imageUrl\" formControlName=\"iconType\" value=\"url\"> Image URL\n <input class=\"ml-5\" type=\"radio\" id=\"iconTypeSelect\" formControlName=\"iconType\" value=\"select\"> Choose Icon\n </div>\n </div>\n <div class=\"form-group\" *ngIf=\"createNodeForm.get('iconType')?.value === 'url'\">\n <label for=\"imageUrl\">Image URL</label>\n <div class=\"input-group\">\n <input type=\"text\" id=\"imageUrl\" formControlName=\"imageUrl\" class=\"form-control\" placeholder=\"Image URL\">\n <button type=\"button\" class=\"btn btn-outline-secondary\" (click)=\"clearImageUrl()\">Clear</button>\n </div>\n </div>\n <div class=\"form-group\" *ngIf=\"createNodeForm.get('iconType')?.value === 'select'\">\n <label for=\"nodeIcon\">Choose Icon</label>\n <ng-select\n formControlName=\"icon\"\n [items]=\"iconsBuffer\"\n [virtualScroll]=\"true\"\n [loading]=\"loading\"\n bindLabel=\"name\"\n bindValue=\"icon\"\n [editableSearchTerm]=\"true\"\n placeholder=\"Select icon\"\n appendTo=\"body\"\n [trackByFn]=\"trackByFn\"\n (scroll)=\"onScroll($event)\"\n (scrollToEnd)=\"onScrollToEnd()\"\n >\n <ng-template ng-header-tmp>\n <small class=\"form-text text-muted\"\n >Loaded {{ iconsBuffer.length }} of {{ fontAwesomeIcons.length }}</small\n >\n </ng-template>\n <ng-template ng-option-tmp let-item=\"item\">\n <i class=\"fa fa-light\">{{item.icon}}</i>\n <span class=\"ml-3\">{{ item.name }}</span>\n </ng-template>\n </ng-select>\n </div>\n <div *ngIf=\"createNodeForm.errors?.iconOrImage\" class=\"text-danger\">\n Please provide either an Image URL or choose an Icon, but not both.\n </div>\n <div class=\"form-group\">\n <label for=\"label\">Labels</label>\n <div formArrayName=\"label\">\n <div *ngFor=\"let label of nodeLabelArray.controls; let i = index\" [formGroupName]=\"i\"\n class=\"d-flex flex-column align-items-start\">\n <div class=\"d-flex align-items-center w-100\">\n <input formControlName=\"label\" class=\"form-control mb-2\" placeholder=\"Label\" [id]=\"'node-label-' + i\">\n <button type=\"button\" class=\"btn btn-danger ml-2\" (click)=\"removeNodeLabel(i)\" [disabled]=\"nodeLabelArray.length <= 1\">Remove</button>\n </div>\n </div>\n </div>\n <button type=\"button\" class=\"btn btn-secondary mt-2\" (click)=\"addNodeLabel()\">Add Label</button>\n </div>\n <div class=\"form-group\">\n <label for=\"nodeAdditionalIcon\">Additional icon</label>\n <ng-select\n formControlName=\"additionalIcon\"\n [items]=\"iconsBuffer\"\n [virtualScroll]=\"true\"\n [loading]=\"loading\"\n bindLabel=\"name\"\n bindValue=\"icon\"\n [editableSearchTerm]=\"true\"\n placeholder=\"Select icon\"\n appendTo=\"body\"\n [trackByFn]=\"trackByFn\"\n (scroll)=\"onScroll($event)\"\n (scrollToEnd)=\"onScrollToEnd()\"\n >\n <ng-template ng-header-tmp>\n <small class=\"form-text text-muted\"\n >Loaded {{ iconsBuffer.length }} of {{ fontAwesomeIcons.length }}</small\n >\n </ng-template>\n <ng-template ng-option-tmp let-item=\"item\">\n <i class=\"fa fa-light\">{{item.icon}}</i>\n <span class=\"ml-3\">{{ item.name }}</span>\n </ng-template>\n </ng-select>\n </div>\n </form>\n </div>\n <div class=\"modal-footer\">\n <button type=\"button\" class=\"btn btn-secondary\" (click)=\"closeModal('modalRef')\">Cancel</button>\n <button type=\"button\" class=\"btn btn-primary\" (click)=\"createEditNode('createNodeModal')\" [disabled]=\"!createNodeForm.valid\">Create Node</button>\n </div>\n</ng-template>\n<!-- ./MODAL-->\n\n<!--EDIT LINKS MODAL-->\n<ng-template #editLinksModal>\n <div class=\"modal-header\">\n <h4 class=\"modal-title pull-left\">Edit Links</h4>\n <button type=\"button\" class=\"btn-close close pull-right\" aria-label=\"Close\" (click)=\"closeModal('modalRef')\">\n <span aria-hidden=\"true\" class=\"visually-hidden\">&times;</span>\n </button>\n </div>\n <div class=\"modal-body\">\n <form [formGroup]=\"createLinkForm\">\n <div class=\"col-sm-12 d-flex flex-column\">\n <div class=\"d-flex mb-3\">\n <div class=\"iconImage\">\n <span><i class=\"fas fa-arrow-left\"></i></span>\n <span class=\"arrow\">\n <input type=\"checkbox\" id=\"sourceArrow\" formControlName=\"sourceArrow\" class=\"form-check-input\">\n <label class=\"d-none form-check-label\" for=\"leftArrow\"></label>\n </span>\n </div>\n <div class=\"iconImage ml-3\">\n <ng-container *ngIf=\"targetImageUrl; else targetIconTemplate\">\n <img class=\"imageUrl\" [src]=\"targetImageUrl\" />\n </ng-container>\n <ng-template #targetIconTemplate>\n <i class=\"fa-solid fa-2x\">{{targetIcon}}</i>\n </ng-template>\n </div>\n <div\n [ngClass]=\"{\n 'link-line-solid': createLinkForm.get('lineStyle')?.value === 'Solid',\n 'link-line-dotted': createLinkForm.get('lineStyle')?.value === 'Dotted'\n }\"\n >\n </div>\n <div class=\"iconImage mr-3\">\n <ng-container *ngIf=\"sourceImageUrl; else sourceIconTemplate\">\n <img class=\"imageUrl\" [src]=\"sourceImageUrl\" />\n </ng-container>\n <ng-template #sourceIconTemplate>\n <i class=\"fa-solid fa-2x\">{{sourceIcon}}</i>\n </ng-template>\n </div>\n <div class=\"iconImage\">\n <span><i class=\"fas fa-arrow-right\"></i></span>\n <span class=\"arrow\">\n <input type=\"checkbox\" id=\"targetArrow\" formControlName=\"targetArrow\" class=\"form-check-input\">\n <label class=\"form-check-label\" for=\"rightArrow\"></label>\n </span>\n </div>\n </div>\n <div class=\"d-flex justify-content-between mb-3\">\n <div class=\"text-left d-block font-weight-bold\" style=\"font-size: 12px\">\n <span class=\"d-block\" *ngFor=\"let label of targetLabels\">{{ label }}</span>\n </div>\n <div class=\"text-right d-block font-weight-bold\" style=\"font-size: 12px\">\n <span class=\"d-block\" *ngFor=\"let label of sourceLabels\">{{ label }}</span>\n </div>\n </div>\n <div *ngIf=\"createLinkForm.get('label')?.value?.length\" class=\"labelPosition text-center\">\n <span *ngFor=\"let label of createLinkForm.get('label')?.value\">\n <span class=\"d-block\">{{ label.label }} <span style=\"color: #856404;\" *ngIf=\"label.linkIcon\"><i class=\"fas fa-link\"></i></span></span>\n </span>\n </div>\n </div>\n <div class=\"form-group\">\n <label for=\"lineStyle\">Line Style</label>\n <select id=\"lineStyle\" formControlName=\"lineStyle\" class=\"form-control\">\n <option value=\"Solid\">Solid</option>\n <option value=\"Dotted\">Dotted</option>\n </select>\n </div>\n\n <div class=\"form-group\">\n <label for=\"label\">Labels</label>\n <div formArrayName=\"label\">\n <div *ngFor=\"let label of labelArray.controls; let i = index\" [formGroupName]=\"i\"\n class=\"d-flex flex-column align-items-start\">\n <div class=\"d-flex align-items-center w-100\">\n <input formControlName=\"label\" class=\"form-control\" placeholder=\"Label\" [id]=\"'label-' + i\">\n <button type=\"button\" class=\"btn btn-danger ml-2\" (click)=\"removeLabel(i)\" [disabled]=\"labelArray.length <= 1\">Remove</button>\n </div>\n <div class=\"form-group form-check\">\n <input type=\"checkbox\" formControlName=\"linkIcon\" class=\"form-check-input\" [id]=\"'linkIcon-' + i\">\n <label [for]=\"'linkIcon-' + i\">Link Icon?</label>\n </div>\n </div>\n </div>\n <button type=\"button\" class=\"btn btn-secondary mt-2\" (click)=\"addLabel()\">Add Label</button>\n </div>\n </form>\n </div>\n <div class=\"modal-footer\">\n <button type=\"button\" class=\"btn btn-secondary\" (click)=\"closeModal('modalRef')\">Cancel</button>\n <button type=\"button\" class=\"btn btn-primary\" (click)=\"createEditLink('editLinkModal')\" [disabled]=\"!createLinkForm.valid\">Save Changes</button>\n <button type=\"button\" class=\"btn btn-danger\" (click)=\"deleteLink()\">Delete Link</button>\n </div>\n</ng-template>\n<!-- ./MODAL-->\n\n\n<!--CREATE LINK MODAL-->\n<ng-template #createLinkModal>\n <div class=\"modal-header\">\n <h4 class=\"modal-title pull-left\">Create Link</h4>\n <button type=\"button\" class=\"btn-close close pull-right\" aria-label=\"Close\" (click)=\"closeModal('modalRef')\">\n <span aria-hidden=\"true\" class=\"visually-hidden\">&times;</span>\n </button>\n </div>\n <div class=\"modal-body\">\n <form [formGroup]=\"createLinkForm\">\n <div class=\"col-sm-12 d-flex flex-column\">\n <div class=\"d-flex mb-3\">\n <div class=\"iconImage\">\n <span><i class=\"fas fa-arrow-left\"></i></span>\n <span class=\"arrow\">\n <input type=\"checkbox\" id=\"sourceArrow\" formControlName=\"sourceArrow\" class=\"form-check-input\">\n <label class=\"d-none form-check-label\" for=\"leftArrow\"></label>\n </span>\n </div>\n <div class=\"iconImage ml-3\">\n <ng-container *ngIf=\"targetImageUrl; else targetIconTemplate\">\n <img class=\"imageUrl\" [src]=\"targetImageUrl\" />\n </ng-container>\n <ng-template #targetIconTemplate>\n <i class=\"fa-solid fa-2x\">{{targetIcon}}</i>\n </ng-template>\n </div>\n <div\n [ngClass]=\"{\n 'link-line-solid': createLinkForm.get('lineStyle')?.value === 'Solid',\n 'link-line-dotted': createLinkForm.get('lineStyle')?.value === 'Dotted'\n }\"\n >\n </div>\n <div class=\"iconImage mr-3\">\n <ng-container *ngIf=\"sourceImageUrl; else sourceIconTemplate\">\n <img class=\"imageUrl\" [src]=\"sourceImageUrl\" />\n </ng-container>\n <ng-template #sourceIconTemplate>\n <i class=\"fa-solid fa-2x\">{{sourceIcon}}</i>\n </ng-template>\n </div>\n <div class=\"iconImage\">\n <span><i class=\"fas fa-arrow-right\"></i></span>\n <span class=\"arrow\">\n <input type=\"checkbox\" id=\"targetArrow\" formControlName=\"targetArrow\" class=\"form-check-input\">\n <label class=\"form-check-label\" for=\"rightArrow\"></label>\n </span>\n </div>\n </div>\n <div class=\"d-flex justify-content-between mb-3\">\n <div class=\"text-left d-block font-weight-bold\" style=\"font-size: 12px\">\n <span class=\"d-block\" *ngFor=\"let label of targetLabels\">{{ label }}</span>\n </div>\n <div class=\"text-right d-block font-weight-bold\" style=\"font-size: 12px\">\n <span class=\"d-block\" *ngFor=\"let label of sourceLabels\">{{ label }}</span>\n </div>\n </div>\n <div *ngIf=\"createLinkForm.get('label')?.value?.length\" class=\"labelPosition text-center\">\n <span *ngFor=\"let label of createLinkForm.get('label')?.value\">\n <span class=\"d-block\">{{ label.label }} <span style=\"color: #856404;\" *ngIf=\"label.linkIcon\"><i class=\"fas fa-link\"></i></span></span>\n </span>\n </div>\n </div>\n <div class=\"form-group\">\n <label for=\"lineStyle\">Line Style</label>\n <select id=\"lineStyle\" formControlName=\"lineStyle\" class=\"form-control\">\n <option value=\"Solid\">Solid</option>\n <option value=\"Dotted\">Dotted</option>\n </select>\n </div>\n\n <div class=\"form-group\">\n <label for=\"label\">Labels</label>\n <div formArrayName=\"label\">\n <div *ngFor=\"let label of labelArray.controls; let i = index\" [formGroupName]=\"i\"\n class=\"d-flex flex-column align-items-start\">\n <div class=\"d-flex align-items-center w-100\">\n <input formControlName=\"label\" class=\"form-control\" placeholder=\"Label\" [id]=\"'label-' + i\">\n <button type=\"button\" class=\"btn btn-danger ml-2\" (click)=\"removeLabel(i)\" [disabled]=\"labelArray.length <= 1\">Remove</button>\n </div>\n <div class=\"form-group form-check\">\n <input type=\"checkbox\" formControlName=\"linkIcon\" class=\"form-check-input\" [id]=\"'linkIcon-' + i\">\n <label [for]=\"'linkIcon-' + i\">Link Icon?</label>\n </div>\n </div>\n </div>\n <button type=\"button\" class=\"btn btn-secondary mt-2\" (click)=\"addLabel()\">Add Label</button>\n </div>\n </form>\n </div>\n <div class=\"modal-footer\">\n <button type=\"button\" class=\"btn btn-secondary\" (click)=\"closeModal('modalRef')\">Cancel</button>\n <button type=\"button\" class=\"btn btn-primary\" (click)=\"createEditLink('createLinkModal')\" [disabled]=\"!createLinkForm.valid\">Create Link</button>\n </div>\n</ng-template>\n<!-- ./MODAL-->", styles: [".imageUrl{max-width:30px}.labelPosition{position:relative;top:-55px;margin-right:30px;margin-left:30px}.link-line-solid{width:100%;position:relative;margin:15px;border-top:2px solid #777}.link-line-dotted{width:100%;position:relative;margin:15px;background-image:repeating-linear-gradient(to right,#cacaca,#cacaca 7px,transparent 7px,transparent 15px);height:2px}.iconImage{position:relative;top:4px}.arrow{position:absolute;top:20px;left:20px}\n"], dependencies: [{ kind: "directive", type: i4.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2$1.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i2$1.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i2$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2$1.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i2$1.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i2$1.RadioControlValueAccessor, selector: "input[type=radio][formControlName],input[type=radio][formControl],input[type=radio][ngModel]", inputs: ["name", "formControlName", "value"] }, { kind: "directive", type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i2$1.FormGroupName, selector: "[formGroupName]", inputs: ["formGroupName"] }, { kind: "directive", type: i2$1.FormArrayName, selector: "[formArrayName]", inputs: ["formArrayName"] }, { kind: "component", type: i5.NgSelectComponent, selector: "ng-select", inputs: ["bindLabel", "bindValue", "markFirst", "placeholder", "notFoundText", "typeToSearchText", "addTagText", "loadingText", "clearAllText", "appearance", "dropdownPosition", "appendTo", "loading", "closeOnSelect", "hideSelected", "selectOnTab", "openOnEnter", "maxSelectedItems", "groupBy", "groupValue", "bufferAmount", "virtualScroll", "selectableGroup", "selectableGroupAsModel", "searchFn", "trackByFn", "clearOnBackspace", "labelForId", "inputAttrs", "tabIndex", "readonly", "searchWhileComposing", "minTermLength", "editableSearchTerm", "keyDownFn", "typeahead", "multiple", "addTag", "searchable", "clearable", "isOpen", "items", "compareWith", "clearSearchOnAdd", "deselectOnClick"], outputs: ["blur", "focus", "change", "open", "close", "search", "clear", "add", "remove", "scroll", "scrollToEnd"] }, { kind: "directive", type: i5.NgOptionTemplateDirective, selector: "[ng-option-tmp]" }, { kind: "directive", type: i5.NgHeaderTemplateDirective, selector: "[ng-header-tmp]" }] });
674
669
  }
675
670
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: ModalsComponent, decorators: [{
676
671
  type: Component,
677
- args: [{ selector: 'app-modals', template: "<!--EDIT NODE MODAL-->\n<ng-template #editNodeModal>\n <div class=\"modal-header\">\n <h4 class=\"modal-title pull-left\">Edit Node</h4>\n <button type=\"button\" class=\"btn-close close pull-right\" aria-label=\"Close\" (click)=\"closeModal('modalRef')\">\n <span aria-hidden=\"true\" class=\"visually-hidden\">&times;</span>\n </button>\n </div>\n <div class=\"modal-body\">\n <form [formGroup]=\"createNodeForm\">\n <div class=\"form-group\">\n <label for=\"iconType\">Icon Type</label>\n <div>\n <input type=\"radio\" id=\"imageUrl\" formControlName=\"iconType\" value=\"url\"> Image URL\n <input class=\"ml-5\" type=\"radio\" id=\"iconTypeSelect\" formControlName=\"iconType\" value=\"select\"> Choose Icon\n </div>\n </div>\n <div class=\"form-group\" *ngIf=\"createNodeForm.get('iconType').value === 'url'\">\n <label for=\"imageUrl\">Image URL</label>\n <div class=\"input-group\">\n <input type=\"text\" id=\"imageUrl\" formControlName=\"imageUrl\" class=\"form-control\" placeholder=\"Image URL\">\n <button type=\"button\" class=\"btn btn-outline-secondary\" (click)=\"clearImageUrl()\">Clear</button>\n </div>\n </div>\n <div class=\"form-group\" *ngIf=\"createNodeForm.get('iconType').value === 'select'\">\n <label for=\"nodeIcon\">Choose Icon</label>\n <ng-select\n formControlName=\"icon\"\n [items]=\"iconsBuffer\"\n [virtualScroll]=\"true\"\n [loading]=\"loading\"\n bindLabel=\"name\"\n bindValue=\"icon\"\n [editableSearchTerm]=\"true\"\n placeholder=\"Select icon\"\n appendTo=\"body\"\n [trackByFn]=\"trackByFn\"\n (scroll)=\"onScroll($event)\"\n (scrollToEnd)=\"onScrollToEnd()\"\n >\n <ng-template ng-header-tmp>\n <small class=\"form-text text-muted\"\n >Loaded {{ iconsBuffer.length }} of {{ fontAwesomeIcons.length }}</small\n >\n </ng-template>\n <ng-template ng-option-tmp let-item=\"item\">\n <i class=\"fa fa-light\">{{item.icon}}</i>\n <span class=\"ml-3\">{{ item.name }}</span>\n </ng-template>\n </ng-select>\n </div>\n <div *ngIf=\"createNodeForm.errors?.iconOrImage\" class=\"text-danger\">\n Please provide either an Image URL or choose an Icon, but not both.\n </div>\n <div class=\"form-group\">\n <label for=\"label\">Labels</label>\n <div formArrayName=\"label\">\n <div *ngFor=\"let label of nodeLabelArray.controls; let i = index\" [formGroupName]=\"i\"\n class=\"d-flex flex-column align-items-start\">\n <div class=\"d-flex align-items-center w-100\">\n <input formControlName=\"label\" class=\"form-control mb-2\" placeholder=\"Label\" [id]=\"'node-label-' + i\">\n <button type=\"button\" class=\"btn btn-danger ml-2\" (click)=\"removeNodeLabel(i)\" [disabled]=\"nodeLabelArray.length <= 1\">Remove</button>\n </div>\n </div>\n </div>\n <button type=\"button\" class=\"btn btn-secondary mt-2\" (click)=\"addNodeLabel()\">Add Label</button>\n </div>\n <div class=\"form-group\">\n <label for=\"nodeAdditionalIcon\">Additional icon</label>\n <ng-select\n formControlName=\"additionalIcon\"\n [items]=\"iconsBuffer\"\n [virtualScroll]=\"true\"\n [loading]=\"loading\"\n bindLabel=\"name\"\n bindValue=\"icon\"\n [editableSearchTerm]=\"true\"\n placeholder=\"Select icon\"\n appendTo=\"body\"\n [trackByFn]=\"trackByFn\"\n (scroll)=\"onScroll($event)\"\n (scrollToEnd)=\"onScrollToEnd()\"\n >\n <ng-template ng-header-tmp>\n <small class=\"form-text text-muted\"\n >Loaded {{ iconsBuffer.length }} of {{ fontAwesomeIcons.length }}</small\n >\n </ng-template>\n <ng-template ng-option-tmp let-item=\"item\">\n <i class=\"fa fa-light\">{{item.icon}}</i>\n <span class=\"ml-3\">{{ item.name }}</span>\n </ng-template>\n </ng-select>\n </div>\n </form>\n </div>\n <div class=\"modal-footer\">\n <button type=\"button\" class=\"btn btn-secondary\" (click)=\"closeModal('modalRef')\">Cancel</button>\n <button type=\"button\" class=\"btn btn-primary\" (click)=\"createEditNode('editNodeModal')\" [disabled]=\"!createNodeForm.valid\">Save Changes</button>\n <button type=\"button\" class=\"btn btn-danger\" (click)=\"deleteNode()\">Delete Node</button>\n </div>\n</ng-template>\n<!-- ./MODAL-->\n\n<!--CREATE NODE MODAL-->\n<ng-template #createNodeModal>\n <div class=\"modal-header\">\n <h4 class=\"modal-title pull-left\">Create Node</h4>\n <button type=\"button\" class=\"btn-close close pull-right\" aria-label=\"Close\" (click)=\"closeModal('modalRef')\">\n <span aria-hidden=\"true\" class=\"visually-hidden\">&times;</span>\n </button>\n </div>\n <div class=\"modal-body\">\n <form [formGroup]=\"createNodeForm\">\n <div class=\"form-group\">\n <label for=\"iconType\">Icon Type</label>\n <div>\n <input type=\"radio\" id=\"imageUrl\" formControlName=\"iconType\" value=\"url\"> Image URL\n <input class=\"ml-5\" type=\"radio\" id=\"iconTypeSelect\" formControlName=\"iconType\" value=\"select\"> Choose Icon\n </div>\n </div>\n <div class=\"form-group\" *ngIf=\"createNodeForm.get('iconType').value === 'url'\">\n <label for=\"imageUrl\">Image URL</label>\n <div class=\"input-group\">\n <input type=\"text\" id=\"imageUrl\" formControlName=\"imageUrl\" class=\"form-control\" placeholder=\"Image URL\">\n <button type=\"button\" class=\"btn btn-outline-secondary\" (click)=\"clearImageUrl()\">Clear</button>\n </div>\n </div>\n <div class=\"form-group\" *ngIf=\"createNodeForm.get('iconType').value === 'select'\">\n <label for=\"nodeIcon\">Choose Icon</label>\n <ng-select\n formControlName=\"icon\"\n [items]=\"iconsBuffer\"\n [virtualScroll]=\"true\"\n [loading]=\"loading\"\n bindLabel=\"name\"\n bindValue=\"icon\"\n [editableSearchTerm]=\"true\"\n placeholder=\"Select icon\"\n appendTo=\"body\"\n [trackByFn]=\"trackByFn\"\n (scroll)=\"onScroll($event)\"\n (scrollToEnd)=\"onScrollToEnd()\"\n >\n <ng-template ng-header-tmp>\n <small class=\"form-text text-muted\"\n >Loaded {{ iconsBuffer.length }} of {{ fontAwesomeIcons.length }}</small\n >\n </ng-template>\n <ng-template ng-option-tmp let-item=\"item\">\n <i class=\"fa fa-light\">{{item.icon}}</i>\n <span class=\"ml-3\">{{ item.name }}</span>\n </ng-template>\n </ng-select>\n </div>\n <div *ngIf=\"createNodeForm.errors?.iconOrImage\" class=\"text-danger\">\n Please provide either an Image URL or choose an Icon, but not both.\n </div>\n <div class=\"form-group\">\n <label for=\"label\">Labels</label>\n <div formArrayName=\"label\">\n <div *ngFor=\"let label of nodeLabelArray.controls; let i = index\" [formGroupName]=\"i\"\n class=\"d-flex flex-column align-items-start\">\n <div class=\"d-flex align-items-center w-100\">\n <input formControlName=\"label\" class=\"form-control mb-2\" placeholder=\"Label\" [id]=\"'node-label-' + i\">\n <button type=\"button\" class=\"btn btn-danger ml-2\" (click)=\"removeNodeLabel(i)\" [disabled]=\"nodeLabelArray.length <= 1\">Remove</button>\n </div>\n </div>\n </div>\n <button type=\"button\" class=\"btn btn-secondary mt-2\" (click)=\"addNodeLabel()\">Add Label</button>\n </div>\n <div class=\"form-group\">\n <label for=\"nodeAdditionalIcon\">Additional icon</label>\n <ng-select\n formControlName=\"additionalIcon\"\n [items]=\"iconsBuffer\"\n [virtualScroll]=\"true\"\n [loading]=\"loading\"\n bindLabel=\"name\"\n bindValue=\"icon\"\n [editableSearchTerm]=\"true\"\n placeholder=\"Select icon\"\n appendTo=\"body\"\n [trackByFn]=\"trackByFn\"\n (scroll)=\"onScroll($event)\"\n (scrollToEnd)=\"onScrollToEnd()\"\n >\n <ng-template ng-header-tmp>\n <small class=\"form-text text-muted\"\n >Loaded {{ iconsBuffer.length }} of {{ fontAwesomeIcons.length }}</small\n >\n </ng-template>\n <ng-template ng-option-tmp let-item=\"item\">\n <i class=\"fa fa-light\">{{item.icon}}</i>\n <span class=\"ml-3\">{{ item.name }}</span>\n </ng-template>\n </ng-select>\n </div>\n </form>\n </div>\n <div class=\"modal-footer\">\n <button type=\"button\" class=\"btn btn-secondary\" (click)=\"closeModal('modalRef')\">Cancel</button>\n <button type=\"button\" class=\"btn btn-primary\" (click)=\"createEditNode('createNodeModal')\" [disabled]=\"!createNodeForm.valid\">Create Node</button>\n </div>\n</ng-template>\n<!-- ./MODAL-->\n\n<!--EDIT LINKS MODAL-->\n<ng-template #editLinksModal>\n <div class=\"modal-header\">\n <h4 class=\"modal-title pull-left\">Edit Links</h4>\n <button type=\"button\" class=\"btn-close close pull-right\" aria-label=\"Close\" (click)=\"closeModal('modalRef')\">\n <span aria-hidden=\"true\" class=\"visually-hidden\">&times;</span>\n </button>\n </div>\n <div class=\"modal-body\">\n <form [formGroup]=\"createLinkForm\">\n <div class=\"col-sm-12 d-flex flex-column\">\n <div class=\"d-flex mb-3\">\n <div class=\"iconImage\">\n <span><i class=\"fas fa-arrow-left\"></i></span>\n <span class=\"arrow\">\n <input type=\"checkbox\" id=\"sourceArrow\" formControlName=\"sourceArrow\" class=\"form-check-input\">\n <label class=\"d-none form-check-label\" for=\"leftArrow\"></label>\n </span>\n </div>\n <div class=\"iconImage ml-3\">\n <ng-container *ngIf=\"targetImageUrl; else targetIconTemplate\">\n <img class=\"imageUrl\" [src]=\"targetImageUrl\" />\n </ng-container>\n <ng-template #targetIconTemplate>\n <i class=\"fa-solid fa-2x\">{{targetIcon}}</i>\n </ng-template>\n </div>\n <div\n [ngClass]=\"{\n 'link-line-solid': createLinkForm.get('lineStyle').value === 'Solid',\n 'link-line-dotted': createLinkForm.get('lineStyle').value === 'Dotted'\n }\"\n >\n </div>\n <div class=\"iconImage mr-3\">\n <ng-container *ngIf=\"sourceImageUrl; else sourceIconTemplate\">\n <img class=\"imageUrl\" [src]=\"sourceImageUrl\" />\n </ng-container>\n <ng-template #sourceIconTemplate>\n <i class=\"fa-solid fa-2x\">{{sourceIcon}}</i>\n </ng-template>\n </div>\n <div class=\"iconImage\">\n <span><i class=\"fas fa-arrow-right\"></i></span>\n <span class=\"arrow\">\n <input type=\"checkbox\" id=\"targetArrow\" formControlName=\"targetArrow\" class=\"form-check-input\">\n <label class=\"form-check-label\" for=\"rightArrow\"></label>\n </span>\n </div>\n </div>\n <div class=\"d-flex justify-content-between mb-3\">\n <div class=\"text-left d-block font-weight-bold\" style=\"font-size: 12px\">\n <span class=\"d-block\" *ngFor=\"let label of targetLabels\">{{ label }}</span>\n </div>\n <div class=\"text-right d-block font-weight-bold\" style=\"font-size: 12px\">\n <span class=\"d-block\" *ngFor=\"let label of sourceLabels\">{{ label }}</span>\n </div>\n </div>\n <div *ngIf=\"createLinkForm.get('label')?.value?.length\" class=\"labelPosition text-center\">\n <span *ngFor=\"let label of createLinkForm.get('label').value\">\n <span class=\"d-block\">{{ label.label }} <span style=\"color: #856404;\" *ngIf=\"label.linkIcon\"><i class=\"fas fa-link\"></i></span></span>\n </span>\n </div>\n </div>\n <div class=\"form-group\">\n <label for=\"lineStyle\">Line Style</label>\n <select id=\"lineStyle\" formControlName=\"lineStyle\" class=\"form-control\">\n <option value=\"Solid\">Solid</option>\n <option value=\"Dotted\">Dotted</option>\n </select>\n </div>\n\n <div class=\"form-group\">\n <label for=\"label\">Labels</label>\n <div formArrayName=\"label\">\n <div *ngFor=\"let label of labelArray.controls; let i = index\" [formGroupName]=\"i\"\n class=\"d-flex flex-column align-items-start\">\n <div class=\"d-flex align-items-center w-100\">\n <input formControlName=\"label\" class=\"form-control\" placeholder=\"Label\" [id]=\"'label-' + i\">\n <button type=\"button\" class=\"btn btn-danger ml-2\" (click)=\"removeLabel(i)\" [disabled]=\"labelArray.length <= 1\">Remove</button>\n </div>\n <div class=\"form-group form-check\">\n <input type=\"checkbox\" formControlName=\"linkIcon\" class=\"form-check-input\" [id]=\"'linkIcon-' + i\">\n <label [for]=\"'linkIcon-' + i\">Link Icon?</label>\n </div>\n </div>\n </div>\n <button type=\"button\" class=\"btn btn-secondary mt-2\" (click)=\"addLabel()\">Add Label</button>\n </div>\n </form>\n </div>\n <div class=\"modal-footer\">\n <button type=\"button\" class=\"btn btn-secondary\" (click)=\"closeModal('modalRef')\">Cancel</button>\n <button type=\"button\" class=\"btn btn-primary\" (click)=\"createEditLink('editLinkModal')\" [disabled]=\"!createLinkForm.valid\">Save Changes</button>\n <button type=\"button\" class=\"btn btn-danger\" (click)=\"deleteLink()\">Delete Link</button>\n </div>\n</ng-template>\n<!-- ./MODAL-->\n\n\n<!--CREATE LINK MODAL-->\n<ng-template #createLinkModal>\n <div class=\"modal-header\">\n <h4 class=\"modal-title pull-left\">Create Link</h4>\n <button type=\"button\" class=\"btn-close close pull-right\" aria-label=\"Close\" (click)=\"closeModal('modalRef')\">\n <span aria-hidden=\"true\" class=\"visually-hidden\">&times;</span>\n </button>\n </div>\n <div class=\"modal-body\">\n <form [formGroup]=\"createLinkForm\">\n <div class=\"col-sm-12 d-flex flex-column\">\n <div class=\"d-flex mb-3\">\n <div class=\"iconImage\">\n <span><i class=\"fas fa-arrow-left\"></i></span>\n <span class=\"arrow\">\n <input type=\"checkbox\" id=\"sourceArrow\" formControlName=\"sourceArrow\" class=\"form-check-input\">\n <label class=\"d-none form-check-label\" for=\"leftArrow\"></label>\n </span>\n </div>\n <div class=\"iconImage ml-3\">\n <ng-container *ngIf=\"targetImageUrl; else targetIconTemplate\">\n <img class=\"imageUrl\" [src]=\"targetImageUrl\" />\n </ng-container>\n <ng-template #targetIconTemplate>\n <i class=\"fa-solid fa-2x\">{{targetIcon}}</i>\n </ng-template>\n </div>\n <div\n [ngClass]=\"{\n 'link-line-solid': createLinkForm.get('lineStyle').value === 'Solid',\n 'link-line-dotted': createLinkForm.get('lineStyle').value === 'Dotted'\n }\"\n >\n </div>\n <div class=\"iconImage mr-3\">\n <ng-container *ngIf=\"sourceImageUrl; else sourceIconTemplate\">\n <img class=\"imageUrl\" [src]=\"sourceImageUrl\" />\n </ng-container>\n <ng-template #sourceIconTemplate>\n <i class=\"fa-solid fa-2x\">{{sourceIcon}}</i>\n </ng-template>\n </div>\n <div class=\"iconImage\">\n <span><i class=\"fas fa-arrow-right\"></i></span>\n <span class=\"arrow\">\n <input type=\"checkbox\" id=\"targetArrow\" formControlName=\"targetArrow\" class=\"form-check-input\">\n <label class=\"form-check-label\" for=\"rightArrow\"></label>\n </span>\n </div>\n </div>\n <div class=\"d-flex justify-content-between mb-3\">\n <div class=\"text-left d-block font-weight-bold\" style=\"font-size: 12px\">\n <span class=\"d-block\" *ngFor=\"let label of targetLabels\">{{ label }}</span>\n </div>\n <div class=\"text-right d-block font-weight-bold\" style=\"font-size: 12px\">\n <span class=\"d-block\" *ngFor=\"let label of sourceLabels\">{{ label }}</span>\n </div>\n </div>\n <div *ngIf=\"createLinkForm.get('label')?.value?.length\" class=\"labelPosition text-center\">\n <span *ngFor=\"let label of createLinkForm.get('label').value\">\n <span class=\"d-block\">{{ label.label }} <span style=\"color: #856404;\" *ngIf=\"label.linkIcon\"><i class=\"fas fa-link\"></i></span></span>\n </span>\n </div>\n </div>\n <div class=\"form-group\">\n <label for=\"lineStyle\">Line Style</label>\n <select id=\"lineStyle\" formControlName=\"lineStyle\" class=\"form-control\">\n <option value=\"Solid\">Solid</option>\n <option value=\"Dotted\">Dotted</option>\n </select>\n </div>\n\n <div class=\"form-group\">\n <label for=\"label\">Labels</label>\n <div formArrayName=\"label\">\n <div *ngFor=\"let label of labelArray.controls; let i = index\" [formGroupName]=\"i\"\n class=\"d-flex flex-column align-items-start\">\n <div class=\"d-flex align-items-center w-100\">\n <input formControlName=\"label\" class=\"form-control\" placeholder=\"Label\" [id]=\"'label-' + i\">\n <button type=\"button\" class=\"btn btn-danger ml-2\" (click)=\"removeLabel(i)\" [disabled]=\"labelArray.length <= 1\">Remove</button>\n </div>\n <div class=\"form-group form-check\">\n <input type=\"checkbox\" formControlName=\"linkIcon\" class=\"form-check-input\" [id]=\"'linkIcon-' + i\">\n <label [for]=\"'linkIcon-' + i\">Link Icon?</label>\n </div>\n </div>\n </div>\n <button type=\"button\" class=\"btn btn-secondary mt-2\" (click)=\"addLabel()\">Add Label</button>\n </div>\n </form>\n </div>\n <div class=\"modal-footer\">\n <button type=\"button\" class=\"btn btn-secondary\" (click)=\"closeModal('modalRef')\">Cancel</button>\n <button type=\"button\" class=\"btn btn-primary\" (click)=\"createEditLink('createLinkModal')\" [disabled]=\"!createLinkForm.valid\">Create Link</button>\n </div>\n</ng-template>\n<!-- ./MODAL-->", styles: [".imageUrl{max-width:30px}.labelPosition{position:relative;top:-55px;margin-right:30px;margin-left:30px}.link-line-solid{width:100%;position:relative;margin:15px;border-top:2px solid #777}.link-line-dotted{width:100%;position:relative;margin:15px;background-image:repeating-linear-gradient(to right,#cacaca,#cacaca 7px,transparent 7px,transparent 15px);height:2px}.iconImage{position:relative;top:4px}.arrow{position:absolute;top:20px;left:20px}\n"] }]
672
+ args: [{ selector: 'app-modals', template: "<!--EDIT NODE MODAL-->\n<ng-template #editNodeModal>\n <div class=\"modal-header\">\n <h4 class=\"modal-title pull-left\">Edit Node</h4>\n <button type=\"button\" class=\"btn-close close pull-right\" aria-label=\"Close\" (click)=\"closeModal('modalRef')\">\n <span aria-hidden=\"true\" class=\"visually-hidden\">&times;</span>\n </button>\n </div>\n <div class=\"modal-body\">\n <form [formGroup]=\"createNodeForm\">\n <div class=\"form-group\">\n <label for=\"iconType\">Icon Type</label>\n <div>\n <input type=\"radio\" id=\"imageUrl\" formControlName=\"iconType\" value=\"url\"> Image URL\n <input class=\"ml-5\" type=\"radio\" id=\"iconTypeSelect\" formControlName=\"iconType\" value=\"select\"> Choose Icon\n </div>\n </div>\n <div class=\"form-group\" *ngIf=\"createNodeForm.get('iconType')?.value === 'url'\">\n <label for=\"imageUrl\">Image URL</label>\n <div class=\"input-group\">\n <input type=\"text\" id=\"imageUrl\" formControlName=\"imageUrl\" class=\"form-control\" placeholder=\"Image URL\">\n <button type=\"button\" class=\"btn btn-outline-secondary\" (click)=\"clearImageUrl()\">Clear</button>\n </div>\n </div>\n <div class=\"form-group\" *ngIf=\"createNodeForm.get('iconType')?.value === 'select'\">\n <label for=\"nodeIcon\">Choose Icon</label>\n <ng-select\n formControlName=\"icon\"\n [items]=\"iconsBuffer\"\n [virtualScroll]=\"true\"\n [loading]=\"loading\"\n bindLabel=\"name\"\n bindValue=\"icon\"\n [editableSearchTerm]=\"true\"\n placeholder=\"Select icon\"\n appendTo=\"body\"\n [trackByFn]=\"trackByFn\"\n (scroll)=\"onScroll($event)\"\n (scrollToEnd)=\"onScrollToEnd()\"\n >\n <ng-template ng-header-tmp>\n <small class=\"form-text text-muted\"\n >Loaded {{ iconsBuffer.length }} of {{ fontAwesomeIcons.length }}</small\n >\n </ng-template>\n <ng-template ng-option-tmp let-item=\"item\">\n <i class=\"fa fa-light\">{{item.icon}}</i>\n <span class=\"ml-3\">{{ item.name }}</span>\n </ng-template>\n </ng-select>\n </div>\n <div *ngIf=\"createNodeForm.errors?.iconOrImage\" class=\"text-danger\">\n Please provide either an Image URL or choose an Icon, but not both.\n </div>\n <div class=\"form-group\">\n <label for=\"label\">Labels</label>\n <div formArrayName=\"label\">\n <div *ngFor=\"let label of nodeLabelArray.controls; let i = index\" [formGroupName]=\"i\"\n class=\"d-flex flex-column align-items-start\">\n <div class=\"d-flex align-items-center w-100\">\n <input formControlName=\"label\" class=\"form-control mb-2\" placeholder=\"Label\" [id]=\"'node-label-' + i\">\n <button type=\"button\" class=\"btn btn-danger ml-2\" (click)=\"removeNodeLabel(i)\" [disabled]=\"nodeLabelArray.length <= 1\">Remove</button>\n </div>\n </div>\n </div>\n <button type=\"button\" class=\"btn btn-secondary mt-2\" (click)=\"addNodeLabel()\">Add Label</button>\n </div>\n <div class=\"form-group\">\n <label for=\"nodeAdditionalIcon\">Additional icon</label>\n <ng-select\n formControlName=\"additionalIcon\"\n [items]=\"iconsBuffer\"\n [virtualScroll]=\"true\"\n [loading]=\"loading\"\n bindLabel=\"name\"\n bindValue=\"icon\"\n [editableSearchTerm]=\"true\"\n placeholder=\"Select icon\"\n appendTo=\"body\"\n [trackByFn]=\"trackByFn\"\n (scroll)=\"onScroll($event)\"\n (scrollToEnd)=\"onScrollToEnd()\"\n >\n <ng-template ng-header-tmp>\n <small class=\"form-text text-muted\"\n >Loaded {{ iconsBuffer.length }} of {{ fontAwesomeIcons.length }}</small\n >\n </ng-template>\n <ng-template ng-option-tmp let-item=\"item\">\n <i class=\"fa fa-light\">{{item.icon}}</i>\n <span class=\"ml-3\">{{ item.name }}</span>\n </ng-template>\n </ng-select>\n </div>\n </form>\n </div>\n <div class=\"modal-footer\">\n <button type=\"button\" class=\"btn btn-secondary\" (click)=\"closeModal('modalRef')\">Cancel</button>\n <button type=\"button\" class=\"btn btn-primary\" (click)=\"createEditNode('editNodeModal')\" [disabled]=\"!createNodeForm.valid\">Save Changes</button>\n <button type=\"button\" class=\"btn btn-danger\" (click)=\"deleteNode()\">Delete Node</button>\n </div>\n</ng-template>\n<!-- ./MODAL-->\n\n<!--CREATE NODE MODAL-->\n<ng-template #createNodeModal>\n <div class=\"modal-header\">\n <h4 class=\"modal-title pull-left\">Create Node</h4>\n <button type=\"button\" class=\"btn-close close pull-right\" aria-label=\"Close\" (click)=\"closeModal('modalRef')\">\n <span aria-hidden=\"true\" class=\"visually-hidden\">&times;</span>\n </button>\n </div>\n <div class=\"modal-body\">\n <form [formGroup]=\"createNodeForm\">\n <div class=\"form-group\">\n <label for=\"iconType\">Icon Type</label>\n <div>\n <input type=\"radio\" id=\"imageUrl\" formControlName=\"iconType\" value=\"url\"> Image URL\n <input class=\"ml-5\" type=\"radio\" id=\"iconTypeSelect\" formControlName=\"iconType\" value=\"select\"> Choose Icon\n </div>\n </div>\n <div class=\"form-group\" *ngIf=\"createNodeForm.get('iconType')?.value === 'url'\">\n <label for=\"imageUrl\">Image URL</label>\n <div class=\"input-group\">\n <input type=\"text\" id=\"imageUrl\" formControlName=\"imageUrl\" class=\"form-control\" placeholder=\"Image URL\">\n <button type=\"button\" class=\"btn btn-outline-secondary\" (click)=\"clearImageUrl()\">Clear</button>\n </div>\n </div>\n <div class=\"form-group\" *ngIf=\"createNodeForm.get('iconType')?.value === 'select'\">\n <label for=\"nodeIcon\">Choose Icon</label>\n <ng-select\n formControlName=\"icon\"\n [items]=\"iconsBuffer\"\n [virtualScroll]=\"true\"\n [loading]=\"loading\"\n bindLabel=\"name\"\n bindValue=\"icon\"\n [editableSearchTerm]=\"true\"\n placeholder=\"Select icon\"\n appendTo=\"body\"\n [trackByFn]=\"trackByFn\"\n (scroll)=\"onScroll($event)\"\n (scrollToEnd)=\"onScrollToEnd()\"\n >\n <ng-template ng-header-tmp>\n <small class=\"form-text text-muted\"\n >Loaded {{ iconsBuffer.length }} of {{ fontAwesomeIcons.length }}</small\n >\n </ng-template>\n <ng-template ng-option-tmp let-item=\"item\">\n <i class=\"fa fa-light\">{{item.icon}}</i>\n <span class=\"ml-3\">{{ item.name }}</span>\n </ng-template>\n </ng-select>\n </div>\n <div *ngIf=\"createNodeForm.errors?.iconOrImage\" class=\"text-danger\">\n Please provide either an Image URL or choose an Icon, but not both.\n </div>\n <div class=\"form-group\">\n <label for=\"label\">Labels</label>\n <div formArrayName=\"label\">\n <div *ngFor=\"let label of nodeLabelArray.controls; let i = index\" [formGroupName]=\"i\"\n class=\"d-flex flex-column align-items-start\">\n <div class=\"d-flex align-items-center w-100\">\n <input formControlName=\"label\" class=\"form-control mb-2\" placeholder=\"Label\" [id]=\"'node-label-' + i\">\n <button type=\"button\" class=\"btn btn-danger ml-2\" (click)=\"removeNodeLabel(i)\" [disabled]=\"nodeLabelArray.length <= 1\">Remove</button>\n </div>\n </div>\n </div>\n <button type=\"button\" class=\"btn btn-secondary mt-2\" (click)=\"addNodeLabel()\">Add Label</button>\n </div>\n <div class=\"form-group\">\n <label for=\"nodeAdditionalIcon\">Additional icon</label>\n <ng-select\n formControlName=\"additionalIcon\"\n [items]=\"iconsBuffer\"\n [virtualScroll]=\"true\"\n [loading]=\"loading\"\n bindLabel=\"name\"\n bindValue=\"icon\"\n [editableSearchTerm]=\"true\"\n placeholder=\"Select icon\"\n appendTo=\"body\"\n [trackByFn]=\"trackByFn\"\n (scroll)=\"onScroll($event)\"\n (scrollToEnd)=\"onScrollToEnd()\"\n >\n <ng-template ng-header-tmp>\n <small class=\"form-text text-muted\"\n >Loaded {{ iconsBuffer.length }} of {{ fontAwesomeIcons.length }}</small\n >\n </ng-template>\n <ng-template ng-option-tmp let-item=\"item\">\n <i class=\"fa fa-light\">{{item.icon}}</i>\n <span class=\"ml-3\">{{ item.name }}</span>\n </ng-template>\n </ng-select>\n </div>\n </form>\n </div>\n <div class=\"modal-footer\">\n <button type=\"button\" class=\"btn btn-secondary\" (click)=\"closeModal('modalRef')\">Cancel</button>\n <button type=\"button\" class=\"btn btn-primary\" (click)=\"createEditNode('createNodeModal')\" [disabled]=\"!createNodeForm.valid\">Create Node</button>\n </div>\n</ng-template>\n<!-- ./MODAL-->\n\n<!--EDIT LINKS MODAL-->\n<ng-template #editLinksModal>\n <div class=\"modal-header\">\n <h4 class=\"modal-title pull-left\">Edit Links</h4>\n <button type=\"button\" class=\"btn-close close pull-right\" aria-label=\"Close\" (click)=\"closeModal('modalRef')\">\n <span aria-hidden=\"true\" class=\"visually-hidden\">&times;</span>\n </button>\n </div>\n <div class=\"modal-body\">\n <form [formGroup]=\"createLinkForm\">\n <div class=\"col-sm-12 d-flex flex-column\">\n <div class=\"d-flex mb-3\">\n <div class=\"iconImage\">\n <span><i class=\"fas fa-arrow-left\"></i></span>\n <span class=\"arrow\">\n <input type=\"checkbox\" id=\"sourceArrow\" formControlName=\"sourceArrow\" class=\"form-check-input\">\n <label class=\"d-none form-check-label\" for=\"leftArrow\"></label>\n </span>\n </div>\n <div class=\"iconImage ml-3\">\n <ng-container *ngIf=\"targetImageUrl; else targetIconTemplate\">\n <img class=\"imageUrl\" [src]=\"targetImageUrl\" />\n </ng-container>\n <ng-template #targetIconTemplate>\n <i class=\"fa-solid fa-2x\">{{targetIcon}}</i>\n </ng-template>\n </div>\n <div\n [ngClass]=\"{\n 'link-line-solid': createLinkForm.get('lineStyle')?.value === 'Solid',\n 'link-line-dotted': createLinkForm.get('lineStyle')?.value === 'Dotted'\n }\"\n >\n </div>\n <div class=\"iconImage mr-3\">\n <ng-container *ngIf=\"sourceImageUrl; else sourceIconTemplate\">\n <img class=\"imageUrl\" [src]=\"sourceImageUrl\" />\n </ng-container>\n <ng-template #sourceIconTemplate>\n <i class=\"fa-solid fa-2x\">{{sourceIcon}}</i>\n </ng-template>\n </div>\n <div class=\"iconImage\">\n <span><i class=\"fas fa-arrow-right\"></i></span>\n <span class=\"arrow\">\n <input type=\"checkbox\" id=\"targetArrow\" formControlName=\"targetArrow\" class=\"form-check-input\">\n <label class=\"form-check-label\" for=\"rightArrow\"></label>\n </span>\n </div>\n </div>\n <div class=\"d-flex justify-content-between mb-3\">\n <div class=\"text-left d-block font-weight-bold\" style=\"font-size: 12px\">\n <span class=\"d-block\" *ngFor=\"let label of targetLabels\">{{ label }}</span>\n </div>\n <div class=\"text-right d-block font-weight-bold\" style=\"font-size: 12px\">\n <span class=\"d-block\" *ngFor=\"let label of sourceLabels\">{{ label }}</span>\n </div>\n </div>\n <div *ngIf=\"createLinkForm.get('label')?.value?.length\" class=\"labelPosition text-center\">\n <span *ngFor=\"let label of createLinkForm.get('label')?.value\">\n <span class=\"d-block\">{{ label.label }} <span style=\"color: #856404;\" *ngIf=\"label.linkIcon\"><i class=\"fas fa-link\"></i></span></span>\n </span>\n </div>\n </div>\n <div class=\"form-group\">\n <label for=\"lineStyle\">Line Style</label>\n <select id=\"lineStyle\" formControlName=\"lineStyle\" class=\"form-control\">\n <option value=\"Solid\">Solid</option>\n <option value=\"Dotted\">Dotted</option>\n </select>\n </div>\n\n <div class=\"form-group\">\n <label for=\"label\">Labels</label>\n <div formArrayName=\"label\">\n <div *ngFor=\"let label of labelArray.controls; let i = index\" [formGroupName]=\"i\"\n class=\"d-flex flex-column align-items-start\">\n <div class=\"d-flex align-items-center w-100\">\n <input formControlName=\"label\" class=\"form-control\" placeholder=\"Label\" [id]=\"'label-' + i\">\n <button type=\"button\" class=\"btn btn-danger ml-2\" (click)=\"removeLabel(i)\" [disabled]=\"labelArray.length <= 1\">Remove</button>\n </div>\n <div class=\"form-group form-check\">\n <input type=\"checkbox\" formControlName=\"linkIcon\" class=\"form-check-input\" [id]=\"'linkIcon-' + i\">\n <label [for]=\"'linkIcon-' + i\">Link Icon?</label>\n </div>\n </div>\n </div>\n <button type=\"button\" class=\"btn btn-secondary mt-2\" (click)=\"addLabel()\">Add Label</button>\n </div>\n </form>\n </div>\n <div class=\"modal-footer\">\n <button type=\"button\" class=\"btn btn-secondary\" (click)=\"closeModal('modalRef')\">Cancel</button>\n <button type=\"button\" class=\"btn btn-primary\" (click)=\"createEditLink('editLinkModal')\" [disabled]=\"!createLinkForm.valid\">Save Changes</button>\n <button type=\"button\" class=\"btn btn-danger\" (click)=\"deleteLink()\">Delete Link</button>\n </div>\n</ng-template>\n<!-- ./MODAL-->\n\n\n<!--CREATE LINK MODAL-->\n<ng-template #createLinkModal>\n <div class=\"modal-header\">\n <h4 class=\"modal-title pull-left\">Create Link</h4>\n <button type=\"button\" class=\"btn-close close pull-right\" aria-label=\"Close\" (click)=\"closeModal('modalRef')\">\n <span aria-hidden=\"true\" class=\"visually-hidden\">&times;</span>\n </button>\n </div>\n <div class=\"modal-body\">\n <form [formGroup]=\"createLinkForm\">\n <div class=\"col-sm-12 d-flex flex-column\">\n <div class=\"d-flex mb-3\">\n <div class=\"iconImage\">\n <span><i class=\"fas fa-arrow-left\"></i></span>\n <span class=\"arrow\">\n <input type=\"checkbox\" id=\"sourceArrow\" formControlName=\"sourceArrow\" class=\"form-check-input\">\n <label class=\"d-none form-check-label\" for=\"leftArrow\"></label>\n </span>\n </div>\n <div class=\"iconImage ml-3\">\n <ng-container *ngIf=\"targetImageUrl; else targetIconTemplate\">\n <img class=\"imageUrl\" [src]=\"targetImageUrl\" />\n </ng-container>\n <ng-template #targetIconTemplate>\n <i class=\"fa-solid fa-2x\">{{targetIcon}}</i>\n </ng-template>\n </div>\n <div\n [ngClass]=\"{\n 'link-line-solid': createLinkForm.get('lineStyle')?.value === 'Solid',\n 'link-line-dotted': createLinkForm.get('lineStyle')?.value === 'Dotted'\n }\"\n >\n </div>\n <div class=\"iconImage mr-3\">\n <ng-container *ngIf=\"sourceImageUrl; else sourceIconTemplate\">\n <img class=\"imageUrl\" [src]=\"sourceImageUrl\" />\n </ng-container>\n <ng-template #sourceIconTemplate>\n <i class=\"fa-solid fa-2x\">{{sourceIcon}}</i>\n </ng-template>\n </div>\n <div class=\"iconImage\">\n <span><i class=\"fas fa-arrow-right\"></i></span>\n <span class=\"arrow\">\n <input type=\"checkbox\" id=\"targetArrow\" formControlName=\"targetArrow\" class=\"form-check-input\">\n <label class=\"form-check-label\" for=\"rightArrow\"></label>\n </span>\n </div>\n </div>\n <div class=\"d-flex justify-content-between mb-3\">\n <div class=\"text-left d-block font-weight-bold\" style=\"font-size: 12px\">\n <span class=\"d-block\" *ngFor=\"let label of targetLabels\">{{ label }}</span>\n </div>\n <div class=\"text-right d-block font-weight-bold\" style=\"font-size: 12px\">\n <span class=\"d-block\" *ngFor=\"let label of sourceLabels\">{{ label }}</span>\n </div>\n </div>\n <div *ngIf=\"createLinkForm.get('label')?.value?.length\" class=\"labelPosition text-center\">\n <span *ngFor=\"let label of createLinkForm.get('label')?.value\">\n <span class=\"d-block\">{{ label.label }} <span style=\"color: #856404;\" *ngIf=\"label.linkIcon\"><i class=\"fas fa-link\"></i></span></span>\n </span>\n </div>\n </div>\n <div class=\"form-group\">\n <label for=\"lineStyle\">Line Style</label>\n <select id=\"lineStyle\" formControlName=\"lineStyle\" class=\"form-control\">\n <option value=\"Solid\">Solid</option>\n <option value=\"Dotted\">Dotted</option>\n </select>\n </div>\n\n <div class=\"form-group\">\n <label for=\"label\">Labels</label>\n <div formArrayName=\"label\">\n <div *ngFor=\"let label of labelArray.controls; let i = index\" [formGroupName]=\"i\"\n class=\"d-flex flex-column align-items-start\">\n <div class=\"d-flex align-items-center w-100\">\n <input formControlName=\"label\" class=\"form-control\" placeholder=\"Label\" [id]=\"'label-' + i\">\n <button type=\"button\" class=\"btn btn-danger ml-2\" (click)=\"removeLabel(i)\" [disabled]=\"labelArray.length <= 1\">Remove</button>\n </div>\n <div class=\"form-group form-check\">\n <input type=\"checkbox\" formControlName=\"linkIcon\" class=\"form-check-input\" [id]=\"'linkIcon-' + i\">\n <label [for]=\"'linkIcon-' + i\">Link Icon?</label>\n </div>\n </div>\n </div>\n <button type=\"button\" class=\"btn btn-secondary mt-2\" (click)=\"addLabel()\">Add Label</button>\n </div>\n </form>\n </div>\n <div class=\"modal-footer\">\n <button type=\"button\" class=\"btn btn-secondary\" (click)=\"closeModal('modalRef')\">Cancel</button>\n <button type=\"button\" class=\"btn btn-primary\" (click)=\"createEditLink('createLinkModal')\" [disabled]=\"!createLinkForm.valid\">Create Link</button>\n </div>\n</ng-template>\n<!-- ./MODAL-->", styles: [".imageUrl{max-width:30px}.labelPosition{position:relative;top:-55px;margin-right:30px;margin-left:30px}.link-line-solid{width:100%;position:relative;margin:15px;border-top:2px solid #777}.link-line-dotted{width:100%;position:relative;margin:15px;background-image:repeating-linear-gradient(to right,#cacaca,#cacaca 7px,transparent 7px,transparent 15px);height:2px}.iconImage{position:relative;top:4px}.arrow{position:absolute;top:20px;left:20px}\n"] }]
678
673
  }], ctorParameters: () => [{ type: i1.BsModalService }, { type: i2$1.FormBuilder }, { type: DexieService }], propDecorators: { editNodeData: [{
679
674
  type: Input
680
675
  }], editLinksData: [{
@@ -703,6 +698,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImpo
703
698
  args: ['editLinksModal']
704
699
  }] } });
705
700
 
701
+ function endpointId(endpoint) {
702
+ return typeof endpoint === 'string' ? endpoint : endpoint.id;
703
+ }
704
+ function linkKey(link) {
705
+ return `${endpointId(link.source)}_${endpointId(link.target)}_${link.labelIndex ?? ''}`;
706
+ }
707
+ function edgeKey(link) {
708
+ return `${endpointId(link.source)}_${endpointId(link.target)}`;
709
+ }
706
710
  class VisualiserGraphService {
707
711
  dexieService;
708
712
  constructor(dexieService) {
@@ -713,17 +717,17 @@ class VisualiserGraphService {
713
717
  gBrush = null;
714
718
  brushMode = false;
715
719
  brushing = false;
716
- shiftKey;
720
+ shiftKey = false;
717
721
  extent = null;
718
722
  zoom = false;
719
723
  zoomToFit = false;
720
- resetSearch;
724
+ resetSearch = false;
721
725
  /** RxJS subject to listen for updates of the selection */
722
726
  selectedNodesArray = new Subject();
723
727
  dblClickNodePayload = new Subject();
724
728
  dblClickLinkPayload = new Subject();
725
729
  selectedLinkArray = new Subject();
726
- saveGraphData = new ReplaySubject();
730
+ saveGraphData = new ReplaySubject(1);
727
731
  update(data, element, zoom, zoomToFit) {
728
732
  const svg = d3.select(element);
729
733
  this.zoom = zoom;
@@ -732,6 +736,14 @@ class VisualiserGraphService {
732
736
  }
733
737
  ticked(link, node, edgepaths) {
734
738
  link.each(function (d, i, n) {
739
+ if (typeof d.source === 'string' ||
740
+ typeof d.target === 'string' ||
741
+ d.source.x === undefined ||
742
+ d.source.y === undefined ||
743
+ d.target.x === undefined ||
744
+ d.target.y === undefined) {
745
+ return;
746
+ }
735
747
  // Total difference in x and y from source to target
736
748
  const diffX = d.target.x - d.source.x;
737
749
  const diffY = d.target.y - d.source.y;
@@ -747,7 +759,7 @@ class VisualiserGraphService {
747
759
  .attr('y2', d.target.y - offsetY);
748
760
  });
749
761
  node.attr('transform', function (d) {
750
- return `translate(${d.x}, ${d.y + 50})`;
762
+ return `translate(${d.x ?? 0}, ${(d.y ?? 0) + 50})`;
751
763
  });
752
764
  // Sets a boundry for the nodes
753
765
  // node.attr('cx', function (d) {
@@ -757,9 +769,23 @@ class VisualiserGraphService {
757
769
  // return (d.y = Math.max(50, Math.min(600 - 40, d.y)));
758
770
  // });
759
771
  edgepaths.attr('d', function (d) {
772
+ if (typeof d.source === 'string' ||
773
+ typeof d.target === 'string' ||
774
+ d.source.x === undefined ||
775
+ d.source.y === undefined ||
776
+ d.target.x === undefined ||
777
+ d.target.y === undefined) {
778
+ return '';
779
+ }
760
780
  return `M ${d.source.x} ${d.source.y} L ${d.target.x} ${d.target.y}`;
761
781
  });
762
782
  edgepaths.attr('transform', function (d) {
783
+ if (typeof d.source === 'string' ||
784
+ typeof d.target === 'string' ||
785
+ d.source.x === undefined ||
786
+ d.target.x === undefined) {
787
+ return null;
788
+ }
763
789
  if (d.target.x < d.source.x) {
764
790
  const bbox = this.getBBox();
765
791
  const rx = bbox.x + bbox.width / 2;
@@ -794,29 +820,26 @@ class VisualiserGraphService {
794
820
  return svg;
795
821
  }
796
822
  forceSimulation(_d3, { width, height }) {
797
- return _d3
798
- .forceSimulation()
799
- .velocityDecay(0.1)
800
- .force('link', _d3
823
+ const linkForce = _d3
801
824
  .forceLink()
802
- .id(function (d) {
803
- return d.id;
804
- })
825
+ .id((d) => d.id)
805
826
  .distance(500)
806
- .strength(1))
827
+ .strength(1);
828
+ const simulation = _d3
829
+ .forceSimulation()
830
+ .velocityDecay(0.1)
831
+ .force('link', linkForce)
807
832
  .force('charge', _d3.forceManyBody().strength(0.1))
808
833
  .force('center', _d3.forceCenter(width / 2, height / 2))
809
834
  .force('collision', _d3.forceCollide().radius(15));
835
+ return { simulation, linkForce };
810
836
  }
811
837
  compareAndMarkNodesNew(nodes, old_nodes) {
812
838
  // Create a map of ids to node objects for the old_nodes array
813
- const oldMap = old_nodes.reduce((map, node) => {
814
- map[node.id] = node;
815
- return map;
816
- }, {});
839
+ const oldMap = new Map(old_nodes.map((node) => [node.id, node]));
817
840
  // Check each node in the nodes array to see if it's new or not
818
841
  nodes.forEach((node) => {
819
- if (!oldMap[node.id]) {
842
+ if (!oldMap.has(node.id)) {
820
843
  // Node is new, mark it with the newItem property
821
844
  node.newItem = true;
822
845
  // Remove the dagre coordinates from new nodes so we can set a random one in view
@@ -856,7 +879,11 @@ class VisualiserGraphService {
856
879
  node.fy = crypto.getRandomValues(new Uint32Array(1))[0] % height;
857
880
  canPlaceNode = !nodeData.some((otherNode) => {
858
881
  if (otherNode.fx === null ||
882
+ otherNode.fx === undefined ||
859
883
  otherNode.fy === null ||
884
+ otherNode.fy === undefined ||
885
+ node.fx === null ||
886
+ node.fy === null ||
860
887
  otherNode === node) {
861
888
  return false;
862
889
  }
@@ -876,19 +903,28 @@ class VisualiserGraphService {
876
903
  return nodeData;
877
904
  }
878
905
  async _update(_d3, svg, data) {
906
+ const isShiftKeyPressed = () => this.shiftKey;
879
907
  const { nodes, links } = data;
880
908
  this.nodes = nodes || [];
881
909
  this.links = links || [];
882
910
  // Disable the reset btn
883
911
  const resetBtn = document.getElementById('reset_graph');
884
912
  const saveBtn = document.getElementById('save_graph');
885
- if (resetBtn) {
913
+ if (resetBtn && saveBtn) {
886
914
  resetBtn.setAttribute('disabled', 'true');
887
915
  saveBtn.setAttribute('disabled', 'true');
888
916
  }
889
917
  // Width/Height of canvas
890
- const parentWidth = _d3.select('svg').node().parentNode.clientWidth;
891
- const parentHeight = _d3.select('svg').node().parentNode.clientHeight;
918
+ const svgElement = svg.node();
919
+ if (!svgElement) {
920
+ throw new Error('The graph SVG element is unavailable.');
921
+ }
922
+ const parentElement = svgElement.parentElement;
923
+ if (!parentElement) {
924
+ throw new Error('The graph SVG element has no parent element.');
925
+ }
926
+ const parentWidth = parentElement.clientWidth;
927
+ const parentHeight = parentElement.clientHeight;
892
928
  // Check to see if nodes are in Dexie
893
929
  const oldData = await this.dexieService.getGraphData('nodes');
894
930
  const oldNodes = oldData ? oldData.nodes : [];
@@ -907,7 +943,7 @@ class VisualiserGraphService {
907
943
  // If nodes don't have a fx/fy coordinate we generate a random one - dagre nodes without links and new nodes added to canvas have null coordinates by design
908
944
  this.nodes = this.randomiseNodePositions(this.nodes, parentWidth, parentHeight);
909
945
  // Getting parents lineStyle and adding it to child objects
910
- const relationshipsArray = this.links.map(({ lineStyle, targetArrow, sourceArrow, relationships }) => relationships.map((r) => ({
946
+ const relationshipsArray = this.links.map(({ lineStyle, targetArrow, sourceArrow, relationships }) => (relationships ?? []).map((r) => ({
911
947
  parentLineStyle: lineStyle,
912
948
  parentSourceArrow: sourceArrow,
913
949
  parentTargetArrow: targetArrow,
@@ -925,7 +961,7 @@ class VisualiserGraphService {
925
961
  d3.select('svg').append('g');
926
962
  // Zoom Start
927
963
  const zoomContainer = _d3.select('svg g');
928
- let currentZoom = d3.zoomTransform(d3.select('svg').node());
964
+ let currentZoom = d3.zoomTransform(svgElement);
929
965
  const updateZoomLevel = () => {
930
966
  const currentScale = currentZoom.k;
931
967
  const maxScale = zoom.scaleExtent()[1];
@@ -977,7 +1013,7 @@ class VisualiserGraphService {
977
1013
  }
978
1014
  }
979
1015
  };
980
- let zoomedInit;
1016
+ let zoomedInit = false;
981
1017
  const zoomed = () => {
982
1018
  const transform = d3.event.transform;
983
1019
  zoomContainer.attr('transform', `translate(${transform.x}, ${transform.y}) scale(${transform.k})`);
@@ -989,17 +1025,21 @@ class VisualiserGraphService {
989
1025
  .zoom()
990
1026
  .scaleExtent([0.5, 1.5])
991
1027
  .on('start', function () {
992
- d3.select(this).style('cursor', this.zoom ? null : 'grabbing');
1028
+ d3.select(this).style('cursor', 'grabbing');
993
1029
  })
994
- .on('zoom', this.zoom ? zoomed : null)
995
1030
  .on('end', function () {
996
1031
  d3.select(this).style('cursor', 'grab');
997
1032
  });
1033
+ if (this.zoom) {
1034
+ zoom.on('zoom', zoomed);
1035
+ }
998
1036
  svg
999
1037
  .call(zoom)
1000
1038
  .style('cursor', 'grab')
1001
- .on(this.zoom ? null : 'wheel.zoom', null)
1002
1039
  .on('dblclick.zoom', null);
1040
+ if (!this.zoom) {
1041
+ svg.on('wheel.zoom', null);
1042
+ }
1003
1043
  zoom.filter(() => !d3.event.shiftKey);
1004
1044
  // Zoom button controls
1005
1045
  d3.select('#zoom_in').on('click', function () {
@@ -1016,7 +1056,11 @@ class VisualiserGraphService {
1016
1056
  });
1017
1057
  // Zoom to fit function and Button
1018
1058
  const handleZoomToFit = () => {
1019
- const nodeBBox = zoomContainer.node().getBBox();
1059
+ const zoomContainerElement = zoomContainer.node();
1060
+ if (!zoomContainerElement) {
1061
+ return;
1062
+ }
1063
+ const nodeBBox = zoomContainerElement.getBBox();
1020
1064
  // Calculate scale and translate values to fit all nodes
1021
1065
  const padding = 30;
1022
1066
  const scaleX = (parentWidth - padding * 2) / nodeBBox.width;
@@ -1055,9 +1099,7 @@ class VisualiserGraphService {
1055
1099
  // Update the currentZoom variable with the new transform
1056
1100
  // zoomedInit - created because if zoomToFit is called before anything else it screws up the base transform - e.g. showCurrentMatch
1057
1101
  if (zoomedInit) {
1058
- currentZoom.x = translateX;
1059
- currentZoom.y = translateY;
1060
- currentZoom.k = scale;
1102
+ currentZoom = d3.zoomIdentity.translate(translateX, translateY).scale(scale);
1061
1103
  }
1062
1104
  updateZoomLevel();
1063
1105
  };
@@ -1182,8 +1224,18 @@ class VisualiserGraphService {
1182
1224
  const searchBtn = document.getElementById('searchButton');
1183
1225
  // Check to see if exists - control bool
1184
1226
  if (searchBtn) {
1185
- const searchInput = document.getElementById('searchInput');
1186
- const clearButton = document.getElementById('clearButton');
1227
+ const searchInputElement = document.getElementById('searchInput');
1228
+ const clearButtonElement = document.getElementById('clearButton');
1229
+ const prevButton = document.getElementById('prevButton');
1230
+ const nextButton = document.getElementById('nextButton');
1231
+ if (!(searchInputElement instanceof HTMLInputElement) ||
1232
+ !(clearButtonElement instanceof HTMLButtonElement) ||
1233
+ !(prevButton instanceof HTMLButtonElement) ||
1234
+ !(nextButton instanceof HTMLButtonElement)) {
1235
+ throw new Error('Search controls are unavailable.');
1236
+ }
1237
+ const searchInput = searchInputElement;
1238
+ const clearButton = clearButtonElement;
1187
1239
  const handleSearch = (event) => {
1188
1240
  if (event.key === 'Enter') {
1189
1241
  event.preventDefault();
@@ -1201,7 +1253,11 @@ class VisualiserGraphService {
1201
1253
  return d3.select(this).attr('id') === matchingNode.id;
1202
1254
  });
1203
1255
  // Add a new background circle to the entire <g> node
1204
- const bbox = nodeWrapper.node().getBBox();
1256
+ const nodeWrapperElement = nodeWrapper.node();
1257
+ if (!nodeWrapperElement) {
1258
+ return;
1259
+ }
1260
+ const bbox = nodeWrapperElement.getBBox();
1205
1261
  const centerX = bbox.x + bbox.width / 2;
1206
1262
  const centerY = bbox.y + bbox.height / 2;
1207
1263
  const radius = Math.max(bbox.width + 30, bbox.height) / 2;
@@ -1226,21 +1282,26 @@ class VisualiserGraphService {
1226
1282
  .attr('r', radius)
1227
1283
  .attr('opacity', '0.3');
1228
1284
  // Zoom to the matching node
1229
- const zoomTransform = d3.zoomTransform(svg.node());
1285
+ const zoomTransform = d3.zoomTransform(svgElement);
1230
1286
  const { k } = zoomTransform;
1231
1287
  const { fx, fy } = matchingNode;
1288
+ if (fx === null || fy === null) {
1289
+ return;
1290
+ }
1232
1291
  const newZoomTransform = d3.zoomIdentity
1233
1292
  .translate(-fx * k + parentWidth / 2, -fy * k + parentHeight / 2)
1234
1293
  .scale(k);
1235
- zoomContainer
1294
+ svg
1236
1295
  .transition()
1237
1296
  .duration(750)
1238
1297
  .call(zoom.transform, newZoomTransform);
1239
1298
  // Disable/Enable navigation buttons
1240
- const prevButton = document.getElementById('prevButton');
1241
- const nextButton = document.getElementById('nextButton');
1242
- prevButton.disabled = currentMatchIndex === 0;
1243
- nextButton.disabled = currentMatchIndex === matchingNodes.length - 1;
1299
+ if (prevButton) {
1300
+ prevButton.disabled = currentMatchIndex === 0;
1301
+ }
1302
+ if (nextButton) {
1303
+ nextButton.disabled = currentMatchIndex === matchingNodes.length - 1;
1304
+ }
1244
1305
  };
1245
1306
  const performSearch = () => {
1246
1307
  // Remove any previously added background circle
@@ -1273,19 +1334,21 @@ class VisualiserGraphService {
1273
1334
  const showNoMatches = () => {
1274
1335
  // Reset zoom level
1275
1336
  const newZoomTransform = d3.zoomIdentity.translate(0, 0).scale(1);
1276
- zoomContainer
1337
+ svg
1277
1338
  .transition()
1278
1339
  .duration(750)
1279
1340
  .call(zoom.transform, newZoomTransform);
1280
1341
  updateZoomLevel();
1281
1342
  // Disable navigation buttons
1282
- const prevButton = document.getElementById('prevButton');
1283
- const nextButton = document.getElementById('nextButton');
1284
- prevButton.disabled = true;
1285
- nextButton.disabled = true;
1343
+ if (prevButton) {
1344
+ prevButton.disabled = true;
1345
+ }
1346
+ if (nextButton) {
1347
+ nextButton.disabled = true;
1348
+ }
1286
1349
  // Show "no matches found" text with fade-in transition
1287
1350
  const noMatchesText = document.getElementById('noMatchesText');
1288
- if (searchInput.value !== '') {
1351
+ if (noMatchesText && searchInput.value !== '') {
1289
1352
  noMatchesText.classList.add('show');
1290
1353
  // Fade away after a few seconds
1291
1354
  setTimeout(() => {
@@ -1331,19 +1394,13 @@ class VisualiserGraphService {
1331
1394
  searchInput.addEventListener('input', updateClearButton);
1332
1395
  searchBtn.addEventListener('click', performSearch);
1333
1396
  clearButton.addEventListener('click', clearSearchInput);
1334
- document
1335
- .getElementById('searchInput')
1336
- .addEventListener('keydown', handleSearch);
1337
- document
1338
- .getElementById('nextButton')
1339
- .addEventListener('click', navigateNext);
1340
- document
1341
- .getElementById('prevButton')
1342
- .addEventListener('click', navigatePrevious);
1397
+ searchInput.addEventListener('keydown', handleSearch);
1398
+ nextButton.addEventListener('click', navigateNext);
1399
+ prevButton.addEventListener('click', navigatePrevious);
1343
1400
  }
1344
1401
  // For arrows
1345
1402
  this.initDefinitions(svg);
1346
- const simulation = this.forceSimulation(_d3, {
1403
+ const { simulation, linkForce } = this.forceSimulation(_d3, {
1347
1404
  width: +svg.attr('width'),
1348
1405
  height: +svg.attr('height'),
1349
1406
  });
@@ -1367,21 +1424,25 @@ class VisualiserGraphService {
1367
1424
  .style('fill-opacity', 0.4);
1368
1425
  })
1369
1426
  .on('brush', () => {
1370
- this.extent = d3.event.selection;
1371
- if (!d3.event.sourceEvent || !this.extent || !this.brushMode)
1427
+ const selection = d3.event.selection;
1428
+ this.extent = selection;
1429
+ if (!d3.event.sourceEvent || !selection || !this.brushMode)
1372
1430
  return;
1373
1431
  if (!currentZoom)
1374
1432
  return;
1375
1433
  nodeEnter
1376
1434
  .classed('selected', (d) => {
1377
- const isInSelection = d3.event.selection[0][0] <= d.x * currentZoom.k + currentZoom.x &&
1378
- d.x * currentZoom.k + currentZoom.x < d3.event.selection[1][0] &&
1379
- d3.event.selection[0][1] <= d.y * currentZoom.k + currentZoom.y &&
1380
- d.y * currentZoom.k + currentZoom.y < d3.event.selection[1][1];
1435
+ if (d.x === undefined || d.y === undefined) {
1436
+ return false;
1437
+ }
1438
+ const isInSelection = selection[0][0] <= d.x * currentZoom.k + currentZoom.x &&
1439
+ d.x * currentZoom.k + currentZoom.x < selection[1][0] &&
1440
+ selection[0][1] <= d.y * currentZoom.k + currentZoom.y &&
1441
+ d.y * currentZoom.k + currentZoom.y < selection[1][1];
1381
1442
  return (d.selected = Boolean(d.previouslySelected) !== isInSelection);
1382
1443
  })
1383
1444
  .select('.nodeText')
1384
- .classed('selected', (d) => d.selected)
1445
+ .classed('selected', (d) => Boolean(d.selected))
1385
1446
  .style('fill', (d) => (d.selected ? 'blue' : '#999'))
1386
1447
  .style('font-weight', (d) => (d.selected ? 700 : 400));
1387
1448
  this.extent = d3.event.selection;
@@ -1399,7 +1460,7 @@ class VisualiserGraphService {
1399
1460
  nodeEnter
1400
1461
  .select('.nodeText')
1401
1462
  .filter(function () {
1402
- return !d3.select(this.parentNode).classed('selected');
1463
+ return !this.parentElement?.classList.contains('selected');
1403
1464
  })
1404
1465
  .style('fill', '#212529')
1405
1466
  .style('font-weight', 400);
@@ -1453,8 +1514,9 @@ class VisualiserGraphService {
1453
1514
  this.shiftKey = true;
1454
1515
  if (!this.gBrush) {
1455
1516
  this.brushMode = true;
1456
- this.gBrush = gBrushHolder.append('g').attr('class', 'brush');
1457
- this.gBrush.call(brush);
1517
+ const brushSelection = gBrushHolder.append('g').attr('class', 'brush');
1518
+ this.gBrush = brushSelection;
1519
+ brushSelection.call(brush);
1458
1520
  }
1459
1521
  }
1460
1522
  };
@@ -1466,10 +1528,9 @@ class VisualiserGraphService {
1466
1528
  return (index ===
1467
1529
  linksArray.findIndex((obj) => obj.source === source && obj.target === target));
1468
1530
  });
1469
- const link = zoomContainer.selectAll().data(filteredLine, function (d) {
1470
- return d.id;
1471
- });
1472
- zoomContainer.selectAll('line').data(link).exit().remove();
1531
+ const link = zoomContainer
1532
+ .selectAll('line')
1533
+ .data(filteredLine, edgeKey);
1473
1534
  const linkEnter = link
1474
1535
  .join('line')
1475
1536
  .style('stroke', function (d) {
@@ -1507,61 +1568,52 @@ class VisualiserGraphService {
1507
1568
  }
1508
1569
  return null;
1509
1570
  });
1510
- link.append('title').text(function (d) {
1511
- return d.label;
1512
- });
1513
- const edgepaths = zoomContainer.selectAll().data(this.links, function (d) {
1514
- return d.id;
1515
- });
1516
- zoomContainer.selectAll('path').data(edgepaths).exit().remove();
1571
+ link
1572
+ .selectAll('title')
1573
+ .data((d) => [d])
1574
+ .join('title')
1575
+ .text((d) => Array.isArray(d.label) ? d.label.join(', ') : d.label ?? '');
1576
+ const edgepaths = zoomContainer
1577
+ .selectAll('path.edgepath')
1578
+ .data(this.links, linkKey);
1517
1579
  const edgepathsEnter = edgepaths
1518
1580
  .join('svg:path')
1519
1581
  .attr('class', 'edgepath')
1520
1582
  .attr('fill-opacity', 0)
1521
1583
  .attr('stroke-opacity', 0)
1522
- .attr('id', function (d, i) {
1523
- return 'edgepath' + i;
1524
- });
1525
- const edgelabels = zoomContainer.selectAll().data(this.links, function (d) {
1526
- return d.id;
1527
- });
1528
- zoomContainer.selectAll('text').data(edgelabels).exit().remove();
1584
+ .attr('id', (d) => `edgepath_${linkKey(d)}`);
1585
+ const edgelabels = zoomContainer
1586
+ .selectAll('text.edgelabel')
1587
+ .data(this.links, linkKey);
1529
1588
  const edgelabelsEnter = edgelabels
1530
1589
  .enter()
1531
1590
  .append('text')
1591
+ .attr('class', 'edgelabel');
1592
+ const edgelabelsMerged = edgelabelsEnter.merge(edgelabels)
1532
1593
  .attr('class', 'edgelabel')
1533
- .attr('id', function (d) {
1534
- const suffix = '_text';
1535
- const source = d.source ? d.source : '';
1536
- const target = d.target ? d.target : '';
1537
- return `${source}_${target}${suffix}`;
1538
- })
1594
+ .attr('id', (d) => `${linkKey(d)}_text`)
1539
1595
  .style('text-anchor', 'middle')
1540
1596
  .attr('font-size', 14)
1541
1597
  .attr('dy', function (d) {
1542
- return d.dy;
1598
+ return d.dy ?? 0;
1543
1599
  });
1544
1600
  svg.selectAll('.edgelabel').on('dblclick', () => {
1545
1601
  const dblClick = d3.select(_d3.event.currentTarget).data();
1546
1602
  this.dblClickLinkPayload.next(dblClick);
1547
1603
  });
1548
- edgelabelsEnter
1549
- .append('textPath')
1550
- .attr('xlink:href', function (d, i) {
1551
- return '#edgepath' + i;
1552
- })
1604
+ const textPaths = edgelabelsMerged
1605
+ .selectAll('textPath')
1606
+ .data((d) => [d])
1607
+ .join('textPath')
1608
+ .attr('xlink:href', (d) => `#edgepath_${linkKey(d)}`)
1553
1609
  .style('cursor', 'pointer')
1554
1610
  .attr('dominant-baseline', 'bottom')
1555
1611
  .attr('startOffset', '50%')
1556
- .text(function (d) {
1557
- return d.label;
1558
- });
1559
- edgelabelsEnter
1560
- .selectAll('textPath')
1561
- .filter(function (d) {
1562
- return d.linkIcon;
1563
- })
1564
- .append('tspan')
1612
+ .text((d) => Array.isArray(d.label) ? d.label.join(', ') : d.label ?? '');
1613
+ textPaths
1614
+ .selectAll('tspan.fa')
1615
+ .data((d) => d.linkIcon ? [d] : [])
1616
+ .join('tspan')
1565
1617
  .style('fill', '#856404')
1566
1618
  .style('font-weight', '700')
1567
1619
  .attr('class', 'fa')
@@ -1604,25 +1656,23 @@ class VisualiserGraphService {
1604
1656
  const localSelectedLinkArray = d3.select(_d3.event.currentTarget).data();
1605
1657
  this.selectedLinkArray.next(localSelectedLinkArray);
1606
1658
  });
1607
- const node = zoomContainer.selectAll().data(this.nodes, function (d) {
1659
+ const node = zoomContainer.selectAll('g.node-wrapper').data(this.nodes, function (d) {
1608
1660
  return d.id;
1609
1661
  });
1610
- zoomContainer.selectAll('g').data(node).exit().remove();
1662
+ zoomContainer.selectAll('g.node-wrapper').data(this.nodes).exit().remove();
1611
1663
  const nodeEnter = node
1612
1664
  .join('g')
1613
1665
  .call(_d3
1614
1666
  .drag()
1615
1667
  .on('start', function dragstarted(d) {
1616
1668
  // Enable the save & reset btn
1617
- if (resetBtn) {
1618
- document
1619
- .getElementById('reset_graph')
1620
- .removeAttribute('disabled');
1621
- document.getElementById('save_graph').removeAttribute('disabled');
1669
+ if (resetBtn && saveBtn) {
1670
+ resetBtn.removeAttribute('disabled');
1671
+ saveBtn.removeAttribute('disabled');
1622
1672
  }
1623
1673
  if (!_d3.event.active)
1624
1674
  simulation.alphaTarget(0.9).restart();
1625
- if (!d.selected && !this.shiftKey) {
1675
+ if (!d.selected && !isShiftKeyPressed()) {
1626
1676
  // if this node isn't selected, then we have to unselect every other node
1627
1677
  nodeEnter.classed('selected', function (p) {
1628
1678
  return (p.selected = p.previouslySelected = false);
@@ -1643,29 +1693,29 @@ class VisualiserGraphService {
1643
1693
  });
1644
1694
  nodeEnter
1645
1695
  .filter(function (d) {
1646
- return d.selected;
1696
+ return Boolean(d.selected);
1647
1697
  })
1648
1698
  .each(function (d) {
1649
- d.fx = d.x;
1650
- d.fy = d.y;
1699
+ d.fx = d.x ?? null;
1700
+ d.fy = d.y ?? null;
1651
1701
  });
1652
1702
  })
1653
1703
  .on('drag', function dragged() {
1654
1704
  nodeEnter
1655
1705
  .filter(function (d) {
1656
- return d.selected;
1706
+ return Boolean(d.selected);
1657
1707
  })
1658
1708
  .each(function (d) {
1659
- d.fx += _d3.event.dx;
1660
- d.fy += _d3.event.dy;
1709
+ d.fx = (d.fx ?? d.x ?? 0) + _d3.event.dx;
1710
+ d.fy = (d.fy ?? d.y ?? 0) + _d3.event.dy;
1661
1711
  });
1662
1712
  })
1663
1713
  .on('end', (d) => {
1664
1714
  if (!_d3.event.active) {
1665
1715
  simulation.alphaTarget(0.3).restart();
1666
1716
  }
1667
- d.fx = d.x;
1668
- d.fy = d.y;
1717
+ d.fx = d.x ?? null;
1718
+ d.fy = d.y ?? null;
1669
1719
  // Subscribes to updated graph positions for save
1670
1720
  this.saveGraphData.next(data);
1671
1721
  }))
@@ -1769,14 +1819,22 @@ class VisualiserGraphService {
1769
1819
  });
1770
1820
  // Right click on a node highlights for context menu
1771
1821
  svg.selectAll('.node-wrapper').on('contextmenu', () => {
1772
- // counts number of selected classes to not exceed 2
1773
- const selectedSize = svg
1774
- .selectAll('.selected')
1775
- .selectAll('.nodeText')
1776
- .size();
1777
- if (selectedSize !== 2) {
1778
- // We don't want to remove style if they are obtaining the context menu for just two nodes (create link option)
1779
- svg.selectAll('.selected').classed('selected', false);
1822
+ const target = _d3.event.currentTarget;
1823
+ const selectedNodes = svg
1824
+ .selectAll('.node-wrapper.selected')
1825
+ .data();
1826
+ const targetIsSelected = selectedNodes.some((selectedNode) => selectedNode.id === target.id);
1827
+ if (selectedNodes.length === 2 && targetIsSelected) {
1828
+ this.selectedNodesArray.next(selectedNodes);
1829
+ }
1830
+ else {
1831
+ // Clear any previous selection before showing the single-node context menu.
1832
+ svg.selectAll('.node-wrapper.selected')
1833
+ .classed('selected', false)
1834
+ .each((selectedNode) => {
1835
+ selectedNode.selected = false;
1836
+ selectedNode.previouslySelected = false;
1837
+ });
1780
1838
  this.selectedNodesArray.next([]);
1781
1839
  _d3
1782
1840
  .selectAll('.edgelabel')
@@ -1795,7 +1853,7 @@ class VisualiserGraphService {
1795
1853
  }
1796
1854
  });
1797
1855
  //click on canvas to remove selected nodes
1798
- _d3.select('svg').on('click', () => {
1856
+ svg.on('click', () => {
1799
1857
  nodeEnter.each(function (d) {
1800
1858
  d.selected = false;
1801
1859
  d.previouslySelected = false;
@@ -1820,7 +1878,7 @@ class VisualiserGraphService {
1820
1878
  nodeEnter
1821
1879
  .filter(function (d) {
1822
1880
  if (!d.imageUrl || d.imageUrl === '') {
1823
- return null;
1881
+ return false;
1824
1882
  }
1825
1883
  return true;
1826
1884
  })
@@ -1846,7 +1904,7 @@ class VisualiserGraphService {
1846
1904
  nodeEnter
1847
1905
  .filter(function (d) {
1848
1906
  if (!d.icon || d.icon === '') {
1849
- return null;
1907
+ return false;
1850
1908
  }
1851
1909
  return true;
1852
1910
  })
@@ -1868,7 +1926,9 @@ class VisualiserGraphService {
1868
1926
  .style('font-size', '35px')
1869
1927
  .style('cursor', 'pointer');
1870
1928
  const nodeText = nodeEnter
1871
- .append('text')
1929
+ .selectAll('text.nodeText')
1930
+ .data((d) => [d], (d) => d.id)
1931
+ .join('text')
1872
1932
  .attr('id', 'nodeText')
1873
1933
  .attr('class', 'nodeText')
1874
1934
  .style('text-anchor', 'middle')
@@ -1881,10 +1941,9 @@ class VisualiserGraphService {
1881
1941
  return `${id}_${suffix}`;
1882
1942
  });
1883
1943
  nodeText
1884
- .selectAll('tspan.text')
1944
+ .selectAll('tspan.nodeTextTspan')
1885
1945
  .data((d) => d.label)
1886
- .enter()
1887
- .append('tspan')
1946
+ .join('tspan')
1888
1947
  .attr('class', 'nodeTextTspan')
1889
1948
  .text((d) => d)
1890
1949
  .style('font-size', '14px')
@@ -1894,7 +1953,7 @@ class VisualiserGraphService {
1894
1953
  nodeEnter
1895
1954
  .filter(function (d) {
1896
1955
  if (!d.additionalIcon) {
1897
- return null;
1956
+ return false;
1898
1957
  }
1899
1958
  return true;
1900
1959
  })
@@ -1917,7 +1976,7 @@ class VisualiserGraphService {
1917
1976
  nodeEnter
1918
1977
  .filter(function (d) {
1919
1978
  if (!d.newItem) {
1920
- return null;
1979
+ return false;
1921
1980
  }
1922
1981
  return true;
1923
1982
  })
@@ -1951,14 +2010,11 @@ class VisualiserGraphService {
1951
2010
  .duration(1000)
1952
2011
  .attr('fill', '#212529')
1953
2012
  .attr('font-weight', 400)
1954
- .attr('fill-opacity', 1)
1955
- .on('end', function () {
1956
- return d3.select(this).call(_d3.transition);
1957
- });
2013
+ .attr('fill-opacity', 1);
1958
2014
  nodeEnter
1959
2015
  .filter(function (d) {
1960
2016
  if (!d.newItem) {
1961
- return null;
2017
+ return false;
1962
2018
  }
1963
2019
  return true;
1964
2020
  })
@@ -1986,15 +2042,14 @@ class VisualiserGraphService {
1986
2042
  .transition()
1987
2043
  .duration(1000)
1988
2044
  .attr('width', 32)
1989
- .attr('height', 32)
1990
- .on('end', function () {
1991
- return d3.select(this).call(d3.transition);
1992
- });
2045
+ .attr('height', 32);
1993
2046
  // Remove the newClass so they don't animate next time
1994
2047
  this.nodes = this.removeNewItem(this.nodes);
1995
- nodeEnter.append('title').text(function (d) {
1996
- return d.label;
1997
- });
2048
+ nodeEnter
2049
+ .selectAll('title')
2050
+ .data((d) => [d])
2051
+ .join('title')
2052
+ .text((d) => d.label.join(', '));
1998
2053
  const maxTicks = 30;
1999
2054
  let tickCount = 0;
2000
2055
  let zoomToFitCalled = false;
@@ -2009,7 +2064,7 @@ class VisualiserGraphService {
2009
2064
  tickCount++;
2010
2065
  }
2011
2066
  });
2012
- simulation.force('link').links(this.links);
2067
+ linkForce.links(this.links);
2013
2068
  this.saveGraphData.next(data);
2014
2069
  }
2015
2070
  resetGraph(initialData, element, zoom, zoomToFit) {
@@ -2061,15 +2116,18 @@ class DagreNodesOnlyLayout {
2061
2116
  acyclicer: undefined,
2062
2117
  ranker: 'network-simplex',
2063
2118
  };
2064
- dagreGraph;
2065
- dagreNodes;
2066
- dagreEdges;
2119
+ dagreGraph = new dagre.graphlib.Graph();
2120
+ dagreNodes = [];
2121
+ dagreEdges = [];
2067
2122
  renderLayout(graph) {
2068
2123
  this.createDagreGraph(graph);
2069
2124
  dagre.layout(this.dagreGraph);
2070
2125
  for (const dagreNodeId of this.dagreGraph.nodes()) {
2071
2126
  const dagreNode = this.dagreGraph.node(dagreNodeId);
2072
2127
  const node = graph.nodes.find((n) => n.id === dagreNodeId);
2128
+ if (!node) {
2129
+ continue;
2130
+ }
2073
2131
  if (node.fx === null && node.fy === null) {
2074
2132
  // Check if the node has any associated edges
2075
2133
  const hasAssociatedEdges = graph.links.some((link) => link.source === dagreNodeId || link.target === dagreNodeId);
@@ -2092,6 +2150,9 @@ class DagreNodesOnlyLayout {
2092
2150
  for (const dagreNodeId of this.dagreGraph.nodes()) {
2093
2151
  const dagreNode = this.dagreGraph.node(dagreNodeId);
2094
2152
  const node = graph.nodes.find((n) => n.id === dagreNodeId);
2153
+ if (!node) {
2154
+ continue;
2155
+ }
2095
2156
  // Check if the node has any associated edges
2096
2157
  const hasAssociatedEdges = graph.links.some((link) => link.source === dagreNodeId || link.target === dagreNodeId);
2097
2158
  if (hasAssociatedEdges) {
@@ -2188,16 +2249,16 @@ class VisualiserGraphComponent {
2188
2249
  graphElement;
2189
2250
  contextMenu;
2190
2251
  saveGraphDataEvent = new EventEmitter();
2191
- selectedNodesArray;
2192
- selectedNodeId;
2193
- selectedLinkArray;
2194
- saveGraphData;
2195
- width;
2252
+ selectedNodesArray = [];
2253
+ selectedNodeId = null;
2254
+ selectedLinkArray = [];
2255
+ saveGraphData = null;
2256
+ width = 0;
2196
2257
  showSearch = false;
2197
- savedGraphData;
2198
- dataId;
2258
+ savedGraphData = null;
2259
+ dataId = '';
2199
2260
  showConfirmation = false;
2200
- buttonBarRightPosition;
2261
+ buttonBarRightPosition = '0';
2201
2262
  editLinksData = null;
2202
2263
  editNodeData = null;
2203
2264
  readOnly = false;
@@ -2244,7 +2305,7 @@ class VisualiserGraphComponent {
2244
2305
  });
2245
2306
  // Subscribe to the double-click node payload
2246
2307
  this.visualiserGraphService.dblClickNodePayload.subscribe((dblClickNodePayload) => {
2247
- this.selectedNodeId = dblClickNodePayload[0].id;
2308
+ this.selectedNodeId = dblClickNodePayload[0]?.id ?? null;
2248
2309
  if (!this.readOnly) {
2249
2310
  this.handleEditNodesEvent(true);
2250
2311
  }
@@ -2279,7 +2340,11 @@ class VisualiserGraphComponent {
2279
2340
  this.updateWidth();
2280
2341
  }
2281
2342
  updateWidth() {
2282
- this.width = document.getElementById('pageId').offsetWidth;
2343
+ const page = document.getElementById('pageId');
2344
+ if (!page) {
2345
+ throw new Error('The graph page element is unavailable.');
2346
+ }
2347
+ this.width = page.offsetWidth;
2283
2348
  }
2284
2349
  async visualiserContextMenus(event) {
2285
2350
  if (this.readOnly) {
@@ -2292,16 +2357,22 @@ class VisualiserGraphComponent {
2292
2357
  let contextMenu;
2293
2358
  let item;
2294
2359
  const targetEl = event.target;
2360
+ if (!(targetEl instanceof Element)) {
2361
+ return;
2362
+ }
2295
2363
  const localName = targetEl.localName;
2296
- const parentNodeId = targetEl.parentNode.id;
2297
- const data = targetEl.parentNode.__data__;
2298
- this.selectedNodeId = targetEl.id || (data && data.id);
2299
- if (this.selectedNodesArray?.length === 2) {
2364
+ const parentElement = targetEl.parentElement;
2365
+ const parentNodeId = parentElement?.id ?? '';
2366
+ const data = parentElement?.__data__;
2367
+ this.selectedNodeId = targetEl.id || data?.id || null;
2368
+ let selectedNodesContext;
2369
+ if (this.selectedNodesArray.length === 2) {
2300
2370
  contextMenu = this.contextMenu.createEditLinkContextMenu;
2301
- item = {
2371
+ selectedNodesContext = {
2302
2372
  graphData: this.savedGraphData,
2303
2373
  selectedNodes: this.selectedNodesArray
2304
2374
  };
2375
+ item = selectedNodesContext;
2305
2376
  }
2306
2377
  else {
2307
2378
  if (localName === 'text' || localName === 'image' || parentNodeId === 'nodeText') {
@@ -2326,10 +2397,13 @@ class VisualiserGraphComponent {
2326
2397
  event.preventDefault();
2327
2398
  // Update context menu items based on data from Dexie
2328
2399
  const updatedData = await this.dexieService.getGraphData(this.dataId);
2329
- if (this.selectedNodesArray?.length === 2) {
2330
- item.graphData = updatedData;
2400
+ if (selectedNodesContext) {
2401
+ selectedNodesContext.graphData = updatedData;
2331
2402
  }
2332
2403
  }
2404
+ dismissContextMenu(event) {
2405
+ this.contextMenuService.closeAllContextMenus({ eventType: 'cancel', event });
2406
+ }
2333
2407
  findCreateNodesEvent(action) {
2334
2408
  if (action === 'findNodes') {
2335
2409
  this.toggleSearch();
@@ -2359,6 +2433,10 @@ class VisualiserGraphComponent {
2359
2433
  this.visualiserGraphService.saveGraphData.subscribe((saveGraphData) => {
2360
2434
  this.saveGraphData = saveGraphData;
2361
2435
  });
2436
+ if (!this.saveGraphData) {
2437
+ console.error('Graph data is unavailable to save.');
2438
+ return;
2439
+ }
2362
2440
  this.saveGraphDataEvent.emit(this.saveGraphData);
2363
2441
  this.disableButtons(true);
2364
2442
  this.data = this.saveGraphData;
@@ -2422,67 +2500,71 @@ class VisualiserGraphComponent {
2422
2500
  return;
2423
2501
  }
2424
2502
  const { payload, source } = linkData;
2425
- // Ensure that exactly two nodes are selected
2426
- if (this.selectedNodesArray.length === 2) {
2427
- // Make sure that the source is always the smaller ID
2428
- this.selectedNodesArray = this.selectedNodesArray.sort((a, b) => Number(a.id) - Number(b.id));
2429
- const sourceNode = this.selectedNodesArray[0];
2430
- const targetNode = this.selectedNodesArray[1];
2431
- // Retrieve the saved graph data from Dexie
2432
- const data = await this.dexieService.getGraphData(this.dataId);
2433
- // Find the next available labelIndex
2434
- const allIndexes = data.links.reduce((acc, link) => {
2435
- return acc.concat(link.relationships.map(rel => rel.labelIndex));
2436
- }, []);
2437
- let nextIndex = Math.max(...allIndexes, 0) + 1;
2438
- // Map over the labels and linkIcon values, assuming each label has a corresponding linkIcon
2439
- const relationships = payload.label.map((item) => ({
2440
- labelIndex: item.labelIndex !== undefined ? item.labelIndex : nextIndex++,
2441
- label: item.label,
2442
- source: sourceNode.id,
2443
- target: targetNode.id,
2444
- linkIcon: item.linkIcon
2445
- }));
2446
- const newLink = {
2447
- source: sourceNode.id,
2448
- target: targetNode.id,
2449
- lineStyle: payload.lineStyle,
2450
- sourceArrow: payload.sourceArrow,
2451
- targetArrow: payload.targetArrow,
2452
- linkId: `${sourceNode.id}_${targetNode.id}`,
2453
- relationships,
2454
- };
2455
- const isEditing = source === 'editLinkModal';
2456
- Swal.fire({
2457
- title: isEditing ? "Editing link" : "Creating link",
2458
- text: "You won't be able to revert this!",
2459
- icon: "warning",
2460
- showCancelButton: true,
2461
- confirmButtonColor: "#3085d6",
2462
- cancelButtonColor: "#d33",
2463
- confirmButtonText: isEditing ? "Update link" : "Create link",
2464
- }).then((result) => {
2465
- if (result.isConfirmed) {
2466
- const existingLinkIndex = data.links.findIndex(link => link.linkId === `${sourceNode.id}_${targetNode.id}` || link.linkId === `${targetNode.id}_${sourceNode.id}`);
2467
- if (existingLinkIndex !== -1) {
2468
- data.links[existingLinkIndex] = newLink;
2469
- }
2470
- else {
2471
- data.links.push(newLink);
2472
- }
2473
- this.data = data;
2474
- this.saveGraphDataEvent.emit(data);
2475
- Swal.fire({
2476
- title: isEditing ? "Link updated" : "Link created",
2477
- text: `Your link has been ${isEditing ? "edited" : "created"} and graph saved.`,
2478
- icon: "success"
2479
- });
2480
- }
2481
- });
2482
- }
2483
- else {
2484
- console.error('Please select exactly two nodes to create a link.');
2503
+ const data = await this.dexieService.getGraphData(this.dataId);
2504
+ const editLinksData = this.editLinksData;
2505
+ let sourceNode;
2506
+ let targetNode;
2507
+ if (Array.isArray(editLinksData) && editLinksData.length === 2) {
2508
+ // The create-link dialog retains the exact nodes it was opened for.
2509
+ [sourceNode, targetNode] = [...editLinksData].sort((a, b) => Number(a.id) - Number(b.id));
2510
+ }
2511
+ else if (editLinksData && !Array.isArray(editLinksData)) {
2512
+ sourceNode = data.nodes.find(node => node.id === editLinksData.source);
2513
+ targetNode = data.nodes.find(node => node.id === editLinksData.target);
2514
+ }
2515
+ if (!sourceNode || !targetNode) {
2516
+ console.error('Exactly two valid nodes are required to create or edit a link.');
2517
+ return;
2485
2518
  }
2519
+ // Find the next available labelIndex
2520
+ const allIndexes = data.links.reduce((acc, link) => {
2521
+ return acc.concat(link.relationships.map(rel => rel.labelIndex));
2522
+ }, []);
2523
+ let nextIndex = Math.max(...allIndexes, 0) + 1;
2524
+ // Map over the labels and linkIcon values, assuming each label has a corresponding linkIcon
2525
+ const relationships = payload.label.map((item) => ({
2526
+ labelIndex: item.labelIndex !== undefined ? item.labelIndex : nextIndex++,
2527
+ label: item.label,
2528
+ source: sourceNode.id,
2529
+ target: targetNode.id,
2530
+ linkIcon: item.linkIcon
2531
+ }));
2532
+ const newLink = {
2533
+ source: sourceNode.id,
2534
+ target: targetNode.id,
2535
+ lineStyle: payload.lineStyle,
2536
+ sourceArrow: payload.sourceArrow,
2537
+ targetArrow: payload.targetArrow,
2538
+ linkId: `${sourceNode.id}_${targetNode.id}`,
2539
+ relationships,
2540
+ };
2541
+ const isEditing = source === 'editLinkModal';
2542
+ Swal.fire({
2543
+ title: isEditing ? "Editing link" : "Creating link",
2544
+ text: "You won't be able to revert this!",
2545
+ icon: "warning",
2546
+ showCancelButton: true,
2547
+ confirmButtonColor: "#3085d6",
2548
+ cancelButtonColor: "#d33",
2549
+ confirmButtonText: isEditing ? "Update link" : "Create link",
2550
+ }).then((result) => {
2551
+ if (result.isConfirmed) {
2552
+ const existingLinkIndex = data.links.findIndex(link => link.linkId === `${sourceNode.id}_${targetNode.id}` || link.linkId === `${targetNode.id}_${sourceNode.id}`);
2553
+ if (existingLinkIndex !== -1) {
2554
+ data.links[existingLinkIndex] = newLink;
2555
+ }
2556
+ else {
2557
+ data.links.push(newLink);
2558
+ }
2559
+ this.data = data;
2560
+ this.saveGraphDataEvent.emit(data);
2561
+ Swal.fire({
2562
+ title: isEditing ? "Link updated" : "Link created",
2563
+ text: `Your link has been ${isEditing ? "edited" : "created"} and graph saved.`,
2564
+ icon: "success"
2565
+ });
2566
+ }
2567
+ });
2486
2568
  }
2487
2569
  async onDeleteNode() {
2488
2570
  if (!this.savedGraphData) {
@@ -2549,7 +2631,20 @@ class VisualiserGraphComponent {
2549
2631
  console.error('savedGraphData is not set');
2550
2632
  return;
2551
2633
  }
2552
- const inputValue = this.selectedLinkArray[0].label;
2634
+ const selectedLink = this.selectedLinkArray[0];
2635
+ if (!selectedLink) {
2636
+ console.error('Selected link data is unavailable.');
2637
+ return;
2638
+ }
2639
+ const inputValue = Array.isArray(selectedLink.label)
2640
+ ? selectedLink.label.join(', ')
2641
+ : selectedLink.label ?? '';
2642
+ const sourceId = typeof selectedLink.source === 'string'
2643
+ ? selectedLink.source
2644
+ : selectedLink.source.id;
2645
+ const targetId = typeof selectedLink.target === 'string'
2646
+ ? selectedLink.target
2647
+ : selectedLink.target.id;
2553
2648
  Swal.fire({
2554
2649
  title: "Editing a link label will save graph data, are you sure?",
2555
2650
  input: "text",
@@ -2562,16 +2657,19 @@ class VisualiserGraphComponent {
2562
2657
  confirmButtonText: "Update link label"
2563
2658
  }).then(async (result) => {
2564
2659
  if (result.isConfirmed) {
2565
- // Update the label property with the result
2566
- this.selectedLinkArray[0].label = result;
2660
+ if (typeof result.value !== 'string') {
2661
+ console.error('The updated link label is invalid.');
2662
+ return;
2663
+ }
2664
+ selectedLink.label = result.value;
2567
2665
  // Retrieve the saved graph data from Dexie
2568
2666
  const data = await this.dexieService.getGraphData(this.dataId);
2569
2667
  // Find the link in the data using source and target IDs
2570
- const link = data.links.find(link => (link.source === this.selectedLinkArray[0].source.id && link.target === this.selectedLinkArray[0].target.id) ||
2571
- (link.source === this.selectedLinkArray[0].target.id && link.target === this.selectedLinkArray[0].source.id));
2668
+ const link = data.links.find(link => (link.source === sourceId && link.target === targetId) ||
2669
+ (link.source === targetId && link.target === sourceId));
2572
2670
  if (link) {
2573
2671
  // Find the relationship with the same labelIndex
2574
- const relationship = link.relationships.find(rel => rel.labelIndex === this.selectedLinkArray[0].labelIndex);
2672
+ const relationship = link.relationships.find(rel => rel.labelIndex === selectedLink.labelIndex);
2575
2673
  if (relationship) {
2576
2674
  // Update the label in the matched object
2577
2675
  relationship.label = result.value;
@@ -2593,7 +2691,7 @@ class VisualiserGraphComponent {
2593
2691
  handleEditLinksEvent(event) {
2594
2692
  if (event.open) {
2595
2693
  this.editLinksData = { ...event.data, dataId: this.dataId };
2596
- this.modalsComponent.openModal(this.modalsComponent.editLinksModal);
2694
+ this.modalsComponent.openModal(this.modalsComponent.editLinksModal, this.editLinksData);
2597
2695
  }
2598
2696
  }
2599
2697
  handleCreateLinksEvent(event) {
@@ -2601,7 +2699,7 @@ class VisualiserGraphComponent {
2601
2699
  // Make sure that the source is always the smaller ID
2602
2700
  const sortedData = event.data.sort((a, b) => Number(a.id) - Number(b.id));
2603
2701
  this.editLinksData = Object.assign(sortedData, { dataId: this.dataId });
2604
- this.modalsComponent.openModal(this.modalsComponent.createLinkModal);
2702
+ this.modalsComponent.openModal(this.modalsComponent.createLinkModal, this.editLinksData);
2605
2703
  }
2606
2704
  }
2607
2705
  async handleEditNodesEvent(event) {
@@ -2638,6 +2736,10 @@ class VisualiserGraphComponent {
2638
2736
  enableButtons() {
2639
2737
  const saveBtn = document.getElementById('save_graph');
2640
2738
  const resetBtn = document.getElementById('reset_graph');
2739
+ if (!saveBtn || !resetBtn) {
2740
+ console.error('Graph action buttons are unavailable.');
2741
+ return;
2742
+ }
2641
2743
  saveBtn.removeAttribute('disabled');
2642
2744
  resetBtn.removeAttribute('disabled');
2643
2745
  }
@@ -2646,6 +2748,10 @@ class VisualiserGraphComponent {
2646
2748
  }
2647
2749
  registerDragElement() {
2648
2750
  const elmnt = document.getElementById('draggable');
2751
+ if (!elmnt) {
2752
+ console.error('Draggable graph controls are unavailable.');
2753
+ return;
2754
+ }
2649
2755
  let pos1 = 0, pos2 = 0, pos3 = 0, pos4 = 0;
2650
2756
  const dragMouseDown = (e) => {
2651
2757
  // Prevent any default behavior
@@ -2680,9 +2786,10 @@ class VisualiserGraphComponent {
2680
2786
  document.onmouseup = null;
2681
2787
  document.onmousemove = null;
2682
2788
  };
2683
- if (document.getElementById(elmnt.id + 'Handle')) {
2789
+ const handle = document.getElementById(`${elmnt.id}Handle`);
2790
+ if (handle) {
2684
2791
  /* if present, the header is where you move the DIV from:*/
2685
- document.getElementById(elmnt.id + 'Handle').onmousedown = dragMouseDown;
2792
+ handle.onmousedown = dragMouseDown;
2686
2793
  }
2687
2794
  else {
2688
2795
  /* otherwise, move the DIV from anywhere inside the DIV:*/
@@ -2699,11 +2806,11 @@ class VisualiserGraphComponent {
2699
2806
  }
2700
2807
  }
2701
2808
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: VisualiserGraphComponent, deps: [{ token: VisualiserGraphService }, { token: i2.ContextMenuService }, { token: DagreNodesOnlyLayout }, { token: DexieService }], target: i0.ɵɵFactoryTarget.Component });
2702
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: VisualiserGraphComponent, selector: "visualiser-graph", inputs: { readOnly: "readOnly", zoom: "zoom", controls: "controls", zoomToFit: "zoomToFit", data: "data" }, outputs: { saveGraphDataEvent: "saveGraphDataEvent" }, viewQueries: [{ propertyName: "graphElement", first: true, predicate: ["svgId"], descendants: true }, { propertyName: "contextMenu", first: true, predicate: ContextMenusComponent, descendants: true }, { propertyName: "modalsComponent", first: true, predicate: ModalsComponent, descendants: true }], ngImport: i0, template: "<div class=\"page\" id=\"pageId\" (window:resize)=\"onResize()\">\n <div id=\"draggable\" class=\"buttonBar\" [style.right]=\"buttonBarRightPosition\">\n <div *ngIf=\"controls\">\n <div class=\"d-flex justify-content-end\">\n <div class=\"btn-group\" role=\"group\" aria-label=\"Controls\">\n <button type=\"button\" id=\"draggableHandle\" class=\"btn btn-light\" data-toggle=\"tooltip\" data-placement=\"top\"\n title=\"Move toolbar\">\n <i class=\"bi bi-grip-vertical\"></i>\n </button>\n\n <button type=\"button\" id=\"dagre_layout\" class=\"btn btn-secondary\" data-toggle=\"tooltip\" data-placement=\"top\"\n title=\"Dagre layout\" (click)=\"applyLayout()\">\n <i class=\"bi bi-diagram-3\"></i>\n </button>\n <button type=\"button\" id=\"save_graph\" class=\"btn btn-secondary\" data-toggle=\"tooltip\" data-placement=\"top\"\n title=\"Save data\" (click)=\"onConfirmSave()\">\n <i class=\"bi bi-save\"></i>\n </button>\n <button type=\"button\" id=\"reset_graph\" class=\"btn btn-secondary\" data-toggle=\"tooltip\" data-placement=\"top\"\n title=\"Reset data\" (click)=\"resetGraph()\">\n <i class=\"bi bi-skip-backward\"></i>\n </button>\n <button type=\"button\" *ngIf=\"zoom\" class=\"btn btn-secondary\" data-toggle=\"tooltip\" data-placement=\"top\"\n title=\"Zoom in\" id=\"zoom_in\">\n <i class=\"bi bi-zoom-in\"></i>\n </button>\n <button type=\"button\" *ngIf=\"zoom\" class=\"btn btn-secondary\" data-toggle=\"tooltip\" data-placement=\"top\"\n title=\"Zoom out\" id=\"zoom_out\">\n <i class=\"bi bi-zoom-out\"></i>\n </button>\n <button type=\"button\" *ngIf=\"zoom\" class=\"btn btn-secondary\" data-toggle=\"tooltip\" data-placement=\"top\"\n title=\"Zoom reset\" id=\"zoom_reset\" disabled=\"true\">\n <i class=\"bi bi-arrow-counterclockwise\"></i>\n </button>\n <button type=\"button\" *ngIf=\"zoom\" class=\"btn btn-secondary\" data-toggle=\"tooltip\" data-placement=\"top\"\n title=\"Zoom to fit\" id=\"zoom_to_fit\">\n <i class=\"bi bi-arrows-fullscreen\"></i>\n </button>\n <button type=\"button\" *ngIf=\"zoom\" class=\"btn btn-secondary\" data-toggle=\"tooltip\" data-placement=\"top\"\n title=\"Select all\" id=\"select_all\">\n <i class=\"bi bi-grid-fill\"></i>\n </button>\n <button type=\"button\" *ngIf=\"zoom\" class=\"btn btn-secondary\" data-toggle=\"tooltip\" data-placement=\"top\"\n title=\"Invert selection\" id=\"toggle_selection\">\n <i class=\"bi bi-ui-checks-grid\"></i>\n </button>\n <button type=\"button\" class=\"btn btn-secondary\" data-toggle=\"tooltip\" data-placement=\"top\"\n title=\"Toggle search\" id=\"toggle_search\"\n [ngClass]=\"{'searchButtonActive': showSearch, 'searchButtonInactive': !showSearch}\"\n (click)=\"toggleSearch()\">\n <i class=\"bi bi-search\"></i>\n </button>\n </div>\n </div>\n <div class=\"search float-right input-group mt-3 pr-0\" [hidden]=\"!showSearch\">\n <div class=\"input-group-prepend\">\n <button type=\"button\" id=\"prevButton\" class=\"btn btn-secondary\" data-toggle=\"tooltip\" data-placement=\"top\"\n title=\"Previous\" disabled>\n <i class=\"bi bi-arrow-left-square\"></i>\n </button>\n <button type=\"button\" id=\"nextButton\" class=\"btn btn-secondary\" data-toggle=\"tooltip\" data-placement=\"top\"\n title=\"Next\" disabled>\n <i class=\"bi bi-arrow-right-square\"></i>\n </button>\n </div>\n <input type=\"text\" id=\"searchInput\" class=\"form-control\" placeholder=\"Search\" aria-label=\"Search\"\n aria-describedby=\"search\" />\n <div class=\"input-group-append\">\n <button class=\"btn btn-outline-secondary\" type=\"button\" id=\"searchButton\" data-toggle=\"tooltip\"\n data-placement=\"top\" title=\"Search\">\n <i class=\"bi bi-search\"></i>\n </button>\n </div>\n <div class=\"input-group-append\">\n <button class=\"btn btn-outline-secondary\" type=\"button\" id=\"clearButton\" data-toggle=\"tooltip\"\n data-placement=\"top\" title=\"Clear\" disabled>\n clear\n </button>\n </div>\n </div>\n </div>\n <div [hidden]=\"!showSearch\" id=\"noMatchesText\" class=\"noMatchesText float-right\">No matches found</div>\n </div>\n <!-- Zoom indicator-->\n <div *ngIf=\"zoom\" class=\"zoomIndicator\">\n <span id=\"zoom_level\"></span>\n </div>\n\n <app-context-menus\n (editNodeContextMenuEvent)=\"handleEditNodesEvent($event)\"\n (findCreateNodesContextMenuEvent)=\"findCreateNodesEvent($event)\"\n (createLinkContextMenuEvent)=\"handleCreateLinksEvent($event)\"\n (editLinkLabelContextMenuEvent)=\"onEditLinkLabel()\"\n (editLinksContextMenuEvent)=\"handleEditLinksEvent($event)\">\n </app-context-menus>\n\n <app-modals\n [editNodeData]=\"editNodeData\"\n [editLinksData]=\"editLinksData\"\n (createEditLinkEvent)=\"onCreateEditLink($event)\"\n (createEditNodeEvent)=\"onCreateEditNode($event)\"\n (deleteLinkEvent)=\"onDeleteLink($event)\"\n (deleteNodeEvent)=\"onDeleteNode()\">\n </app-modals>\n\n <svg #svgId [attr.width]=\"width\" height=\"780\" (contextmenu)=\"visualiserContextMenus($event)\"></svg>\n</div>", styles: ["@import\"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css\";@import\"https://cdnjs.cloudflare.com/ajax/libs/bootstrap/4.6.2/css/bootstrap.min.css\";@import\"https://cdn.jsdelivr.net/npm/bootstrap-icons@1.3.0/font/bootstrap-icons.css\";#zoom_level{position:relative;background-color:#000c;color:#fff;padding:5px;border-radius:5px;opacity:0;transition:opacity 1s ease-in-out}.buttonBar{position:absolute;padding:10px}.zoomIndicator{position:absolute;left:0;padding:10px}.noMatchesText{opacity:0;transition:opacity .5s;color:red}.noMatchesText.show{opacity:1}@keyframes floatInFromTop{0%{opacity:0;transform:translateY(-100%)}to{opacity:1;transform:translateY(0)}}.input-group{animation-name:floatInFromTop;animation-duration:.3s;animation-fill-mode:forwards;position:relative;width:407px}.searchButtonActive{outline:none;-webkit-box-shadow:inset 0px 0px 5px #323232;-moz-box-shadow:inset 0px 0px 5px #323232;box-shadow:inset 0 0 5px #323232}.searchButtonActive:focus,.searchButtonActive:active{outline:none;-webkit-box-shadow:inset 0px 0px 5px #323232;-moz-box-shadow:inset 0px 0px 5px #323232;box-shadow:inset 0 0 5px #323232}.searchButtonInactive{opacity:1;outline:none;box-shadow:none;background-color:#6c757d!important;border-color:#6c757d!important}#draggableHandle{cursor:move}@media (max-width: 768px){.buttonBar{flex-direction:column;align-items:flex-start}.btn-group{flex-direction:column}.btn-group .btn{width:100%;margin-bottom:5px}}\n"], dependencies: [{ kind: "directive", type: i4.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: ContextMenusComponent, selector: "app-context-menus", outputs: ["editNodeContextMenuEvent", "findCreateNodesContextMenuEvent", "createLinkContextMenuEvent", "editLinkLabelContextMenuEvent", "editLinksContextMenuEvent"] }, { kind: "component", type: ModalsComponent, selector: "app-modals", inputs: ["editNodeData", "editLinksData"], outputs: ["closeModalEvent", "createEditLinkEvent", "createEditNodeEvent", "deleteLinkEvent", "deleteNodeEvent"] }] });
2809
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: VisualiserGraphComponent, selector: "visualiser-graph", inputs: { readOnly: "readOnly", zoom: "zoom", controls: "controls", zoomToFit: "zoomToFit", data: "data" }, outputs: { saveGraphDataEvent: "saveGraphDataEvent" }, viewQueries: [{ propertyName: "graphElement", first: true, predicate: ["svgId"], descendants: true }, { propertyName: "contextMenu", first: true, predicate: ContextMenusComponent, descendants: true }, { propertyName: "modalsComponent", first: true, predicate: ModalsComponent, descendants: true }], ngImport: i0, template: "<div class=\"page\" id=\"pageId\" (window:resize)=\"onResize()\">\n <div id=\"draggable\" class=\"buttonBar\" [style.right]=\"buttonBarRightPosition\">\n <div *ngIf=\"controls\">\n <div class=\"d-flex justify-content-end\">\n <div class=\"btn-group\" role=\"group\" aria-label=\"Controls\">\n <button type=\"button\" id=\"draggableHandle\" class=\"btn btn-light\" data-toggle=\"tooltip\" data-placement=\"top\"\n title=\"Move toolbar\">\n <i class=\"bi bi-grip-vertical\"></i>\n </button>\n\n <button type=\"button\" id=\"dagre_layout\" class=\"btn btn-secondary\" data-toggle=\"tooltip\" data-placement=\"top\"\n title=\"Dagre layout\" (click)=\"applyLayout()\">\n <i class=\"bi bi-diagram-3\"></i>\n </button>\n <button type=\"button\" id=\"save_graph\" class=\"btn btn-secondary\" data-toggle=\"tooltip\" data-placement=\"top\"\n title=\"Save data\" (click)=\"onConfirmSave()\">\n <i class=\"bi bi-save\"></i>\n </button>\n <button type=\"button\" id=\"reset_graph\" class=\"btn btn-secondary\" data-toggle=\"tooltip\" data-placement=\"top\"\n title=\"Reset data\" (click)=\"resetGraph()\">\n <i class=\"bi bi-skip-backward\"></i>\n </button>\n <button type=\"button\" *ngIf=\"zoom\" class=\"btn btn-secondary\" data-toggle=\"tooltip\" data-placement=\"top\"\n title=\"Zoom in\" id=\"zoom_in\">\n <i class=\"bi bi-zoom-in\"></i>\n </button>\n <button type=\"button\" *ngIf=\"zoom\" class=\"btn btn-secondary\" data-toggle=\"tooltip\" data-placement=\"top\"\n title=\"Zoom out\" id=\"zoom_out\">\n <i class=\"bi bi-zoom-out\"></i>\n </button>\n <button type=\"button\" *ngIf=\"zoom\" class=\"btn btn-secondary\" data-toggle=\"tooltip\" data-placement=\"top\"\n title=\"Zoom reset\" id=\"zoom_reset\" disabled=\"true\">\n <i class=\"bi bi-arrow-counterclockwise\"></i>\n </button>\n <button type=\"button\" *ngIf=\"zoom\" class=\"btn btn-secondary\" data-toggle=\"tooltip\" data-placement=\"top\"\n title=\"Zoom to fit\" id=\"zoom_to_fit\">\n <i class=\"bi bi-arrows-fullscreen\"></i>\n </button>\n <button type=\"button\" *ngIf=\"zoom\" class=\"btn btn-secondary\" data-toggle=\"tooltip\" data-placement=\"top\"\n title=\"Select all\" id=\"select_all\">\n <i class=\"bi bi-grid-fill\"></i>\n </button>\n <button type=\"button\" *ngIf=\"zoom\" class=\"btn btn-secondary\" data-toggle=\"tooltip\" data-placement=\"top\"\n title=\"Invert selection\" id=\"toggle_selection\">\n <i class=\"bi bi-ui-checks-grid\"></i>\n </button>\n <button type=\"button\" class=\"btn btn-secondary\" data-toggle=\"tooltip\" data-placement=\"top\"\n title=\"Toggle search\" id=\"toggle_search\"\n [ngClass]=\"{'searchButtonActive': showSearch, 'searchButtonInactive': !showSearch}\"\n (click)=\"toggleSearch()\">\n <i class=\"bi bi-search\"></i>\n </button>\n </div>\n </div>\n <div class=\"search float-right input-group mt-3 pr-0\" [hidden]=\"!showSearch\">\n <div class=\"input-group-prepend\">\n <button type=\"button\" id=\"prevButton\" class=\"btn btn-secondary\" data-toggle=\"tooltip\" data-placement=\"top\"\n title=\"Previous\" disabled>\n <i class=\"bi bi-arrow-left-square\"></i>\n </button>\n <button type=\"button\" id=\"nextButton\" class=\"btn btn-secondary\" data-toggle=\"tooltip\" data-placement=\"top\"\n title=\"Next\" disabled>\n <i class=\"bi bi-arrow-right-square\"></i>\n </button>\n </div>\n <input type=\"text\" id=\"searchInput\" class=\"form-control\" placeholder=\"Search\" aria-label=\"Search\"\n aria-describedby=\"search\" />\n <div class=\"input-group-append\">\n <button class=\"btn btn-outline-secondary\" type=\"button\" id=\"searchButton\" data-toggle=\"tooltip\"\n data-placement=\"top\" title=\"Search\">\n <i class=\"bi bi-search\"></i>\n </button>\n </div>\n <div class=\"input-group-append\">\n <button class=\"btn btn-outline-secondary\" type=\"button\" id=\"clearButton\" data-toggle=\"tooltip\"\n data-placement=\"top\" title=\"Clear\" disabled>\n clear\n </button>\n </div>\n </div>\n </div>\n <div [hidden]=\"!showSearch\" id=\"noMatchesText\" class=\"noMatchesText float-right\">No matches found</div>\n </div>\n <!-- Zoom indicator-->\n <div *ngIf=\"zoom\" class=\"zoomIndicator\">\n <span id=\"zoom_level\"></span>\n </div>\n\n <app-context-menus\n (editNodeContextMenuEvent)=\"handleEditNodesEvent($event)\"\n (findCreateNodesContextMenuEvent)=\"findCreateNodesEvent($event)\"\n (createLinkContextMenuEvent)=\"handleCreateLinksEvent($event)\"\n (editLinkLabelContextMenuEvent)=\"onEditLinkLabel()\"\n (editLinksContextMenuEvent)=\"handleEditLinksEvent($event)\">\n </app-context-menus>\n\n <app-modals\n [editNodeData]=\"editNodeData\"\n [editLinksData]=\"editLinksData\"\n (createEditLinkEvent)=\"onCreateEditLink($event)\"\n (createEditNodeEvent)=\"onCreateEditNode($event)\"\n (deleteLinkEvent)=\"onDeleteLink($event)\"\n (deleteNodeEvent)=\"onDeleteNode()\">\n </app-modals>\n\n <svg #svgId [attr.width]=\"width\" height=\"780\" (click)=\"dismissContextMenu($event)\" (contextmenu)=\"visualiserContextMenus($event)\"></svg>\n</div>", styles: ["@import\"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css\";@import\"https://cdnjs.cloudflare.com/ajax/libs/bootstrap/4.6.2/css/bootstrap.min.css\";@import\"https://cdn.jsdelivr.net/npm/bootstrap-icons@1.3.0/font/bootstrap-icons.css\";#zoom_level{position:relative;background-color:#000c;color:#fff;padding:5px;border-radius:5px;opacity:0;transition:opacity 1s ease-in-out}.buttonBar{position:absolute;padding:10px}.zoomIndicator{position:absolute;left:0;padding:10px}.noMatchesText{opacity:0;transition:opacity .5s;color:red}.noMatchesText.show{opacity:1}@keyframes floatInFromTop{0%{opacity:0;transform:translateY(-100%)}to{opacity:1;transform:translateY(0)}}.input-group{animation-name:floatInFromTop;animation-duration:.3s;animation-fill-mode:forwards;position:relative;width:407px}.searchButtonActive{outline:none;-webkit-box-shadow:inset 0px 0px 5px #323232;-moz-box-shadow:inset 0px 0px 5px #323232;box-shadow:inset 0 0 5px #323232}.searchButtonActive:focus,.searchButtonActive:active{outline:none;-webkit-box-shadow:inset 0px 0px 5px #323232;-moz-box-shadow:inset 0px 0px 5px #323232;box-shadow:inset 0 0 5px #323232}.searchButtonInactive{opacity:1;outline:none;box-shadow:none;background-color:#6c757d!important;border-color:#6c757d!important}#draggableHandle{cursor:move}@media (max-width: 768px){.buttonBar{flex-direction:column;align-items:flex-start}.btn-group{flex-direction:column}.btn-group .btn{width:100%;margin-bottom:5px}}\n"], dependencies: [{ kind: "directive", type: i4.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: ContextMenusComponent, selector: "app-context-menus", outputs: ["editNodeContextMenuEvent", "findCreateNodesContextMenuEvent", "createLinkContextMenuEvent", "editLinkLabelContextMenuEvent", "editLinksContextMenuEvent"] }, { kind: "component", type: ModalsComponent, selector: "app-modals", inputs: ["editNodeData", "editLinksData"], outputs: ["closeModalEvent", "createEditLinkEvent", "createEditNodeEvent", "deleteLinkEvent", "deleteNodeEvent"] }] });
2703
2810
  }
2704
2811
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: VisualiserGraphComponent, decorators: [{
2705
2812
  type: Component,
2706
- args: [{ selector: 'visualiser-graph', template: "<div class=\"page\" id=\"pageId\" (window:resize)=\"onResize()\">\n <div id=\"draggable\" class=\"buttonBar\" [style.right]=\"buttonBarRightPosition\">\n <div *ngIf=\"controls\">\n <div class=\"d-flex justify-content-end\">\n <div class=\"btn-group\" role=\"group\" aria-label=\"Controls\">\n <button type=\"button\" id=\"draggableHandle\" class=\"btn btn-light\" data-toggle=\"tooltip\" data-placement=\"top\"\n title=\"Move toolbar\">\n <i class=\"bi bi-grip-vertical\"></i>\n </button>\n\n <button type=\"button\" id=\"dagre_layout\" class=\"btn btn-secondary\" data-toggle=\"tooltip\" data-placement=\"top\"\n title=\"Dagre layout\" (click)=\"applyLayout()\">\n <i class=\"bi bi-diagram-3\"></i>\n </button>\n <button type=\"button\" id=\"save_graph\" class=\"btn btn-secondary\" data-toggle=\"tooltip\" data-placement=\"top\"\n title=\"Save data\" (click)=\"onConfirmSave()\">\n <i class=\"bi bi-save\"></i>\n </button>\n <button type=\"button\" id=\"reset_graph\" class=\"btn btn-secondary\" data-toggle=\"tooltip\" data-placement=\"top\"\n title=\"Reset data\" (click)=\"resetGraph()\">\n <i class=\"bi bi-skip-backward\"></i>\n </button>\n <button type=\"button\" *ngIf=\"zoom\" class=\"btn btn-secondary\" data-toggle=\"tooltip\" data-placement=\"top\"\n title=\"Zoom in\" id=\"zoom_in\">\n <i class=\"bi bi-zoom-in\"></i>\n </button>\n <button type=\"button\" *ngIf=\"zoom\" class=\"btn btn-secondary\" data-toggle=\"tooltip\" data-placement=\"top\"\n title=\"Zoom out\" id=\"zoom_out\">\n <i class=\"bi bi-zoom-out\"></i>\n </button>\n <button type=\"button\" *ngIf=\"zoom\" class=\"btn btn-secondary\" data-toggle=\"tooltip\" data-placement=\"top\"\n title=\"Zoom reset\" id=\"zoom_reset\" disabled=\"true\">\n <i class=\"bi bi-arrow-counterclockwise\"></i>\n </button>\n <button type=\"button\" *ngIf=\"zoom\" class=\"btn btn-secondary\" data-toggle=\"tooltip\" data-placement=\"top\"\n title=\"Zoom to fit\" id=\"zoom_to_fit\">\n <i class=\"bi bi-arrows-fullscreen\"></i>\n </button>\n <button type=\"button\" *ngIf=\"zoom\" class=\"btn btn-secondary\" data-toggle=\"tooltip\" data-placement=\"top\"\n title=\"Select all\" id=\"select_all\">\n <i class=\"bi bi-grid-fill\"></i>\n </button>\n <button type=\"button\" *ngIf=\"zoom\" class=\"btn btn-secondary\" data-toggle=\"tooltip\" data-placement=\"top\"\n title=\"Invert selection\" id=\"toggle_selection\">\n <i class=\"bi bi-ui-checks-grid\"></i>\n </button>\n <button type=\"button\" class=\"btn btn-secondary\" data-toggle=\"tooltip\" data-placement=\"top\"\n title=\"Toggle search\" id=\"toggle_search\"\n [ngClass]=\"{'searchButtonActive': showSearch, 'searchButtonInactive': !showSearch}\"\n (click)=\"toggleSearch()\">\n <i class=\"bi bi-search\"></i>\n </button>\n </div>\n </div>\n <div class=\"search float-right input-group mt-3 pr-0\" [hidden]=\"!showSearch\">\n <div class=\"input-group-prepend\">\n <button type=\"button\" id=\"prevButton\" class=\"btn btn-secondary\" data-toggle=\"tooltip\" data-placement=\"top\"\n title=\"Previous\" disabled>\n <i class=\"bi bi-arrow-left-square\"></i>\n </button>\n <button type=\"button\" id=\"nextButton\" class=\"btn btn-secondary\" data-toggle=\"tooltip\" data-placement=\"top\"\n title=\"Next\" disabled>\n <i class=\"bi bi-arrow-right-square\"></i>\n </button>\n </div>\n <input type=\"text\" id=\"searchInput\" class=\"form-control\" placeholder=\"Search\" aria-label=\"Search\"\n aria-describedby=\"search\" />\n <div class=\"input-group-append\">\n <button class=\"btn btn-outline-secondary\" type=\"button\" id=\"searchButton\" data-toggle=\"tooltip\"\n data-placement=\"top\" title=\"Search\">\n <i class=\"bi bi-search\"></i>\n </button>\n </div>\n <div class=\"input-group-append\">\n <button class=\"btn btn-outline-secondary\" type=\"button\" id=\"clearButton\" data-toggle=\"tooltip\"\n data-placement=\"top\" title=\"Clear\" disabled>\n clear\n </button>\n </div>\n </div>\n </div>\n <div [hidden]=\"!showSearch\" id=\"noMatchesText\" class=\"noMatchesText float-right\">No matches found</div>\n </div>\n <!-- Zoom indicator-->\n <div *ngIf=\"zoom\" class=\"zoomIndicator\">\n <span id=\"zoom_level\"></span>\n </div>\n\n <app-context-menus\n (editNodeContextMenuEvent)=\"handleEditNodesEvent($event)\"\n (findCreateNodesContextMenuEvent)=\"findCreateNodesEvent($event)\"\n (createLinkContextMenuEvent)=\"handleCreateLinksEvent($event)\"\n (editLinkLabelContextMenuEvent)=\"onEditLinkLabel()\"\n (editLinksContextMenuEvent)=\"handleEditLinksEvent($event)\">\n </app-context-menus>\n\n <app-modals\n [editNodeData]=\"editNodeData\"\n [editLinksData]=\"editLinksData\"\n (createEditLinkEvent)=\"onCreateEditLink($event)\"\n (createEditNodeEvent)=\"onCreateEditNode($event)\"\n (deleteLinkEvent)=\"onDeleteLink($event)\"\n (deleteNodeEvent)=\"onDeleteNode()\">\n </app-modals>\n\n <svg #svgId [attr.width]=\"width\" height=\"780\" (contextmenu)=\"visualiserContextMenus($event)\"></svg>\n</div>", styles: ["@import\"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css\";@import\"https://cdnjs.cloudflare.com/ajax/libs/bootstrap/4.6.2/css/bootstrap.min.css\";@import\"https://cdn.jsdelivr.net/npm/bootstrap-icons@1.3.0/font/bootstrap-icons.css\";#zoom_level{position:relative;background-color:#000c;color:#fff;padding:5px;border-radius:5px;opacity:0;transition:opacity 1s ease-in-out}.buttonBar{position:absolute;padding:10px}.zoomIndicator{position:absolute;left:0;padding:10px}.noMatchesText{opacity:0;transition:opacity .5s;color:red}.noMatchesText.show{opacity:1}@keyframes floatInFromTop{0%{opacity:0;transform:translateY(-100%)}to{opacity:1;transform:translateY(0)}}.input-group{animation-name:floatInFromTop;animation-duration:.3s;animation-fill-mode:forwards;position:relative;width:407px}.searchButtonActive{outline:none;-webkit-box-shadow:inset 0px 0px 5px #323232;-moz-box-shadow:inset 0px 0px 5px #323232;box-shadow:inset 0 0 5px #323232}.searchButtonActive:focus,.searchButtonActive:active{outline:none;-webkit-box-shadow:inset 0px 0px 5px #323232;-moz-box-shadow:inset 0px 0px 5px #323232;box-shadow:inset 0 0 5px #323232}.searchButtonInactive{opacity:1;outline:none;box-shadow:none;background-color:#6c757d!important;border-color:#6c757d!important}#draggableHandle{cursor:move}@media (max-width: 768px){.buttonBar{flex-direction:column;align-items:flex-start}.btn-group{flex-direction:column}.btn-group .btn{width:100%;margin-bottom:5px}}\n"] }]
2813
+ args: [{ selector: 'visualiser-graph', template: "<div class=\"page\" id=\"pageId\" (window:resize)=\"onResize()\">\n <div id=\"draggable\" class=\"buttonBar\" [style.right]=\"buttonBarRightPosition\">\n <div *ngIf=\"controls\">\n <div class=\"d-flex justify-content-end\">\n <div class=\"btn-group\" role=\"group\" aria-label=\"Controls\">\n <button type=\"button\" id=\"draggableHandle\" class=\"btn btn-light\" data-toggle=\"tooltip\" data-placement=\"top\"\n title=\"Move toolbar\">\n <i class=\"bi bi-grip-vertical\"></i>\n </button>\n\n <button type=\"button\" id=\"dagre_layout\" class=\"btn btn-secondary\" data-toggle=\"tooltip\" data-placement=\"top\"\n title=\"Dagre layout\" (click)=\"applyLayout()\">\n <i class=\"bi bi-diagram-3\"></i>\n </button>\n <button type=\"button\" id=\"save_graph\" class=\"btn btn-secondary\" data-toggle=\"tooltip\" data-placement=\"top\"\n title=\"Save data\" (click)=\"onConfirmSave()\">\n <i class=\"bi bi-save\"></i>\n </button>\n <button type=\"button\" id=\"reset_graph\" class=\"btn btn-secondary\" data-toggle=\"tooltip\" data-placement=\"top\"\n title=\"Reset data\" (click)=\"resetGraph()\">\n <i class=\"bi bi-skip-backward\"></i>\n </button>\n <button type=\"button\" *ngIf=\"zoom\" class=\"btn btn-secondary\" data-toggle=\"tooltip\" data-placement=\"top\"\n title=\"Zoom in\" id=\"zoom_in\">\n <i class=\"bi bi-zoom-in\"></i>\n </button>\n <button type=\"button\" *ngIf=\"zoom\" class=\"btn btn-secondary\" data-toggle=\"tooltip\" data-placement=\"top\"\n title=\"Zoom out\" id=\"zoom_out\">\n <i class=\"bi bi-zoom-out\"></i>\n </button>\n <button type=\"button\" *ngIf=\"zoom\" class=\"btn btn-secondary\" data-toggle=\"tooltip\" data-placement=\"top\"\n title=\"Zoom reset\" id=\"zoom_reset\" disabled=\"true\">\n <i class=\"bi bi-arrow-counterclockwise\"></i>\n </button>\n <button type=\"button\" *ngIf=\"zoom\" class=\"btn btn-secondary\" data-toggle=\"tooltip\" data-placement=\"top\"\n title=\"Zoom to fit\" id=\"zoom_to_fit\">\n <i class=\"bi bi-arrows-fullscreen\"></i>\n </button>\n <button type=\"button\" *ngIf=\"zoom\" class=\"btn btn-secondary\" data-toggle=\"tooltip\" data-placement=\"top\"\n title=\"Select all\" id=\"select_all\">\n <i class=\"bi bi-grid-fill\"></i>\n </button>\n <button type=\"button\" *ngIf=\"zoom\" class=\"btn btn-secondary\" data-toggle=\"tooltip\" data-placement=\"top\"\n title=\"Invert selection\" id=\"toggle_selection\">\n <i class=\"bi bi-ui-checks-grid\"></i>\n </button>\n <button type=\"button\" class=\"btn btn-secondary\" data-toggle=\"tooltip\" data-placement=\"top\"\n title=\"Toggle search\" id=\"toggle_search\"\n [ngClass]=\"{'searchButtonActive': showSearch, 'searchButtonInactive': !showSearch}\"\n (click)=\"toggleSearch()\">\n <i class=\"bi bi-search\"></i>\n </button>\n </div>\n </div>\n <div class=\"search float-right input-group mt-3 pr-0\" [hidden]=\"!showSearch\">\n <div class=\"input-group-prepend\">\n <button type=\"button\" id=\"prevButton\" class=\"btn btn-secondary\" data-toggle=\"tooltip\" data-placement=\"top\"\n title=\"Previous\" disabled>\n <i class=\"bi bi-arrow-left-square\"></i>\n </button>\n <button type=\"button\" id=\"nextButton\" class=\"btn btn-secondary\" data-toggle=\"tooltip\" data-placement=\"top\"\n title=\"Next\" disabled>\n <i class=\"bi bi-arrow-right-square\"></i>\n </button>\n </div>\n <input type=\"text\" id=\"searchInput\" class=\"form-control\" placeholder=\"Search\" aria-label=\"Search\"\n aria-describedby=\"search\" />\n <div class=\"input-group-append\">\n <button class=\"btn btn-outline-secondary\" type=\"button\" id=\"searchButton\" data-toggle=\"tooltip\"\n data-placement=\"top\" title=\"Search\">\n <i class=\"bi bi-search\"></i>\n </button>\n </div>\n <div class=\"input-group-append\">\n <button class=\"btn btn-outline-secondary\" type=\"button\" id=\"clearButton\" data-toggle=\"tooltip\"\n data-placement=\"top\" title=\"Clear\" disabled>\n clear\n </button>\n </div>\n </div>\n </div>\n <div [hidden]=\"!showSearch\" id=\"noMatchesText\" class=\"noMatchesText float-right\">No matches found</div>\n </div>\n <!-- Zoom indicator-->\n <div *ngIf=\"zoom\" class=\"zoomIndicator\">\n <span id=\"zoom_level\"></span>\n </div>\n\n <app-context-menus\n (editNodeContextMenuEvent)=\"handleEditNodesEvent($event)\"\n (findCreateNodesContextMenuEvent)=\"findCreateNodesEvent($event)\"\n (createLinkContextMenuEvent)=\"handleCreateLinksEvent($event)\"\n (editLinkLabelContextMenuEvent)=\"onEditLinkLabel()\"\n (editLinksContextMenuEvent)=\"handleEditLinksEvent($event)\">\n </app-context-menus>\n\n <app-modals\n [editNodeData]=\"editNodeData\"\n [editLinksData]=\"editLinksData\"\n (createEditLinkEvent)=\"onCreateEditLink($event)\"\n (createEditNodeEvent)=\"onCreateEditNode($event)\"\n (deleteLinkEvent)=\"onDeleteLink($event)\"\n (deleteNodeEvent)=\"onDeleteNode()\">\n </app-modals>\n\n <svg #svgId [attr.width]=\"width\" height=\"780\" (click)=\"dismissContextMenu($event)\" (contextmenu)=\"visualiserContextMenus($event)\"></svg>\n</div>", styles: ["@import\"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css\";@import\"https://cdnjs.cloudflare.com/ajax/libs/bootstrap/4.6.2/css/bootstrap.min.css\";@import\"https://cdn.jsdelivr.net/npm/bootstrap-icons@1.3.0/font/bootstrap-icons.css\";#zoom_level{position:relative;background-color:#000c;color:#fff;padding:5px;border-radius:5px;opacity:0;transition:opacity 1s ease-in-out}.buttonBar{position:absolute;padding:10px}.zoomIndicator{position:absolute;left:0;padding:10px}.noMatchesText{opacity:0;transition:opacity .5s;color:red}.noMatchesText.show{opacity:1}@keyframes floatInFromTop{0%{opacity:0;transform:translateY(-100%)}to{opacity:1;transform:translateY(0)}}.input-group{animation-name:floatInFromTop;animation-duration:.3s;animation-fill-mode:forwards;position:relative;width:407px}.searchButtonActive{outline:none;-webkit-box-shadow:inset 0px 0px 5px #323232;-moz-box-shadow:inset 0px 0px 5px #323232;box-shadow:inset 0 0 5px #323232}.searchButtonActive:focus,.searchButtonActive:active{outline:none;-webkit-box-shadow:inset 0px 0px 5px #323232;-moz-box-shadow:inset 0px 0px 5px #323232;box-shadow:inset 0 0 5px #323232}.searchButtonInactive{opacity:1;outline:none;box-shadow:none;background-color:#6c757d!important;border-color:#6c757d!important}#draggableHandle{cursor:move}@media (max-width: 768px){.buttonBar{flex-direction:column;align-items:flex-start}.btn-group{flex-direction:column}.btn-group .btn{width:100%;margin-bottom:5px}}\n"] }]
2707
2814
  }], ctorParameters: () => [{ type: VisualiserGraphService }, { type: i2.ContextMenuService }, { type: DagreNodesOnlyLayout }, { type: DexieService }], propDecorators: { graphElement: [{
2708
2815
  type: ViewChild,
2709
2816
  args: ['svgId']