'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: 38
    }
  }, _react2.default.createElement('rect', {
    x: 0,
    y: 0,
    width: width,
    height: height,
    fill: '#00f2ff',
    rx: 14,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 39
    }
  }), _react2.default.createElement(_group.Group, { top: margin.top, __source: {
      fileName: _jsxFileName,
      lineNumber: 47
    }
  }, _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: 48
    }
  }), _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: 70
        }
      }, _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: 71
        }
      }), _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: 79
        }
      }), _react2.default.createElement(_glyph.GlyphDot, {
        cx: xScale(x(d)),
        cy: yScale(y(d)),
        r: 4,
        fill: '#ffffff',
        __source: {
          fileName: _jsxFileName,
          lineNumber: 87
        }
      }));
    },
    __source: {
      fileName: _jsxFileName,
      lineNumber: 59
    }
  })));
};
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImNvbXBvbmVudHMvdGlsZXMvbXVsdGlsaW5lLmpzIl0sIm5hbWVzIjpbIlJlYWN0IiwiR3JvdXAiLCJHbHlwaERvdCIsIkxpbmVQYXRoIiwiZ2VuRGF0ZVZhbHVlIiwic2NhbGVUaW1lIiwic2NhbGVMaW5lYXIiLCJjdXJ2ZU1vbm90b25lWCIsImN1cnZlQmFzaXMiLCJleHRlbnQiLCJtYXgiLCJtaW4iLCJkYXRhIiwieCIsImQiLCJkYXRlIiwieSIsInZhbHVlIiwid2lkdGgiLCJoZWlnaHQiLCJtYXJnaW4iLCJ4TWF4IiwibGVmdCIsInJpZ2h0IiwieU1heCIsInRvcCIsImJvdHRvbSIsInhTY2FsZSIsInJhbmdlIiwiZG9tYWluIiwieVNjYWxlIiwiaSJdLCJtYXBwaW5ncy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