99 ChartModel ,
1010 ChartModelSettings ,
1111 ChartUtils ,
12+ FilterMap ,
1213 isFigureChartModel ,
1314} from '@deephaven/chart' ;
1415import {
@@ -63,7 +64,7 @@ import ChartColumnSelectorOverlay, {
6364 SelectorColumn ,
6465} from './ChartColumnSelectorOverlay' ;
6566import './ChartPanel.scss' ;
66- import { Link } from '../linker/LinkerUtils' ;
67+ import { Link , LinkFilterMap } from '../linker/LinkerUtils' ;
6768import { PanelState as IrisGridPanelState } from './IrisGridPanel' ;
6869import { isChartPanelTableMetadata } from './ChartPanelUtils' ;
6970import { ColumnSelectionValidator } from '../linker/ColumnSelectionValidator' ;
@@ -73,8 +74,6 @@ const UPDATE_MODEL_DEBOUNCE = 150;
7374
7475export type InputFilterMap = Map < string , InputFilter > ;
7576
76- export type FilterMap = Map < string , string > ;
77-
7877export type LinkedColumnMap = Map < string , { name : string ; type : string } > ;
7978
8079export type ChartPanelFigureMetadata = {
@@ -109,7 +108,7 @@ export interface ChartPanelTableSettings {
109108 partitionColumn ?: string ;
110109}
111110export interface GLChartPanelState {
112- filterValueMap : [ string , string ] [ ] ;
111+ filterValueMap : [ string , unknown ] [ ] ;
113112 settings : Partial < ChartModelSettings > ;
114113 tableSettings : ChartPanelTableSettings ;
115114 irisGridState ?: {
@@ -159,10 +158,10 @@ interface ChartPanelState {
159158
160159 // Map of all non-empty filters applied to the chart.
161160 // Initialize the filter map to the previously stored values; input filters will be applied after load.
162- filterMap : Map < string , string > ;
161+ filterMap : FilterMap ;
163162 // Map of filter values set from links, stored in panelState.
164163 // Combined with inputFilters to get applied filters (filterMap).
165- filterValueMap : Map < string , string > ;
164+ filterValueMap : FilterMap ;
166165 model ?: ChartModel ;
167166 columnMap : ColumnMap ;
168167
@@ -786,20 +785,22 @@ export class ChartPanel extends Component<ChartPanelProps, ChartPanelState> {
786785 * Set chart filters based on the filter map
787786 * @param filterMapParam Filter map
788787 */
789- setFilterMap (
790- filterMapParam : Map < string , { columnType : string ; value : string } >
791- ) : void {
788+ setFilterMap ( filterMapParam : LinkFilterMap ) : void {
792789 log . debug ( 'setFilterMap' , filterMapParam ) ;
793790 this . setState ( state => {
794791 const { columnMap, filterMap } = state ;
795- let updatedFilterMap : null | Map < string , string > = null ;
792+ let updatedFilterMap : null | FilterMap = null ;
796793 const filterValueMap = new Map ( state . filterValueMap ) ;
797-
798- filterMapParam . forEach ( ( { columnType, value } , columnName ) => {
794+ filterMapParam . forEach ( ( { columnType, filterList } , columnName ) => {
799795 const column = columnMap . get ( columnName ) ;
800796 if ( column == null || column . type !== columnType ) {
801797 return ;
802798 }
799+ if ( filterList . length < 1 ) {
800+ log . debug ( 'Ignoring empty filterList for column' , columnName ) ;
801+ return ;
802+ }
803+ const { value } = filterList [ 0 ] ;
803804 filterValueMap . set ( columnName , value ) ;
804805 if ( filterMap . get ( columnName ) !== value ) {
805806 if ( updatedFilterMap === null ) {
0 commit comments