structurizr / lite

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

Manual line shape always lost #23

Closed phxnsharp closed 1 year ago

phxnsharp commented 1 year ago

Much like in #19 I am using manual layouts. I am not experiencing their complete loss of position. Moving blocks and components around is saved fine. However, any edits to the line locations and shape is (for my complex diagrams) lost every single time the page is loaded. This makes structurizr somewhat unusable as I cannot make the lines correct at all.

Reproduction:

workspace {
  model {
    ExternalSystem = softwareSystem "External System"
    System = softwareSystem "The Project"
    ExternalSystem -> System
    System -> ExternalSystem
  }

  views {
    systemContext System "SystemContext" "Top Level Context" {
      include *
    }
  }
}

Launch structurizr lite:

docker run -d  --rm -p 8080:8080 -v ${PWD}:/usr/local/structurizr structurizr/lite:2920

View the page: image

Move the blocks and also change the line locations. Note that with this simple model, sometimes the line positions are saved, sometimes they are lost. The simple edit that is always lost is to remove the elbow so that the lines are straight and overlapping. image

Ensure that the save has completed

Press f5 to reload the page. The block positions are saved, but the lines positions are lost: image

simonbrowndotje commented 1 year ago

There's some code in the diagram renderer that detects cyclic arrows (as shown in image 2) and breaks them apart (as shown in image 3). So what you're seeing is the expected behaviour.

phxnsharp commented 1 year ago

For a new user, it is pretty frustrating to have it overwrite manual adjustments I have made. But with this information, a simple workaround is to leave the elbow point, but just have the elbow in a straight line. Thank you.

simonbrowndotje commented 1 year ago

Are you trying to replicate a bi-directional arrow?

phxnsharp commented 1 year ago

Yes

simonbrowndotje commented 1 year ago

I don't recommend bi-directional arrows as they are generally ambiguous, which is why Structurizr doesn't support them. Sorry!