diff options
Diffstat (limited to 'src/client/views/nodes/DataVizBox/components/Histogram.tsx')
-rw-r--r-- | src/client/views/nodes/DataVizBox/components/Histogram.tsx | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/client/views/nodes/DataVizBox/components/Histogram.tsx b/src/client/views/nodes/DataVizBox/components/Histogram.tsx index ff0262c15..aef2d64f3 100644 --- a/src/client/views/nodes/DataVizBox/components/Histogram.tsx +++ b/src/client/views/nodes/DataVizBox/components/Histogram.tsx @@ -43,7 +43,7 @@ export class Histogram extends ObservableReactComponent<HistogramProps> { private numericalYData: boolean = false; // whether the y axis is controlled by provided data rather than frequency private maxBins = 15; // maximum number of bins that is readable on a normal sized doc @observable _currSelected: any | undefined = undefined; // Object of selected bar - private curBarSelected: any = undefined; // histogram bin of selected bar + private curBarSelected: any = undefined; // histogram bin of selected bar for when just one bar is selected private selectedData: any = undefined; // Selection of selected bar private hoverOverData: any = undefined; // Selection of bar being hovered over @@ -166,16 +166,17 @@ export class Histogram extends ObservableReactComponent<HistogramProps> { this.selectedData = sameAsCurrent ? undefined : d; // for filtering child dataviz docs - const selectedRows = Cast(this._props.layoutDoc.dataViz_selectedRows, listSpec('number'), null); - this._tableDataIds.forEach(rowID => { - let match = true; - Object.keys(showSelected).map(key => { - if(key!='frequency' && this._props.records[rowID][key]!=showSelected[key]){ - match = false; + if (this._props.layoutDoc.dataViz_filterSelection){ + console.log("d", d); + const selectedRows = Cast(this._props.layoutDoc.dataViz_selectedRows, listSpec('number'), null); + this._tableDataIds.forEach(rowID => { + let match = false; + for (let i=0; i<d.length; i++){ + if (this._props.records[rowID][xAxisTitle] == d[i]) match = true; } + if (match && !selectedRows?.includes(rowID)) selectedRows?.push(rowID); }) - if (match && !selectedRows?.includes(rowID)) selectedRows?.push(rowID); - }) + } } else this.hoverOverData = d; return true; } |