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