r - 您如何在 Diagrammer 中设置边长?
问题描述
我不希望边缘标签与节点重叠。这可以手动完成吗?可以将边缘长度设置为不与所有边缘标签的节点重叠吗?
谢谢你。
例如红边:
library(DiagrammeR)
grViz("
digraph circo {
graph[layout = circo,
overlap=false]
node[shape = circle,
style=filled,
color = grey,
label = 'my label']
A[label='Jeffrey Jones']; B; C; D; E; F
node[shape= rectangle]
1[label='This is a long label number 1']; 2; 3; 4; 5; 6; 7[label=number7];
# add edge statements
A-> 1[label='This is my edge label', color=red, len=30.0]; B-2; B->3; B->4; C->A
}
")
解决方案
我认为,这个简单的示例将对您有所帮助:
library(DiagrammeR)
grViz("
digraph {
graph [ranksep = 0.2]
node [shape = circle]
A [label = 'Jeffrey Jones']
node [shape = rectangle]
B [label = 'This is a long label number']
C [label = 'Age']
edge [minlen = 3] #set minimum length here
A->B [label='This is my edge label ']
A->C
{rank = same; A; B}
}
")
从基础开始,然后更快地成长。
祝你好运 ;)
推荐阅读
- spring-boot - 加载配置文件时如何修复空值错误
- spring - Spring Cloud Gateway 上的 CORS 配置问题
- php - Check for Product Category in cart items with WooCommerce
- node.js - GCP Cloud Function 从 Cloud Storage 读取文件
- reactjs - google-map-react 标记未显示
- java - 我们如何从 Java 启动一个 mockserver 来接收传入的流量?
- azure - 通过 Azure AD SCIM 管理 SaaS 用户和组
- python - 如何从价值 $1,632.50 (BigQuery) 中仅提取数字
- google-oauth - Google API PHP Authentication Invalid Token Format(问题和答案)
- java - Eclipse、JSF、Java 中的 Crud 实现