Skip to content

Commit 1ae445d

Browse files
committed
removed manual viz filters
1 parent f2d2536 commit 1ae445d

2 files changed

Lines changed: 6 additions & 98 deletions

File tree

README.md

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,9 @@ run graphify on graphify-rootly-data --mode deep
7171

7272
---
7373

74-
### Step 3: Re-apply Rootly colors *(terminal)*
74+
### Step 3: Open the current graph output
7575

76-
After semantic enrichment, restore the Rootly-specific visualization with severity colors, triggered alert toggles, and team/service layers.
77-
78-
```bash
79-
graphify rootly viz
80-
```
76+
After semantic enrichment, use the top-level output in `graphify-out/graph.html`. The current generic visualization already includes the maintained filters and visuals, so no separate re-apply command is needed.
8177

8278
---
8379

@@ -113,7 +109,7 @@ Once `graph.html` is open in a browser:
113109

114110
3. **Optional deep enrichment.** Run `/graphify ./graphify-rootly-data --mode deep` to dispatch parallel subagents over the markdown files and infer cross-incident themes, rationale, and conceptual links.
115111

116-
4. **Re-apply Rootly visualization.** After semantic enrichment the generic extractor replaces `graph.html`. Run `graphify rootly viz` to regenerate it with the full Rootly color scheme and filters applied to the enriched graph.
112+
4. **Use the current top-level output.** After semantic enrichment, open `graphify-out/graph.html`. The current generic exporter already includes the maintained filters and visuals directly, so no separate re-apply step is required.
117113

118114
**Clustering is graph-topology-based — no embeddings.** Leiden finds communities by edge density. Semantic similarity edges (`semantically_similar_to`, marked `INFERRED`) influence community detection directly. No separate embedding step or vector database required.
119115

@@ -145,8 +141,6 @@ graphify rootly # interactive Rootly impo
145141
graphify rootly --days 30 # collect last 30 days of incidents
146142
graphify rootly --api-key-env ROOTLY_API_KEY # non-interactive key lookup from env
147143
graphify rootly --output ./my-rootly-corpus # write corpus to a custom folder
148-
graphify rootly viz # re-apply Rootly coloring after semantic enrichment
149-
graphify rootly viz --graph ./corpus/graphify-out/graph.json
150144
151145
# --- Semantic enrichment (agent: Claude Code / Codex) ---
152146
/graphify ./graphify-rootly-data # analyze the Rootly corpus
@@ -179,9 +173,6 @@ graphify rootly --api-key-env ROOTLY_API_KEY --days 30 --mode standard
179173

180174
# Re-enrich with semantic step (Claude Code)
181175
/graphify graphify-rootly-data --update
182-
183-
# Restore Rootly colors
184-
graphify rootly viz
185176
```
186177

187178
---

graphify/__main__.py

Lines changed: 3 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
"""graphify CLI - `graphify install` sets up the Claude Code skill."""
1+
"""graphify CLI - `graphify install` sets up the Claude Code skill."""
22
from __future__ import annotations
33
import json
44
import platform
@@ -378,89 +378,8 @@ def main() -> None:
378378
print("Run 'graphify --help' for usage.", file=sys.stderr)
379379
sys.exit(1)
380380

381-
382-
def _run_rootly_viz_command(args: list[str]) -> None:
383-
"""Re-apply Rootly coloring + filters to an existing graph.json.
384-
385-
Usage: graphify rootly viz [--graph <path>] [--output <path>]
386-
387-
Defaults:
388-
--graph graphify-rootly-data/graphify-out/graph.json
389-
--output graphify-rootly-data/graphify-out/graph.html
390-
"""
391-
graph_path: Path | None = None
392-
output_path: Path | None = None
393-
394-
i = 0
395-
while i < len(args):
396-
arg = args[i]
397-
if arg in ("--graph",) and i + 1 < len(args):
398-
graph_path = Path(args[i + 1])
399-
i += 2
400-
elif arg.startswith("--graph="):
401-
graph_path = Path(arg.split("=", 1)[1])
402-
i += 1
403-
elif arg in ("--output",) and i + 1 < len(args):
404-
output_path = Path(args[i + 1])
405-
i += 2
406-
elif arg.startswith("--output="):
407-
output_path = Path(arg.split("=", 1)[1])
408-
i += 1
409-
elif arg in ("-h", "--help"):
410-
print("Usage: graphify rootly viz [--graph <path>] [--output <path>]")
411-
print()
412-
print("Re-applies Rootly color coding and filters to an existing graph.json.")
413-
print("Use this after running semantic extraction (e.g. via /graphify) to")
414-
print("restore the Rootly-specific visualization with severity colors,")
415-
print("team/service layers, and alert filtering.")
416-
print()
417-
print("Options:")
418-
print(" --graph <path> path to graph.json (default: graphify-rootly-data/graphify-out/graph.json)")
419-
print(" --output <path> path to write graph.html (default: same dir as graph.json)")
420-
return
421-
else:
422-
print(f"error: unknown flag '{arg}'. Run 'graphify rootly viz --help'.", file=sys.stderr)
423-
sys.exit(1)
424-
425-
# Defaults
426-
if graph_path is None:
427-
graph_path = Path("graphify-rootly-data") / "graphify-out" / "graph.json"
428-
if not graph_path.exists():
429-
print(f"error: graph.json not found at {graph_path}", file=sys.stderr)
430-
print(" Run 'graphify rootly' first to generate it.", file=sys.stderr)
431-
sys.exit(1)
432-
433-
if output_path is None:
434-
output_path = graph_path.parent / "graph.html"
435-
436-
print(f" Loading graph from {graph_path}...")
437-
from networkx.readwrite import json_graph as nx_json_graph
438-
from graphify.cluster import cluster
439-
from graphify.export import to_html
440-
441-
# graph.json is written by to_json() using node_link_data (edges key = "links"),
442-
# so we must load it with node_link_graph — not build_from_json which expects
443-
# an extraction dict with an "edges" key and would silently drop all edges.
444-
graph_data = json.loads(graph_path.read_text(encoding="utf-8"))
445-
G = nx_json_graph.node_link_graph(graph_data, edges="links")
446-
communities = cluster(G)
447-
448-
print(f" Applying Rootly visualization...")
449-
try:
450-
to_html(G, communities, str(output_path), rootly=True)
451-
print(f" Done -> {output_path.resolve()}")
452-
except ValueError as exc:
453-
print(f" error: {exc}", file=sys.stderr)
454-
sys.exit(1)
455-
456-
457381
def _run_rootly_command(args: list[str]) -> None:
458382
"""Parse flags for `graphify rootly` and delegate to rootly_flow."""
459-
# Subcommand dispatch
460-
if args and args[0] == "viz":
461-
_run_rootly_viz_command(args[1:])
462-
return
463-
464383
api_key_override: str | None = None
465384
days_override: int | None = None
466385
mode_override: str | None = None
@@ -519,10 +438,7 @@ def _run_rootly_command(args: list[str]) -> None:
519438
data_override = arg.split("=", 1)[1]
520439
i += 1
521440
elif arg in ("-h", "--help"):
522-
print("Usage: graphify rootly [subcommand] [options]")
523-
print()
524-
print("Subcommands:")
525-
print(" viz re-apply Rootly coloring to an existing graph.json")
441+
print("Usage: graphify rootly [options]")
526442
print()
527443
print("Options (fetch + build):")
528444
print(" --days 7|30|90 date range (skips the TUI prompt)")
@@ -551,3 +467,4 @@ def _run_rootly_command(args: list[str]) -> None:
551467

552468
if __name__ == "__main__":
553469
main()
470+

0 commit comments

Comments
 (0)