Reputation: 62876
Here is my graphviz code:
digraph G {
rankdir="LR"
node [shape=square]
exDNS [label="External DNS"]
inDNS [label="Internal DNS"]
tm [label="Traffic Manager"]
pri [label="App Service\nPrimary Region"]
sec [label="App Service\nSecondary Region"]
Browser -> {inDNS,exDNS} -> Imperva-> tm -> {pri,sec}
Browser -> Imperva -> {pri,sec}
}
It produces the following result:
I would the edge
Browser -> Imperva
to go straight between the nodes External DNS
and Internal DNS
.
How can I do it?
I am using the dot renderer.
Upvotes: 3
Views: 1035
Reputation: 6826
You can do this without fiddling about with ports.
Your current dot first explicitly defines exDNS and inDNS, then Imperva is implicitly defined in the edges - i.e. it's defined third.
All I've added in the dot below is the explicit declaration of node Imperva
between exDNS
and inDNS
, i.e. so it is defined second, before inDNS.
I think this works because there's this wording in the dotguide section 2.6 (NOTE in these words rankdir is the default top-to-bottom so for rankdir=LR read left as top and right as bottom) :
If a subgraph has ordering=out, then out-edges within the subgraph that have the same tail node wll fan-out from left to right in their order of creation.
TBH I'm not completely sure this is the reason because the dotguide doesn't give a default for ordering
.
Regardless of the dotguide, in my dot below if I move the definition of Imperva
up one line to be above the exDNS
node declaration then the edge from Browser
to Imperva
passes over exDNS
(because Imperva
is defined first). Move the definition of node Imperva
below the line for inDNS
- or omit this explicit definition of the node completely like your dot does - so Imperva is defined after inDNS, and the edge goes below inDNS
like your graph.
digraph G {
rankdir="LR"
node [shape=square]
exDNS [label="External DNS"]
Imperva;
inDNS [label="Internal DNS"]
tm [label="Traffic Manager"]
pri [label="App Service\nPrimary Region"]
sec [label="App Service\nSecondary Region"]
Browser -> {inDNS,exDNS} -> Imperva-> tm -> {pri,sec}
Browser -> Imperva -> {pri,sec}
}
produces:
Upvotes: 2
Reputation: 6791
It is difficult to make edges behave (explicitly position them). But by attaching edges to ports, you can have some influence on edge locations.
I think this is what you're after:
digraph G {
rankdir="LR"
// graph [splines=polyline]
node [shape=square]
exDNS [label="External DNS"]
inDNS [label="Internal DNS"]
tm [label="Traffic Manager"]
pri [label="App Service\nPrimary Region"]
sec [label="App Service\nSecondary Region"]
Browser:ne -> exDNS -> Imperva
Browser:e -> Imperva
Browser:se -> inDNS -> Imperva
Imperva-> tm -> {pri,sec}
Imperva -> {pri,sec}
}
Upvotes: 3