craftworksgmbh / ngx-circular-slider

ngx-circular-slider inspired by iOS bedtime
18 stars 4 forks source link

Slow response of slider #11

Open WoutervdVen opened 5 years ago

WoutervdVen commented 5 years ago

Hi,

I'm trying to implement the ngx-circular-slider in an Ionic project. When I run the project, the circular slider shows perfectly. However, when trying to drag the slider the response is very slow. Do u know the cause or a solution for this?

Thanks in advance!

zualexander commented 5 years ago

hi @WoutervdVen,

first - thanks for trying it out!

about your issue - we use a throttleTime method for observables, where we throttle the move-events, because at every slide, we re-calculate the positions of the slider and show it in the svg.

we noticed the slightly lag on our tablet device, but our first priority is to update the api to make the calculation for angle's obsolete, add meaningful tests for it, and then we wan't to tackle the performance issue, which could basically end in a re-write of the drawing.

you can try to clone the project, and link the npm package locally to your project, there is a THROTTLE_TIME constant in the slider component, you can try to change it and see if this fix your problem: https://github.com/craftworksgmbh/ngx-circular-slider/blob/master/projects/ngx-circular-slider/src/lib/ngx-cs-slider/ngx-cs-slider.component.ts#L25

steps would be

Sorry I can't help more at the moment.

BR Alex