mvn-tree-visualizer 1.0.3b1__py3-none-any.whl → 1.0.3b4__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.
@@ -0,0 +1,61 @@
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>"""
File without changes
@@ -1,4 +1,4 @@
1
- from .cli import cli
2
-
3
1
  if __name__ == "__main__":
2
+ from mvn_tree_visualizer.cli import cli
3
+
4
4
  cli()
@@ -1,6 +1,8 @@
1
1
  from pathlib import Path
2
2
 
3
- from jinja2 import Environment, FileSystemLoader
3
+ from jinja2 import BaseLoader, Environment
4
+
5
+ from .TEMPLATE import HTML_TEMPLATE
4
6
 
5
7
 
6
8
  def _convert_to_mermaid(dependency_tree: str) -> str:
@@ -55,8 +57,7 @@ def create_diagram(keep_tree: bool = False, intermediate_filename: str = "depend
55
57
 
56
58
  mermaid_diagram = _convert_to_mermaid(dependency_tree)
57
59
 
58
- env = Environment(loader=FileSystemLoader("./src/mvn_tree_visualizer"))
59
- template = env.get_template("dependency_diagram_template.j2")
60
+ template = Environment(loader=BaseLoader).from_string(HTML_TEMPLATE)
60
61
  rendered = template.render(diagram_definition=mermaid_diagram)
61
62
 
62
63
  parent_dir = Path(output_filename).parent
@@ -1,42 +1,41 @@
1
- Metadata-Version: 2.4
2
- Name: mvn-tree-visualizer
3
- Version: 1.0.3b1
4
- Summary: A simple command line tool to visualize the dependency tree of a Maven project in a graphical format.
5
- Author-email: Iraklis Konsoulas <dyka3773@gmail.com>
6
- License-Expression: MIT
7
- Project-URL: source, https://github.com/dyka3773/mvn-tree-visualizer
8
- Keywords: maven,dependency,visualization,tree,cli,command-line,tool,graph,mermaid
9
- Classifier: Development Status :: 4 - Beta
10
- Classifier: Intended Audience :: Developers
11
- Classifier: Programming Language :: Python :: 3
12
- Classifier: Programming Language :: Python :: 3.13
13
- Classifier: Topic :: Software Development :: Build Tools
14
- Requires-Python: >=3.13
15
- Description-Content-Type: text/markdown
16
- License-File: LICENSE
17
- Requires-Dist: jinja2>=3.1.6
18
- Dynamic: license-file
19
-
20
- # mvn-tree-visualizer
21
-
22
- This project provides a simple command line tool to visualize the dependency tree of a Maven project in a graphical format.
23
-
24
- ## How to Use
25
- 1. Run the following command in your terminal to generate the dependency tree and save it to a file:
26
- ```bash
27
- mvn dependency:tree -DoutputFile=maven_dependency_file -DappendOutput=true
28
- ```
29
- > Feel free to add other options to the command as needed. eg `-Dincludes="org.example"`
30
- 2. Use the `mvn-tree-visualizer` command to visualize the dependency tree:
31
- ```bash
32
- python -m mvn_tree_visualizer --filename "maven_dependency_file" --output "diagram.html"
33
- ```
34
- 3. Open the generated `diagram.html` file in your web browser to view the dependency tree.
35
-
36
- ## Options
37
- - `--filename`: The name of the file containing the Maven dependency tree. Default is `maven_dependency_file`.
38
- - `--output`: The name of the output HTML file. Default is `diagram.html`.
39
- - `--directory`: The directory to scan for the Maven dependency file(s). Default is the current directory.
40
- - `--keep-tree`: Keep the tree structure file when processing is complete in the same directory as the output file. Default is false.
41
- - `--help`: Show help message and exit.
42
-
1
+ Metadata-Version: 2.4
2
+ Name: mvn-tree-visualizer
3
+ Version: 1.0.3b4
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
+ Requires-Python: >=3.13
16
+ Requires-Dist: jinja2>=3.1.6
17
+ Description-Content-Type: text/markdown
18
+
19
+ # mvn-tree-visualizer
20
+
21
+ This project provides a simple command line tool to visualize the dependency tree of a Maven project in a graphical format.
22
+
23
+ ## How to Use
24
+ 1. Run the following command in your terminal to generate the dependency tree and save it to a file:
25
+ ```bash
26
+ mvn dependency:tree -DoutputFile=maven_dependency_file -DappendOutput=true
27
+ ```
28
+ > Feel free to add other options to the command as needed. eg `-Dincludes="org.example"`
29
+ 2. Use the `mvn-tree-visualizer` command to visualize the dependency tree:
30
+ ```bash
31
+ python -m mvn_tree_visualizer --filename "maven_dependency_file" --output "diagram.html"
32
+ ```
33
+ 3. Open the generated `diagram.html` file in your web browser to view the dependency tree.
34
+
35
+ ## Options
36
+ - `--filename`: The name of the file containing the Maven dependency tree. Default is `maven_dependency_file`.
37
+ - `--output`: The name of the output HTML file. Default is `diagram.html`.
38
+ - `--directory`: The directory to scan for the Maven dependency file(s). Default is the current directory.
39
+ - `--keep-tree`: Keep the tree structure file when processing is complete in the same directory as the output file. Default is false.
40
+ - `--help`: Show help message and exit.
41
+
@@ -0,0 +1,11 @@
1
+ mvn_tree_visualizer/TEMPLATE.py,sha256=oQa_84GV-DGvHfPpOor7ALkZwfGvk1wvCrQKCBsuOeg,2560
2
+ mvn_tree_visualizer/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
+ mvn_tree_visualizer/__main__.py,sha256=1UA2dYHkOCbajDc7rQyKB8N1hP9POnbajya_JpIh28k,86
4
+ mvn_tree_visualizer/cli.py,sha256=sMl1yeCQGwWswiC5xVEOdy1nXhF9Vx5DnoqfHuq02_U,2036
5
+ mvn_tree_visualizer/diagram.py,sha256=PCuR96pBH2JUOZ2RsYKRwMzG7c58CKdNJvk6t0FxuL0,2603
6
+ mvn_tree_visualizer/get_dependencies_in_one_file.py,sha256=d0ldXC0sYvDKLXozD0JgHsMcID_gN4xjeCUdk5TCiV4,515
7
+ mvn_tree_visualizer-1.0.3b4.dist-info/METADATA,sha256=YVQ_d3TKC1vq91ZKxJCZOX5NuUDFO1h9Ri1HaOyVv4E,1972
8
+ mvn_tree_visualizer-1.0.3b4.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
9
+ mvn_tree_visualizer-1.0.3b4.dist-info/entry_points.txt,sha256=Mu3QZhrlvbYuCxqmluVGi2efgKjkQY6T8Opf-vdb7hU,68
10
+ mvn_tree_visualizer-1.0.3b4.dist-info/licenses/LICENSE,sha256=c_8ezHwcOG8McIzdj7ZPgkqN1RuUMfP0hlmd6gX4gR0,1096
11
+ mvn_tree_visualizer-1.0.3b4.dist-info/RECORD,,
@@ -1,5 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (80.9.0)
2
+ Generator: hatchling 1.27.0
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
-
@@ -1,10 +0,0 @@
1
- mvn_tree_visualizer/__main__.py,sha256=CE0SkifsGtLofFUdPozg-CvvkqrCmZlOpjap1nBnVnM,63
2
- mvn_tree_visualizer/cli.py,sha256=sMl1yeCQGwWswiC5xVEOdy1nXhF9Vx5DnoqfHuq02_U,2036
3
- mvn_tree_visualizer/diagram.py,sha256=bxZC7Hqr06KIEYYFavKKGo1JL8l2uo0TC1aTgjcpbGk,2640
4
- mvn_tree_visualizer/get_dependencies_in_one_file.py,sha256=d0ldXC0sYvDKLXozD0JgHsMcID_gN4xjeCUdk5TCiV4,515
5
- mvn_tree_visualizer-1.0.3b1.dist-info/licenses/LICENSE,sha256=c_8ezHwcOG8McIzdj7ZPgkqN1RuUMfP0hlmd6gX4gR0,1096
6
- mvn_tree_visualizer-1.0.3b1.dist-info/METADATA,sha256=-XUuZc97WtMqrVH_Shi1VICPnOBNt74g3F5kVlh7U3Q,2036
7
- mvn_tree_visualizer-1.0.3b1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
8
- mvn_tree_visualizer-1.0.3b1.dist-info/entry_points.txt,sha256=Mu3QZhrlvbYuCxqmluVGi2efgKjkQY6T8Opf-vdb7hU,68
9
- mvn_tree_visualizer-1.0.3b1.dist-info/top_level.txt,sha256=HnFdJDMoJlvQhMTolib_U5UawIdRfkNk8andYnM5lMk,20
10
- mvn_tree_visualizer-1.0.3b1.dist-info/RECORD,,
@@ -1 +0,0 @@
1
- mvn_tree_visualizer