0

In React-vis, I display the cursor position of the mouse using a LineSeries. I would like it to extend along all the vertical extent of the FlexibleXYPlot in which it's included:

Image of the cursor on a ReactVis plot

¿How can I get the value of the yDomain of the plot?

Thank you!

Edit

I am using React-vis in clojurescript. I got the line seen in the first image with this code:

[:> rvis/LineSeries {:data [{:x @nearest-x :y y-min}{:x @nearest-x :y y-max}]
 :strokeStyle "dashed" :color "black"
 :opacity (if @button-pressed? .5 0)}]

And I needed to compute the value of y-min and y-max (that was the meaning of my question).

But then I realized that I can use the Crosshair facility:

[:> rvis/Crosshair {:values [{:x @nearest-x :y 0}] 
 :style {:line {:opacity (if @button-pressed? .5 0)}}}
 [:div]]

Crosshair in React-vis

It's difficult to see (it's under the cursor), because I still can't manage to change its color. I thought that this would work:

[:> rvis/Crosshair {:values [{:x @nearest-x :y 0}] 
 :style {:line {:color "#000"
 :opacity (if @button-pressed? .5 0)}}}
 [:div]]

But it doesn't. I think this would be another question. :)

Edit 2

It was :background "black" instead of :color "black". I got it reading the file plot.scss. :)

asked Mar 8, 2022 at 14:12
2
  • Please provide enough code so others can better understand or reproduce the problem. Commented Mar 8, 2022 at 17:02
  • @rottweiler: Thanks for your interest! I just have done so. Commented Mar 8, 2022 at 18:00

0

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.