|
Last change
on this file since a762898 was a762898, checked in by istevanoska <ilinastevanoska@…>, 5 months ago |
|
Added visualizations
|
-
Property mode
set to
100644
|
|
File size:
1.2 KB
|
| Rev | Line | |
|---|
| [a762898] | 1 | function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|---|
| 2 | import * as React from 'react';
|
|---|
| 3 | import { clsx } from 'clsx';
|
|---|
| 4 | import { adaptEventHandlers } from '../util/types';
|
|---|
| 5 | import { svgPropertiesNoEvents } from '../util/svgPropertiesNoEvents';
|
|---|
| 6 | import { isNumber } from '../util/DataUtils';
|
|---|
| 7 | /**
|
|---|
| 8 | * Renders a dot in the chart.
|
|---|
| 9 | *
|
|---|
| 10 | * This component accepts X and Y coordinates in pixels.
|
|---|
| 11 | * If you need to position the rectangle based on your chart's data,
|
|---|
| 12 | * consider using the {@link ReferenceDot} component instead.
|
|---|
| 13 | *
|
|---|
| 14 | * @param props
|
|---|
| 15 | * @constructor
|
|---|
| 16 | */
|
|---|
| 17 | export var Dot = props => {
|
|---|
| 18 | var {
|
|---|
| 19 | cx,
|
|---|
| 20 | cy,
|
|---|
| 21 | r,
|
|---|
| 22 | className
|
|---|
| 23 | } = props;
|
|---|
| 24 | var layerClass = clsx('recharts-dot', className);
|
|---|
| 25 | if (isNumber(cx) && isNumber(cy) && isNumber(r)) {
|
|---|
| 26 | return /*#__PURE__*/React.createElement("circle", _extends({}, svgPropertiesNoEvents(props), adaptEventHandlers(props), {
|
|---|
| 27 | className: layerClass,
|
|---|
| 28 | cx: cx,
|
|---|
| 29 | cy: cy,
|
|---|
| 30 | r: r
|
|---|
| 31 | }));
|
|---|
| 32 | }
|
|---|
| 33 | return null;
|
|---|
| 34 | }; |
|---|
Note:
See
TracBrowser
for help on using the repository browser.