victory 31.2.0 → 31.3.0

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.
package/dist/victory.js CHANGED
@@ -37342,7 +37342,13 @@ Object.defineProperty(VictoryBoxPlot, "propTypes", {
37342
37342
  eventHandlers: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.object
37343
37343
  })),
37344
37344
  horizontal: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.bool,
37345
- labelOrientation: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.oneOf(["top", "bottom", "left", "right"]),
37345
+ labelOrientation: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.oneOf(["top", "bottom", "left", "right"]), __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.exact({
37346
+ q1: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.oneOf(["top", "bottom", "left", "right"]),
37347
+ q3: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.oneOf(["top", "bottom", "left", "right"]),
37348
+ min: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.oneOf(["top", "bottom", "left", "right"]),
37349
+ max: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.oneOf(["top", "bottom", "left", "right"]),
37350
+ median: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.oneOf(["top", "bottom", "left", "right"])
37351
+ })]),
37346
37352
  labels: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.bool,
37347
37353
  max: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_4_victory_core__["u" /* PropTypes */].allOfType([__WEBPACK_IMPORTED_MODULE_4_victory_core__["u" /* PropTypes */].integer, __WEBPACK_IMPORTED_MODULE_4_victory_core__["u" /* PropTypes */].nonNegative]), __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.string, __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.arrayOf(__WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.string)]),
37348
37354
  maxComponent: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.element,
@@ -37813,6 +37819,10 @@ var getText = function (props, type) {
37813
37819
  return Array.isArray(labelProp) ? labelProp[index] : labelProp;
37814
37820
  };
37815
37821
 
37822
+ var getOrientation = function (labelOrientation, type) {
37823
+ return typeof labelOrientation === "object" && labelOrientation[type] || labelOrientation;
37824
+ };
37825
+
37816
37826
  var getLabelProps = function (props, text, type) {
37817
37827
  var datum = props.datum,
37818
37828
  positions = props.positions,
@@ -37821,6 +37831,7 @@ var getLabelProps = function (props, text, type) {
37821
37831
  horizontal = props.horizontal,
37822
37832
  labelOrientation = props.labelOrientation,
37823
37833
  style = props.style;
37834
+ var orientation = getOrientation(labelOrientation, type);
37824
37835
  var namespace = "".concat(type, "Labels");
37825
37836
  var labelStyle = style[namespace] || style.labels;
37826
37837
  var defaultVerticalAnchor = horizontal ? "end" : "middle";
@@ -37830,8 +37841,8 @@ var getLabelProps = function (props, text, type) {
37830
37841
 
37831
37842
  var getDefaultPosition = function (coord) {
37832
37843
  var sign = {
37833
- x: labelOrientation === "left" ? -1 : 1,
37834
- y: labelOrientation === "top" ? -1 : 1
37844
+ x: orientation === "left" ? -1 : 1,
37845
+ y: orientation === "top" ? -1 : 1
37835
37846
  };
37836
37847
  return positions[coord] + sign[coord] * width / 2 + sign[coord] * (labelStyle.padding || 0);
37837
37848
  };