xieziyu / ngx-echarts

An angular (ver >= 2.x) directive for ECharts (ver >= 3.x)
https://xieziyu.github.io/ngx-echarts/
MIT License
1.11k stars 197 forks source link

unwanted change detection #132

Closed smnbbrv closed 6 years ago

smnbbrv commented 6 years ago

Hi @xieziyu

just started to play around the lib and found out that the following lines trigger unwanted change detection:

https://github.com/xieziyu/ngx-echarts/blob/03c817b9c513b35a477101eb1863005ce51e0d3e/projects/ngx-echarts/src/lib/ngx-echarts.directive.ts#L144

This could lead to poor performance on big pages especially events like mousemove.

What do you think of a feature that allows to disable this._ngZone.run and delegate taking care of change detection to the end user?

Something like detectEventChanges which is true by default?

xieziyu commented 6 years ago

@smnbbrv It makes sense to me. It will be included in the next release. Thanks.

xieziyu commented 6 years ago

Published in v4.0.0-beta.1

smnbbrv commented 6 years ago

super!

This is actually sad that there is no way to deal with those eventEmitter things...

I created a stackoverflow question, who knows, maybe there is a better solution to the problem.

smnbbrv commented 6 years ago

Look at the answer. Not that beautiful but still can be useful some day ;)