Mikhus / canvas-gauges

HTML5 Canvas Gauge. Tiny implementation of highly configurable gauge using pure JavaScript and HTML5 canvas. No dependencies. Suitable for IoT devices because of minimum code base.
http://canvas-gauges.com/
MIT License
1.57k stars 396 forks source link

If scan the DOM on ready #87

Closed GermanBluefox closed 7 years ago

GermanBluefox commented 7 years ago

My editor has over 5000 elements on the page. And canvas-gauges scan at DOMready all these elements.

It would be very useful to make this feature controllable and create gauges only dynamically. 5000 take about 1.5 seconds to be "checked".

Just now I disabled this line: https://github.com/Mikhus/canvas-gauges/blob/master/lib/DomObserver.js#L112 And everything is fast again.

Mikhus commented 7 years ago

I could propose to have some global flag to prevent auto DOM check. Will add this in 2.1

Mikhus commented 7 years ago

Implemented in 2.1 branch