mingrammer / diagrams

:art: Diagram as Code for prototyping cloud system architectures
https://diagrams.mingrammer.com
MIT License
37.35k stars 2.43k forks source link

Support automatic unique colors per line or resource name #160

Open trov-madisonhope opened 4 years ago

trov-madisonhope commented 4 years ago

For a large enough graph, following out the lines without distinction becomes pretty difficult. I usually use a hashing strategy for this but I thought I'd open the ticket for a potential mainline feature.

leandrodamascena commented 4 years ago

You can do this in actual version.. Only put an Edge and set color between connectors.. Like this code...

from diagrams import Cluster, Diagram, Edge
from diagrams.aws.iot import InternetOfThings, IotCore, IotEvents
from diagrams.aws.integration import SQS

with Diagram("IOT Diagram", show=True, direction="LR"):

    _iotoutside = InternetOfThings("ESP-32 Board")

    with Cluster("AWS Serverless IOT"):

        _iotcore = IotCore("ESP-32 Iot Core")
        _iotevent = IotEvents("Event trigger SQS")
        _sqsesp32 = SQS("SQS Queue ESP32")

    _iotoutside >> Edge(color="#FF2FC0") >> _iotcore >> Edge(color="#FFFF2F") >> _iotevent >> _sqsesp32

image