如何更改Diagrammer图表上的箭头类型? 我想在同一个图表上混合它们。
玩具示例:
library(data.table)
niv <- c("A","B","C","D","E","X","Y")
from <- c("A","A","A","A","B","C","D","E", "X", "B")
to <- c("B","C","D","E","X","X","Y","Y","Y", "C")
temp <- data.table(from=factor(from, levels=niv),
to=factor(to,levels=niv), col=c(rep("blue",5), rep("black",5)))
nodes <- create_node_df( n=length(niv), label=niv, width=0.3)
edges <- create_edge_df(from = temp$from, to = temp$to,
rel = "leading_to", label=temp$from, color=temp$col)
graph <- create_graph( nodes_df = nodes, edges_df = edges)
render_graph(graph)
现在所有箭头都定义为rel =“leading_to”。 但是我无法在文档中找到我可以使用的其他选项。
我想将该参数链接到我的数据表上的新列,指定我是否需要“到”箭头,“从”箭头,或者只绘制没有箭头的行。
带尾巴但没有头部的箭头有哪些选项?
对于没有箭头的简单线?
答案 0 :(得分:1)
我找到了参数
的方法arrowhead = myvector
我的矢量包含元素&#34;无&#34; 和/或&#34;正常&#34; 。这让我可以抑制一些箭头。其他有趣的选项是 inv 或 crow 。 https://rich-iannone.github.io/DiagrammeR/graphviz_and_mermaid.html
也许参数 rel 还有一个选项,但我找不到它。