Skip to content
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

Change [cornerRadius] prop to support rounding edges on both sides #867

Closed
boygirl opened this issue Dec 7, 2017 · 3 comments
Closed

Change [cornerRadius] prop to support rounding edges on both sides #867

boygirl opened this issue Dec 7, 2017 · 3 comments

Comments

@boygirl
Copy link
Contributor

boygirl commented Dec 7, 2017

From @FranciscoMurias on November 17, 2017 9:28

It would be extremely useful to change the cornerRadius prop to also support objects like these:
cornerRadius={{ top: 10, bottom: 10 }}
The corner radius only being applied on top atm, and it would give users a greater element of customizability to their graphs.

This would allow for graphs like this:

pasted_image_at_2017_11_14_11_19_am-1

At the moment we can only do this:

screen shot 2017-11-16 at 6 19 11 pm

This would also be extremely useful in the pieChart graph for situations like this:

pasted_image_at_2017_11_14_11_19_am-2

Being able to define either a global corner radius for the start and end point of a graph, or give it a object setting each individual edge is a cool option to have ;)

Copied from original issue: FormidableLabs/victory-native#191

@boygirl
Copy link
Contributor Author

boygirl commented Dec 7, 2017

Implementation:

cornerRadius: PropTypes.oneOfType([
    PropTypes.number,
    PropTypes.shape({
      top: PropTypes.number, bottom: PropTypes.number
    })
  ])

When given as a single number it will apply only to the top corners to avoid the breaking change.

@kale-stew kale-stew self-assigned this Feb 5, 2018
@nthegedus
Copy link

Sorry but I didn't get how do I implement this. Someone could explain?

I need to use cornerRadius on top and bottom too.

@pixelomo
Copy link

@boygirl please give an example of how we implement this, your code just shows what you're changing on the core code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants