thingco / shared-frontend-libs

0 stars 0 forks source link

[FIX] - scrubbing on larger graphs is very jumpy/inconsistent #65

Open ThingCoDanW opened 3 years ago

ThingCoDanW commented 3 years ago

Which package does this affect?

If this covers multiple packages, if possible open an issue for both and PR separately: this will keep the PR's scope as small as possible (plus each package needs separate version bumps & republishing after the fix has been applied).

Describe the bug On larger graphs, perhaps due to the translation between the (hidden) slider and the full with of the graph, it is very difficult to scroll to specific points, or even to scroll smoothly through the entire graph. Clicking to begin dragging will cause the graph to jump about wildly, and it's often very difficult to scroll to the very end of the graph.

Expected behavior The scrubbing behaviour needs to be smoother, and ideally should be a 'grab-and-drag' style implementation (particularly on mobile where this would make a lot more sense). I think it will be necessary to ditch the slider implementation and try to find something with a scrollview, or maybe some other kind of canvas which can handle drag events.

ThingCoDanW commented 2 years ago

Graphs in portal have been rebuilt to use Canvas rather than SVG, as SVG performance is very poor. No longer using these graphs in mobile app either, largely due to the issues raised here (jumpy/inconsistent scrubbing), so this lib is currently unused.

This library will need a major rework to be viable, though it might make more sense to separate the graphing lib(s) into the component libraries and have different implementations for web/mobile (canvas performance on mobile is very poor due to webview rendering limitations).