"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

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

var _debug = _interopRequireDefault(require("debug"));

var _graphingUtils = require("../../../graphing-utils");

var _withRootEdge = require("../shared/line/with-root-edge");

var log = (0, _debug["default"])('pie-lib:graphing:absolute');
var Absolute = (0, _withRootEdge.withRootEdge)(function (props) {
  var root = props.root,
      edge = props.edge,
      graphProps = props.graphProps;
  var domain = graphProps.domain,
      range = graphProps.range;
  var dataPoints = edge && edge.x === root.x ? [] : (0, _graphingUtils.buildDataPoints)(domain, range, root, edge, (0, _graphingUtils.absoluteFromTwoPoints)(root, edge), true);
  log('dataPoints:', dataPoints);
  return {
    root: props.root,
    edge: props.edge,
    dataPoints: dataPoints,
    enableCurve: false
  };
});
var Component = (0, _withRootEdge.rootEdgeComponent)(Absolute);
var _default = Component;
exports["default"] = _default;
//# sourceMappingURL=component.js.map