I have tried to make it work using React, though I cant seem to find the convertPixelToValue function, which at this stage is not permitting me from finalising the code.
Can you please share a jsfiddle or sample project(over google-drive or one-drive) reproducing the issue you are facing, so that we can look into your code, understand it better and help you out?