Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using doubly-nested subgraphs without connected nodes does not render #69

Closed
Sushisource opened this issue Mar 22, 2017 · 1 comment
Closed
Labels

Comments

@Sushisource
Copy link

I have created a repro case for this. I would expect this to generate output roughly like:

digraph structs {
    subgraph cluster_branch {
        subgraph UnChained {
            inode
        }
    }
}

Instead the output is just an empty digraph. This test fails.

    test("Dot rendering with one node") {
      import scalax.collection.Graph
      import scalax.collection.io.dot._
      import scalax.collection.io.dot.implicits._
      import scalax.collection.GraphEdge.DiEdge
      val g = Graph[Int, DiEdge](1)
      val root = DotRootGraph(
        directed = true,
        id = Some("structs")
      )
      val branchDOT = DotSubGraph(root,
                                  "cluster_branch",
                                  attrList = List(DotAttr("label", "branch")))
      val cSubGraph = DotSubGraph(branchDOT, "cluster_chained", attrList =
        List(DotAttr("label", "Chained")))
      val iSubGraph = DotSubGraph(branchDOT, "cluster_unchained", attrList =
        List(DotAttr("label", "UnChained")))
      val dot = g.toDot(
        dotRoot = root,
        edgeTransformer = _.edge match {
          case _ =>
            Some((root, DotEdgeStmt("hi", "guys")))
        },
        cNodeTransformer = Some({ _ => Some((cSubGraph, DotNodeStmt("cnode"))) }),
        iNodeTransformer = Some({ _ => Some((iSubGraph, DotNodeStmt("inode"))) })
      )
      assert(dot.contains("inode"))
    }
@peter-empen
Copy link
Contributor

Also, thanks for the nice example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants