structurizr / lite

Structurizr Lite
https://docs.structurizr.com/lite
MIT License
232 stars 28 forks source link

Unable to disable automatic layout using struturizr lite docker image #26

Closed gluefactory closed 1 year ago

gluefactory commented 1 year ago

I'm running the structurizr lite docker image locally using:

docker run -it --rm -p 8080:8080 -v $PWD:/usr/local/structurizr structurizr/lite

and then editing workspace.dsl to the sample to the basic example in the language reference

workspace {

    model {
        user = person "User"
        softwareSystem = softwareSystem "Software System" {
            webapp = container "Web Application"
            database = container "Database"
         }

        user -> webapp "Uses"
        webapp -> database "Reads from and writes to"
    }

    views {
        theme default
    }

}

When I render it on localhost:8080 I can't edit because This diagram is not editable because automatic layout is enabled. However the dsl contains no autoLayout option. I can see autoLayout in workplace.json but if I remove that, it is overwritten and recreated again.

simonbrowndotje commented 1 year ago

See https://github.com/structurizr/dsl/blob/master/docs/language-reference.md#autolayout ... you'll need to use a script to disable automatic layout, or define the views yourself.

gluefactory commented 1 year ago

Thanks. If I replace the existing:

    views {
        theme default
    }

with:

    views {

        styles {
            element "Software System" {
                background #1168bd
                color #ffffff
            }
            element "User" {
                shape person
                background #08427b
                color #ffffff
            }
        }
    }

I still have the same issue. Does that not constitute defining a view?

simonbrowndotje commented 1 year ago

It doesn't ... you're not actually defining any views inside the views block. See https://github.com/structurizr/dsl/tree/master/docs/cookbook/system-context-view for an example.

gluefactory commented 1 year ago

Ahh right. Thanks