How to create a plot but not actually plot it. Javascript


I am using plotly javascript to draw some plots. But what I actually need is the url and I don’t really need the ploly to draw it on the web.

Here is an example, What I really need is the url and I don’t want the plot show on the website. How to do that? Thanks!


I don’t understand your question.

By URL, you mean something like ?


Thanks for your reply.

I mean when I export the graph, I need the code like

Plotly.newPlot('myDiv', data, layout).then(
                                 console.log(url)// this is what i really need!! I dont want it to be ploted~!

The key is to get the url. However, when getting the url, the code needs to generate the plot first with Plotly.newPlot(). I wonder if it is possible not to generate the plot but get the url?

Sorry for the confusion.

  {data: data, layout: layout}, 
  {height: 600, width: 800}
).then(url => {

should work.