mvn-tree-visualizer 1.2.0__py3-none-any.whl → 1.4.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of mvn-tree-visualizer might be problematic. Click here for more details.
- mvn_tree_visualizer/cli.py +155 -24
- mvn_tree_visualizer/diagram.py +15 -3
- mvn_tree_visualizer/enhanced_template.py +218 -0
- mvn_tree_visualizer/exceptions.py +25 -0
- mvn_tree_visualizer/file_watcher.py +71 -0
- mvn_tree_visualizer/get_dependencies_in_one_file.py +34 -7
- mvn_tree_visualizer/outputs/html_output.py +81 -14
- mvn_tree_visualizer/outputs/json_output.py +2 -2
- mvn_tree_visualizer/themes.py +189 -0
- mvn_tree_visualizer/validation.py +86 -0
- mvn_tree_visualizer-1.4.0.dist-info/METADATA +209 -0
- mvn_tree_visualizer-1.4.0.dist-info/RECORD +17 -0
- mvn_tree_visualizer/TEMPLATE.py +0 -61
- mvn_tree_visualizer-1.2.0.dist-info/METADATA +0 -94
- mvn_tree_visualizer-1.2.0.dist-info/RECORD +0 -13
- {mvn_tree_visualizer-1.2.0.dist-info → mvn_tree_visualizer-1.4.0.dist-info}/WHEEL +0 -0
- {mvn_tree_visualizer-1.2.0.dist-info → mvn_tree_visualizer-1.4.0.dist-info}/entry_points.txt +0 -0
- {mvn_tree_visualizer-1.2.0.dist-info → mvn_tree_visualizer-1.4.0.dist-info}/licenses/LICENSE +0 -0
mvn_tree_visualizer/TEMPLATE.py
DELETED
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
HTML_TEMPLATE = r"""<html></html>
|
|
2
|
-
<head>
|
|
3
|
-
<style type="text/css">
|
|
4
|
-
#mySvgId {
|
|
5
|
-
height: 90%;
|
|
6
|
-
width: 90%;
|
|
7
|
-
}
|
|
8
|
-
</style>
|
|
9
|
-
<title>Dependency Diagram</title>
|
|
10
|
-
</head>
|
|
11
|
-
<body>
|
|
12
|
-
<div id="graphDiv"></div>
|
|
13
|
-
<button id="downloadButton">Download SVG</button>
|
|
14
|
-
<script src="https://cdn.jsdelivr.net/npm/svg-pan-zoom@3.5.0/dist/svg-pan-zoom.min.js"></script>
|
|
15
|
-
<script type="module">
|
|
16
|
-
import mermaid from 'https://cdn.jsdelivr.net/npm/mermaid@10.9.0/dist/mermaid.esm.min.mjs';
|
|
17
|
-
mermaid.initialize({
|
|
18
|
-
startOnLoad:true,
|
|
19
|
-
sequence:{
|
|
20
|
-
useMaxWidth:false
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
const drawDiagram = async function () {
|
|
25
|
-
const element = document.querySelector('#graphDiv');
|
|
26
|
-
const graphDefinition = `
|
|
27
|
-
{{diagram_definition}}
|
|
28
|
-
`;
|
|
29
|
-
const { svg } = await mermaid.render('mySvgId', graphDefinition);
|
|
30
|
-
element.innerHTML = svg.replace(/[ ]*max-width:[ 0-9\.]*px;/i , '');
|
|
31
|
-
var panZoomTiger = svgPanZoom('#mySvgId', {
|
|
32
|
-
zoomEnabled: true,
|
|
33
|
-
controlIconsEnabled: true,
|
|
34
|
-
fit: true,
|
|
35
|
-
center: true
|
|
36
|
-
})
|
|
37
|
-
};
|
|
38
|
-
await drawDiagram();
|
|
39
|
-
|
|
40
|
-
// Add event listener to the download button to download the SVG without the pan & zoom buttons
|
|
41
|
-
document.getElementById('downloadButton').addEventListener('click', function() {
|
|
42
|
-
const svg = document.querySelector('#mySvgId');
|
|
43
|
-
let svgData = new XMLSerializer().serializeToString(svg);
|
|
44
|
-
|
|
45
|
-
// To remove the pan & zoom buttons of the diagram, any element whose class contains the string 'svg-pan-zoom-*' should be removed
|
|
46
|
-
svgData = svgData.replace(/<g\b[^>]*\bclass="svg-pan-zoom-.*?".*?>.*?<\/g>/g, '');
|
|
47
|
-
// The above leaves out a closing </g> tag before the final </svg> tag, so we need to remove it
|
|
48
|
-
svgData = svgData.replace(/<\/g><\/svg>/, '</svg>');
|
|
49
|
-
|
|
50
|
-
const svgBlob = new Blob([svgData], {type: 'image/svg+xml;charset=utf-8'});
|
|
51
|
-
const svgUrl = URL.createObjectURL(svgBlob);
|
|
52
|
-
const downloadLink = document.createElement('a');
|
|
53
|
-
downloadLink.href = svgUrl;
|
|
54
|
-
downloadLink.download = 'diagram.svg';
|
|
55
|
-
document.body.appendChild(downloadLink);
|
|
56
|
-
downloadLink.click();
|
|
57
|
-
document.body.removeChild(downloadLink);
|
|
58
|
-
});
|
|
59
|
-
</script>
|
|
60
|
-
</body>
|
|
61
|
-
</html>"""
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: mvn-tree-visualizer
|
|
3
|
-
Version: 1.2.0
|
|
4
|
-
Summary: A simple command line tool to visualize the dependency tree of a Maven project in a graphical format.
|
|
5
|
-
Project-URL: source, https://github.com/dyka3773/mvn-tree-visualizer
|
|
6
|
-
Author-email: Iraklis Konsoulas <dyka3773@gmail.com>
|
|
7
|
-
License-Expression: MIT
|
|
8
|
-
License-File: LICENSE
|
|
9
|
-
Keywords: cli,command-line,dependency,graph,maven,mermaid,tool,tree,visualization
|
|
10
|
-
Classifier: Development Status :: 4 - Beta
|
|
11
|
-
Classifier: Intended Audience :: Developers
|
|
12
|
-
Classifier: Programming Language :: Python :: 3
|
|
13
|
-
Classifier: Programming Language :: Python :: 3.13
|
|
14
|
-
Classifier: Topic :: Software Development :: Build Tools
|
|
15
|
-
Classifier: Typing :: Typed
|
|
16
|
-
Requires-Python: >=3.13
|
|
17
|
-
Requires-Dist: jinja2>=3.1.6
|
|
18
|
-
Description-Content-Type: text/markdown
|
|
19
|
-
|
|
20
|
-
# Maven Dependency Tree Visualizer
|
|
21
|
-
|
|
22
|
-
[](https://badge.fury.io/py/mvn-tree-visualizer)
|
|
23
|
-
|
|
24
|
-
A simple command-line tool to visualize the dependency tree of a Maven project in a graphical and interactive format.
|
|
25
|
-
|
|
26
|
-
This tool was born out of the frustration of not being able to easily visualize the dependency tree of a Maven project. The `mvn dependency:tree` command is great, but the output can be hard to read, especially for large projects. This tool aims to solve that problem by providing a simple way to generate an interactive diagram or a structured JSON output of the dependency tree.
|
|
27
|
-
|
|
28
|
-
## Features
|
|
29
|
-
|
|
30
|
-
* **Multiple Output Formats:**
|
|
31
|
-
* **HTML:** Generates an interactive HTML diagram of your dependency tree using Mermaid.js.
|
|
32
|
-
* **JSON:** Creates a structured JSON representation of the dependency tree, perfect for scripting or integration with other tools.
|
|
33
|
-
* **Version Display:** Show or hide dependency versions in both HTML and JSON outputs using the `--show-versions` flag.
|
|
34
|
-
* **Easy to Use:** A simple command-line interface that gets the job done with minimal configuration.
|
|
35
|
-
* **File Merging:** Automatically finds and merges multiple `maven_dependency_file` files from different subdirectories.
|
|
36
|
-
* **Customizable Output:** Specify the output file name and location.
|
|
37
|
-
* **SVG Export:** Download the generated diagram as an SVG file directly from the HTML page.
|
|
38
|
-
|
|
39
|
-
## How to Use
|
|
40
|
-
|
|
41
|
-
1. **Generate the dependency file:**
|
|
42
|
-
Run the following command in your terminal at the root of your Maven project. This will generate a file named `maven_dependency_file` in each module's `target` directory.
|
|
43
|
-
|
|
44
|
-
```bash
|
|
45
|
-
mvn dependency:tree -DoutputFile=maven_dependency_file -DappendOutput=true
|
|
46
|
-
```
|
|
47
|
-
> You can add other options like `-Dincludes="org.example"` to filter the dependencies.
|
|
48
|
-
|
|
49
|
-
2. **Visualize the dependency tree:**
|
|
50
|
-
Use the `mvn-tree-visualizer` command to generate the diagram.
|
|
51
|
-
|
|
52
|
-
**For an HTML diagram:**
|
|
53
|
-
```bash
|
|
54
|
-
mvn_tree_visualizer --filename "maven_dependency_file" --output "diagram.html" --format html
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
**For a JSON output:**
|
|
58
|
-
```bash
|
|
59
|
-
mvn_tree_visualizer --filename "maven_dependency_file" --output "dependencies.json" --format json
|
|
60
|
-
```
|
|
61
|
-
|
|
62
|
-
**With version information displayed:**
|
|
63
|
-
```bash
|
|
64
|
-
mvn_tree_visualizer --filename "maven_dependency_file" --output "diagram.html" --show-versions
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
**JSON output with versions:**
|
|
68
|
-
```bash
|
|
69
|
-
mvn_tree_visualizer --filename "maven_dependency_file" --output "dependencies.json" --format json --show-versions
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
3. **View the output:**
|
|
73
|
-
* Open the generated `diagram.html` file in your web browser to view the interactive dependency tree.
|
|
74
|
-
* Use the `dependencies.json` file in your scripts or other tools.
|
|
75
|
-
|
|
76
|
-
## Options
|
|
77
|
-
|
|
78
|
-
* `--filename`: The name of the file containing the Maven dependency tree. Defaults to `maven_dependency_file`.
|
|
79
|
-
* `--output`: The name of the output file. Defaults to `diagram.html`.
|
|
80
|
-
* `--format`: The output format. Can be `html` or `json`. Defaults to `html`.
|
|
81
|
-
* `--show-versions`: Show dependency versions in the diagram. Applicable to both HTML and JSON output formats.
|
|
82
|
-
* `--directory`: The directory to scan for the Maven dependency file(s). Defaults to the current directory.
|
|
83
|
-
* `--keep-tree`: Keep the intermediate `dependency_tree.txt` file after generating the diagram. Defaults to `False`.
|
|
84
|
-
* `--help`: Show the help message and exit.
|
|
85
|
-
|
|
86
|
-
## Contributing
|
|
87
|
-
|
|
88
|
-
Contributions are welcome! If you have any ideas, suggestions, or bug reports, please open an issue or submit a pull request.
|
|
89
|
-
|
|
90
|
-
Please read our [CONTRIBUTING.md](CONTRIBUTING.md) file for more details.
|
|
91
|
-
|
|
92
|
-
## License
|
|
93
|
-
|
|
94
|
-
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
mvn_tree_visualizer/TEMPLATE.py,sha256=WIQfSNBygUZVkBrERq7QzqouGURA0NYVqUUm-11wMvo,2499
|
|
2
|
-
mvn_tree_visualizer/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
3
|
-
mvn_tree_visualizer/__main__.py,sha256=yIQFAdWjthKAFbSzzRuz5_YGlK0c6BnR2ypjNRDq180,82
|
|
4
|
-
mvn_tree_visualizer/cli.py,sha256=Pygjrz87rge2Bfpy1ePucjER8PL2ZP1fBJCRax4otqo,2761
|
|
5
|
-
mvn_tree_visualizer/diagram.py,sha256=8If6rNbyBZlM_BkQwpGTE3W3bHHxcJ_5MMBc2NnJZWM,313
|
|
6
|
-
mvn_tree_visualizer/get_dependencies_in_one_file.py,sha256=1UQUWny5t5QLbE2HOkK_BXSIU3BP7Qjx8mo6yEhMFi4,580
|
|
7
|
-
mvn_tree_visualizer/outputs/html_output.py,sha256=QwUZRzNUCKrpdOq6BHadIJSU47W_1Kat-ouzwue-olA,2857
|
|
8
|
-
mvn_tree_visualizer/outputs/json_output.py,sha256=49X02e3gNoKzBj2FYGKOwuyaX0s5pxWIQUZPruCTbTQ,2064
|
|
9
|
-
mvn_tree_visualizer-1.2.0.dist-info/METADATA,sha256=ZJNzw2z2zRItzBof4tFGrotsBL7SBumgaranNor4BWc,4603
|
|
10
|
-
mvn_tree_visualizer-1.2.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
11
|
-
mvn_tree_visualizer-1.2.0.dist-info/entry_points.txt,sha256=Mu3QZhrlvbYuCxqmluVGi2efgKjkQY6T8Opf-vdb7hU,68
|
|
12
|
-
mvn_tree_visualizer-1.2.0.dist-info/licenses/LICENSE,sha256=4zi6unpe17RUDMBu7ebh14jdbyvyeT-UA3n8Zl7aW74,1075
|
|
13
|
-
mvn_tree_visualizer-1.2.0.dist-info/RECORD,,
|
|
File without changes
|
{mvn_tree_visualizer-1.2.0.dist-info → mvn_tree_visualizer-1.4.0.dist-info}/entry_points.txt
RENAMED
|
File without changes
|
{mvn_tree_visualizer-1.2.0.dist-info → mvn_tree_visualizer-1.4.0.dist-info}/licenses/LICENSE
RENAMED
|
File without changes
|