-
Notifications
You must be signed in to change notification settings - Fork 525
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
add diff labels and orientation support #1295
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is looking really good. I'm a little concerned about how getCandleWidth
is working, but I need to think more about what has access to active
. I would also really like to see more demos / stories
}; | ||
|
||
const getCandleWidth = (props, style) => { | ||
const { active, datum, data, candleWidth, scale, defaultCandleWidth } = props; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a little confusing. You're using the same function that was in Candle
and supplying it with the data props that you're calculating for each Candle
. That mostly works, but active
will not typically be defined at this level. Typically it would get added to state by Victory's event system.
(typeof labelOrientation === "object" && labelOrientation[type]) || labelOrientation; | ||
|
||
/* eslint-disable complexity*/ | ||
const calculateAxisValues = (props) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm confused about this function name. I don't think axis is accurate here.
@ashika01 I've been trying out this branch, and looking for edge cases. There are a couple issues:
I'm also seeing a few console warnings in this situation:
I was also not able to alter the new labels via events. For example:
I'll look into the event issue if you'd prefer. It looks potentially confusing. |
Last commit include change in box plot as well |
Fixes: #1286
Improvements on label support for
victory-candlestick
. This PR includes following label support for candlestickThere is also continued support for
labels
andlabelComponent
.style
can be applied on all the different labels.Also support
top
,bottom
,left
,right
label orientation support for all the labelsTODO: