aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsrichman333 <sarah_n_richman@brown.edu>2023-08-10 17:22:16 -0400
committersrichman333 <sarah_n_richman@brown.edu>2023-08-10 17:22:16 -0400
commit5417c64b0723df1bc011efbea2f0f286100d9bf3 (patch)
tree00ae000aba66ab2c43cd391fbff131103a493311
parent5a1bf41682f641967304c8a7fa7df9b6b343b7b2 (diff)
histogram numerical Y axis fixes
-rw-r--r--src/client/views/nodes/DataVizBox/components/Histogram.tsx7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/client/views/nodes/DataVizBox/components/Histogram.tsx b/src/client/views/nodes/DataVizBox/components/Histogram.tsx
index 8161a12c9..df713c462 100644
--- a/src/client/views/nodes/DataVizBox/components/Histogram.tsx
+++ b/src/client/views/nodes/DataVizBox/components/Histogram.tsx
@@ -70,10 +70,10 @@ export class Histogram extends React.Component<HistogramProps> {
@computed get defaultGraphTitle(){
var ax0 = this.props.axes[0];
var ax1 = (this.props.axes.length>1)? this.props.axes[1] : undefined;
- if (this.props.axes.length<2 || !/\d/.test(this.props.pairs[0][ax0]) || !ax1 || !this.numericalYData){
+ if (this.props.axes.length<2 || !ax1 || !/\d/.test(this.props.pairs[0][ax1]) || !this.numericalYData){
return ax0 + " Histogram";
}
- else return ax1 + " by " + ax0 + " Histogram";
+ else return ax0 + " by " + ax1 + " Histogram";
}
@computed get incomingLinks() {
@@ -149,7 +149,7 @@ export class Histogram extends React.Component<HistogramProps> {
const selected = svg.selectAll('.histogram-bar').filter((d: any) => {
barCounter++; // uses the order of bars and width of each bar to find which one the pointer is over
if ((barCounter*eachRectWidth ) <= pointerX && pointerX <= ((barCounter+1)*eachRectWidth)){
- var showSelected = this.numericalYData? this._histogramData.filter((data: { [x: string]: any; }) => data[xAxisTitle].replace(/\$/g, '').replace(/\%/g, '').replace(/\</g, '')==d[0])[0]
+ var showSelected = this.numericalYData? this._histogramData.filter((data: { [x: string]: any; }) => StrCast(data[xAxisTitle]).replace(/\$/g, '').replace(/\%/g, '').replace(/\</g, '')==d[0])[0]
: histDataSet.filter((data: { [x: string]: any; }) => data[xAxisTitle].replace(/\$/g, '').replace(/\%/g, '').replace(/\</g, '')==d[0])[0];
if (this.numericalXData){
// calculating frequency
@@ -404,6 +404,7 @@ export class Histogram extends React.Component<HistogramProps> {
};
render() {
+ this._histogramData
var curSelectedBarName;
var titleAccessor: any='';
if (this.props.axes.length==2) titleAccessor = 'histogram-title-'+this.props.axes[0]+'-'+this.props.axes[1];