I would like to display a Plotly.js graph in a new browser window while maintaining all the interactive capabilites (a copy of the image will not suffice). However, it seems Plotly.js can't recognize any element outside. Any ideas?
div1=document.createElement('div');
div1.id='div1';
newwindow=window.open('','',"top=0,left=0,width=800,height=800");
div2=document.createElement('div'); // also tried newwindow.document.createElement('div') without success
div2.id='div2';
newwindow.document.body.appendChild(div2);
Plotly.newPlot('div1', data, layout); // works to put it on same window
Plotly.newPlot('div2', data, layout); // Uncaught Error: No DOM element with id 'div2' exists on the page.