|
1 |
| -<svg |
2 |
| - class="roadmap-container" |
3 |
| - width="100%" |
4 |
| - height="100%" |
5 |
| - xmlns:svg="http://www.w3.org/1999/html" |
6 |
| -> |
7 |
| - <svg:foreignObject |
8 |
| - style="transform: translateX(calc(50% - {{ layoutEl.clientWidth / 2 }}px))" |
9 |
| - height="0" |
10 |
| - width="0" |
11 |
| - overflow="visible" |
| 1 | +<div class="relative h-full w-full"> |
| 2 | + <svg |
| 3 | + #roadmap |
| 4 | + height="100%" |
| 5 | + width="100%" |
| 6 | + xmlns:svg="http://www.w3.org/1999/html" |
12 | 7 | >
|
13 |
| - <div |
14 |
| - #layoutEl |
15 |
| - class="relative flex h-fit w-fit translate-y-16 flex-col items-center gap-16" |
| 8 | + <svg:foreignObject |
| 9 | + overflow="visible" |
| 10 | + style="transform: translateX(calc(50% - {{ |
| 11 | + layoutEl.clientWidth / 2 |
| 12 | + }}px))" |
16 | 13 | >
|
17 |
| - @for (layer of roadmapLayers(); track layer.parentNode.id) { |
18 |
| - <div #layerEl class="flex w-full flex-col items-center gap-16"> |
19 |
| - @if (!$last) { |
20 |
| - @let layerHeightWithGap = layerEl.clientHeight + 64 - 24 || 0; |
21 |
| - <svg |
22 |
| - [attr.height]="layerHeightWithGap" |
23 |
| - style="position: absolute" |
24 |
| - overflow="visible" |
25 |
| - width="100" |
26 |
| - xmlns="http://www.w3.org/2000/svg" |
27 |
| - > |
28 |
| - <defs> |
29 |
| - <marker |
30 |
| - id="arrowhead" |
31 |
| - markerWidth="6" |
32 |
| - markerHeight="8" |
33 |
| - refX="0" |
34 |
| - refY="4" |
35 |
| - orient="auto" |
36 |
| - > |
37 |
| - <polygon points="0 0, 6 4, 0 8" fill="#FDF5FD" /> |
38 |
| - </marker> |
39 |
| - </defs> |
40 |
| - <line |
41 |
| - [attr.y2]="layerHeightWithGap" |
42 |
| - x1="50" |
43 |
| - y1="0" |
44 |
| - x2="50" |
45 |
| - stroke="white" |
46 |
| - stroke-width="4" |
47 |
| - marker-end="url(#arrowhead)" |
48 |
| - /> |
49 |
| - </svg> |
50 |
| - } |
| 14 | + <div |
| 15 | + #layoutEl |
| 16 | + class="relative flex h-fit w-fit translate-y-16 flex-col items-center gap-16" |
| 17 | + > |
| 18 | + @for (layer of roadmapLayers(); track layer.parentNode.id) { |
| 19 | + <div #layerEl class="flex w-full flex-col items-center gap-16"> |
| 20 | + @if (!$last) { |
| 21 | + @let layerHeightWithGap = layerEl.clientHeight + 64 - 24 || 0; |
| 22 | + <svg |
| 23 | + [attr.height]="layerHeightWithGap" |
| 24 | + style="position: absolute" |
| 25 | + overflow="visible" |
| 26 | + width="100" |
| 27 | + xmlns="http://www.w3.org/2000/svg" |
| 28 | + > |
| 29 | + <defs> |
| 30 | + <marker |
| 31 | + id="arrowhead" |
| 32 | + markerWidth="6" |
| 33 | + markerHeight="8" |
| 34 | + refX="0" |
| 35 | + refY="4" |
| 36 | + orient="auto" |
| 37 | + > |
| 38 | + <polygon points="0 0, 6 4, 0 8" fill="#FDF5FD" /> |
| 39 | + </marker> |
| 40 | + </defs> |
| 41 | + <line |
| 42 | + [attr.y2]="layerHeightWithGap" |
| 43 | + x1="50" |
| 44 | + y1="0" |
| 45 | + x2="50" |
| 46 | + stroke="white" |
| 47 | + stroke-width="4" |
| 48 | + marker-end="url(#arrowhead)" |
| 49 | + /> |
| 50 | + </svg> |
| 51 | + } |
51 | 52 |
|
52 |
| - <!-- layer parent node--> |
53 |
| - @if (layer.parentNode.nodeType === 'primary') { |
54 |
| - <al-ui-roadmap-primary-node [node]="layer.parentNode" /> |
55 |
| - } @else if (layer.parentNode.nodeType === 'angular-love') { |
56 |
| - <al-ui-roadmap-angular-love-node |
57 |
| - [node]="layer.parentNode" |
58 |
| - ></al-ui-roadmap-angular-love-node> |
59 |
| - } |
| 53 | + <!-- layer parent node--> |
| 54 | + @if (layer.parentNode.nodeType === 'primary') { |
| 55 | + <al-ui-roadmap-primary-node [node]="layer.parentNode" /> |
| 56 | + } @else if (layer.parentNode.nodeType === 'angular-love') { |
| 57 | + <al-ui-roadmap-angular-love-node |
| 58 | + [node]="layer.parentNode" |
| 59 | + ></al-ui-roadmap-angular-love-node> |
| 60 | + } |
60 | 61 |
|
61 |
| - <!-- layer child nodes--> |
62 |
| - @if (layer.childNodes?.length) { |
63 |
| - @let shift = |
64 |
| - (allChildNodesEl.clientWidth / 2 - leftChildNodesEl.clientWidth || |
65 |
| - 0) - 32; |
66 |
| - <div |
67 |
| - #allChildNodesEl |
68 |
| - class="flex gap-16" |
69 |
| - style="transform: translate({{ shift }}px)" |
70 |
| - > |
71 |
| - <div #leftChildNodesEl class="flex gap-12"> |
72 |
| - @let centerShift = layerEl.clientWidth / 2 - shift; |
73 |
| - @for (node of layer.childNodes | leftSlice; track node.id) { |
| 62 | + <!-- layer child nodes--> |
| 63 | + @if (layer.childNodes?.length) { |
| 64 | + @let shift = |
| 65 | + (allChildNodesEl.clientWidth / 2 - |
| 66 | + leftChildNodesEl.clientWidth || 0) - 32; |
| 67 | + <div |
| 68 | + #allChildNodesEl |
| 69 | + class="flex gap-16" |
| 70 | + style="transform: translate({{ shift }}px)" |
| 71 | + > |
| 72 | + <div #leftChildNodesEl class="flex gap-12"> |
| 73 | + @let centerShift = layerEl.clientWidth / 2 - shift; |
| 74 | + @for (node of layer.childNodes | leftSlice; track node.id) { |
| 75 | + @let arrowShift = |
| 76 | + secondaryNode.offsetLeft - |
| 77 | + centerShift + |
| 78 | + secondaryNode.clientWidth / 2; |
| 79 | + <svg |
| 80 | + [attr.height]="64" |
| 81 | + style="position: absolute; top: -64px; left: {{ |
| 82 | + centerShift |
| 83 | + }}px" |
| 84 | + overflow="visible" |
| 85 | + width="1" |
| 86 | + xmlns="http://www.w3.org/2000/svg" |
| 87 | + > |
| 88 | + <svg:path |
| 89 | + [attr.d]="arrowShift | secondaryArrow: $first" |
| 90 | + fill="none" |
| 91 | + stroke="#FDF5FD" |
| 92 | + stroke-width="2" |
| 93 | + stroke-linecap="round" |
| 94 | + stroke-linejoin="round" |
| 95 | + /> |
| 96 | + </svg> |
| 97 | + <div #secondaryNode> |
| 98 | + @if (node.nodeType === 'secondary') { |
| 99 | + <al-ui-roadmap-secondary-node [node]="node" /> |
| 100 | + } @else if (node.nodeType === 'cluster') { |
| 101 | + <al-ui-roadmap-cluster |
| 102 | + [cluster]="$any(node)" |
| 103 | + ></al-ui-roadmap-cluster> |
| 104 | + } |
| 105 | + </div> |
| 106 | + } |
| 107 | + </div> |
| 108 | + @for (node of layer.childNodes | rightSlice; track node.id) { |
74 | 109 | @let arrowShift =
|
75 | 110 | secondaryNode.offsetLeft -
|
76 | 111 | centerShift +
|
|
85 | 120 | xmlns="http://www.w3.org/2000/svg"
|
86 | 121 | >
|
87 | 122 | <svg:path
|
88 |
| - [attr.d]="arrowShift | secondaryArrow: $first" |
| 123 | + [attr.d]="arrowShift | secondaryArrow: $last" |
89 | 124 | fill="none"
|
90 | 125 | stroke="#FDF5FD"
|
91 | 126 | stroke-width="2"
|
|
104 | 139 | </div>
|
105 | 140 | }
|
106 | 141 | </div>
|
107 |
| - @for (node of layer.childNodes | rightSlice; track node.id) { |
108 |
| - @let arrowShift = |
109 |
| - secondaryNode.offsetLeft - |
110 |
| - centerShift + |
111 |
| - secondaryNode.clientWidth / 2; |
112 |
| - <svg |
113 |
| - [attr.height]="64" |
114 |
| - style="position: absolute; top: -64px; left: {{ |
115 |
| - centerShift |
116 |
| - }}px" |
117 |
| - overflow="visible" |
118 |
| - width="1" |
119 |
| - xmlns="http://www.w3.org/2000/svg" |
120 |
| - > |
121 |
| - <svg:path |
122 |
| - [attr.d]="arrowShift | secondaryArrow: $last" |
123 |
| - fill="none" |
124 |
| - stroke="#FDF5FD" |
125 |
| - stroke-width="2" |
126 |
| - stroke-linecap="round" |
127 |
| - stroke-linejoin="round" |
128 |
| - /> |
129 |
| - </svg> |
130 |
| - <div #secondaryNode> |
131 |
| - @if (node.nodeType === 'secondary') { |
132 |
| - <al-ui-roadmap-secondary-node [node]="node" /> |
133 |
| - } @else if (node.nodeType === 'cluster') { |
134 |
| - <al-ui-roadmap-cluster |
135 |
| - [cluster]="$any(node)" |
136 |
| - ></al-ui-roadmap-cluster> |
137 |
| - } |
138 |
| - </div> |
139 |
| - } |
140 |
| - </div> |
141 |
| - } |
142 |
| - </div> |
143 |
| - } |
144 |
| - </div> |
145 |
| - </svg:foreignObject> |
146 |
| -</svg> |
| 142 | + } |
| 143 | + </div> |
| 144 | + } |
| 145 | + </div> |
| 146 | + </svg:foreignObject> |
| 147 | + </svg> |
| 148 | + <div |
| 149 | + class="absolute bottom-4 right-4 flex h-fit w-fit flex-col items-center gap-8" |
| 150 | + > |
| 151 | + @for (control of controls; track $index) { |
| 152 | + <al-ui-roadmap-svg-control |
| 153 | + [size]="control.size" |
| 154 | + [event]="control.event" |
| 155 | + [iconName]="control.name" |
| 156 | + (resizeRoadmap)="resizeRoadmap($event)" |
| 157 | + /> |
| 158 | + } |
| 159 | + </div> |
| 160 | +</div> |
0 commit comments