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

More Improvements: #3

Merged
merged 2 commits into from
Apr 17, 2021
Merged

More Improvements: #3

merged 2 commits into from
Apr 17, 2021

Conversation

mrbrutti
Copy link
Contributor

  • Migrating renderer into a class
  • Renderer support of with statement to improve overall flow to build graphs.

- style is imported by default
- createEdge -> connectTo
- connectTo returns endNode to allow method concatenation.
- Migrating renderer into a class
- Renderer support of with statement to improve overall flow to build graphs.
if __name__ == "__main__":
root = Node(label="Reality")
goal = Node(label="Attacker gets data from bucket")
with Renderer(root = "Reality", goal= "Attacker gets data from bucket") as graph:
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we will quickly need graphs with multiple goal-nodes. Not sure about this although we could easily frame it up with goals=["Attacker gets data from bucket"] - what do you think?

# Overload the default formatting shape if the Node is flagged as unimplemented
if unimplemented:
node_attr = node_attr | dotformat['_unimplemented_override']
def __init__(self, root="Root", goal="Goal"):
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment as above, we likely do want multiple goals

@hyakuhei
Copy link
Owner

This will break any other graphs people have been playing with (and I guess that means we need to quickly get to a stable pattern of models or some versioning or something)

@hyakuhei hyakuhei merged commit 571b2d4 into hyakuhei:main Apr 17, 2021
@mrbrutti
Copy link
Contributor Author

Very interesting point on multiple goals I had not thought of that TBH. I guess we could pass a strong or a list (either strings or actual Nodes) and depending on it set one or more elements. Goal1, goal2 or something like that it should not be difficult. Let me think about it and provide you a PoC, but you totally set a great point.

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

Successfully merging this pull request may close these issues.

2 participants