aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/DataVizBox/components/Histogram.tsx
diff options
context:
space:
mode:
authorsrichman333 <sarah_n_richman@brown.edu>2023-08-04 14:52:35 -0400
committersrichman333 <sarah_n_richman@brown.edu>2023-08-04 14:52:35 -0400
commitbee66361d878c366e8c753ca844abc2f78fbf7f3 (patch)
tree11842d83e57270151befe4f6792463bcc9b4ff7b /src/client/views/nodes/DataVizBox/components/Histogram.tsx
parentf073fd90481d58f2eaccc1d546899dd157aff905 (diff)
better row guids so selected rows stay on refresh
Diffstat (limited to 'src/client/views/nodes/DataVizBox/components/Histogram.tsx')
-rw-r--r--src/client/views/nodes/DataVizBox/components/Histogram.tsx5
1 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 02f1ddbbb..a9be151bc 100644
--- a/src/client/views/nodes/DataVizBox/components/Histogram.tsx
+++ b/src/client/views/nodes/DataVizBox/components/Histogram.tsx
@@ -49,12 +49,13 @@ export class Histogram extends React.Component<HistogramProps> {
// TODO: nda - some sort of mapping that keeps track of the annotated points so we can easily remove when annotations list updates
@computed get _histogramData() {
+ var guids = StrListCast(this.props.layoutDoc.rowGuids);
if (this.props.axes.length < 1) return [];
if (this.props.axes.length < 2) {
var ax0 = this.props.axes[0];
if (/\d/.test(this.props.pairs[0][ax0])){ this.numericalXData = true }
return this.props.pairs
- ?.filter(pair => (!this.incomingLinks.length ? true : this.incomingLinks[0]!.selected && StrListCast(this.incomingLinks[0].selected).includes(pair.guid)))
+ ?.filter(pair => (!this.incomingLinks.length ? true : this.incomingLinks[0]!.selected && StrListCast(this.incomingLinks[0].selected).includes(guids[this.props.pairs.indexOf(pair)])))
.map(pair => ({ [ax0]: (pair[this.props.axes[0]])}))
};
@@ -63,7 +64,7 @@ export class Histogram extends React.Component<HistogramProps> {
if (/\d/.test(this.props.pairs[0][ax0])) { this.numericalXData = true;}
if (/\d/.test(this.props.pairs[0][ax1]) && this.props.pairs.length < this.maxBins) { this.numericalYData = true;}
return this.props.pairs
- ?.filter(pair => (!this.incomingLinks.length ? true : this.incomingLinks[0]!.selected && StrListCast(this.incomingLinks[0].selected).includes(pair.guid)))
+ ?.filter(pair => (!this.incomingLinks.length ? true : this.incomingLinks[0]!.selected && StrListCast(this.incomingLinks[0].selected).includes(guids[this.props.pairs.indexOf(pair)])))
.map(pair => ({ [ax0]: (pair[this.props.axes[0]]), [ax1]: (pair[this.props.axes[1]]) }))
}
@computed get defaultGraphTitle(){