rumble-charts
Version:
Truly declarative React charts components
18 lines (15 loc) • 806 B
JavaScript
import React from 'react';
import './helpers/colorFunc.js';
import 'd3-shape';
import 'd3-ease';
import { isFunction } from './helpers/isFunction.js';
import { getCoords } from './helpers/getCoords.js';
import { isString } from './helpers/isString.js';
function Title(props) {
var style = props.style, className = props.className, children = props.children;
var _a = getCoords(props.position, props.layerWidth, props.layerHeight, props.width, props.height), x = _a.x, y = _a.y;
return (React.createElement("g", { className: className, transform: "translate(".concat(x, " ").concat(y, ")"), style: style }, isString(children)
? React.createElement("text", { textAnchor: props.textAnchor }, children)
: (isFunction(children) ? children(props) : children)));
}
export { Title };