Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
from diagrams import Cluster
from diagrams.custom import Custom
from diagrams import Diagram
from diagrams.onprem.analytics import Hive
# Custom Image sourc dir
img_src = "/Users/csreekanth/Desktop"
# Attributes
graph_attr = {
"fontsize": "60",
"compund": "True"
}
cluster_attr = {
"fontsize": "40",
}
node_attr = {
"fontsize": "25",
"height": "10.6"
}
edge_attr = {
"minlen": "4.0",
"penwidth":"3.0",
"concentrate": "true"
}
# Custom Icons
druid_icon = "{}/druid2.png".format(img_src)
Big_icon = "{}/big_query.png".format(img_src)
facebook_icon = "{}/facebook.png".format(img_src)
aol_icon = "{}/aol.png".format(img_src)
hue_icon = "{}/hue.png".format(img_src)
revenue_icon = "{}/revenue.png".format(img_src)
looker_icon = "{}/looker.png".format(img_src)
marvel_icon = "{}/marvel.png".format(img_src)
# Clusters
with Diagram("Custom Architectture",show=True, graph_attr=graph_attr, edge_attr=edge_attr, node_attr=node_attr):
with Cluster("Source", graph_attr=cluster_attr):
facebook = Custom("External", facebook_icon)
aol = Custom("Aol Legacy", aol_icon)
with Cluster("Storage", graph_attr=cluster_attr):
druid = Custom("Druid",druid_icon)
hive = Hive("Hive")
big_query = Custom("Big_Query", Big_icon)
with Cluster("Visualize", graph_attr=cluster_attr):
hue = Custom("Hue", hue_icon)
looker = Custom("MAW Explorer", looker_icon)
marvel = Custom("Marvel", marvel_icon)
# Visualization
[facebook, aol] >> hive >> big_query >> [looker, marvel, hue]
hive >> druid >> [looker, marvel, hue]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment