Skip to content

can't "pull nodes into" a subgraph #40

@gordonwoodhull

Description

@gordonwoodhull

In graphviz, the following are equivalent

digraph g {
  subgraph cluster_SG { a -> b}
  a -> c
}
digraph g {
  a -> b
  subgraph cluster_SG { a b }
  a -> c
}

In other words, a node doesn't have to be first declared within a subgraph to be a member of the subgraph; it can be "pulled into" a subgraph by declaring it again within the subgraph.

However, parsing the second example with graphlib-dot, cluster_SG doesn't get declared at all, and a and b are children of the top-level graph. I haven't looked into the code yet, but it seems that the later declarations are ignored, and the subgraph ends up empty and is discarded.

I know the dagre clustering implementation is incomplete, but I hope to read the files anyway, in order to draw the clusters using other algorithms.

I hope to take a look into fixing this, but wanted to post an issue first in case anyone has any clues about this. Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions