DiagrammeR节点标签属性(style =“ filled”不起作用)

时间:2018-09-14 19:06:31

标签: r graph diagrammer

我想创建一个带有节点标记的图形。但是,当节点标签很长时,即使我使用style="filled"

,也不会填充节点的内部

这是我的代码和输出:

# Create an ndf with distinct labels and
# additional node attributes (where their classes
# will be inferred from the input vectors)
node_df <-
  create_node_df(
    n = 4,
    type = "a",
    label = c(23843333, 3333942, 836332, 21943333),
    style = "filled",
    color = "aqua",
    shape = c("circle", "circle",
              "rectangle", "rectangle"),
    value = c(3.5, 2.6, 9.4, 2.7))

# Display the node data frame
node_df
# }



# Create an edf with additional edge
# attributes (where their classes will
# be inferred from the input vectors)
edf <-
  create_edge_df(
    from = c(1, 2, 3, 4),
    to = c(4, 3, 1, 1),
    rel = "a",
    length = c(50, 100, 250, 100),
    color = "green",
    width = c(1, 5, 2, 3))

# Display the edge data frame
edf
# }

g <- create_graph(nodes_df = node_df, edges_df = edf)
render_graph(g)

Graph output

0 个答案:

没有答案