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

Flexible Cluster #91

Open
jonioni opened this issue Apr 5, 2020 · 2 comments
Open

Flexible Cluster #91

jonioni opened this issue Apr 5, 2020 · 2 comments
Labels
kind/feature New feature or request proposal Suggestion proposed

Comments

@jonioni
Copy link

jonioni commented Apr 5, 2020

  1. Treating Cluster as Node:
    with Cluster("VPC"):
      vpc = VPC("...")
      with Cluster("subnet") as subnet:
        ...
      vpc >> subnet
    Related: Is there a way to have arrows to and from Clusters #17
  2. Empty default label:
    with Cluster():
      ...
    Produces empty label instead of "cluster".
  3. Node as Cluster Key:
    with Cluster(VPC("...")):
      with Cluster("subnet"):
        ...
    Could be resulting in the same effect as an empty cluster label with an additional node:
    with Cluster(""):
        VPC("...")
    Related: Allow any Node to behave as a Cluster #34, ability to add icons to the cluster label #90
@givanovexpe
Copy link

The cluster is different than a node is because a "Cluster" translates to a "subgraph" in graphviz lingo, while "node" and "edge" translate to node and edge respectively. Also when diagrams translate a Cluster into the corresponding graphviz code, it creates a "subgraph" but also a "graph" inside it. So I am not sure this is possible, but I am not expert by far.

@jonioni
Copy link
Author

jonioni commented Apr 7, 2020

Thanks @givanovexpe . However the proposal here is actually more about python initializer tweaking, and all the features are achievable through current graphviz.

For [1] treating cluster as node, its about being about to point to a subgraph instead of a node. This is achievable by utilizing compound=True diagram attribute and [ltail=subgraphA,lhead= subgraphB] attribute. And for the python part it'd be great if the with Cluster(...) context can be associated with a handle with Cluster(...) as GroupA.

For [2] Empty default label, it's about having a unique Cluster class counter as unique id instead of depending on cluster name for layout and rendering. So that there can be cluster with no name.

For [3] Node as cluster key, it's an enhancement on top of [2] where name can be not limited to :str. In the case of with Cluster(VPC("...")), it'd have same effect as an empty cluster label and a node in the subgraph.

@mingrammer mingrammer added kind/feature New feature or request proposal Suggestion proposed labels Apr 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature New feature or request proposal Suggestion proposed
Projects
None yet
Development

No branches or pull requests

3 participants