Open HariSekhon opened 1 year ago
I had tried direction: down
initially as one of the first things, but it didn't work, and nor does the invisible connection between the two, it's only ELK that makes it work when combined with both of the other two options.
I expect it's difficult to fix near
and connections to work together?
That placement control given by near
is such a key feature... as are connections... having to choose between the two or switch engines entirely seems like a pretty big limitation?
Thank you for the workaround though, I'll try that.
So since raising this ticket, I switched all the icons to shape: image
... which looked better, but when comined with --layout elk
just now, results in the arrows not reaching the icons any more, look at the middle of this diagram, the two arrows around the OpenTSDB service go into thin air (probably because there would have been a big horizontal rectangle with a little icon in the middle without shape: image
:
This is the best I've been able to come up with by going back to the default dagre layout engine, using near
placement control of the hadoop cluster and not using any connections between the tsdb objects or k8s container and the hadoop container, due to the original error message from this issue:
This issue could be fixed if the use of grid on the blank canvas is implemented (https://github.com/terrastruct/d2/issues/1145).
The user could specify:
# title, first node, kubernetes on prem, hadoop cluster on prem
grid-columns: 4
# prevent nodes from appearing on right or left side
grid-rows: 1
# Influence the diagram to declare nodes in a specific direction (from declaration order?)
direction: down
Documentation https://d2lang.com/tour/grid-diagrams/ https://d2lang.com/tour/layouts/#direction
Hitting this issue with another diagram too:
I think this placement control is a really big issue, it affects this one too:
Very strange - this code doesn't work with v0.6.1
CLI, but does work in the Playground.
A: {
near: top-center
a
b
}
B: {
x
y
}
A.a -> B.x
@AndreiPashkin oh Playground runs on latest master branch. I made an issue to note that in Playground so it's clear: https://github.com/terrastruct/d2-playground/issues/42
@AndreiPashkin oh Playground runs on latest master branch. I made an issue to note that in Playground so it's clear: terrastruct/d2-playground#42
Okay, my sanity is restored.
I've got a diagram of OpenTSDB on HBase and I've set
near: bottom-center
on the Hadoop/HBase cluster because it must be underneath the OpenTSDB cluster like so:But I want to connect the OpenTSDB nodes to the HBase nodes, but any connection to the cluster or cluster nodes such as:
results in this error:
If I comment out the
near: bottom-center
the the diagram comes out messed up with the Hadoop/HBase cluster being put out to the side (the very reason I came to D2 running away from Python diagrams module in the first place)The full code is here in my Diagrams-as-Code github repo:
https://github.com/HariSekhon/Diagrams-as-Code/blob/master/opentsdb_kubernetes_hbase.d2