aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/client/views/nodes/DataVizBox/DataVizBox.scss1
-rw-r--r--src/client/views/nodes/DataVizBox/components/Histogram.tsx19
2 files changed, 11 insertions, 9 deletions
diff --git a/src/client/views/nodes/DataVizBox/DataVizBox.scss b/src/client/views/nodes/DataVizBox/DataVizBox.scss
index a4f9dba73..9825d926f 100644
--- a/src/client/views/nodes/DataVizBox/DataVizBox.scss
+++ b/src/client/views/nodes/DataVizBox/DataVizBox.scss
@@ -30,6 +30,7 @@
}
.liveSchema-checkBox {
+ margin-left: 10px;
margin-bottom: -35px;
}
.filterData-checkBox {
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;
}