|
5 | 5 | [style.transform]="layoutOuterTransform" |
6 | 6 | [style.transform-origin]="layoutEffectTransformOrigin" |
7 | 7 | [style.width.px]="width" |
8 | | - [@animationState]="'active'" |
9 | | - [@.disabled]="!animate" |
| 8 | + [animate.enter]="animate() ? 'ngx-graph-outer-fade' : null" |
10 | 9 | (mouseWheelUp)="onZoom($event, 'in')" |
11 | 10 | (mouseWheelDown)="onZoom($event, 'out')" |
12 | 11 | mouseWheel |
|
20 | 19 | class="graph chart" |
21 | 20 | > |
22 | 21 | <defs> |
23 | | - @if (defsTemplate) { |
24 | | - <ng-container [ngTemplateOutlet]="defsTemplate"></ng-container> |
| 22 | + @if (defsTemplate()) { |
| 23 | + <ng-container [ngTemplateOutlet]="defsTemplate()"></ng-container> |
25 | 24 | } |
26 | 25 | @for (link of graph.edges; track link) { |
27 | 26 | <svg:path class="text-path" [attr.id]="link.id"></svg:path> |
|
40 | 39 | <svg:g |
41 | 40 | #clusterElement |
42 | 41 | class="node-group" |
43 | | - [class.old-node]="(animate || layoutJsMorphEnabled) && oldClusters.has(node.id)" |
| 42 | + [class.old-node]="(animate() || layoutJsMorphEnabled) && oldClusters.has(node.id)" |
44 | 43 | [id]="node.id" |
45 | 44 | [attr.transform]="node.transform" |
46 | 45 | (click)="onClick(node)" |
47 | 46 | > |
48 | | - @if (clusterTemplate && !node.hidden) { |
| 47 | + @if (clusterTemplate() && !node.hidden) { |
49 | 48 | <ng-container |
50 | | - [ngTemplateOutlet]="clusterTemplate" |
| 49 | + [ngTemplateOutlet]="clusterTemplate()" |
51 | 50 | [ngTemplateOutletContext]="{ $implicit: node, transitionAfterChangesActive: layoutJsMorphEnabled }" |
52 | 51 | ></ng-container> |
53 | 52 | } |
54 | | - @if (!clusterTemplate && !node.hidden) { |
| 53 | + @if (!clusterTemplate() && !node.hidden) { |
55 | 54 | <svg:g class="node cluster"> |
56 | 55 | <svg:rect |
57 | 56 | [attr.width]="node.dimension.width" |
|
71 | 70 | <svg:g |
72 | 71 | #nodeElement |
73 | 72 | class="node-group" |
74 | | - [class.old-node]="(animate || layoutJsMorphEnabled) && oldCompoundNodes.has(node.id)" |
| 73 | + [class.old-node]="(animate() || layoutJsMorphEnabled) && oldCompoundNodes.has(node.id)" |
75 | 74 | [id]="node.id" |
76 | 75 | [attr.transform]="node.transform" |
77 | 76 | (click)="onClick(node)" |
78 | 77 | (mousedown)="onNodeMouseDown($event, node)" |
79 | 78 | > |
80 | | - @if (nodeTemplate && !node.hidden) { |
| 79 | + @if (nodeTemplate() && !node.hidden) { |
81 | 80 | <ng-container |
82 | | - [ngTemplateOutlet]="nodeTemplate" |
| 81 | + [ngTemplateOutlet]="nodeTemplate()" |
83 | 82 | [ngTemplateOutletContext]="{ $implicit: node, transitionAfterChangesActive: layoutJsMorphEnabled }" |
84 | 83 | ></ng-container> |
85 | 84 | } |
86 | | - @if (!nodeTemplate && !node.hidden) { |
| 85 | + @if (!nodeTemplate() && !node.hidden) { |
87 | 86 | <svg:g class="node compound-node"> |
88 | 87 | <svg:rect |
89 | 88 | [attr.width]="node.dimension.width" |
|
101 | 100 | <svg:g class="links"> |
102 | 101 | @for (link of graph.edges; track trackLinkBy($index, link)) { |
103 | 102 | <svg:g #linkElement class="link-group" [id]="link.id"> |
104 | | - @if (linkTemplate) { |
| 103 | + @if (linkTemplate()) { |
105 | 104 | <ng-container |
106 | | - [ngTemplateOutlet]="linkTemplate" |
| 105 | + [ngTemplateOutlet]="linkTemplate()" |
107 | 106 | [ngTemplateOutletContext]="{ $implicit: link, transitionAfterChangesActive: layoutJsMorphEnabled }" |
108 | 107 | ></ng-container> |
109 | 108 | } |
110 | | - @if (!linkTemplate) { |
| 109 | + @if (!linkTemplate()) { |
111 | 110 | <svg:path class="edge line" /> |
112 | 111 | } |
113 | 112 | </svg:g> |
|
118 | 117 | <svg:g |
119 | 118 | #nodeElement |
120 | 119 | class="node-group" |
121 | | - [class.old-node]="(animate || layoutJsMorphEnabled) && oldNodes.has(node.id)" |
| 120 | + [class.old-node]="(animate() || layoutJsMorphEnabled) && oldNodes.has(node.id)" |
122 | 121 | [id]="node.id" |
123 | 122 | [attr.transform]="node.transform" |
124 | 123 | (click)="onClick(node)" |
125 | 124 | (mousedown)="onNodeMouseDown($event, node)" |
126 | 125 | > |
127 | | - @if (nodeTemplate && !node.hidden) { |
| 126 | + @if (nodeTemplate() && !node.hidden) { |
128 | 127 | <ng-container |
129 | | - [ngTemplateOutlet]="nodeTemplate" |
| 128 | + [ngTemplateOutlet]="nodeTemplate()" |
130 | 129 | [ngTemplateOutletContext]="{ $implicit: node, transitionAfterChangesActive: layoutJsMorphEnabled }" |
131 | 130 | ></ng-container> |
132 | 131 | } |
133 | | - @if (!nodeTemplate && !node.hidden) { |
| 132 | + @if (!nodeTemplate() && !node.hidden) { |
134 | 133 | <svg:circle |
135 | 134 | [attr.r]="defaultNodeCircleRadius(node)" |
136 | 135 | [attr.cx]="node.dimension.width / 2" |
|
151 | 150 | ></svg:rect> |
152 | 151 | </svg:clipPath> |
153 | 152 |
|
154 | | - @if (showMiniMap) { |
| 153 | + @if (showMiniMap()) { |
155 | 154 | <svg:g class="minimap" [attr.transform]="minimapTransform" [attr.clip-path]="'url(#' + minimapClipPathId + ')'"> |
156 | 155 | <svg:rect |
157 | 156 | class="minimap-background" |
|
173 | 172 | <svg:g |
174 | 173 | #nodeElement |
175 | 174 | class="node-group" |
176 | | - [class.old-node]="(animate || layoutJsMorphEnabled) && oldNodes.has(node.id)" |
| 175 | + [class.old-node]="(animate() || layoutJsMorphEnabled) && oldNodes.has(node.id)" |
177 | 176 | [id]="node.id" |
178 | 177 | [attr.transform]="node.transform" |
179 | 178 | > |
180 | | - @if (miniMapNodeTemplate) { |
| 179 | + @if (miniMapNodeTemplate()) { |
181 | 180 | <ng-container |
182 | | - [ngTemplateOutlet]="miniMapNodeTemplate" |
| 181 | + [ngTemplateOutlet]="miniMapNodeTemplate()" |
183 | 182 | [ngTemplateOutletContext]="{ $implicit: node, transitionAfterChangesActive: layoutJsMorphEnabled }" |
184 | 183 | ></ng-container> |
185 | 184 | } |
186 | | - @if (!miniMapNodeTemplate && nodeTemplate) { |
| 185 | + @if (!miniMapNodeTemplate() && nodeTemplate()) { |
187 | 186 | <ng-container |
188 | | - [ngTemplateOutlet]="nodeTemplate" |
| 187 | + [ngTemplateOutlet]="nodeTemplate()" |
189 | 188 | [ngTemplateOutletContext]="{ $implicit: node, transitionAfterChangesActive: layoutJsMorphEnabled }" |
190 | 189 | ></ng-container> |
191 | 190 | } |
192 | | - @if (!nodeTemplate && !miniMapNodeTemplate && !node.hidden) { |
| 191 | + @if (!nodeTemplate() && !miniMapNodeTemplate() && !node.hidden) { |
193 | 192 | <svg:circle |
194 | 193 | [attr.r]="defaultNodeCircleRadius(node) / minimapScaleCoefficient" |
195 | 194 | [attr.cx]="node.dimension.width / 2 / minimapScaleCoefficient" |
|
0 commit comments