| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
PatternFly-React preview: https://2193-pr-patternfly-react-patternfly.surge.sh |
Sorry, something went wrong.
Codecov Report
@@ Coverage Diff @@
## master #2193 +/- ##
==========================================
- Coverage 80.65% 80.45% -0.21%
==========================================
Files 660 660
Lines 8322 8343 +21
Branches 628 641 +13
==========================================
Hits 6712 6712
- Misses 1310 1331 +21
Partials 300 300
Continue to review full report at Codecov.
|
Sorry, something went wrong.
…donutWidth Fixes patternfly#2191 Fixes patternfly#2192
There was a problem hiding this comment.
LGTM
Sorry, something went wrong.
There was a problem hiding this comment.
LGTM
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
This PR is for donut utilization changes requested by @TheRealJon for use in OpenShift.
Fixes #2191
Fixes #2192
Fixes #2194
I was able to fix #2191 by setting capHeight (using a rem value) in order to help center the label vertically. I only use this when both title and subtitle are available -- not necessary for a single label. I've added a property so it may be overridden.
I was able to address #2192 by changing the default donutHeight and donutWidth properties to use the min. of the given SVG height or width. If height & width are not provided, the default theme property would be used.
With these changes, the user can just set the height and width properties. Similar to other charts, we'll set the donut size to match that.
This also works with the threshold chart. I've modified the dynamic chart to be 28px smaller than the static (threshold) chart by default. This is similar to innerRadius, where we set a default regardless of the chart size.
This probably covers most use cases where the width is larger to accommodate either a left or right aligned legend. Of course, it also works without any legends at all. Thus, allowing the user to more easily create different size charts.
For edge cases, the user can still override the donutHeight and donutWidth properties. There an example of this (below), where the overall SVG height and width are larger than donutHeight and donutWidth. In this particular example, the horizontal legend is wider than the chart's donutWidth, while the SVG is sized appropriately to accommodate both the chart and legend.