Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question] Snap cursor to previous point until moved over next point. #972

Open
vildantursic opened this issue Jul 16, 2024 · 1 comment

Comments

@vildantursic
Copy link

vildantursic commented Jul 16, 2024

Hi,
First of all I want to thank you for all the amazing work!

I moved from ECharts to uPlot library and so far almost everything I had in previous one is reimplemented in uPlot except one thing. Snapping of the cursor on xAxis is a bit confusing, tbh I got lost with options and functions 🥲

There are two features that I am trying to implement.

  • First one is to replicate same snapping as in Echarts where cursor snaps directly on next point if there is a gap [recording1]

  • Second one would be more advanced. Snapping cursor on previous point until I cross next point. In short, to avoid snapping mid way (to avoid snapping when going over gap area).
    Is this possible with uPlot?
    I tried using prox and bias as { prox: 1000, bias: -1, skip: [null] } thinking that it would snap to closest previous one since bias is -1 but I'm probably wrong since it is not working 😄

Is it also possible to snap vertical dotted cursor on X axis like in [recording1], and if yes how?

Current implementation in uPlot is shown in [recording2]

recording1

Screen.Recording.2024-07-16.at.13.46.34.mov

recording2

Screen.Recording.2024-07-16.at.13.51.26.mov

Thank you in advance!

P.S.
Do you have any plans for documentation? I am willing to help with creating docs, I just don't want to do PR without any consultation and have it hanging forever in Github void 😄

@vildantursic vildantursic changed the title Help needed. Snap cursor to previous point until moved over next point. [Question] Snap cursor to previous point until moved over next point. Aug 1, 2024
@vildantursic
Copy link
Author

Hey @leeoniya, sorry but had to ping you just to ask if this is even possible 😄 if it is not I am totally fine with it. Finally completed everything, and works great.
Also check last part/question about Documentation 😄 would really like to contribute on that part!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant