victory-box-plot 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.
@@ -11981,7 +11981,13 @@ Object.defineProperty(VictoryBoxPlot, "propTypes", {
11981
11981
  eventHandlers: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.object
11982
11982
  })),
11983
11983
  horizontal: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.bool,
11984
- labelOrientation: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.oneOf(["top", "bottom", "left", "right"]),
11984
+ 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({
11985
+ q1: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.oneOf(["top", "bottom", "left", "right"]),
11986
+ q3: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.oneOf(["top", "bottom", "left", "right"]),
11987
+ min: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.oneOf(["top", "bottom", "left", "right"]),
11988
+ max: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.oneOf(["top", "bottom", "left", "right"]),
11989
+ median: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.oneOf(["top", "bottom", "left", "right"])
11990
+ })]),
11985
11991
  labels: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.bool,
11986
11992
  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__["i" /* PropTypes */].allOfType([__WEBPACK_IMPORTED_MODULE_4_victory_core__["i" /* PropTypes */].integer, __WEBPACK_IMPORTED_MODULE_4_victory_core__["i" /* 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)]),
11987
11993
  maxComponent: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.element,
@@ -23636,6 +23642,10 @@ var getText = function (props, type) {
23636
23642
  return Array.isArray(labelProp) ? labelProp[index] : labelProp;
23637
23643
  };
23638
23644
 
23645
+ var getOrientation = function (labelOrientation, type) {
23646
+ return typeof labelOrientation === "object" && labelOrientation[type] || labelOrientation;
23647
+ };
23648
+
23639
23649
  var getLabelProps = function (props, text, type) {
23640
23650
  var datum = props.datum,
23641
23651
  positions = props.positions,
@@ -23644,6 +23654,7 @@ var getLabelProps = function (props, text, type) {
23644
23654
  horizontal = props.horizontal,
23645
23655
  labelOrientation = props.labelOrientation,
23646
23656
  style = props.style;
23657
+ var orientation = getOrientation(labelOrientation, type);
23647
23658
  var namespace = "".concat(type, "Labels");
23648
23659
  var labelStyle = style[namespace] || style.labels;
23649
23660
  var defaultVerticalAnchor = horizontal ? "end" : "middle";
@@ -23653,8 +23664,8 @@ var getLabelProps = function (props, text, type) {
23653
23664
 
23654
23665
  var getDefaultPosition = function (coord) {
23655
23666
  var sign = {
23656
- x: labelOrientation === "left" ? -1 : 1,
23657
- y: labelOrientation === "top" ? -1 : 1
23667
+ x: orientation === "left" ? -1 : 1,
23668
+ y: orientation === "top" ? -1 : 1
23658
23669
  };
23659
23670
  return positions[coord] + sign[coord] * width / 2 + sign[coord] * (labelStyle.padding || 0);
23660
23671
  };