|
1 |
| -<svg #svg width="100%" height="100%" xmlns:svg="http://www.w3.org/1999/html"> |
2 |
| - <svg:defs> |
3 |
| - <marker |
4 |
| - id="arrowhead" |
5 |
| - markerWidth="6" |
6 |
| - markerHeight="8" |
7 |
| - refX="0" |
8 |
| - refY="4" |
9 |
| - orient="auto" |
10 |
| - > |
11 |
| - <polygon points="0 0, 6 4, 0 8" fill="#FDF5FD" /> |
12 |
| - </marker> |
13 |
| - </svg:defs> |
14 |
| - |
| 1 | +<svg width="100%" height="100%" xmlns:svg="http://www.w3.org/1999/html"> |
15 | 2 | <svg:foreignObject height="0" width="0" overflow="visible">
|
16 | 3 | <div
|
17 |
| - class="flex h-fit w-fit translate-x-80 translate-y-16 flex-col items-center gap-16" |
| 4 | + class="relative flex h-fit w-fit translate-x-80 translate-y-16 flex-col items-center gap-16" |
18 | 5 | >
|
19 | 6 | @for (layer of roadmapLayers(); track layer.parentNode.id) {
|
20 |
| - <div class="flex w-full flex-col items-center gap-12"> |
| 7 | + <div #layerEl class="flex w-full flex-col items-center gap-16"> |
| 8 | + @if (!$last) { |
| 9 | + @let layerHeightWithGap = layerEl.clientHeight + 64 - 24 || 0; |
| 10 | + <svg |
| 11 | + [attr.height]="layerHeightWithGap" |
| 12 | + style="position: absolute" |
| 13 | + overflow="visible" |
| 14 | + width="100" |
| 15 | + xmlns="http://www.w3.org/2000/svg" |
| 16 | + > |
| 17 | + <svg:defs> |
| 18 | + <marker |
| 19 | + id="arrowhead" |
| 20 | + markerWidth="6" |
| 21 | + markerHeight="8" |
| 22 | + refX="0" |
| 23 | + refY="4" |
| 24 | + orient="auto" |
| 25 | + > |
| 26 | + <polygon points="0 0, 6 4, 0 8" fill="#FDF5FD" /> |
| 27 | + </marker> |
| 28 | + </svg:defs> |
| 29 | + <line |
| 30 | + [attr.y2]="layerHeightWithGap" |
| 31 | + x1="50" |
| 32 | + y1="0" |
| 33 | + x2="50" |
| 34 | + stroke="white" |
| 35 | + stroke-width="4" |
| 36 | + marker-end="url(#arrowhead)" |
| 37 | + /> |
| 38 | + </svg> |
| 39 | + } |
| 40 | + |
| 41 | + <!-- layer parent node--> |
21 | 42 | @if (layer.parentNode.nodeType === 'primary') {
|
22 | 43 | <al-ui-roadmap-primary-node [node]="layer.parentNode" />
|
23 | 44 | } @else if (layer.parentNode.nodeType === 'angular-love') {
|
24 | 45 | <al-ui-roadmap-angular-love-node
|
25 | 46 | [node]="layer.parentNode"
|
26 | 47 | ></al-ui-roadmap-angular-love-node>
|
27 | 48 | }
|
| 49 | + |
| 50 | + <!-- layer child nodes--> |
28 | 51 | @if (layer.childNodes?.length) {
|
29 |
| - <div class="flex gap-12"> |
30 |
| - @for (node of layer.childNodes | leftSlice; track node.id) { |
31 |
| - <div class="flex gap-10"> |
32 |
| - @if (node.nodeType === 'secondary') { |
33 |
| - <al-ui-roadmap-secondary-node [node]="node" /> |
34 |
| - } @else if (node.nodeType === 'cluster') { |
35 |
| - <al-ui-roadmap-cluster |
36 |
| - [cluster]="$any(node)" |
37 |
| - ></al-ui-roadmap-cluster> |
38 |
| - } |
39 |
| - </div> |
40 |
| - } |
| 52 | + <div |
| 53 | + #allChildNodesEl |
| 54 | + class="translate-x-[{{ |
| 55 | + allChildNodesEl.clientWidth - leftChildNodesEl.clientWidth |
| 56 | + }}px] flex gap-12" |
| 57 | + > |
| 58 | + <div #leftChildNodesEl class="flex gap-12"> |
| 59 | + @for (node of layer.childNodes | leftSlice; track node.id) { |
| 60 | + <div class="flex gap-10"> |
| 61 | + @if (node.nodeType === 'secondary') { |
| 62 | + <al-ui-roadmap-secondary-node [node]="node" /> |
| 63 | + } @else if (node.nodeType === 'cluster') { |
| 64 | + <al-ui-roadmap-cluster |
| 65 | + [cluster]="$any(node)" |
| 66 | + ></al-ui-roadmap-cluster> |
| 67 | + } |
| 68 | + </div> |
| 69 | + } |
| 70 | + </div> |
41 | 71 | @for (node of layer.childNodes | rightSlice; track node.id) {
|
42 | 72 | <div class="flex gap-10">
|
43 | 73 | @if (node.nodeType === 'secondary') {
|
|
0 commit comments