File tree 2 files changed +26
-22
lines changed
benchmark/llms/components
2 files changed +26
-22
lines changed Original file line number Diff line number Diff line change @@ -13,9 +13,6 @@ import {
13
13
} from "lib/benchmark/llms/common" ;
14
14
import { combineLeftAndRight } from "lib/benchmark/llms/utils/llmUtils" ;
15
15
16
- const ROW_GAP = 100 ;
17
- const ROW_HEIGHT = 38 ;
18
-
19
16
const getDeviceArch = (
20
17
device : string | undefined ,
21
18
arch : string | undefined
@@ -345,21 +342,18 @@ export default function LLMsSummaryPanel({
345
342
346
343
// TODO (huydhn): Table bigger than 100 rows requires x-data-grid-pro
347
344
return (
348
- < Grid2 container spacing = { 2 } style = { { height : "100%" } } >
349
- < Grid2
350
- size = { { xs : 12 , lg : 12 } }
351
- height = {
352
- data . length > 90
353
- ? 90 * ROW_HEIGHT
354
- : ( data . length + 1 ) * ROW_HEIGHT + ROW_GAP
355
- }
356
- >
345
+ < Grid2 container spacing = { 10 } >
346
+ < Grid2 size = { { xs : 12 , lg : 11.8 } } >
357
347
< TablePanelWithData
358
348
title = { "Models" }
359
349
data = { data }
360
350
columns = { columns }
361
351
dataGridProps = { { getRowId : ( el : any ) => el . name } }
362
352
showFooter = { true }
353
+ disableAutoPageSize = { true }
354
+ customStyle = { {
355
+ maxHeight : 1200 ,
356
+ } }
363
357
/>
364
358
</ Grid2 >
365
359
</ Grid2 >
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ import HelpIcon from "@mui/icons-material/Help";
2
2
import { Skeleton , Typography } from "@mui/material" ;
3
3
import IconButton from "@mui/material/IconButton" ;
4
4
import { DataGrid , GridColDef } from "@mui/x-data-grid" ;
5
+ import { CSSProperties } from "react" ;
5
6
import useSWR from "swr" ;
6
7
7
8
const fetcher = ( url : string ) => fetch ( url ) . then ( ( res ) => res . json ( ) ) ;
@@ -64,13 +65,17 @@ export function TablePanelWithData({
64
65
// An optional flag to show the table footer
65
66
showFooter,
66
67
pageSize,
68
+ disableAutoPageSize,
69
+ customStyle,
67
70
} : {
68
71
title : string ;
69
72
data : any ;
70
73
columns : GridColDef [ ] ;
71
74
dataGridProps : any ;
72
75
helpLink ?: string ;
73
76
showFooter ?: boolean ;
77
+ disableAutoPageSize ?: boolean ;
78
+ customStyle ?: CSSProperties ;
74
79
pageSize ?: number ;
75
80
} ) {
76
81
if ( data === undefined ) {
@@ -95,15 +100,20 @@ export function TablePanelWithData({
95
100
}
96
101
97
102
return (
98
- < DataGrid
99
- { ...dataGridProps }
100
- density = { "compact" }
101
- rows = { data }
102
- columns = { columns }
103
- hideFooter = { ! showFooter }
104
- autoPageSize = { showFooter && pageSize === undefined }
105
- pageSize = { pageSize }
106
- slots = { { toolbar : Header } }
107
- />
103
+ < >
104
+ < DataGrid
105
+ style = { customStyle }
106
+ { ...dataGridProps }
107
+ density = { "compact" }
108
+ rows = { data }
109
+ columns = { columns }
110
+ hideFooter = { ! showFooter }
111
+ autoPageSize = {
112
+ showFooter && pageSize === undefined && ! disableAutoPageSize
113
+ }
114
+ pageSize = { pageSize }
115
+ slots = { { toolbar : Header } }
116
+ />
117
+ </ >
108
118
) ;
109
119
}
You can’t perform that action at this time.
0 commit comments