justone / dockviz

Visualizing Docker data
Apache License 2.0
1.21k stars 107 forks source link

Feature request: Collapsed view #48

Open nl-brett-stime opened 3 years ago

nl-brett-stime commented 3 years ago

A useful feature would be to collapse long chains of dependent layers when there's no branching and none of the layers between two points in the graph are labelled. Perhaps the collapse could happen by default after a major release and then use a command line switch to optionally emit/expand on all of the details. In the mean time, the collapse feature could be optional.

E.g.,

From:

├─<missing> Virtual Size: 63.2 MB
│ └─<missing> Virtual Size: 64.2 MB
│   └─<missing> Virtual Size: 64.2 MB
│     └─<missing> Virtual Size: 64.2 MB
│       └─2eb2d388e1a2 Virtual Size: 64.2 MB Tags: ubuntu:18.04
│         └─4040366ea929 Virtual Size: 64.2 MB
│           └─c760175c924f Virtual Size: 1.3 GB
│             └─a05af0056379 Virtual Size: 1.3 GB
│               └─92307fb4f577 Virtual Size: 1.6 GB
│                 └─7ae420564a53 Virtual Size: 1.6 GB
│                   └─14e125e97949 Virtual Size: 1.8 GB
│                     └─e6a7a16eb779 Virtual Size: 1.8 GB
│                       └─7dc18daff83f Virtual Size: 1.8 GB
│                         └─88a0972c5601 Virtual Size: 2.0 GB
│                           └─6f210398b754 Virtual Size: 2.2 GB
│                             └─d36437dd6d91 Virtual Size: 2.2 GB
│                               └─371a47b727f3 Virtual Size: 2.2 GB
│                                 └─b5e85f78d8c6 Virtual Size: 2.2 GB
│                                   └─fd444c63c29c Virtual Size: 2.2 GB
│                                     └─88d6707832ef Virtual Size: 2.2 GB
│                                       └─630d9e8a61e9 Virtual Size: 2.2 GB
│                                         └─f4bc53a3b824 Virtual Size: 2.2 GB
│                                           └─164954efc6d6 Virtual Size: 2.2 GB
│                                             └─f5c46d8d5a7e Virtual Size: 2.2 GB
│                                               └─114b0d37c397 Virtual Size: 2.2 GB
│                                                 └─74e02d43d31d Virtual Size: 2.2 GB
│                                                   └─8b98b392a191 Virtual Size: 2.2 GB
│                                                     └─fae8b6ae4853 Virtual Size: 2.2 GB
│                                                       └─f506cd9335ce Virtual Size: 2.2 GB
│                                                         └─e53c60ef5f95 Virtual Size: 2.2 GB
│                                                           └─876a906daf9e Virtual Size: 2.2 GB
│                                                             └─b2adf33cd106 Virtual Size: 2.2 GB
│                                                               └─2a27335c7e7c Virtual Size: 2.2 GB
│                                                                 └─3c194ef79f0e Virtual Size: 2.6 GB
│                                                                   └─e9834370cd36 Virtual Size: 2.6 GB
│                                                                     └─1147fdd740ce Virtual Size: 2.6 GB
│                                                                       └─531613959f2a Virtual Size: 2.6 GB
│                                                                         └─6cd993018f28 Virtual Size: 2.7 GB
│                                                                           └─54d9b1f0a011 Virtual Size: 2.7 GB
│                                                                             └─052f131f4dad Virtual Size: 2.7 GB
│                                                                               └─6fb77c426cfc Virtual Size: 2.7 GB
│                                                                                 └─7da263073c3e Virtual Size: 2.8 GB
│                                                                                   └─b96344b7dcfe Virtual Size: 2.8 GB
│                                                                                     └─96e87d983215 Virtual Size: 3.1 GB
│                                                                                       └─f9148349994e Virtual Size: 3.1 GB
│                                                                                         └─5b38bb01d2d1 Virtual Size: 3.2 GB
│                                                                                           └─88740d7e7e51 Virtual Size: 3.2 GB
│                                                                                             └─378595f003a3 Virtual Size: 3.2 GB
│                                                                                               └─288da0906906 Virtual Size: 3.2 GB
│                                                                                                 └─4dca8def0f4b Virtual Size: 3.2 GB
│                                                                                                   └─dd8cf75c4153 Virtual Size: 3.4 GB
│                                                                                                     └─e9b5f794a766 Virtual Size: 3.4 GB
│                                                                                                       └─61f894fb3173 Virtual Size: 3.5 GB
│                                                                                                         └─311289a49e3b Virtual Size: 3.5 GB
│                                                                                                           └─0814f8196fce Virtual Size: 3.7 GB
│                                                                                                             └─735e577b1258 Virtual Size: 3.7 GB
│                                                                                                               └─1c336c47b793 Virtual Size: 3.8 GB
│                                                                                                                 └─7d735bd35dbb Virtual Size: 3.8 GB
│                                                                                                                   └─72dccdcca30d Virtual Size: 3.8 GB
│                                                                                                                     └─06c6087eb39b Virtual Size: 3.8 GB
│                                                                                                                       └─37cd60936b0b Virtual Size: 3.8 GB
│                                                                                                                         └─478ebbbc7ec0 Virtual Size: 4.1 GB
│                                                                                                                           └─553947870ce8 Virtual Size: 4.1 GB
│                                                                                                                             └─5db156b7a488 Virtual Size: 4.1 GB
│                                                                                                                               └─adcf84a26033 Virtual Size: 4.3 GB
│                                                                                                                                 └─08e99d787348 Virtual Size: 4.3 GB
│                                                                                                                                   └─21299bfffeb1 Virtual Size: 4.3 GB
│                                                                                                                                     └─2ffa0253caff Virtual Size: 4.3 GB
│                                                                                                                                       └─b2f084a571a9 Virtual Size: 4.7 GB
│                                                                                                                                         └─0cb9fe5a74ba Virtual Size: 5.0 GB
│                                                                                                                                           └─d94d94b54c47 Virtual Size: 5.0 GB
│                                                                                                                                             └─299cf350531f Virtual Size: 5.0 GB
│                                                                                                                                               └─7066d028cee4 Virtual Size: 5.0 GB
│                                                                                                                                                 └─0d6eb58e60e6 Virtual Size: 5.0 GB
│                                                                                                                                                   └─2a3d32ce4c0f Virtual Size: 5.0 GB
│                                                                                                                                                     └─9f0287a36ec3 Virtual Size: 5.0 GB
│                                                                                                                                                       └─c410ee887c83 Virtual Size: 5.3 GB
│                                                                                                                                                         └─e89edbe51bad Virtual Size: 6.8 GB
│                                                                                                                                                           └─424b48b6779e Virtual Size: 7.2 GB
│                                                                                                                                                             └─e902385474b6 Virtual Size: 8.2 GB
│                                                                                                                                                               └─24c80f04a599 Virtual Size: 8.2 GB
│                                                                                                                                                                 └─ca10c6824438 Virtual Size: 8.2 GB
│                                                                                                                                                                   └─fc4c29c1c846 Virtual Size: 8.2 GB
│                                                                                                                                                                     └─0b320e9b2dfd Virtual Size: 8.4 GB
│                                                                                                                                                                       └─02c6686eb22f Virtual Size: 8.4 GB
│                                                                                                                                                                         └─d4eb41435558 Virtual Size: 8.4 GB
│                                                                                                                                                                           └─d4b94a44d7d7 Virtual Size: 8.7 GB
│                                                                                                                                                                             └─c35528d57bcc Virtual Size: 8.8 GB
│                                                                                                                                                                               └─41207c4ba899 Virtual Size: 8.8 GB
│                                                                                                                                                                                 └─8a39531409fd Virtual Size: 8.8 GB
│                                                                                                                                                                                   └─0a17cd6f20c6 Virtual Size: 8.8 GB
│                                                                                                                                                                                     └─a8bed6a99ef6 Virtual Size: 8.8 GB
│                                                                                                                                                                                       └─78e50546055e Virtual Size: 8.8 GB
│                                                                                                                                                                                         └─c63a5b226ed9 Virtual Size: 8.8 GB
│                                                                                                                                                                                           └─efaecbeb1184 Virtual Size: 8.8 GB
│                                                                                                                                                                                             └─8ec1cc053c3f Virtual Size: 8.8 GB
│                                                                                                                                                                                               └─f9aef76f8f56 Virtual Size: 8.8 GB
│                                                                                                                                                                                                 └─b61fba4a3e71 Virtual Size: 8.8 GB Tags: aws/codebuild/standard:4.0

to

| ... 4 layer(s) collapsed
│   └─2eb2d388e1a2 Virtual Size: 64.2 MB Tags: ubuntu:18.04
        ... 92 layer(s) collapsed
│     └─b61fba4a3e71 Virtual Size: 8.8 GB Tags: aws/codebuild/standard:4.0
maxsatula commented 11 months ago

Excuse me in case if I did not read the description carefully, but has it been implemented by --only-labelled option?