Skip to content

Commit

Permalink
docs: python details, drawio usage
Browse files Browse the repository at this point in the history
  • Loading branch information
tsypuk committed Aug 6, 2023
1 parent 757d45b commit 6067f47
Show file tree
Hide file tree
Showing 3 changed files with 82 additions and 36 deletions.
62 changes: 32 additions & 30 deletions docs/docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,31 +7,53 @@ nav_order: 2
# Getting started
{: .no_toc }

Welcome to ``multicloud-diagrams`` 👋 This section will walk you through the basic installation process and provide a quick example to get you started.
Welcome to ``multicloud-diagrams`` 👋 This section will walk you through the basic installation process and provide a quick example to get you started.
If you're looking for more advanced features and customization options, be sure to explore the subsequent sections in our comprehensive documentation.

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

1. TOC
{:toc}

---


## Dependency details

python-3.11
{: .label .label-green }

python-3.10
{: .label .label-green }

python-3.9
{: .label .label-green }

python-3.8
{: .label .label-green }

python-3.7
{: .label .label-yellow }

The ``multicloud-diagrams`` package is a Python library that provides support for major ``Python`` versions, including ``3.7``, ``3.8``, ``3.9``, ``3.10``, and ``3.11``.
The package ensures compatibility with these Python versions by running tests using a Git workflow.
These tests are designed to verify that the library functions as expected across each mentioned Python version.

The package is readily accessible on [PyPI: https://pypi.org/project/multicloud-diagrams/](https://pypi.org/project/multicloud-diagrams/)
for easy installation and usage. As an open-source project, it encourages community participation and welcomes contributions from developers
[https://github.com/tsypuk/multicloud-diagrams](https://github.com/tsypuk/multicloud-diagrams)
Whether you want to use the package's functionalities or contribute to its improvement, it offers a user-friendly experience, backed by an active and engaged community.
Compatibility tests are included for latest LTS Python versions that have ``Security Support``.

| Release | Released | Security Support | Latest |
|:--------|:------------|:-----------------|:--------|
| 3.11 | 24 Oct 2022 | 24 Oct 2027 | 3.11.4 |
| 3.10 | 04 Oct 2021 | 04 Oct 2026 | 3.10.12 |
| 3.9 | 05 Oct 2020 | 05 Oct 2025 | 3.9.1 |
| 3.8 | 14 Oct 2019 | 14 Oct 2024 | 3.8.17 |
| 3.7 | 26 Jun 2018 | 27 Jun 2023 | 3.7.17 |

You can use ``multicloud-diagrams`` with Python versions <3.7 that do not have official ``Security Support`` with own verification.

The package is readily accessible on [PyPI: https://pypi.org/project/multicloud-diagrams/](https://pypi.org/project/multicloud-diagrams/)
for easy installation and usage. As an open-source project, it encourages community participation and welcomes contributions from developers
[https://github.com/tsypuk/multicloud-diagrams](https://github.com/tsypuk/multicloud-diagrams)
Whether you want to use the package's functionalities or contribute to its improvement, it offers a user-friendly experience, backed by an active and engaged community.

## Installation

Expand Down Expand Up @@ -60,7 +82,7 @@ Edit your ``project.toml`` and add ``multicloud-diagrams`` as dependecy:

{: .d-inline-block }

The minimum configuration requires importing MultiCloudDiagrams, adding vertices, connecting them with links and exporting to output file.
The minimum configuration requires importing MultiCloudDiagrams, adding vertices, connecting them with links and exporting to output file.

```python
from multicloud_diagrams import MultiCloudDiagrams
Expand Down Expand Up @@ -113,25 +135,5 @@ mcd.export_to_file(output_file)
mcd.export_to_file('../output/diagram.drawio')
```

## Vertices and Edges

Each ``vertex`` has a mandatory and optional attributes.

Mandatory Attributes:
- node_id
- node_name
- arn
- node_type

Optional Attributes:
- metadata

To see the list of all supported nodes (currently AWS and on-prem), syntax of each node with examples, please follow to ``AWS Components`` section


Vertices are connected using edges, by specifying source and target Vertex IDs. Also allowing to add labels to connection.

ID syntax is: ``RESOURCE_TYPE:ARN``
Examples: f'lambda_function:{func_arn}' f'iam_role:{role_arn}'

For more advanced use cases, detailed customization options, and in-depth functionalities, please continue exploring the next sections in our documentation. There, you will find a wealth of information to help you leverage the full potential of multicloud-diagrams in your projects. Happy diagramming!
For more advanced use cases, detailed customization options, and in-depth functionalities, please continue exploring the next sections in our documentation. There, you will find a wealth of
information to help you leverage the full potential of multicloud-diagrams in your projects. Happy diagramming!
22 changes: 22 additions & 0 deletions docs/docs/core-components/vertices_edges.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,25 @@ Tables are responsive by default, allowing wide tables to have a horizontal scro
| ok | good `oreos` | hmm |
| ok | good `zoute` drop | yumm |
```

## Vertices and Edges

Each ``vertex`` has a mandatory and optional attributes.

Mandatory Attributes:

- node_id
- node_name
- arn
- node_type

Optional Attributes:

- metadata

To see the list of all supported nodes (currently AWS and on-prem), syntax of each node with examples, please follow to ``AWS Components`` section

Vertices are connected using edges, by specifying source and target Vertex IDs. Also allowing to add labels to connection.

ID syntax is: ``RESOURCE_TYPE:ARN``
Examples: f'lambda_function:{func_arn}' f'iam_role:{role_arn}'
34 changes: 28 additions & 6 deletions docs/docs/extra.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,53 @@
---
layout: default
title: drawio usage
title: drawio usage
nav_order: 4
---

# How to use drawio
{: .no_toc }

Draw.io has gained widespread popularity as an extensively used editor and file format. Apart from the standard web browser version, it offers various other scenarios for usage, which include:

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

1. TOC
{:toc}

---

```python
{% root_include ../samples/samples/aws_iam_from_yaml.py %}
```

## Running draw.io from CLI
## Offline draw.io installation

Lorem Ipsum
```shell
brew cask install drawio
```

https://github.com/jgraph/drawio-desktop/releases/

## draw.io in CLI

## drawio standalone application
Here's a command-line example demonstrating how to convert the vector representation of a landscape.drawio file into an output PNG file, while scaling its size to be twice as large
(you can use create and use short ``alias`` in ``CLI`` instead of specifying the full path):

Lorem Ipsum
```shell
/Applications/draw.io.app/Contents/MacOS/draw.io -x --border 2 -f png --scale 2 -o landscape.png landscape.drawio
```

Other arguments:

| argument | description |
|:------------------------|:---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| -f, --format <format> | if output file name extension is specified, this option is ignored (file type is determined from output extension, possible export formats are pdf, png, jpg, svg, vsdx, and xml) (default: "pdf") |
| -q, --quality <quality> | output image quality for JPEG (default: 90) |
| t, --transparent | set transparent background for PNG |
| -b, --border <border> | sets the border width around the diagram (default: 0) |
| -s, --scale <scale> | scales the diagram size |
| --width <width> | fits the generated image/pdf into the specified width, preserves aspect ratio. |
| --height <height> | fits the generated image/pdf into the specified height, preserves aspect ratio. |

## drawio in the browser

Expand Down

0 comments on commit 6067f47

Please sign in to comment.