Reputation: 159
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!
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]]
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. :)
It was :background "black"
instead of :color "black"
. I got it reading the file plot.scss
. :)
Upvotes: 0
Views: 87