File tree Expand file tree Collapse file tree 2 files changed +35
-24
lines changed
Expand file tree Collapse file tree 2 files changed +35
-24
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ import { useLocation, useNavigate } from "react-router-dom";
44import { state } from "../App" ;
55import Button from "./Button" ;
66import { EvaluationTable } from "./EvaluationTable" ;
7- import PivotTable from "./PivotTable " ;
7+ import PivotTab from "./PivotTab " ;
88import TabButton from "./TabButton" ;
99import flattenJson from "../util/flatten-json" ;
1010
@@ -132,29 +132,7 @@ const Dashboard = observer(({ onRefresh }: DashboardProps) => {
132132 { activeTab === "table" ? (
133133 < EvaluationTable />
134134 ) : (
135- < div >
136- < div className = "text-xs text-gray-600 mb-2" >
137- Showing pivot of flattened rows (JSONPath keys). Defaults:
138- rows by eval name and status; columns by model; values average
139- score.
140- </ div >
141- < PivotTable
142- data = { flattened }
143- rowFields = { [
144- "$.eval_metadata.name" as keyof ( typeof flattened ) [ number ] ,
145- "$.eval_metadata.status" as keyof ( typeof flattened ) [ number ] ,
146- ] }
147- columnFields = { [
148- "$.input_metadata.completion_params.model" as keyof ( typeof flattened ) [ number ] ,
149- ] }
150- valueField = {
151- "$.evaluation_result.score" as keyof ( typeof flattened ) [ number ]
152- }
153- aggregator = "avg"
154- showRowTotals
155- showColumnTotals
156- />
157- </ div >
135+ < PivotTab data = { flattened } />
158136 ) }
159137 </ div >
160138 </ div >
Original file line number Diff line number Diff line change 1+ import { observer } from "mobx-react" ;
2+ import PivotTable from "./PivotTable" ;
3+
4+ interface PivotTabProps {
5+ data : any [ ] ;
6+ }
7+
8+ const PivotTab = observer ( ( { data } : PivotTabProps ) => {
9+ return (
10+ < div >
11+ < div className = "text-xs text-gray-600 mb-2" >
12+ Showing pivot of flattened rows (JSONPath keys). Defaults: rows by eval
13+ name and status; columns by model; values average score.
14+ </ div >
15+ < PivotTable
16+ data = { data }
17+ rowFields = { [
18+ "$.eval_metadata.name" as keyof ( typeof data ) [ number ] ,
19+ "$.eval_metadata.status" as keyof ( typeof data ) [ number ] ,
20+ ] }
21+ columnFields = { [
22+ "$.input_metadata.completion_params.model" as keyof ( typeof data ) [ number ] ,
23+ ] }
24+ valueField = { "$.evaluation_result.score" as keyof ( typeof data ) [ number ] }
25+ aggregator = "avg"
26+ showRowTotals
27+ showColumnTotals
28+ />
29+ </ div >
30+ ) ;
31+ } ) ;
32+
33+ export default PivotTab ;
You can’t perform that action at this time.
0 commit comments