Plotly.js - box-select limiting the selecting on x or y axis only, like zoom and pan do when an axis has fixed range

I want to use box-select but limit the functionality to the selecting on the x or y axis, like zoom and pan do when an axis has fixed range.

any help or solutions would be very helpful

found the solution

within the layout add

    selectdirection: 'h', or 
    selectdirection: 'v',