UNPKG

r-d3

Version:

D3 data, React rendering.

35 lines (26 loc) 1.37 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; var _react = require("react"); var React = _interopRequireWildcard(_react); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } var Chart = function Chart(props) { var className = props.className, height = props.height, width = props.width, otherProps = _objectWithoutProperties(props, ["className", "height", "width"]); return React.createElement( "svg", { className: className, height: height, width: width }, React.createElement("g", _extends({}, otherProps, { className: "chart" })) ); }; exports.default = Chart;