'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 _gradient = require('@vx/gradient');

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

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

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

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


var points = (0, _mockData.genRandomNormalPoints)(600).filter(function (d, i) {
  return i < 600;
});

var x = function x(d) {
  return d[0];
};
var y = function y(d) {
  return d[1];
};
var z = function z(d) {
  return d[2];
};

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

  var xMax = width;
  var yMax = height - 80;
  if (width < 10) return null;

  var xScale = (0, _scale.scaleLinear)({
    domain: [1.3, 2.2],
    range: [0, xMax],
    clamp: true
  });
  var yScale = (0, _scale.scaleLinear)({
    domain: [.75, 1.6],
    range: [yMax, 0],
    clamp: true
  });

  return _react2.default.createElement('svg', { width: width, height: height, __source: {
      fileName: _jsxFileName,
      lineNumber: 36
    }
  }, _react2.default.createElement(_gradient.GradientPinkRed, { id: 'pink', __source: {
      fileName: _jsxFileName,
      lineNumber: 37
    }
  }), _react2.default.createElement('rect', {
    x: 0,
    y: 0,
    width: width,
    height: height,
    rx: 14,
    fill: 'url(#pink)',
    __source: {
      fileName: _jsxFileName,
      lineNumber: 38
    }
  }), _react2.default.createElement(_group.Group, {
    __source: {
      fileName: _jsxFileName,
      lineNumber: 46
    }
  }, points.map(function (point, i) {
    return _react2.default.createElement(_glyph.GlyphDot, {
      key: 'point-' + point.x + '-' + i,
      fill: '#f6c431',
      cx: xScale(x(point)),
      cy: yScale(y(point)),
      r: i % 3 === 0 ? 2 : 3,
      __source: {
        fileName: _jsxFileName,
        lineNumber: 49
      }
    });
  })));
};