cebor / angular-highcharts

Highcharts directive for Angular
MIT License
212 stars 64 forks source link

Fix change detection #313

Open frct1 opened 4 years ago

frct1 commented 4 years ago

Hello, There is possible bug: when we moving cursor on graph change detection change is calling many many times

r-havelka commented 4 years ago

@frct1 That might just be your os/browser rendering. Every time you move your cursor an event is fired and there is an event loop that says 'where is the cursor, what is it over, what needs to change/update'. Without this event loop, there would be no way to say 'the cursor is over a point in the chart, display a tooltip' so I think that is what you're experiencing, unless you have a more detailed demo.

instantaphex commented 4 years ago

@r-havelka No, @frct1 is correct, ALL of the highcharts events are triggering change detection, causing MASSIVE slow down. The official angular wrapper from highcharts provides an input [runOutsideAngular] to mitigate this. I have confirmed that change detection is running by profiling the code.

frct1 commented 4 years ago

@instantaphex Nope [runOutsideAngular] in official package doesn't help

SayakMukhopadhyay commented 4 years ago

I am facing massive slowdowns too, but it seems to happen only on Firefox. Things are fine on Edge(Chromium) and Chrome.(Latest updates as of this post)