Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

All diagrams keep losing their formatting #180

Open
relentless opened this issue Jan 23, 2025 · 1 comment
Open

All diagrams keep losing their formatting #180

relentless opened this issue Jan 23, 2025 · 1 comment
Labels
bug Something isn't working

Comments

@relentless
Copy link

Expected

When I make changes to the workspace.dsl, these should be reflected in the diagrams on the web editor, with the diagrams keeping their formatting (the position of the elements).

Actual

Quite often, I make some changes to the workspace.dsl, and when these are picked up by the website, all my diagrams lose their formatting, regardless of whether the I changed any of the elements on them. (As in, all the elements go back to the top-left corner of the diagram).

The only solution I've found is to keep saving copies of the workspace.dsl and workspace.json, and when this happens, go back to a previous version and add the changes back in, perhaps saving more regularly.

Steps to reproduce

  1. Write some DSL including multiple diagrams
  2. Format the diagrams in the web editor and save the changes
  3. Update and save the DSL (I've not been able to work out exactly what sort of change causes this issue - I try to save the DSL regularly to minimise the chances, but it still happens quite often)
  4. Wait for the website to reload
  5. Look sadly at your diagrams and see the formatting is gone (the diagrams look correct in the thumbnails, but as you click on them, you see the formatting is gone and the thumbnail updates to the unformatted version)
  6. Realise you forgot to back up the workspace dsl/json for a while and wonder whether it will be quicker to add all your changes back into the dsl or reformat all your diagrams again.

Version/build information

C:\WINDOWS\system32>C:\Apps\microsoft-jdk-21.0.5-windows-x64\jdk-21.0.5+11\bin\java -jar C:\Users\gcro\Downloads\structurizr-lite.war C:\Apps\Structurizr\Case

[main 2025-01-23T09:46:17.714Z] update#setState idle
(node:21368) [DEP0168] DeprecationWarning: Uncaught N-API callback exception detected, please run node with option --force-node-api-uncaught-exceptions-policy=true to handle those exceptions properly.
(Use code --trace-deprecation ... to show where the warning was created)
2025-01-23T09:46:18.790Z INFO 14404 --- [ main] com.structurizr.lite.StructurizrLite : Starting StructurizrLite using Java 21.0.5 with PID 14404 (C:\Users\gcro\Downloads\structurizr-lite.war started by gcro in C:\WINDOWS\system32)
2025-01-23T09:46:18.800Z INFO 14404 --- [ main] com.structurizr.lite.StructurizrLite : No active profile set, falling back to 1 default profile: "default"
2025-01-23T09:46:25.062Z WARN 14404 --- [ main] o.a.l.i.v.VectorizationProvider : Java vector incubator module is not readable. For optimal vector performance, pass '--add-modules jdk.incubator.vector' to enable Vector API.
2025-01-23T09:46:25.479Z INFO 14404 --- [ main] com.structurizr.lite.StructurizrLite : Started StructurizrLite in 7.154 seconds (process running for 8.823)
2025-01-23T09:46:25.479Z INFO 14404 --- [ main] com.structurizr.lite.StructurizrLite : ***********************************************************************************
2025-01-23T09:46:25.479Z INFO 14404 --- [ main] com.structurizr.lite.StructurizrLite : _____ _ _ _
2025-01-23T09:46:25.479Z INFO 14404 --- [ main] com.structurizr.lite.StructurizrLite : / | | | | ()
2025-01-23T09:46:25.479Z INFO 14404 --- [ main] com.structurizr.lite.StructurizrLite : | (
| |_ _ __ _ _ | | _ _ _ __ _ _____ __
2025-01-23T09:46:25.479Z INFO 14404 --- [ main] com.structurizr.lite.StructurizrLite : _
| | '| | | |/ | | | | | '| | / '|
2025-01-23T09:46:25.479Z INFO 14404 --- [ main] com.structurizr.lite.StructurizrLite : __) | || | | || | (
| || || | | | |/ /| |
2025-01-23T09:46:25.479Z INFO 14404 --- [ main] com.structurizr.lite.StructurizrLite : |
/ _|| _,|_|_|_,|| |/|_|
2025-01-23T09:46:25.479Z INFO 14404 --- [ main] com.structurizr.lite.StructurizrLite :
2025-01-23T09:46:25.479Z INFO 14404 --- [ main] com.structurizr.lite.StructurizrLite : Structurizr Lite
2025-01-23T09:46:25.495Z INFO 14404 --- [ main] com.structurizr.lite.StructurizrLite : - build: 2024.11.04 (2024-11-04T11:32:50Z)
2025-01-23T09:46:25.497Z INFO 14404 --- [ main] com.structurizr.lite.StructurizrLite : - structurizr-java: v3.1.0
2025-01-23T09:46:25.501Z INFO 14404 --- [ main] com.structurizr.lite.StructurizrLite : - structurizr-dsl: v3.1.0
2025-01-23T09:46:25.501Z INFO 14404 --- [ main] com.structurizr.lite.StructurizrLite : - structurizr-graphviz: v3.1.0
2025-01-23T09:46:25.501Z INFO 14404 --- [ main] com.structurizr.lite.StructurizrLite :
2025-01-23T09:46:25.501Z INFO 14404 --- [ main] com.structurizr.lite.StructurizrLite : Workspace path: C:\Apps\Structurizr\Case
2025-01-23T09:46:25.501Z INFO 14404 --- [ main] com.structurizr.lite.StructurizrLite : Workspace filename: workspace[.dsl|.json]
2025-01-23T09:46:25.501Z INFO 14404 --- [ main] com.structurizr.lite.StructurizrLite : Workspaces: 1
2025-01-23T09:46:25.501Z INFO 14404 --- [ main] com.structurizr.lite.StructurizrLite : URL:
2025-01-23T09:46:25.501Z INFO 14404 --- [ main] com.structurizr.lite.StructurizrLite : Auto-save interval: 0ms
2025-01-23T09:46:25.501Z INFO 14404 --- [ main] com.structurizr.lite.StructurizrLite : Auto-refresh interval: 2000ms
2025-01-23T09:46:25.501Z WARN 14404 --- [ main] com.structurizr.lite.StructurizrLite : Cannot run program "dot": CreateProcess error=2, The system cannot find the file specified
2025-01-23T09:46:25.501Z INFO 14404 --- [ main] com.structurizr.lite.StructurizrLite : Graphviz (dot): false
2025-01-23T09:46:25.516Z INFO 14404 --- [ main] com.structurizr.lite.StructurizrLite : ***********************************************************************************

Severity

Major

Priority

Low (I have no budget and there's no rush, please fix this for free)

More information

Possible the same issue as this: #5

(I believe I may have lost my formatting before simply by leaving the program running for a while, e.g. overnight, but I've not confirmed this).

The troubleshooting on the website mentions an issue related to the merging algorithm which may be the cause: https://docs.structurizr.com/lite/troubleshooting#diagram-layout-is-lost-when-using-manual-layout

All my diagrams have keys though, which I don't change. I do sometimes move things around in the DSL file, but it's hard not to.

@relentless relentless added the bug Something isn't working label Jan 23, 2025
@relentless
Copy link
Author

I did some testing after raising this and I'm starting to think it might not be related to DSL changes.

Specifically, when I lost all my formatting I went back to a previous backup of the workspace dsl & json. I then copied all the DSL changes back into workspace.dsl in one go, and it was fine. As expected, the new elements were all in the corner, but in general all the diagrams were still formatted.

Looking at the json where the formatting was lost, I see the x & y of everything is set to 0 (but otherwise seems OK)

"containerViews" : [ {
"elements" : [ {
"id" : "10",
"x" : 0,
"y" : 0
}, {
"id" : "11",
"x" : 0,
"y" : 0
}, {
"id" : "13",
"x" : 0,
"y" : 0
}, {
"id" : "15",
"x" : 0,
"y" : 0
}, {
"id" : "16",
"x" : 0,
"y" : 0
}, {
"id" : "19",
"x" : 0,
"y" : 0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant