'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});

var _react = require('react');

var _react2 = _interopRequireDefault(_react);

var _group = require('@vx/group');

var _glyph = require('@vx/glyph');

var _shape = require('@vx/shape');

var _mockData = require('@vx/mock-data');

var _scale = require('@vx/scale');

var _curve = require('@vx/curve');

var _d3Array = require('d3-array');

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

var _jsxFileName = '/Users/hshoff/Code/vx/packages/vx-demo/components/tiles/multiline.js';


var data = (0, _mockData.genDateValue)(15);

// accessors
var x = function x(d) {
  return d.date;
};
var y = function y(d) {
  return d.value;
};

exports.default = function (_ref) {
  var width = _ref.width,
      height = _ref.height,
      margin = _ref.margin;

  if (width < 10) return null;

  // bounds
  var xMax = width - margin.left - margin.right;
  var yMax = height - margin.top - margin.bottom;

  // scales
  var xScale = (0, _scale.scaleTime)({
    range: [0, xMax],
    domain: (0, _d3Array.extent)(data, x)
  });
  var yScale = (0, _scale.scaleLinear)({
    range: [yMax, 0],
    domain: [0, (0, _d3Array.max)(data, y)]
  });

  return _react2.default.createElement('svg', { width: width, height: height, __source: {
      fileName: _jsxFileName,
      lineNumber: 34
    }
  }, _react2.default.createElement('rect', { x: 0, y: 0, width: width, height: height, fill: '#00f2ff', rx: 14, __source: {
      fileName: _jsxFileName,
      lineNumber: 35
    }
  }), _react2.default.createElement(_group.Group, { top: margin.top, __source: {
      fileName: _jsxFileName,
      lineNumber: 36
    }
  }, _react2.default.createElement(_shape.LinePath, {
    data: data,
    xScale: xScale,
    yScale: yScale,
    x: x,
    y: y,
    stroke: 'rgba(126, 31, 220, 1.000)',
    strokeWidth: 2,
    strokeDasharray: '2,2',
    curve: _curve.curveBasis,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 37
    }
  }), _react2.default.createElement(_shape.LinePath, {
    data: data,
    xScale: xScale,
    yScale: yScale,
    x: x,
    y: y,
    stroke: 'rgba(126, 31, 220, 1.000)',
    strokeWidth: 3,
    curve: _curve.curveMonotoneX,
    glyph: function glyph(d, i) {
      return _react2.default.createElement('g', { key: 'line-point-' + i, __source: {
          fileName: _jsxFileName,
          lineNumber: 59
        }
      }, _react2.default.createElement(_glyph.GlyphDot, {
        cx: xScale(x(d)),
        cy: yScale(y(d)),
        r: 6,
        fill: '#fff',
        stroke: 'rgba(0, 242, 255, 1.000)',
        strokeWidth: 10,
        __source: {
          fileName: _jsxFileName,
          lineNumber: 60
        }
      }), _react2.default.createElement(_glyph.GlyphDot, {
        cx: xScale(x(d)),
        cy: yScale(y(d)),
        r: 6,
        fill: 'rgba(0, 242, 255, 1.000)',
        stroke: 'rgba(126, 31, 220, 1.000)',
        strokeWidth: 3,
        __source: {
          fileName: _jsxFileName,
          lineNumber: 68
        }
      }), _react2.default.createElement(_glyph.GlyphDot, { cx: xScale(x(d)), cy: yScale(y(d)), r: 4, fill: '#ffffff', __source: {
          fileName: _jsxFileName,
          lineNumber: 76
        }
      }));
    },
    __source: {
      fileName: _jsxFileName,
      lineNumber: 48
    }
  })));
};
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImNvbXBvbmVudHMvdGlsZXMvbXVsdGlsaW5lLmpzIl0sIm5hbWVzIjpbIlJlYWN0IiwiR3JvdXAiLCJHbHlwaERvdCIsIkxpbmVQYXRoIiwiZ2VuRGF0ZVZhbHVlIiwic2NhbGVUaW1lIiwic2NhbGVMaW5lYXIiLCJjdXJ2ZU1vbm90b25lWCIsImN1cnZlQmFzaXMiLCJleHRlbnQiLCJtYXgiLCJtaW4iLCJkYXRhIiwieCIsImQiLCJkYXRlIiwieSIsInZhbHVlIiwid2lkdGgiLCJoZWlnaHQiLCJtYXJnaW4iLCJ4TWF4IiwibGVmdCIsInJpZ2h0IiwieU1heCIsInRvcCIsImJvdHRvbSIsInhTY2FsZSIsInJhbmdlIiwiZG9tYWluIiwieVNjYWxlIiwiaSJdLCJtYXBwaW5ncyI6Ijs7Ozs7O0FBQUEsQUF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