= ({ onClose, children }) => {
+ useEffect(() => {
+ const checkKeyAndClose = (e: KeyboardEvent) => {
+ if (e.key === 'Escape') {
+ onClose()
+ }
+ }
+ window.addEventListener('keydown', checkKeyAndClose)
+
+ return () => {
+ window.removeEventListener('keydown', checkKeyAndClose)
+ }
+ }, [onClose])
return (
{
fireEvent.click(plotButton)
}
+
+export const CheckpointZoomedInPlot = Template.bind({})
+CheckpointZoomedInPlot.parameters = {
+ chromatic: { delay: 500 }
+}
+CheckpointZoomedInPlot.play = async ({ canvasElement }) => {
+ const canvas = within(canvasElement)
+ const plot = await canvas.findByText('summary.json:val_accuracy')
+
+ plot.scrollIntoView()
+
+ fireEvent.click(plot)
+}