This feature is now supported by plotly.js: https://github.com/plotly/plotly.js/pull/535