mirror of
https://github.com/chanzuckerberg/cellxgene.git
synced 2026-09-19 10:58:10 +08:00
check for bins change for canvas draw (#1693)
* check for bins change for canvas draw * PR feedback
This commit is contained in:
committed by
GitHub
parent
b5e5ee0168
commit
b18f96da77
@@ -453,7 +453,9 @@ class CategoryValue extends React.Component {
|
||||
label,
|
||||
CHART_WIDTH,
|
||||
VALUE_HEIGHT
|
||||
) ?? {};
|
||||
) ?? {}; // if createHistogramBins returns empty object assign null to deconstructed
|
||||
|
||||
if (!xScale || !yScale || !bins) return null;
|
||||
|
||||
return (
|
||||
<MiniHistogram
|
||||
|
||||
@@ -40,10 +40,11 @@ export default class MiniHistogram extends React.PureComponent {
|
||||
};
|
||||
|
||||
componentDidUpdate = (prevProps) => {
|
||||
const { obsOrVarContinuousFieldDisplayName } = this.props;
|
||||
const { obsOrVarContinuousFieldDisplayName, bins } = this.props;
|
||||
if (
|
||||
prevProps.obsOrVarContinuousFieldDisplayName !==
|
||||
obsOrVarContinuousFieldDisplayName
|
||||
obsOrVarContinuousFieldDisplayName ||
|
||||
prevProps.bins !== bins
|
||||
)
|
||||
this.drawHistogram();
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user