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

VictoryCursorComponent Linesegment goes outside of the graph #3033

Open
2 tasks done
andytubeee opened this issue Jan 10, 2025 · 2 comments
Open
2 tasks done

VictoryCursorComponent Linesegment goes outside of the graph #3033

andytubeee opened this issue Jan 10, 2025 · 2 comments
Labels
Type: Bug 🐛 Oh no! A bug or unintentional behavior

Comments

@andytubeee
Copy link

andytubeee commented Jan 10, 2025

Is there an existing issue for this?

  • I have searched the existing issues

Code of Conduct

  • I agree to follow this project's Code of Conduct

Victory version

37.3.5

Code Sandbox link

No response

Bug report

VictoryZoomCursorContainer, the line segments goes outside of the chart (e.g to the left of the x-axis).

This issue is that the chart domain of xRange is large, and I used Zoom + Cursor container to zoom into a subset, allowing panning functionality. Which causes Cursor Container's line segnment to render outside of current viewportX 

I think edge-case is a better term than bug for this one.

The documentation states

The cursor moves with the mouse (or on touch on mobile devices) along the visible domain of the chart.

Since the domain of the chart is 7-days, I use zoom container first to "zoom" into 1 day, and allows the user to then pan to left and right within the total domain xRange. The cursor container (cursorComponent) neglects the x-axis.

This edgecase is most likely due to the usage of createContainer between zoom and cursor containers. VictoryZoom's clipping isn't operating on the cursor container to reflect what the "visible-domain" is.

Steps to reproduce

Using VictoryCursorContainer

Expected behavior

It should stop rendering the line segment if cursor is outside of the chart

Actual behavior

Environment

- Device:
- OS:
- Node: v20.5.1
- npm: 10.8.3
@andytubeee andytubeee added the Type: Bug 🐛 Oh no! A bug or unintentional behavior label Jan 10, 2025
@andytubeee
Copy link
Author

image

@andytubeee
Copy link
Author

Or is there way to not render the cursorComponent without using disable={true}, by using tracking the value using onCursorChange?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug 🐛 Oh no! A bug or unintentional behavior
Projects
None yet
Development

No branches or pull requests

1 participant