diff options
author | srichman333 <sarah_n_richman@brown.edu> | 2024-05-05 13:50:22 -0400 |
---|---|---|
committer | srichman333 <sarah_n_richman@brown.edu> | 2024-05-05 13:50:22 -0400 |
commit | 0d38f3e9bc4306c9e38decef5497c88c67376a83 (patch) | |
tree | 63b16818a509801a9a1354b26b89be935978d81c | |
parent | 4b4b7d2b4e905b3c64b0d0b42dd3ed329bad857e (diff) |
$, %, etc... can be selected for histograms and linecharts
-rw-r--r-- | src/client/views/nodes/DataVizBox/components/Histogram.tsx | 2 | ||||
-rw-r--r-- | src/client/views/nodes/DataVizBox/components/LineChart.tsx | 3 |
2 files changed, 3 insertions, 2 deletions
diff --git a/src/client/views/nodes/DataVizBox/components/Histogram.tsx b/src/client/views/nodes/DataVizBox/components/Histogram.tsx index 2152df8a1..110626923 100644 --- a/src/client/views/nodes/DataVizBox/components/Histogram.tsx +++ b/src/client/views/nodes/DataVizBox/components/Histogram.tsx @@ -209,7 +209,7 @@ export class Histogram extends ObservableReactComponent<HistogramProps> { 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 (this._props.records[rowID][xAxisTitle].replace(/\$/g, '').replace(/\%/g, '').replace(/\</g, '') == d[i]) match = true; } if (match && !selectedRows?.includes(rowID)) selectedRows?.push(rowID); // adding to filtered rows else if (match && sameAsAny) selectedRows.splice(selectedRows.indexOf(rowID), 1); // removing from filtered rows diff --git a/src/client/views/nodes/DataVizBox/components/LineChart.tsx b/src/client/views/nodes/DataVizBox/components/LineChart.tsx index 11d117b29..e79f4cde5 100644 --- a/src/client/views/nodes/DataVizBox/components/LineChart.tsx +++ b/src/client/views/nodes/DataVizBox/components/LineChart.tsx @@ -209,7 +209,8 @@ export class LineChart extends ObservableReactComponent<LineChartProps> { if (this._props.layoutDoc.dataViz_filterSelection){ const selectedRows = Cast(this._props.layoutDoc.dataViz_selectedRows, listSpec('number'), null); this._tableDataIds.forEach(rowID => { - if (this._props.records[rowID][this._props.axes[0]]==d.x && this._props.records[rowID][this._props.axes[1]]==d.y) { + if (this._props.records[rowID][this._props.axes[0]].replace(/\$/g, '').replace(/\%/g, '').replace(/\</g, '')==d.x + && this._props.records[rowID][this._props.axes[1]].replace(/\$/g, '').replace(/\%/g, '').replace(/\</g, '')==d.y) { if (!selectedRows?.includes(rowID)) selectedRows?.push(rowID); // adding to filtered rows else if (sameAsAny) selectedRows.splice(selectedRows.indexOf(rowID), 1); // removing from filtered rows } |