feat: Add Interactive AI Explainability & Telemetry Hub Issue#15#16
Open
Yashm2610 wants to merge 2 commits into
Open
feat: Add Interactive AI Explainability & Telemetry Hub Issue#15#16Yashm2610 wants to merge 2 commits into
Yashm2610 wants to merge 2 commits into
Conversation
Ishwarpatra
requested changes
Jun 19, 2026
| <div className="flex flex-col gap-4"> | ||
| {!reportToDisplay ? ( | ||
| <div className="p-6 text-center text-white/45 border border-dashed border-white/10 rounded-xl"> | ||
| <BookOpen className="w-8 h-8 mx-auto mb-2 opacity-30" /> |
Collaborator
There was a problem hiding this comment.
Critical Bug:
Inside src/components/ExplainablePanel.jsx (around line 124):
<BookOpen className="w-8 h-8 mx-auto mb-2 opacity-30" />
The BookOpen component is used in the placeholder UI when no report is selected, but it is not imported from lucide-react at the top of the file:import {
AlertCircle, Cpu, ShieldAlert, Sparkles, Activity,
HelpCircle, RefreshCw, Layers, CheckCircle2, AlertTriangle
} from 'lucide-react';Because the dashboard loads with no report selected by default, this missing import will immediately trigger a fatal ReferenceError: BookOpen is not defined and crash the dashboard page.
How to Fix:
Add BookOpen to the lucide-react import statement at the top of src/components/ExplainablePanel.jsx:
import {
AlertCircle, Cpu, ShieldAlert, Sparkles, Activity,
HelpCircle, RefreshCw, Layers, CheckCircle2, AlertTriangle, BookOpen
} from 'lucide-react';```
Owner
|
@Yashm2610 please respond and update the pr within 3 days!! |
Author
|
yes yes sure i will do it |
Author
|
plz check i create a new commit |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR implements the AI Explainability & Telemetry Hub on the Supervisor Dashboard. It bridges the gap between AI backend inference models (LSTM Danger Predictor, Computer Vision CCTV Analyzer, Transformer NLP Report Classifier) and the front-end operator console.
Supervisors can now click on map nodes or select citizen incident reports to inspect real-time token-level word attention highlights, emotion distributions, credibility metrics, and sensor score aggregation details. Additionally, a dynamic "What-If Simulator" has been added, allowing operators to run simulated NLP classifications directly against the FastAPI /reports/analyze backend endpoint.
Changes Made
Added onSelectIntersection callback prop.
Attached click event handlers on Leaflet CircleMarker nodes to update selected intersection states across the dashboard context in real-time.
Fully redesigned from a simple stub to a comprehensive XAI diagnostic console:
Word Attention Highlights: Custom tokenizer that splits incident reports into tags and highlights vocabulary matching critical threats (red), high distress (orange), medium issues (yellow), and infrastructure factors (green).
Emotion confidence bars: Added an interactive Recharts vertical bar chart displaying scores for all 7 emotions.
What-If incident simulator: Added a sandbox textarea that feeds directly to the FastAPI /reports/analyze endpoint.
Sensor Aggregator gauges: Visual breakdown of safety weights (LSTM, CV, Anomaly, Graph) showing active status and dynamic redistribution.
Imported ExplainablePanel.
Tracked a new selectedReport hook, which highlights report cards with custom borders and shadows when active.
Added a new draggable glassmorphic FloatingWindow (ID: telemetry) holding the Explainable panel.
Connected map clicks via onSelectIntersection={setSelectedIntersection} to update danger aggregation scores.