See https://codepen.io/etpinard/pen/vmzpPy?editors=1010 and https://github.com/plotly/plotly.js/pull/1694#pullrequestreview-38774918