diff options
author | srichman333 <sarah_n_richman@brown.edu> | 2024-04-23 23:05:24 -0400 |
---|---|---|
committer | srichman333 <sarah_n_richman@brown.edu> | 2024-04-23 23:05:24 -0400 |
commit | 81325ec64a24a98e3677b208a56dd048669fae72 (patch) | |
tree | 34e7fb252b0de9b3bb0f262e4b004af5c8dc706d /src/client/views/nodes/DataVizBox/components/Histogram.tsx | |
parent | 2de4f0938dedf8a6b2d60886df5c59bce7c72f59 (diff) |
filter one histogram bar onto child dataviz doc at a time
Diffstat (limited to 'src/client/views/nodes/DataVizBox/components/Histogram.tsx')
-rw-r--r-- | src/client/views/nodes/DataVizBox/components/Histogram.tsx | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/client/views/nodes/DataVizBox/components/Histogram.tsx b/src/client/views/nodes/DataVizBox/components/Histogram.tsx index 6672603f3..ff0262c15 100644 --- a/src/client/views/nodes/DataVizBox/components/Histogram.tsx +++ b/src/client/views/nodes/DataVizBox/components/Histogram.tsx @@ -164,6 +164,18 @@ export class Histogram extends ObservableReactComponent<HistogramProps> { sameAsCurrent = this._currSelected ? showSelected[xAxisTitle] == this._currSelected![xAxisTitle] && showSelected[yAxisTitle] == this._currSelected![yAxisTitle] : false; this._currSelected = sameAsCurrent ? undefined : showSelected; 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 (match && !selectedRows?.includes(rowID)) selectedRows?.push(rowID); + }) } else this.hoverOverData = d; return true; } |