1. /**
    
  2.  * Copyright (c) Meta Platforms, Inc. and affiliates.
    
  3.  *
    
  4.  * This source code is licensed under the MIT license found in the
    
  5.  * LICENSE file in the root directory of this source tree.
    
  6.  * @typechecks
    
  7.  *
    
  8.  * Example usage:
    
  9.  * <Circle
    
  10.  *   radius={10}
    
  11.  *   stroke="green"
    
  12.  *   strokeWidth={3}
    
  13.  *   fill="blue"
    
  14.  * />
    
  15.  *
    
  16.  */
    
  17. 
    
  18. 'use strict';
    
  19. 
    
  20. var assign = Object.assign;
    
  21. var PropTypes = require('prop-types');
    
  22. var React = require('react');
    
  23. var ReactART = require('react-art');
    
  24. 
    
  25. var createReactClass = require('create-react-class');
    
  26. 
    
  27. var Path = ReactART.Path;
    
  28. var Shape = ReactART.Shape;
    
  29. 
    
  30. /**
    
  31.  * Circle is a React component for drawing circles. Like other ReactART
    
  32.  * components, it must be used in a <Surface>.
    
  33.  */
    
  34. var Circle = createReactClass({
    
  35.   displayName: 'Circle',
    
  36. 
    
  37.   propTypes: {
    
  38.     radius: PropTypes.number.isRequired,
    
  39.   },
    
  40. 
    
  41.   render: function render() {
    
  42.     var radius = this.props.radius;
    
  43. 
    
  44.     var path = Path()
    
  45.       .moveTo(0, -radius)
    
  46.       .arc(0, radius * 2, radius)
    
  47.       .arc(0, radius * -2, radius)
    
  48.       .close();
    
  49.     return React.createElement(Shape, assign({}, this.props, {d: path}));
    
  50.   },
    
  51. });
    
  52. 
    
  53. module.exports = Circle;