Created: 2024-01-15 | Updated: 2024-05-17

Github code

New (v0.3.22)

Table of contents

  1. Node Type: github_code
  2. Rendering:
  3. Code Snippet:
  4. drawio github_code vertex:
  5. Advanced for Geeks:
    1. Style:
    2. Vertex size:
    3. Full XML dump:
    4. drawio file:

Node Type: github_code

Rendering:

lambda

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;"
attributevalue
alignleft
fillColor#00BEF2
html1
pointerEvents1
shapemxgraph.azure.github_code
strokeColornone
verticalAligntop
verticalLabelPositionbottom

Vertex size:

attributevalue
width50
height50

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="&lt;b&gt;Name&lt;/b&gt;: github_code&lt;BR&gt;&lt;b&gt;ID&lt;/b&gt;: arn:aws:code:eu-west-1:123456789012:repo/123&lt;BR&gt;-----------&lt;BR&gt;&lt;b&gt;name&lt;/b&gt;: my-code&lt;BR&gt;&lt;b&gt;codeDigest&lt;/b&gt;: 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:

Download