Skip to content

Commit 5ee5add

Browse files
committed
plotly - trigger problem if height is less than 50px
1 parent ec468bd commit 5ee5add

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/components/plotly/shared/custom-plot.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,13 @@ const CustomPlot = ({
5656

5757
// record warnings
5858
const [problem, setProblem] = useState()
59+
useEffect(() => {
60+
setProblem(
61+
height < 50
62+
? `There isn't enough space to render the visualization${doSubPlots ? 's' : ''}.`
63+
: null,
64+
)
65+
}, [doSubPlots, height])
5966

6067
// special styling is needed for square visualizations due to plotly.js deficiencies
6168
// however, this should only be applied if the container is taller than it is wide

0 commit comments

Comments
 (0)