KGVisualizer, AnalyticsVisualizer, TemporalVisualizer, and OntologyVisualizer turn graph dicts, analytics results, and ontologies into interactive HTML dashboards or static images in a single method call. Use them to present centrality rankings, community clusters, event timelines, and before/after snapshot diffs to stakeholders without writing any rendering code.
All visualizers accept
output="interactive" (Plotly/pyvis HTML, shown in Jupyter or saved to file) or output="static" (PNG/SVG via Matplotlib). Omit file_path to get the figure object back for further manipulation.Rendering the Full Knowledge Graph
The first thing to put in front of stakeholders is the full network — nodes coloured by entity type, sized by degree centrality, with tooltips showing content on hover.highlight_path:
Showing Community Structure
After community detection, you have a dict mapping community labels to node ID lists.visualize_communities on KGVisualizer overlays those clusters on the network; AnalyticsVisualizer.visualize_community_structure forwards to that same community graph view.
Plotting Centrality Rankings
The centrality dict maps node IDs to scores. Two calls cover the two use cases: a network view where node size reflects centrality, and a standalone ranked bar chart for the “top 10 most connected nodes” slide.Analytics Charts: Connectivity and Degree Distribution
After running graph analytics, two additional charts complete the picture. The connectivity chart shows how many disconnected components exist and how large each one is. The degree distribution shows the power-law shape of your graph — useful for confirming that your graph is scale-free (a few highly-connected hubs, many leaf nodes).visualize_connectivity takes the connectivity analysis result dict — not graph.to_dict(). The dict must contain "is_connected", "num_components", and "component_sizes". Compute it from your graph analytics output and pass the result.Drawing a Timeline of Events
When the story you are telling is temporal — a CVE lifecycle, an incident timeline, a campaign progression —TemporalVisualizer.visualize_timeline turns a list of timestamped events into a scrollable interactive chart.
Comparing Two Graph Snapshots Side-by-Side
When the question is “what changed between March 14 and April 14?”,visualize_snapshot_comparison takes two named snapshots from TemporalVersionManager and renders a side-by-side diff view showing nodes and edges added or removed.
Tracking Graph Growth Over Time
The final chart for a stakeholder review is the growth curve — how many nodes and edges has the graph accumulated over the past year?visualize_metrics_evolution takes a history dict and a parallel timestamps list.
Domain Examples
- Defense — CTI/Threat
- Security — SOC/Incident
- Life Science — Clinical/Pharma
- Banking — Risk/Compliance
A full analyst briefing package: interactive threat network, community breakdown, CVE timeline, and graph growth curve — all generated from a live CTI graph before the morning standup.
Output Modes
Every visualizer method accepts the same two output modes:output value | Format | Best for |
|---|---|---|
"interactive" | Self-contained HTML (Plotly / pyvis) | Jupyter notebooks, analyst portals, email attachments |
"static" | PNG / SVG (Matplotlib) | PDF reports, slide decks, regulatory submissions |
file_path:
Related Guides
- Context Graphs —
graph.to_dict()is the primary input forKGVisualizer - Ontology Management —
OntologyVisualizerrenders ontologies produced byOntologyGenerator - Change Management —
TemporalVersionManagersnapshots feedvisualize_metrics_evolution()andvisualize_snapshot_comparison() - Graph Analytics — centrality scores, community dicts, and connectivity results that feed the
AnalyticsVisualizer - Export & Serialization — export the same graph to GraphML, GEXF, or DOT for Gephi and Graphviz
