aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/DataVizBox/components/Histogram.tsx
diff options
context:
space:
mode:
authorsrichman333 <sarah_n_richman@brown.edu>2024-04-25 02:40:33 -0400
committersrichman333 <sarah_n_richman@brown.edu>2024-04-25 02:40:33 -0400
commit8de07e0c17c2914bb6aff54f86e198eef5d2ac06 (patch)
treea302eadfca9a834d43c050e3ca3e32172035e2c1 /src/client/views/nodes/DataVizBox/components/Histogram.tsx
parent3bc20dcc61ae0addf11f838392919eab806045b8 (diff)
fixed filteres axes, console errors
Diffstat (limited to 'src/client/views/nodes/DataVizBox/components/Histogram.tsx')
-rw-r--r--src/client/views/nodes/DataVizBox/components/Histogram.tsx8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/client/views/nodes/DataVizBox/components/Histogram.tsx b/src/client/views/nodes/DataVizBox/components/Histogram.tsx
index d9f355f67..74711bd58 100644
--- a/src/client/views/nodes/DataVizBox/components/Histogram.tsx
+++ b/src/client/views/nodes/DataVizBox/components/Histogram.tsx
@@ -408,8 +408,8 @@ export class Histogram extends ObservableReactComponent<HistogramProps> {
const eachData = histDataSet.filter((data: { [x: string]: number }) => {
return data[xAxisTitle] == d[0];
});
- const length = eachData.length ? eachData[0][yAxisTitle].replace(/\$/g, '').replace(/\%/g, '').replace(/\</g, '') : 0;
- return 'translate(' + x(d.x0!) + ',' + y(length) + ')';
+ const length = eachData.length ? StrCast(eachData[0][yAxisTitle]).replace(/\$/g, '').replace(/\%/g, '').replace(/\</g, '') : 0;
+ return 'translate(' + x(d.x0!) + ',' + y(Number(length)) + ')';
}
: function (d) {
return 'translate(' + x(d.x0!) + ',' + y(d.length) + ')';
@@ -422,8 +422,8 @@ export class Histogram extends ObservableReactComponent<HistogramProps> {
const eachData = histDataSet.filter((data: { [x: string]: number }) => {
return data[xAxisTitle] == d[0];
});
- const length = eachData.length ? eachData[0][yAxisTitle].replace(/\$/g, '').replace(/\%/g, '').replace(/\</g, '') : 0;
- return height - y(length);
+ const length = eachData.length ? StrCast(eachData[0][yAxisTitle]).replace(/\$/g, '').replace(/\%/g, '').replace(/\</g, '') : 0;
+ return height - y(Number(length));
}
: function (d) {
return height - y(d.length);