'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
    }
  })));
};