-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Added Cluster icon and iconsize #853
base: master
Are you sure you want to change the base?
Conversation
FYI, seems like it won't be merged as probably doesn't conform with standards. Thanks to @tanure I was able to create an external option which works just fine: def icon(node: object, label: str, size=30):
"""
Function adds a Diagrams-compatible icon
:param node: Diagrams object, like VPC or Docker
:param label: Label text, like "subnet-a"
:param size: Icon size in px.
:returns: "Label prefixed with a specified icon"
"""
# o = node.__new__(cls=None, label=label, size=size)
class Node(node):
def __init__(self):
pass
icon_path = Node()._load_icon()
return '<<table border="0" width="100%"><tr><td fixedsize="true" width="' + str(size) + '" height="' + str(
size) + '"><img src="' + icon_path + '" /></td><td>' + label + '</td></tr></table>>' To be used like this: with Cluster(icon(VPC, "prod-vpc")):
... |
I missed the conflict. I didn't see the notification about it. However, I'm really happy because @AutomationD created an alternative and improved code. Thanks a lot and it's good to learn with you! |
You're too kind! I don't think I've improved anything, it would be still great to do it without external functions. Maybe @mingrammer can give a hint what can be improved on the PR? |
Also, seems like there is an issue with my code. I'm getting an actual node on the diagram in addition to the icon. I'll see if I can fix it. |
This is really community! Let's contribute and learn. I'm going to test it as well! Thanks a lot @AutomationD |
@tanure OK, seems like overriding |
🚀 feature: redo mingrammer#853, add cluster icon
why isn't this merged yet? |
Hi, I noticed this feature has been developed but hasn't been merged yet. I'm interested in contributing to this project and would like to understand.
I'd be happy to assist with additional development or testing if needed. |
Hello @tiaz0128 The project was stopped for a while. Thank you! |
Thank you for bringing this project back to life. I'm a regular user and really appreciate your work on it. I'd be happy to help with simple tasks like updating icons or keeping things up to date. Please let me know if there are any such tasks I can assist with. If you create an issue for any task, I'll be happy to work on it. |
Hello @tiaz0128 Thank you! |
Related PR: #438 |
I added an implementation to be able to add icon for a Cluster