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

Build out options to Custom #388

Closed
stanbiryukov opened this issue Dec 2, 2020 · 4 comments
Closed

Build out options to Custom #388

stanbiryukov opened this issue Dec 2, 2020 · 4 comments

Comments

@stanbiryukov
Copy link

Would be great if Custom had additional properties such as enabling resizing of the icon:

from diagrams.custom import Custom

Custom("Private\nEndpoint", icon_path=f"{parent_dir}/azPrivateEndpoint_logo.png")

# fails:
Custom("Private\nEndpoint", icon_path=f"{parent_dir}/azPrivateEndpoint_logo.png", width="0.5", height="0.8")

@clayms
Copy link

clayms commented Dec 2, 2020

You can use the Node class directly and use all of the graphviz attributes.

@stanbiryukov
Copy link
Author

So in this case I would make my own Node class for a custom image. I guess that's fine if we want to leave Custom as is.

@clayms
Copy link

clayms commented Dec 2, 2020

You don't have to make your own class it is already there.

See the following:

#306 (comment)

#243 (comment)

#202 (comment)

@stanbiryukov
Copy link
Author

Excellent, thanks @clayms - didn't fully grasp the utility of Node.
The image argument is what I was after:
Node(image=f"{parent_dir}/azPrivateEndpoint_logo.png", width="0.5", height="0.8")

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

No branches or pull requests

2 participants