Investigate calculating data intersections in `VictoryCursorContainer`
So that folks can put a marker on a line and have it smoothly follow the cursor. Currently the process is v. complex
From the gitter channel:
You will need to make a little wrapped line and provide it to
VictoryCursorContainervia thecursorComponentprop. You will inspect the props coming into it, and alter they1so that it cuts off early. You can use theonCursorChangecallback prop to calculate what the newy1prop should be. This callback will be called with the value of the cursor in terms of data as the first argument, and the rest ofVictoryCursorContainer's props (includingscale) as the second argument. Unfortunately,VictoryCursorContainerdoesn't calculate any intersections with your data, so you will have to do some math on your data array to get the the value of the data intersection You can use something like https://github.com/d3/d3-array#bisectLeft. You will then use thescale propto convert that value to an svg coordinate and use that as youry1. Phew. That's a lot! I will open an issue to investigate the the complications / performance impact of calculating the intersection in VictoryCursorContainer
Seeing as there's been no change on this particular issue, does that mean the only way to get the intersecting Y value right now is still to do a search over your data given the X value provided via onCursorChange?
I have a custom Cursor + Voronoi container set up in Victory Native right now for a price-datetime chart, and the desire is that on tap, I can get both the date (which is the provided value) and price (which is not currently available) so that I can call another callback to update a component outside the chart itself, but that doesn't seem to be possible right now without taking the performance hit of manually querying against my data object