plotly / angular-plotly.js

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Possible to add [updateOnConfigChange]?

icoker opened this issue · comments

I have plots inside of resizable divs, and I would like the 'export plot to image' functionality to be able to export the image as the size of component on screen. I already have the nativeElement size of the plot, and I can modify the config (toImageButtonOptions) during a resize event, but plotly does not update the mode bar when the configuration is changed.

Hello, @icoker . A bit hard to understand what is the issue. The modebar isn't updated when you change the config object? As in you'd like to have the export button only with a certain size of the graph?

@andrefarzat Correct, ideally the modebar would be updated when the config object is modified. This way, when I change specified size in the toImageButtonOptions property via a resize event, the button on the modebar would export at the new size.

Apologies @andrefarzat , I believe this issue can be closed. It seems like, when modifying the entire object, the modebar did not update, but modifying each individual property in the toImageButtonOptions object does seem to cause to modebar to update.

@icoker oh, I see. That's why the angular's diffChecker isn't working. As alternative, you could use revision property: https://github.com/plotly/angular-plotly.js#basic-props