import React from 'react'; import { SelectionPlugin } from './SelectionPlugin'; interface ZoomPluginProps { onZoom: (range: { from: number; to: number }) => void; } // min px width that triggers zoom const MIN_ZOOM_DIST = 5; /** * @alpha */ export const ZoomPlugin: React.FC = ({ onZoom }) => { return ( { if (selection.bbox.width < MIN_ZOOM_DIST) { return; } onZoom({ from: selection.min, to: selection.max }); }} /> ); };