Skip to content Skip to sidebar Skip to footer

Extract All Attributes From Plotly Javascript

How to extract all the attributes being used in a plotly JavaScript plot? For example, I draw a scatter plot at here. How to extract the full attribute information of data and layo

Solution 1:

The call to newPlot will return a Promise that resolves to the new plot when it is complete. You can get the values of the attributes you want once this promise has resolved.

Plotly.newPlot('myDiv', data, layout).then(plot => {
    console.log(plot.data);
    console.log(plot.layout);
    console.log(plot._fullLayout);
});

Post a Comment for "Extract All Attributes From Plotly Javascript"