that one is easy: just use Plotly.relayout('graph', 'xaxis.range', [/* new range */]). See how we do it here.
Plotly.relayout('graph', 'xaxis.range', [/* new range */])
this one not so much, you can try mocking mouse events. See how we do it here
Thanks Etienne, I will have a deep look.