structurizr-python icon indicating copy to clipboard operation
structurizr-python copied to clipboard

How to enable auto layout

Open falko-burghausen opened this issue 4 years ago • 4 comments

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

falko-burghausen avatar Jan 05 '21 12:01 falko-burghausen

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?

Midnighter avatar Feb 11 '21 10:02 Midnighter

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 avatar Feb 11 '21 11:02 simonbrowndotje

See also #65.

simonbrowndotje avatar Feb 11 '21 11:02 simonbrowndotje

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

Midnighter avatar Feb 11 '21 16:02 Midnighter