mvn-tree-visualizer 1.4.0__py3-none-any.whl → 1.5.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.
- mvn_tree_visualizer/enhanced_template.py +68 -5
- mvn_tree_visualizer/themes.py +13 -0
- {mvn_tree_visualizer-1.4.0.dist-info → mvn_tree_visualizer-1.5.0.dist-info}/METADATA +5 -7
- {mvn_tree_visualizer-1.4.0.dist-info → mvn_tree_visualizer-1.5.0.dist-info}/RECORD +7 -7
- {mvn_tree_visualizer-1.4.0.dist-info → mvn_tree_visualizer-1.5.0.dist-info}/WHEEL +0 -0
- {mvn_tree_visualizer-1.4.0.dist-info → mvn_tree_visualizer-1.5.0.dist-info}/entry_points.txt +0 -0
- {mvn_tree_visualizer-1.4.0.dist-info → mvn_tree_visualizer-1.5.0.dist-info}/licenses/LICENSE +0 -0
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
from typing import Any, Dict
|
|
4
4
|
|
|
5
|
-
from .themes import STANDARD_COLORS, Theme
|
|
5
|
+
from .themes import MAX_ZOOM, MIN_ZOOM, STANDARD_COLORS, ZOOM_SCALE_SENSITIVITY, Theme
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
def get_html_template(theme: Theme) -> str:
|
|
@@ -93,6 +93,12 @@ def get_html_template(theme: Theme) -> str:
|
|
|
93
93
|
<button id="downloadButton" class="toggle-btn">Download SVG</button>
|
|
94
94
|
<!-- Note: PNG download feature to be implemented in future version -->
|
|
95
95
|
</div>
|
|
96
|
+
<div class="control-group">
|
|
97
|
+
<span class="control-label">Navigation:</span>
|
|
98
|
+
<button id="zoomInButton" class="toggle-btn">Zoom In (+)</button>
|
|
99
|
+
<button id="zoomOutButton" class="toggle-btn">Zoom Out (-)</button>
|
|
100
|
+
<button id="resetZoomButton" class="toggle-btn">Reset (Ctrl+R)</button>
|
|
101
|
+
</div>
|
|
96
102
|
</div>
|
|
97
103
|
|
|
98
104
|
<div id="graphDiv"></div>
|
|
@@ -107,6 +113,10 @@ def get_html_template(theme: Theme) -> str:
|
|
|
107
113
|
// Global variables
|
|
108
114
|
let panZoomInstance = null;
|
|
109
115
|
|
|
116
|
+
const MIN_ZOOM = {MIN_ZOOM};
|
|
117
|
+
const MAX_ZOOM = {MAX_ZOOM};
|
|
118
|
+
const ZOOM_SCALE_SENSITIVITY = {ZOOM_SCALE_SENSITIVITY};
|
|
119
|
+
|
|
110
120
|
const drawDiagram = async function () {{
|
|
111
121
|
const element = document.querySelector('#graphDiv');
|
|
112
122
|
const graphDefinition = `{{{{diagram_definition}}}}`;
|
|
@@ -115,14 +125,21 @@ def get_html_template(theme: Theme) -> str:
|
|
|
115
125
|
const {{ svg }} = await mermaid.render('mySvgId', graphDefinition);
|
|
116
126
|
element.innerHTML = svg.replace(/[ ]*max-width:[ 0-9\\.]*px;/i , '');
|
|
117
127
|
|
|
118
|
-
// Initialize pan & zoom
|
|
128
|
+
// Initialize pan & zoom with improved settings for large diagrams
|
|
119
129
|
panZoomInstance = svgPanZoom('#mySvgId', {{
|
|
120
130
|
zoomEnabled: true,
|
|
121
131
|
controlIconsEnabled: true,
|
|
122
132
|
fit: true,
|
|
123
133
|
center: true,
|
|
124
|
-
minZoom:
|
|
125
|
-
maxZoom:
|
|
134
|
+
minZoom: MIN_ZOOM, // Allow zooming out further for large diagrams
|
|
135
|
+
maxZoom: MAX_ZOOM, // Allow much higher zoom for detailed inspection
|
|
136
|
+
zoomScaleSensitivity: ZOOM_SCALE_SENSITIVITY, // Smoother zoom increments
|
|
137
|
+
mouseWheelZoomEnabled: true,
|
|
138
|
+
preventMouseEventsDefault: true,
|
|
139
|
+
beforeZoom: function(oldScale, newScale) {{
|
|
140
|
+
// Prevent zooming beyond reasonable limits
|
|
141
|
+
return newScale >= MIN_ZOOM && newScale <= MAX_ZOOM;
|
|
142
|
+
}}
|
|
126
143
|
}});
|
|
127
144
|
|
|
128
145
|
// Setup node interactions
|
|
@@ -142,11 +159,29 @@ def get_html_template(theme: Theme) -> str:
|
|
|
142
159
|
}});
|
|
143
160
|
}};
|
|
144
161
|
|
|
145
|
-
//
|
|
162
|
+
// Button event listeners
|
|
146
163
|
document.getElementById('downloadButton').addEventListener('click', function() {{
|
|
147
164
|
downloadSVG();
|
|
148
165
|
}});
|
|
149
166
|
|
|
167
|
+
document.getElementById('zoomInButton').addEventListener('click', function() {{
|
|
168
|
+
if (panZoomInstance) {{
|
|
169
|
+
panZoomInstance.zoomIn();
|
|
170
|
+
}}
|
|
171
|
+
}});
|
|
172
|
+
|
|
173
|
+
document.getElementById('zoomOutButton').addEventListener('click', function() {{
|
|
174
|
+
if (panZoomInstance) {{
|
|
175
|
+
panZoomInstance.zoomOut();
|
|
176
|
+
}}
|
|
177
|
+
}});
|
|
178
|
+
|
|
179
|
+
document.getElementById('resetZoomButton').addEventListener('click', function() {{
|
|
180
|
+
if (panZoomInstance) {{
|
|
181
|
+
panZoomInstance.reset();
|
|
182
|
+
}}
|
|
183
|
+
}});
|
|
184
|
+
|
|
150
185
|
const downloadSVG = function() {{
|
|
151
186
|
const svg = document.querySelector('#mySvgId');
|
|
152
187
|
let svgData = new XMLSerializer().serializeToString(svg);
|
|
@@ -183,6 +218,34 @@ def get_html_template(theme: Theme) -> str:
|
|
|
183
218
|
panZoomInstance.reset();
|
|
184
219
|
}}
|
|
185
220
|
break;
|
|
221
|
+
case '=':
|
|
222
|
+
case '+':
|
|
223
|
+
e.preventDefault();
|
|
224
|
+
if (panZoomInstance) {{
|
|
225
|
+
panZoomInstance.zoomIn();
|
|
226
|
+
}}
|
|
227
|
+
break;
|
|
228
|
+
case '-':
|
|
229
|
+
e.preventDefault();
|
|
230
|
+
if (panZoomInstance) {{
|
|
231
|
+
panZoomInstance.zoomOut();
|
|
232
|
+
}}
|
|
233
|
+
break;
|
|
234
|
+
}}
|
|
235
|
+
}} else {{
|
|
236
|
+
// Non-Ctrl shortcuts
|
|
237
|
+
switch(e.key) {{
|
|
238
|
+
case '+':
|
|
239
|
+
case '=':
|
|
240
|
+
if (panZoomInstance) {{
|
|
241
|
+
panZoomInstance.zoomIn();
|
|
242
|
+
}}
|
|
243
|
+
break;
|
|
244
|
+
case '-':
|
|
245
|
+
if (panZoomInstance) {{
|
|
246
|
+
panZoomInstance.zoomOut();
|
|
247
|
+
}}
|
|
248
|
+
break;
|
|
186
249
|
}}
|
|
187
250
|
}}
|
|
188
251
|
}});
|
mvn_tree_visualizer/themes.py
CHANGED
|
@@ -2,6 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
from typing import Any, Dict
|
|
4
4
|
|
|
5
|
+
# Mermaid configuration constants for large project support
|
|
6
|
+
MAX_TEXT_SIZE_LARGE_PROJECTS = 900000000 # Increase max text size for large dependency trees
|
|
7
|
+
MAX_EDGES_LARGE_PROJECTS = 20000 # Increase max edges for large projects
|
|
8
|
+
|
|
9
|
+
# Zoom configuration constants for enhanced navigation
|
|
10
|
+
MIN_ZOOM = 0.01 # Minimum zoom level for large diagram overview
|
|
11
|
+
MAX_ZOOM = 50 # Maximum zoom level for detailed inspection
|
|
12
|
+
ZOOM_SCALE_SENSITIVITY = 0.2 # Smoother zoom increments
|
|
13
|
+
|
|
5
14
|
|
|
6
15
|
class Theme:
|
|
7
16
|
"""Base theme configuration class."""
|
|
@@ -98,6 +107,8 @@ THEMES = {
|
|
|
98
107
|
"secondaryColor": "#f5f5f5",
|
|
99
108
|
"tertiaryColor": "#ffffff",
|
|
100
109
|
},
|
|
110
|
+
"maxTextSize": MAX_TEXT_SIZE_LARGE_PROJECTS, # Increase max text size for large dependency trees
|
|
111
|
+
"maxEdges": MAX_EDGES_LARGE_PROJECTS, # Increase max edges for large projects
|
|
101
112
|
},
|
|
102
113
|
),
|
|
103
114
|
"dark": Theme(
|
|
@@ -174,6 +185,8 @@ THEMES = {
|
|
|
174
185
|
"nodeTextColor": "#ffffff",
|
|
175
186
|
"textColor": "#ffffff",
|
|
176
187
|
},
|
|
188
|
+
"maxTextSize": MAX_TEXT_SIZE_LARGE_PROJECTS, # Increase max text size for large dependency trees
|
|
189
|
+
"maxEdges": MAX_EDGES_LARGE_PROJECTS, # Increase max edges for large projects
|
|
177
190
|
},
|
|
178
191
|
),
|
|
179
192
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: mvn-tree-visualizer
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.5.0
|
|
4
4
|
Summary: A simple command line tool to visualize the dependency tree of a Maven project in a graphical format.
|
|
5
5
|
Project-URL: source, https://github.com/dyka3773/mvn-tree-visualizer
|
|
6
6
|
Author-email: Iraklis Konsoulas <dyka3773@gmail.com>
|
|
@@ -57,12 +57,10 @@ pip install mvn-tree-visualizer
|
|
|
57
57
|
- **JSON:** Creates a structured JSON representation of the dependency tree, perfect for scripting or integration with other tools.
|
|
58
58
|
- **🎨 Theme System:** Choose from 2 built-in themes (minimal, dark) for clean and consistent diagram styling.
|
|
59
59
|
- **🔄 Watch Mode:** Automatically regenerates diagrams when Maven dependency files change using the `--watch` flag.
|
|
60
|
-
- **📋 Version Display:**
|
|
61
|
-
-
|
|
62
|
-
- **📂 File
|
|
63
|
-
-
|
|
64
|
-
- **💾 Enhanced Downloads:** Download diagrams as SVG or high-resolution PNG directly from the HTML page.
|
|
65
|
-
- **🖱️ Interactive Features:** Hover tooltips, click-to-highlight connections, pan/zoom controls, and keyboard shortcuts.
|
|
60
|
+
- **📋 Version Display:** Toggle dependency versions in outputs with `--show-versions`
|
|
61
|
+
- **💾 Enhanced Downloads:** SVG and PNG export directly from browser
|
|
62
|
+
- **📂 Smart File Handling:** Automatically finds and merges multiple `maven_dependency_file` files from different subdirectories.
|
|
63
|
+
- **🎯 Color Coding:** Visual distinction between root, intermediate, and leaf dependencies
|
|
66
64
|
|
|
67
65
|
## How to Use
|
|
68
66
|
|
|
@@ -2,16 +2,16 @@ mvn_tree_visualizer/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSu
|
|
|
2
2
|
mvn_tree_visualizer/__main__.py,sha256=yIQFAdWjthKAFbSzzRuz5_YGlK0c6BnR2ypjNRDq180,82
|
|
3
3
|
mvn_tree_visualizer/cli.py,sha256=Gufk14zH74lqSTz2o2KPPEmNLvOHKHLyno-eSyXqahw,8504
|
|
4
4
|
mvn_tree_visualizer/diagram.py,sha256=UfvP_J4Im4JQLe3EWlY3TsP4tua3oYk5NiCGbZNQwoA,933
|
|
5
|
-
mvn_tree_visualizer/enhanced_template.py,sha256=
|
|
5
|
+
mvn_tree_visualizer/enhanced_template.py,sha256=AwK4gw5U8Ag-RmeD8Y11LXLRSnVzMFZhWja__c2iF4M,9813
|
|
6
6
|
mvn_tree_visualizer/exceptions.py,sha256=R4nnJ0xrOpd84GfPD9rFSDk40etDLoph7iZpj1CCR0c,543
|
|
7
7
|
mvn_tree_visualizer/file_watcher.py,sha256=JtmV1KW08_Az-XqpKhcd342WpxV1vUW-Dge9lodjjJY,2284
|
|
8
8
|
mvn_tree_visualizer/get_dependencies_in_one_file.py,sha256=nXhEhU-dI7tXa3TpoW1pv2t86t1K0yppSw8FYDtmTlQ,1973
|
|
9
|
-
mvn_tree_visualizer/themes.py,sha256=
|
|
9
|
+
mvn_tree_visualizer/themes.py,sha256=T7vdNVTHPtYYkh4HusGG1MUWk1mJcqFBjCc5IK5l6Dc,6338
|
|
10
10
|
mvn_tree_visualizer/validation.py,sha256=UQ194gHiVS8UnJpp90sCM-Vjn3aeXT6scdwOplAoaSE,3689
|
|
11
11
|
mvn_tree_visualizer/outputs/html_output.py,sha256=Y0IY-UF0UMTa5w8mVFoLidgcW6BUBTxASO0iRo26hH4,5531
|
|
12
12
|
mvn_tree_visualizer/outputs/json_output.py,sha256=cXntw9ndE_BcrmFnuV61cEwZaRMp9Ev0SxaK1SUedlw,2037
|
|
13
|
-
mvn_tree_visualizer-1.
|
|
14
|
-
mvn_tree_visualizer-1.
|
|
15
|
-
mvn_tree_visualizer-1.
|
|
16
|
-
mvn_tree_visualizer-1.
|
|
17
|
-
mvn_tree_visualizer-1.
|
|
13
|
+
mvn_tree_visualizer-1.5.0.dist-info/METADATA,sha256=DhMPseZxQHVHuPOVHPXtdA7h6vBUWc3gKAPbhaBDIxU,8477
|
|
14
|
+
mvn_tree_visualizer-1.5.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
15
|
+
mvn_tree_visualizer-1.5.0.dist-info/entry_points.txt,sha256=Mu3QZhrlvbYuCxqmluVGi2efgKjkQY6T8Opf-vdb7hU,68
|
|
16
|
+
mvn_tree_visualizer-1.5.0.dist-info/licenses/LICENSE,sha256=4zi6unpe17RUDMBu7ebh14jdbyvyeT-UA3n8Zl7aW74,1075
|
|
17
|
+
mvn_tree_visualizer-1.5.0.dist-info/RECORD,,
|
|
File without changes
|
{mvn_tree_visualizer-1.4.0.dist-info → mvn_tree_visualizer-1.5.0.dist-info}/entry_points.txt
RENAMED
|
File without changes
|
{mvn_tree_visualizer-1.4.0.dist-info → mvn_tree_visualizer-1.5.0.dist-info}/licenses/LICENSE
RENAMED
|
File without changes
|