File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed
Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -274,24 +274,27 @@ export const updateSummaryStats = (filteredData: FilteredData): void => {
274274 const totalRuns = filteredData . rawData . length ;
275275 const models = [ ...new Set ( filteredData . rawData . map ( ( d ) => d . Model ) ) ] ;
276276
277- // Calculate total cost from filtered raw data
278- const totalCost = filteredData . rawData . reduce ( ( sum , d ) => sum + d . total_cost , 0 ) ;
279- const avgCostPerRun = totalRuns > 0 ? totalCost / totalRuns : 0 ;
277+ // Calculate unique test cases (difficulty levels) in filtered data
278+ const testCases = [ ...new Set ( filteredData . rawData . map ( ( d ) => d . test_group ) ) ] ;
280279
281280 const statCards = document . querySelectorAll ( '.stat-card' ) ;
281+
282+ // Update Total Evaluation Runs (first card)
282283 if ( statCards [ 0 ] ) {
283284 const valueElement = statCards [ 0 ] . querySelector ( '.stat-value' ) ;
284285 if ( valueElement ) valueElement . textContent = totalRuns . toString ( ) ;
285286 }
287+
288+ // Update Models Evaluated (second card)
286289 if ( statCards [ 1 ] ) {
287290 const valueElement = statCards [ 1 ] . querySelector ( '.stat-value' ) ;
288291 if ( valueElement ) valueElement . textContent = models . length . toString ( ) ;
289292 }
293+
294+ // Update Test Cases (third card) with actual unique difficulty levels in filtered data
290295 if ( statCards [ 2 ] ) {
291296 const valueElement = statCards [ 2 ] . querySelector ( '.stat-value' ) ;
292- if ( valueElement ) valueElement . textContent = `$${ totalCost . toFixed ( 2 ) } ` ;
293- const detailElement = statCards [ 2 ] . querySelector ( '.stat-detail' ) ;
294- if ( detailElement ) detailElement . textContent = `Avg: $${ avgCostPerRun . toFixed ( 4 ) } /run` ;
297+ if ( valueElement ) valueElement . textContent = testCases . length . toString ( ) ;
295298 }
296299} ;
297300
You can’t perform that action at this time.
0 commit comments