Problem with 'plotly relayout' event

I’m working on application in Angular 2. I have a fully dynamic plot, where you can click&drag any of the axises and load more data and show it in the plot. I’m using following code:

this.plot.on('plotly_relayout', () => {
    this.loadNewDataAfterZoom(); //function responsible for loading data into plot
});

Everything works great, but until I click the ‘save as PNG’ button. I don’t have any clue why does it happen. I can click on whatever button I want or anywhere on the chart, but the event is expiring just in this particular case. Only when I click on this download .PNG button.

Is this button colliding with the relayout event? I really look forward for any kind of help. Thank you so much.

P.S. Maybe I should just disable that button?

Hmm. That shouldn’t happen. I can’t replicate it in a minimal example http://codepen.io/etpinard/pen/OpJWMK

If you choose that solution. Here’s how: http://codepen.io/etpinard/pen/PpoWNr

1 Like

Thank you so much. I’ve hidden it. But there’s another one thing, which is very important for me and it fails :frowning:

When I resize the window with chart, the relayout event is being turned off :((

I have to restart the app to make it work again. Isn’t that strange?

That shouldn’t happen. Care to share a reproducible example?

1 Like

I will try, but it will be difficult. I will let you know.

I have fixed it. It wasn’t related with plotly, but I just had some problem with ng material. Plotly works great. Thank you :slight_smile:

1 Like