"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports["default"] = void 0;

var _react = _interopRequireDefault(require("react"));

var _propTypes = _interopRequireDefault(require("prop-types"));

var _victory = require("victory");

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }

var GradientBox = function GradientBox(_ref) {
  var scale = _ref.scale,
      domain = _ref.domain,
      fill = _ref.fill;
  var width = scale.x(domain.x[1]) - scale.x(domain.x[0]);
  var height = Math.abs(scale.y(domain.y[1]) - scale.y(domain.y[0]));
  return _react["default"].createElement(_victory.Box, {
    x: scale.x(domain.x[0]),
    y: scale.y(domain.y[1]),
    width: width,
    height: height,
    style: {
      fill: fill,
      stroke: "none"
    }
  });
};

GradientBox.propTypes = {
  scale: _propTypes["default"].shape({
    y: _propTypes["default"].func,
    x: _propTypes["default"].func
  }),
  domain: _propTypes["default"].shape({
    x: _propTypes["default"].arrayOf(_propTypes["default"].number),
    y: _propTypes["default"].arrayOf(_propTypes["default"].number)
  }),
  fill: _propTypes["default"].string.isRequired
};
var _default = GradientBox;
exports["default"] = _default;