victory-pie 11.4.1 → 11.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -94,12 +94,9 @@ export default {
94
94
  var colors = Array.isArray(colorScale) ? colorScale : Style.getColorScale(colorScale);
95
95
  var padding = Helpers.getPadding(props);
96
96
  var radius = this.getRadius(props, padding);
97
- var offsetWidth = width / 2 + padding.left - padding.right;
98
- var offsetHeight = height / 2 + padding.top - padding.bottom;
99
- var origin = {
100
- x: offsetWidth + radius > width ? radius + padding.left - padding.right : offsetWidth,
101
- y: offsetHeight + radius > height ? radius + padding.top - padding.bottom : offsetHeight
102
- };
97
+ var offsetWidth = (radius + padding.left + (width - radius - padding.right)) / 2;
98
+ var offsetHeight = (radius + padding.top + (height - radius - padding.bottom)) / 2;
99
+ var origin = { x: offsetWidth, y: offsetHeight };
103
100
  var data = Data.getData(props);
104
101
  var slices = this.getSlices(props, data);
105
102
  var pathFunction = d3Shape.arc().cornerRadius(props.cornerRadius).outerRadius(radius).innerRadius(props.innerRadius);
@@ -116,12 +116,9 @@ exports.default = {
116
116
  var colors = Array.isArray(colorScale) ? colorScale : _victoryCore.Style.getColorScale(colorScale);
117
117
  var padding = _victoryCore.Helpers.getPadding(props);
118
118
  var radius = this.getRadius(props, padding);
119
- var offsetWidth = width / 2 + padding.left - padding.right;
120
- var offsetHeight = height / 2 + padding.top - padding.bottom;
121
- var origin = {
122
- x: offsetWidth + radius > width ? radius + padding.left - padding.right : offsetWidth,
123
- y: offsetHeight + radius > height ? radius + padding.top - padding.bottom : offsetHeight
124
- };
119
+ var offsetWidth = (radius + padding.left + (width - radius - padding.right)) / 2;
120
+ var offsetHeight = (radius + padding.top + (height - radius - padding.bottom)) / 2;
121
+ var origin = { x: offsetWidth, y: offsetHeight };
125
122
  var data = _victoryCore.Data.getData(props);
126
123
  var slices = this.getSlices(props, data);
127
124
  var pathFunction = d3Shape.arc().cornerRadius(props.cornerRadius).outerRadius(radius).innerRadius(props.innerRadius);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "victory-pie",
3
- "version": "11.4.1",
3
+ "version": "11.4.2",
4
4
  "description": "D3 pie & donut chart component for React",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",
@@ -81,12 +81,9 @@ export default {
81
81
  const colors = Array.isArray(colorScale) ? colorScale : Style.getColorScale(colorScale);
82
82
  const padding = Helpers.getPadding(props);
83
83
  const radius = this.getRadius(props, padding);
84
- const offsetWidth = width / 2 + padding.left - padding.right;
85
- const offsetHeight = height / 2 + padding.top - padding.bottom;
86
- const origin = {
87
- x: offsetWidth + radius > width ? radius + padding.left - padding.right : offsetWidth,
88
- y: offsetHeight + radius > height ? radius + padding.top - padding.bottom : offsetHeight
89
- };
84
+ const offsetWidth = ((radius + padding.left) + (width - radius - padding.right)) / 2;
85
+ const offsetHeight = ((radius + padding.top) + (height - radius - padding.bottom)) / 2;
86
+ const origin = { x: offsetWidth, y: offsetHeight };
90
87
  const data = Data.getData(props);
91
88
  const slices = this.getSlices(props, data);
92
89
  const pathFunction = d3Shape.arc()