This repository has been archived by the owner on Feb 19, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 88
Support for a wickStrokeWidth style prop #554
Merged
Changes from 4 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
6eaf9ef
calculate and reduce highWick & lowWick
c8ac617
wick never crosses candle
87a9b47
remove excess calculations
34a1c28
look for a wickStrokeWidth prop
6c9647d
y1 → `high`, y2 → `low`
bca491b
removed `y` const
9873a44
lint
175a86b
unneccessary prop declaration
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,10 +6,10 @@ export default { | |
props = Helpers.modifyProps(props, fallbackProps, "candlestick"); | ||
const calculatedValues = this.getCalculatedValues(props); | ||
const { data, style, scale, domain, origin } = calculatedValues; | ||
const { groupComponent, width, height, padding, standalone, theme, polar } = props; | ||
const { groupComponent, width, height, padding, standalone, theme, polar, wickStrokeWidth } = props; | ||
const initialChildProps = { parent: { | ||
domain, scale, width, height, data, standalone, theme, polar, origin, | ||
style: style.parent, padding | ||
style: style.parent, padding, wickStrokeWidth | ||
} }; | ||
|
||
return data.reduce((childProps, datum, index) => { | ||
|
@@ -19,10 +19,12 @@ export default { | |
const y2 = scale.y(datum._low); | ||
const candleHeight = Math.abs(scale.y(datum._open) - scale.y(datum._close)); | ||
const y = scale.y(Math.max(datum._open, datum._close)); | ||
const highWick = y; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unnecessary variable. |
||
const lowWick = scale.y(Math.min(datum._open, datum._close)); | ||
const dataStyle = this.getDataStyles(datum, style.data, props); | ||
const dataProps = { | ||
x, y, y1, y2, candleHeight, scale, data, datum, groupComponent, | ||
index, style: dataStyle, padding, width, polar, origin | ||
x, y, y1, y2, candleHeight, scale, data, datum, groupComponent, highWick, lowWick, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looking at this now, and thinking about how you'll actually be using these props, I think it would be nice to refactor the props that get supplied to |
||
index, style: dataStyle, padding, width, polar, origin, wickStrokeWidth | ||
}; | ||
|
||
childProps[eventKey] = { | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
wickStrokeWidth
is not needed as a prop onparent