@@ -20,7 +20,8 @@ import {
2020} from '@deephaven/components' ;
2121import type { DraggableRenderItemProps , Range } from '@deephaven/components' ;
2222import { type ModelIndex } from '@deephaven/grid' ;
23- import type AggregationOperation from './AggregationOperation' ;
23+ import type { dh as DhType } from '@deephaven/jsapi-types' ;
24+ import AggregationOperation from './AggregationOperation' ;
2425import AggregationUtils , { SELECTABLE_OPTIONS } from './AggregationUtils' ;
2526import './Aggregations.scss' ;
2627
@@ -46,22 +47,30 @@ export type AggregationsProps = {
4647 removed : AggregationOperation [ ]
4748 ) => void ;
4849 onEdit : ( aggregation : Aggregation ) => void ;
50+ dh : typeof DhType ;
4951} ;
5052
5153function Aggregations ( {
5254 isRollup,
5355 settings,
5456 onChange,
5557 onEdit,
58+ dh,
5659} : AggregationsProps ) : JSX . Element {
5760 const { aggregations, showOnTop } = settings ;
5861 const options = useMemo (
5962 ( ) =>
6063 SELECTABLE_OPTIONS . filter (
6164 option =>
62- ! aggregations . some ( aggregation => aggregation . operation === option )
65+ ! aggregations . some ( aggregation => aggregation . operation === option ) &&
66+ ! (
67+ option === AggregationOperation . MEDIAN &&
68+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
69+ // @ts -ignore - MEDIAN is not defined in older version of Core
70+ dh . AggregationOperation . MEDIAN === undefined
71+ )
6372 ) ,
64- [ aggregations ]
73+ [ aggregations , dh ]
6574 ) ;
6675 const [ selectedOperation , setSelectedOperation ] = useState ( options [ 0 ] ) ;
6776 const [ selectedRanges , setSelectedRanges ] = useState < Range [ ] > ( [ ] ) ;
0 commit comments