Created: 2023-08-14 | Updated: 2024-05-17

Single Snapshot

New (v0.3.8)

Table of contents

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

Single row table with a snapshot representation of XML, JSON or text/plain.


Node Type: snapshot

Rendering:

lambda

Code Snippet:

# given
mcd = MultiCloudDiagrams()
mcd.read_coords_from_file('docs/docs/core-components/output/drawio/snapshot.drawio')

snapshot = json.dumps(
    {
        "200": {
            "responseParameters": {
                "method.response.header.Access-Control-Allow-Headers": "'Content-Type,X-Amz-Date,Authorization'",
                "method.response.header.Access-Control-Allow-Methods": "'OPTIONS,GET,POST'",
                "method.response.header.Access-Control-Allow-Origin": "'*'"
            },
            "statusCode": "200"
        }
    }, indent=4)

# when
mcd.add_snapshot(table_name='Integration Response', snapshot=snapshot)

drawio snapshot vertex:

<mxCell id="vertex:Integration Response:list" parent="1" vertex="1">
    <mxGeometry width="560" height="190" as="geometry" x="-180"/>
</mxCell>

Advanced for Geeks:

Style:

style="swimlane;fontStyle=0;childLayout=stackLayout;horizontal=1;startSize=30;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;whiteSpace=wrap;html=1;"
attributevalue
childLayoutstackLayout
collapsible1
fontStyle0
horizontal1
horizontalStack0
html1
marginBottom0
resizeLast0
resizeParent1
resizeParentMax0
startSize30
swimlane 
whiteSpacewrap

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:Integration Response:list" value="&lt;b&gt;Integration Response&lt;/b&gt;" style="swimlane;fontStyle=0;childLayout=stackLayout;horizontal=1;startSize=30;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
                    <mxGeometry width="560" height="190" as="geometry" x="-180"/>
                </mxCell>
                <mxCell id="vertex:Integration Response:row:1" value="{
    &quot;200&quot;: {
        &quot;responseParameters&quot;: {
            &quot;method.response.header.Access-Control-Allow-Headers&quot;: &quot;'Content-Type,X-Amz-Date,Authorization'&quot;,
            &quot;method.response.header.Access-Control-Allow-Methods&quot;: &quot;'OPTIONS,GET,POST'&quot;,
            &quot;method.response.header.Access-Control-Allow-Origin&quot;: &quot;'*'&quot;
        },
        &quot;statusCode&quot;: &quot;200&quot;
    }
}" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" parent="vertex:Integration Response:list" vertex="1">
                    <mxGeometry width="560" height="160" y="30" as="geometry"/>
                </mxCell>
            </root>
        </mxGraphModel>
    </diagram>
</mxfile>

drawio file:

Download generated snapshot.drawio:

Download