Skip to content

Commit

Permalink
feat: add web client node
Browse files Browse the repository at this point in the history
  • Loading branch information
tsypuk committed Jan 8, 2024
1 parent 0a05e88 commit 938bc83
Show file tree
Hide file tree
Showing 5 changed files with 148 additions and 0 deletions.
13 changes: 13 additions & 0 deletions docs/docs/core-components/output/drawio/web_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:web_client:web" value="&lt;b&gt;Name&lt;/b&gt;: Chrome v.52&lt;BR&gt;&lt;b&gt;ID&lt;/b&gt;: web" style="sketch=0;outlineConnect=0;fontColor=#232F3E;gradientColor=none;fillColor=#232F3D;strokeColor=none;dashed=0;verticalLabelPosition=bottom;verticalAlign=top;align=left;html=1;fontSize=12;fontStyle=0;aspect=fixed;pointerEvents=1;shape=mxgraph.aws4.client;labelBackgroundColor=none;" parent="1" vertex="1">
<mxGeometry width="78" height="76" 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.
100 changes: 100 additions & 0 deletions docs/docs/core-components/web_client.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
---
layout: default
title: WEB Client
parent: CORE Components
nav_order: 3
date: 2024-01-08
---

# WEB 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: ``web_client``

## Rendering:

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

## Code Snippet:

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

## drawio web_client vertex:

```xml
<mxCell id="vertex:web_client:web" parent="1" vertex="1">
<mxGeometry width="78" height="76" as="geometry"/>
</mxCell>
```
---

## Advanced for Geeks:

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

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

### Vertex size:

| attribute | value |
|:---------|:-----------|
| width | 78 |
| height |76|

### 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:web_client:web" value="&lt;b&gt;Name&lt;/b&gt;: Chrome v.52&lt;BR&gt;&lt;b&gt;ID&lt;/b&gt;: web" style="sketch=0;outlineConnect=0;fontColor=#232F3E;gradientColor=none;fillColor=#232F3D;strokeColor=none;dashed=0;verticalLabelPosition=bottom;verticalAlign=top;align=left;html=1;fontSize=12;fontStyle=0;aspect=fixed;pointerEvents=1;shape=mxgraph.aws4.client;labelBackgroundColor=none;" parent="1" vertex="1">
<mxGeometry width="78" height="76" as="geometry"/>
</mxCell>
</root>
</mxGraphModel>
</diagram>
</mxfile>
```

### drawio file:

Download generated ``web_client.drawio``:

[Download](output/drawio/web_client.drawio){: .btn .btn-purple }
7 changes: 7 additions & 0 deletions multicloud_diagrams/providers/core.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,12 @@
"height": "60",
"version": "0.3.20",
"desc": "Mobile Client"
},
"web_client": {
"style": "sketch=0;outlineConnect=0;fontColor=#232F3E;gradientColor=none;fillColor=#232F3D;strokeColor=none;dashed=0;verticalLabelPosition=bottom;verticalAlign=top;align=left;html=1;fontSize=12;fontStyle=0;aspect=fixed;pointerEvents=1;shape=mxgraph.aws4.client;labelBackgroundColor=none;",
"width": "78",
"height": "76",
"version": "0.3.20",
"desc": "WEB Client"
}
}
28 changes: 28 additions & 0 deletions tests/core/test_web_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_web_client(self):
# docs
self.node_type = 'web_client'

# given
mcd = MultiCloudDiagrams()

# when
mcd.add_vertex(node_id="web",
node_name='Chrome v.52',
node_type='web_client')

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

# docs
self.mcd = mcd

0 comments on commit 938bc83

Please sign in to comment.