Add errors when log on graphs with negative domain

This commit is contained in:
Sam Nolan 2022-06-23 03:21:24 +00:00
parent c42c646838
commit 3983fa8f0f

View File

@ -76,6 +76,7 @@ export const DistributionChart: React.FC<DistributionChartProps> = ({
return (
<div style={{ width: widthProp }}>
{!(isLogX && massBelow0) ? (
<Vega
spec={spec}
data={{ con: shape.value.continuous, dis: shape.value.discrete }}
@ -83,6 +84,11 @@ export const DistributionChart: React.FC<DistributionChartProps> = ({
height={height}
actions={false}
/>
) : (
<ErrorAlert heading="Log Domain Error">
Cannot graph distribution with negative values on logarithmic scale.
</ErrorAlert>
)}
<div className="flex justify-center">
{showSummary && <SummaryTable distribution={distribution} />}
</div>