From 1ef77c02ffe7d4d4d8c7496943d225c5d4079dab Mon Sep 17 00:00:00 2001 From: vkuchenik Date: Mon, 5 Oct 2026 16:10:46 -0700 Subject: [PATCH] update: quad plot api has new data, ui was updated to display it correctly --- .../Widgets/LlmAlChangesQuadPlot.jsx | 43 ++++++++++++++----- 1 file changed, 32 insertions(+), 11 deletions(-) diff --git a/client/src/components/Widgets/LlmAlChangesQuadPlot.jsx b/client/src/components/Widgets/LlmAlChangesQuadPlot.jsx index f8ff839..330436f 100644 --- a/client/src/components/Widgets/LlmAlChangesQuadPlot.jsx +++ b/client/src/components/Widgets/LlmAlChangesQuadPlot.jsx @@ -8,6 +8,10 @@ export default function LlmAlChangesQuadPlot(props) { let tn_percent = 0; let fp_percent = 0; let fn_percent = 0; + let just_false_count = 0; + let error_count = 0; + let no_dvar_data_count = 0; + // Clean, single-line data fetching const { data: apiData, isLoading, error } = VdapApi('/api/v2/llm_quadrant_plot'); @@ -32,32 +36,35 @@ export default function LlmAlChangesQuadPlot(props) { if (apiData) { console.log(apiData); - tp_percent = ((apiData[0]['tp_count']/apiData[0]['tot_count'])*100).toFixed(2); - tn_percent = ((apiData[0]['tn_count']/apiData[0]['tot_count'])*100).toFixed(2); - fp_percent = ((apiData[0]['fp_count']/apiData[0]['tot_count'])*100).toFixed(2); - fn_percent = ((apiData[0]['fn_count']/apiData[0]['tot_count'])*100).toFixed(2); + tp_percent = ((apiData[0]['tp_count']/apiData[0]['vr_count'])*100).toFixed(2); + tn_percent = ((apiData[0]['tn_count']/apiData[0]['vr_count'])*100).toFixed(2); + fp_percent = ((apiData[0]['fp_count']/apiData[0]['vr_count'])*100).toFixed(2); + fn_percent = ((apiData[0]['fn_count']/apiData[0]['vr_count'])*100).toFixed(2); + just_false_count = apiData[0]['jf_count']; + error_count = apiData[0]['e_count']; + no_dvar_data_count = apiData[0]['ndd_count']; } return ( - - + + {/*Alert Level Changes Quad Plot*/} All time - +
True Positive {tp_percent}% - {apiData[0]['tp_count']}/{apiData[0]['tot_count']} + {apiData[0]['tp_count']}/{apiData[0]['vr_count']}
True Negative {tn_percent}% - {apiData[0]['tn_count']}/{apiData[0]['tot_count']} + {apiData[0]['tn_count']}/{apiData[0]['vr_count']}
@@ -66,18 +73,32 @@ export default function LlmAlChangesQuadPlot(props) { False Positive {fp_percent}% - {apiData[0]['fp_count']}/{apiData[0]['tot_count']} + {apiData[0]['fp_count']}/{apiData[0]['vr_count']}
False Negative {fn_percent}% - {apiData[0]['fn_count']}/{apiData[0]['tot_count']} + {apiData[0]['fn_count']}/{apiData[0]['vr_count']}
+ + + Just False: + {just_false_count} + + + Errors: + {error_count} + + + # of No DVAR Data: + {no_dvar_data_count} + +
)