Midnighter / structurizr-python

A Python 3 port of Simon Brown's Structurizr diagrams-as-code architecture description tool.
https://structurizr.com/
Apache License 2.0
65 stars 16 forks source link

How to enable auto layout #69

Open falko-burghausen opened 3 years ago

falko-burghausen commented 3 years ago

Checklist

Question

Hi, is it currently already somehow possible to use the auto-layout functionality for the diagrams, and if yes, how can I do that?

Thanks, Falko

Midnighter commented 3 years ago

Hey @falko-burghausen,

My own workflow has typically been to create a workspace, upload it, and then use the workspace editor interface to layout diagrams with a mix of auto and manual layouts. Are you saying that you would like automatic layouts to be applied via the API? Is this possible?

simonbrowndotje commented 3 years ago

Are you saying that you would like automatic layouts to be applied via the API? Is this possible?

There's an enableAutomaticLayout() method on the Java version of the View class that sets a property called automaticLayout ... it's just an object with a few properties. This is used by the web-based rendering engine, which subsequently uses this information to initiate the auto-layout algorithm, so the Python client library doesn't need to implement any auto-layout algorithms itself. Hope that helps!

simonbrowndotje commented 3 years ago

See also #65.

Midnighter commented 3 years ago

Ah, thank you for the clarification Simon. That actually looks quite manageable in terms of implementation.