Created: 2024-01-15 | Updated: 2024-08-11
Github code
New (v0.3.22)
Table of contents
Node Type: github_code
Rendering:
Code Snippet:
# given
mcd = MultiCloudDiagrams()
# when
arn = 'arn:aws:code:eu-west-1:123456789012:repo/123'
metadata = {
'name': 'my-code',
'codeDigest': 'sha256:5562sfsf60a6d1aaed5c2bb227d3d4ec14c755bdb446349b',
}
mcd.add_vertex(node_id=arn, node_name='github_code', node_type='github_code', metadata=metadata)
drawio github_code vertex:
<mxCell id="vertex:github_code:arn:aws:code:eu-west-1:123456789012:repo/123" parent="1" vertex="1">
<mxGeometry width="50" height="50" as="geometry"/>
</mxCell>
Advanced for Geeks:
Style:
style="verticalLabelPosition=bottom;html=1;verticalAlign=top;align=left;strokeColor=none;fillColor=#00BEF2;shape=mxgraph.azure.github_code;pointerEvents=1;"
attribute | value |
---|---|
align | left |
fillColor | #00BEF2 |
html | 1 |
pointerEvents | 1 |
shape | mxgraph.azure.github_code |
strokeColor | none |
verticalAlign | top |
verticalLabelPosition | bottom |
Vertex size:
attribute | value |
---|---|
width | 50 |
height | 50 |
Full XML dump:
<mxfile host="multicloud-diagrams" agent="PIP package multicloud-diagrams. Generate resources in draw.io compatible format for Cloud infrastructure. Copyrights @ Roman Tsypuk 2023. MIT license." type="MultiCloud">
<diagram id="diagram_1" name="AWS components">
<mxGraphModel dx="1015" dy="661" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="850" pageHeight="1100" math="0" shadow="1">
<root>
<mxCell id="0"/>
<mxCell id="1" parent="0"/>
<mxCell id="vertex:github_code:arn:aws:code:eu-west-1:123456789012:repo/123" value="<b>Name</b>: github_code<BR><b>ID</b>: arn:aws:code:eu-west-1:123456789012:repo/123<BR>-----------<BR><b>name</b>: my-code<BR><b>codeDigest</b>: sha256:5562sfsf60a6d1aaed5c2bb227d3d4ec14c755bdb446349b" style="verticalLabelPosition=bottom;html=1;verticalAlign=top;align=left;strokeColor=none;fillColor=#00BEF2;shape=mxgraph.azure.github_code;pointerEvents=1;" parent="1" vertex="1">
<mxGeometry width="50" height="50" as="geometry"/>
</mxCell>
</root>
</mxGraphModel>
</diagram>
</mxfile>
drawio file:
Download generated github_code.drawio
: