Created: 2023-08-14 | Updated: 2024-09-21
Single Snapshot
New (v0.3.8)
Table of contents
Single row table with a snapshot representation of XML, JSON or text/plain.
Node Type: snapshot
Rendering:
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;"
attribute | value |
---|---|
childLayout | stackLayout |
collapsible | 1 |
fontStyle | 0 |
horizontal | 1 |
horizontalStack | 0 |
html | 1 |
marginBottom | 0 |
resizeLast | 0 |
resizeParent | 1 |
resizeParentMax | 0 |
startSize | 30 |
swimlane | |
whiteSpace | wrap |
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="<b>Integration Response</b>" 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="{
"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"
}
}" 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
: