-
Can the direction be changed from vertical to horizontal? |
Beta Was this translation helpful? Give feedback.
Answered by
s0l0ist
Jan 15, 2025
Replies: 1 comment
-
Hi @kadiemq, Yes! You'll likely want to set the import {
DirectedGraph,
LabelPos,
RankDir,
} from "@vizdom/vizdom-ts-node"
const graph = new DirectedGraph({
layout: {
rank_dir: RankDir.LR, // or RankDir.RL
},
});
const v0 = graph.new_vertex({
render: {
label: "Hello",
},
});
const v1 = graph.new_vertex({
render: {
label: "World!",
},
});
// Add an edge between the vertices
graph.new_edge(v0, v1, {
render: {
label: "Foo Bar",
},
layout: {
label_pos: LabelPos.R,
},
}); |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
s0l0ist
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi @kadiemq,
Yes! You'll likely want to set the
rank_dir
toLR
and maybe change thelabel_pos
setting on any edges to suit your needs.Which will produce a graph that looks like this: