How to rearrange diagram in R

后端 未结 3 1234
囚心锁ツ
囚心锁ツ 2021-01-14 05:04

I updated my diagrammer to version 0.9.0 and started rendering different diagram from the same data. My data frame now looks like this:

df <-          


        
3条回答
  •  礼貌的吻别
    2021-01-14 05:58

    Create graph with attr_theme = NULL:

    g <- create_graph(nodes_df=nodes, edges_df=edges, attr_theme = NULL)
    

    In current version, DiagrammeR sets the global attribute layout to neato. You can check this with:

    g <- create_graph(nodes_df=nodes, edges_df=edges)
    get_global_graph_attrs(g)
    
    #           attr      value attr_type
    # 1       layout      neato     graph
    # 2  outputorder edgesfirst     graph
    # 3     fontname  Helvetica      node
    # 4     fontsize         10      node
    # 5        shape     circle      node
    # 6    fixedsize       true      node
    # 7        width        0.5      node
    # 8        style     filled      node
    # 9    fillcolor  aliceblue      node
    # 10       color     gray70      node
    # 11   fontcolor     gray50      node
    # 12         len        1.5      edge
    # 13       color     gray40      edge
    # 14   arrowsize        0.5      edge
    

    You can also set these attributes with set_global_graph_attrs after creating the graph object.

提交回复
热议问题