Skip to content

Commit

Permalink
feat: add mobile client node
Browse files Browse the repository at this point in the history
  • Loading branch information
tsypuk committed Jan 8, 2024
1 parent 766b83a commit 0a05e88
Show file tree
Hide file tree
Showing 5 changed files with 148 additions and 0 deletions.
100 changes: 100 additions & 0 deletions docs/docs/core-components/mobile_client.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
---
layout: default
title: Mobile Client
parent: CORE Components
nav_order: 3
date: 2024-01-08
---

# Mobile Client
{: .d-inline-block .no_toc }

New (v0.3.20)
{: .label .label-green }

## Table of contents
{: .no_toc .text-delta }

1. TOC
{:toc}

---


## Node Type: ``mobile_client``

## Rendering:

![lambda](output/jpg/mobile_client.jpg)

## Code Snippet:

```python
{% root_include_snippet ../tests/core/test_mobile_client.py %}
```

## drawio mobile_client vertex:

```xml
<mxCell id="vertex:mobile_client:mobile" parent="1" vertex="1">
<mxGeometry width="60" height="60" as="geometry"/>
</mxCell>
```
---

## Advanced for Geeks:

### Style:
```html
style="sketch=0;outlineConnect=0;fontColor=#232F3E;gradientColor=none;strokeColor=#232F3E;fillColor=none;dashed=0;verticalLabelPosition=bottom;verticalAlign=top;align=left;html=1;fontSize=12;fontStyle=0;aspect=fixed;shape=mxgraph.aws4.resourceIcon;resIcon=mxgraph.aws4.mobile_client;labelBackgroundColor=none;"
```

| attribute | value |
|:----------|:------|
|align| left |
|aspect| fixed |
|dashed| 0 |
|fillColor| none |
|fontColor| #232F3E |
|fontSize| 12 |
|fontStyle| 0 |
|gradientColor| none |
|html| 1 |
|labelBackgroundColor| none |
|outlineConnect| 0 |
|resIcon| mxgraph.aws4.mobile_client |
|shape| mxgraph.aws4.resourceIcon |
|sketch| 0 |
|strokeColor| #232F3E |
|verticalAlign| top |
|verticalLabelPosition| bottom |

### Vertex size:

| attribute | value |
|:---------|:-----------|
| width | 60 |
| height |60|

### Full XML dump:
```xml
<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:mobile_client:mobile" value="&lt;b&gt;Name&lt;/b&gt;: Android&lt;BR&gt;&lt;b&gt;ID&lt;/b&gt;: mobile" style="sketch=0;outlineConnect=0;fontColor=#232F3E;gradientColor=none;strokeColor=#232F3E;fillColor=none;dashed=0;verticalLabelPosition=bottom;verticalAlign=top;align=left;html=1;fontSize=12;fontStyle=0;aspect=fixed;shape=mxgraph.aws4.resourceIcon;resIcon=mxgraph.aws4.mobile_client;labelBackgroundColor=none;" parent="1" vertex="1">
<mxGeometry width="60" height="60" as="geometry"/>
</mxCell>
</root>
</mxGraphModel>
</diagram>
</mxfile>
```

### drawio file:

Download generated ``mobile_client.drawio``:

[Download](output/drawio/mobile_client.drawio){: .btn .btn-purple }
13 changes: 13 additions & 0 deletions docs/docs/core-components/output/drawio/mobile_client.drawio
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<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:mobile_client:mobile" value="&lt;b&gt;Name&lt;/b&gt;: Android&lt;BR&gt;&lt;b&gt;ID&lt;/b&gt;: mobile" style="sketch=0;outlineConnect=0;fontColor=#232F3E;gradientColor=none;strokeColor=#232F3E;fillColor=none;dashed=0;verticalLabelPosition=bottom;verticalAlign=top;align=left;html=1;fontSize=12;fontStyle=0;aspect=fixed;shape=mxgraph.aws4.resourceIcon;resIcon=mxgraph.aws4.mobile_client;labelBackgroundColor=none;" parent="1" vertex="1">
<mxGeometry width="60" height="60" as="geometry"/>
</mxCell>
</root>
</mxGraphModel>
</diagram>
</mxfile>
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions multicloud_diagrams/providers/core.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,12 @@
"height": "60",
"version": "0.3.20",
"desc": "Block Rectangle"
},
"mobile_client": {
"style": "sketch=0;outlineConnect=0;fontColor=#232F3E;gradientColor=none;strokeColor=#232F3E;fillColor=none;dashed=0;verticalLabelPosition=bottom;verticalAlign=top;align=left;html=1;fontSize=12;fontStyle=0;aspect=fixed;shape=mxgraph.aws4.resourceIcon;resIcon=mxgraph.aws4.mobile_client;labelBackgroundColor=none;",
"width": "60",
"height": "60",
"version": "0.3.20",
"desc": "Mobile Client"
}
}
28 changes: 28 additions & 0 deletions tests/core/test_mobile_client.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
from multicloud_diagrams import MultiCloudDiagrams
from utils.templating import TestRendering


class TestCoreVertexInIsolation(TestRendering):

def test_mobile_client(self):
# docs
self.node_type = 'mobile_client'

# given
mcd = MultiCloudDiagrams()

# when
mcd.add_vertex(node_id="mobile",
node_name='Android',
node_type='mobile_client')

# then
expected = {'id': 'vertex:mobile_client:mobile',
'parent': '1',
'style': 'sketch=0;outlineConnect=0;fontColor=#232F3E;gradientColor=none;strokeColor=#232F3E;fillColor=#ffffff;dashed=0;verticalLabelPosition=bottom;verticalAlign=top;align=left;html=1;fontSize=12;fontStyle=0;aspect=fixed;shape=mxgraph.aws4.resourceIcon;resIcon=mxgraph.aws4.mobile_client;labelBackgroundColor=none;',
'value': '<b>Name</b>: Android<BR><b>ID</b>: mobile',
'vertex': '1'}
self.verify_resource(expected, mcd.mx_file, 'mobile_client', 'mobile_client')

# docs
self.mcd = mcd

0 comments on commit 0a05e88

Please sign in to comment.