Skip to content

Commit

Permalink
FIREFLY-1627: Merge PR #1678 from FIREFLY-1627-filter-order-plot
Browse files Browse the repository at this point in the history
FIREFLY-1627: filtering on spectral plots with >1 order causes chaos
  • Loading branch information
robyww authored Dec 10, 2024
2 parents 0503b27 + c8a38d5 commit e64f399
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/firefly/js/charts/ui/ChartPanel.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,16 +60,20 @@ ChartPanelView.propTypes = {
};




const ResizableChartAreaInternal = React.memo((props) => {
const {errors, Chart, size}= props;
const {errors, Chart, size, chartData}= props;
const {width:widthPx, height:heightPx}= size;
const knownSize = widthPx && heightPx;

if (!knownSize) return <div/>;

const hasData = chartData?.data?.length > errors?.length;

return (
<Stack id='chart-resizer' height={1} width={1} sx={{flexGrow:1, position:'absolute', overflow:'hidden', inset:0}}>
{errors.length || isUndefined(Chart) ?
{!hasData || isUndefined(Chart) ?
<ErrorPanel errors={errors}/> :
<Chart {...Object.assign({}, props, {widthPx, heightPx})}/>
}
Expand Down

0 comments on commit e64f399

Please sign in to comment.