spotify/reactochart

Prop for XLine and YLine to have a prop to set height and width

krissalvador27 opened this issue · 4 comments

Currently XLine/YLine span the full height/width of the chart. Would be nice to declare a stopping point for height/width based on a value in the xaxis/yaxis domain. This can set up visualizations such as intersection points on a LineChart.

Hi @krissalvador27,

Just wanted to make sure I understand the expected behavior for the chart from the new prop that you are talking about. So this "stopper" prop would just take in a value that lies within the xDomain/yDomain, and cut the line short at the value provided right?

I've implemented it for the YLine by using the xScale function, but this is all based on my understanding (screenshot below):

Screen Shot 2019-05-20 at 9 33 36 AM

Let me know if this is what you had in mind!

Hey @tanayv

Yes! Your definition of the stopper prop is what I was envisioning and looks good based on the screenshot. I'm not sold on the prop name "stopper", but also can't think of anything better. Naming things is hard. 😅

Sounds good!

Yes, I agree. "stopper" doesn't exactly convey what the prop is doing very well. What are your thoughts on something along the lines of xLimit for YLine and yLimit for XLine, or using just limit to keep it consistent across the two?

Something simple like height or width could also potentially work but I can see that being slightly confusing because it could mean the stroke width?

Yeah, height/width would be misleading for both the stroke and the value i.e. does 10 mean 10px or the value 10?

I think xLimit for YLine and yLimit for xLine would work!