Skip to content

Commit 2eeafa4

Browse files
committed
interactive bugfix
1 parent cd07dae commit 2eeafa4

3 files changed

Lines changed: 3902 additions & 14 deletions

File tree

json_explorer/interactive.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,11 @@ def run(self) -> int:
7272
elif choice == "2":
7373
self._interactive_jmespath_search()
7474
elif choice == "3":
75-
self._interactive_stats()
75+
self._show_jmespath_help()
7676
elif choice == "4":
77-
self._interactive_visualization()
77+
self._interactive_stats()
7878
elif choice == "5":
79-
self._show_jmespath_help()
79+
self._interactive_visualization()
8080
elif choice == "6":
8181
self._load_new_data()
8282
elif choice == "7":
@@ -95,9 +95,9 @@ def _show_main_menu(self) -> None:
9595
9696
[cyan]1.[/cyan] 🌳 Tree View (Structure Analysis)
9797
[cyan]2.[/cyan] 🔍 JMESPath Search
98-
[cyan]3.[/cyan] 📊 Statistics & Analysis
99-
[cyan]4.[/cyan] 📈 Visualizations
100-
[cyan]5.[/cyan] ❓ JMESPath Query Help
98+
[cyan]3.[/cyan] ❓ JMESPath Query Help
99+
[cyan]4.[/cyan] 📊 Statistics & Analysis
100+
[cyan]5.[/cyan] 📈 Visualizations
101101
[cyan]6.[/cyan] 📂 Load New Data
102102
[cyan]7.[/cyan] 📋 Data Summary
103103
[cyan]8.[/cyan] ⚡ Code Generation
@@ -175,19 +175,19 @@ def _interactive_visualization(self) -> None:
175175
self.console.print("\n📈 [bold]Visualization Options[/bold]")
176176
viz_format = Prompt.ask(
177177
"Select visualization format",
178-
choices=["terminal", "interactive", "html", "all"],
179-
default="interactive",
178+
choices=["terminal", "html", "all"],
179+
default="html",
180180
)
181181
detailed = Confirm.ask("Generate detailed visualizations?", default=False)
182182
save_path = None
183183

184-
if Confirm.ask("Save visualizations to file?"):
185-
save_path = Prompt.ask("Enter save path (optional)", default="")
186-
save_path = save_path if save_path else None
184+
open_browser = False
187185

188-
open_browser = True
186+
if viz_format in ["html", "all"]:
187+
if Confirm.ask("Save visualizations to file?"):
188+
save_path = Prompt.ask("Enter save path (optional)", default="")
189+
save_path = save_path if save_path else None
189190

190-
if viz_format in ["interactive", "html", "all"]:
191191
open_browser = Confirm.ask(
192192
"Open browser for HTML visualizations?", default=True
193193
)

json_explorer/visualizer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ def visualize(
9898
else:
9999
self._terminal_fallback(detailed)
100100

101-
elif output in ("interactive", "html"):
101+
elif output == "html":
102102
if not PLOTLY_AVAILABLE:
103103
raise RuntimeError(
104104
"Plotly not available. Install with: pip install plotly"

temp.html

Lines changed: 3888 additions & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)