UNPKG

react-gifted-charts

Version:

ReactJS counterpart of react-native-gifted-charts. An intuitive charting library for Bar, Line, Area, Pie, Donut, Stacked Bar, Population Pyramid and Radar charts in React

139 lines 23 kB
var __assign = (this && this.__assign) || function () { __assign = Object.assign || function(t) { for (var s, i = 1, n = arguments.length; i < n; i++) { s = arguments[i]; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; } return t; }; return __assign.apply(this, arguments); }; import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime"; import { Fragment } from 'react'; import { ruleTypes, usePopulationPyramid, Framework } from 'gifted-charts-core'; export var PopulationPyramid = function (props) { var _a, _b, _c, _d, _e, _f, _g, _h, _j; var _k = usePopulationPyramid(__assign(__assign({}, props), { screenWidth: 300, framework: Framework.reactJS })), width = _k.width, verticalMarginBetweenBars = _k.verticalMarginBetweenBars, barsMapToYAxisSections = _k.barsMapToYAxisSections, data = _k.data, hideRules = _k.hideRules, yAxisColor = _k.yAxisColor, xAxisColor = _k.xAxisColor, xAxisThickness = _k.xAxisThickness, xAxisType = _k.xAxisType, xAxisNoOfSections = _k.xAxisNoOfSections, showXAxisIndices = _k.showXAxisIndices, showXAxisLabelTexts = _k.showXAxisLabelTexts, xAxisLabelShiftX = _k.xAxisLabelShiftX, xAxisLabelPrefix = _k.xAxisLabelPrefix, xAxisLabelSuffix = _k.xAxisLabelSuffix, formatXAxisLabels = _k.formatXAxisLabels, showVerticalLines = _k.showVerticalLines, showYAxisIndices = _k.showYAxisIndices, yAxisIndicesWidth = _k.yAxisIndicesWidth, yAxisIndicesHeight = _k.yAxisIndicesHeight, yAxisIndicesColor = _k.yAxisIndicesColor, yAxisLabelFontSize = _k.yAxisLabelFontSize, yAxisLabelFontStyle = _k.yAxisLabelFontStyle, yAxisLabelFontWeight = _k.yAxisLabelFontWeight, yAxisLabelFontFamily = _k.yAxisLabelFontFamily, yAxisLabelColor = _k.yAxisLabelColor, yAxisLabelTextMarginRight = _k.yAxisLabelTextMarginRight, yAxisLabelTexts = _k.yAxisLabelTexts, showValuesAsBarLabels = _k.showValuesAsBarLabels, rulesThickness = _k.rulesThickness, rulesColor = _k.rulesColor, rulesType = _k.rulesType, dashWidth = _k.dashWidth, dashGap = _k.dashGap, leftBarLabelWidth = _k.leftBarLabelWidth, leftBarLabelFontSize = _k.leftBarLabelFontSize, leftBarLabelColor = _k.leftBarLabelColor, leftBarLabelFontStyle = _k.leftBarLabelFontStyle, leftBarLabelFontWeight = _k.leftBarLabelFontWeight, leftBarLabelFontFamily = _k.leftBarLabelFontFamily, leftBarLabelPrefix = _k.leftBarLabelPrefix, leftBarLabelSuffix = _k.leftBarLabelSuffix, rightBarLabelFontSize = _k.rightBarLabelFontSize, rightBarLabelColor = _k.rightBarLabelColor, rightBarLabelFontStyle = _k.rightBarLabelFontStyle, rightBarLabelFontWeight = _k.rightBarLabelFontWeight, rightBarLabelFontFamily = _k.rightBarLabelFontFamily, rightBarLabelPrefix = _k.rightBarLabelPrefix, rightBarLabelSuffix = _k.rightBarLabelSuffix, formatBarLabels = _k.formatBarLabels, showMidAxis = _k.showMidAxis, midAxisLabelFontSize = _k.midAxisLabelFontSize, midAxisLabelColor = _k.midAxisLabelColor, midAxisLabelFontStyle = _k.midAxisLabelFontStyle, midAxisLabelFontWeight = _k.midAxisLabelFontWeight, midAxisLabelFontFamily = _k.midAxisLabelFontFamily, leftBarColor = _k.leftBarColor, rightBarColor = _k.rightBarColor, leftBarBorderColor = _k.leftBarBorderColor, rightBarBorderColor = _k.rightBarBorderColor, leftBarBorderWidth = _k.leftBarBorderWidth, rightBarBorderWidth = _k.rightBarBorderWidth, leftBarBorderRadius = _k.leftBarBorderRadius, rightBarBorderRadius = _k.rightBarBorderRadius, allCornersRounded = _k.allCornersRounded, showSurplus = _k.showSurplus, showSurplusLeft = _k.showSurplusLeft, showSurplusRight = _k.showSurplusRight, leftSurplusColor = _k.leftSurplusColor, leftSurplusBorderColor = _k.leftSurplusBorderColor, rightSurplusColor = _k.rightSurplusColor, rightSurplusBorderColor = _k.rightSurplusBorderColor, leftSurplusBorderWidth = _k.leftSurplusBorderWidth, rightSurplusBorderWidth = _k.rightSurplusBorderWidth, yAxisLabelWidth = _k.yAxisLabelWidth, noOfSections = _k.noOfSections, stepHeight = _k.stepHeight, containerHeightWithXaxisLabels = _k.containerHeightWithXaxisLabels, mid = _k.mid, barWidthFactor = _k.barWidthFactor, leftXAfterMid = _k.leftXAfterMid, rightXAfterMid = _k.rightXAfterMid, yAxisLineProps = _k.yAxisLineProps, midAxisLineCommonProps = _k.midAxisLineCommonProps, xAxisIndicesCommonProps = _k.xAxisIndicesCommonProps, verticalLinesCommonProps = _k.verticalLinesCommonProps, xAxisLabelsCommonProps = _k.xAxisLabelsCommonProps, getXLabel = _k.getXLabel, midAxisLabelWidth = _k.midAxisLabelWidth; /********************************************************************************************* *********************** Type modifications for ReactJS **********************/ var yAxisStroke = (_a = yAxisLineProps.stroke) === null || _a === void 0 ? void 0 : _a.toString(); var yAxisStrokeDashArray = (_b = yAxisLineProps.strokeDasharray) === null || _b === void 0 ? void 0 : _b.toString(); var verticalLinesStroke = (_c = verticalLinesCommonProps.stroke) === null || _c === void 0 ? void 0 : _c.toString(); var verticalLinesStrokeDashArray = (_d = verticalLinesCommonProps.strokeDasharray) === null || _d === void 0 ? void 0 : _d.toString(); var xAxisIndicesStroke = xAxisIndicesCommonProps.stroke.toString(); var midAxisStrokeDashArray = (_e = midAxisLineCommonProps.strokeDasharray) === null || _e === void 0 ? void 0 : _e.toString(); var xAxisLabelStroke = xAxisLabelsCommonProps.stroke.toString(); return (_jsx("div", { style: { height: containerHeightWithXaxisLabels, width: width }, children: _jsxs("svg", { fill: 'none', height: containerHeightWithXaxisLabels, children: [_jsx("line", __assign({}, yAxisLineProps, { stroke: yAxisStroke, strokeDasharray: yAxisStrokeDashArray })), Array.from(Array(noOfSections)).map(function (item, index) { var _a, _b; var isLast = index === noOfSections - 1; var y = stepHeight * (index + 1); var rulesProps = { x1: yAxisLabelWidth, y1: y, x2: width, y2: y, stroke: (isLast ? xAxisColor : rulesColor).toString(), strokeWidth: isLast ? xAxisThickness : rulesThickness }; if ((isLast && xAxisType !== ruleTypes.SOLID) || (!isLast && rulesType !== ruleTypes.SOLID)) { rulesProps.strokeDasharray = [dashWidth, dashGap].toString(); } else { delete rulesProps.strokeDasharray; } return (_jsxs(Fragment, { children: [!hideRules || isLast ? (_jsx("line", __assign({}, rulesProps, { strokeDasharray: (_a = rulesProps.strokeDasharray) === null || _a === void 0 ? void 0 : _a.toString() }))) : null, showYAxisIndices ? (_jsx("line", { x1: yAxisLabelWidth - yAxisIndicesWidth / 2, y1: y, x2: yAxisLabelWidth + yAxisIndicesWidth / 2, y2: y, stroke: yAxisIndicesColor.toString(), strokeWidth: yAxisIndicesHeight })) : null, !barsMapToYAxisSections ? (_jsx("text", { x: yAxisLabelWidth - yAxisLabelTextMarginRight, y: stepHeight * (index + 0.5) + yAxisLabelFontSize / 2 - 2, stroke: yAxisLabelColor.toString(), fontSize: yAxisLabelFontSize, fontStyle: yAxisLabelFontStyle, fontWeight: yAxisLabelFontWeight, fontFamily: yAxisLabelFontFamily, textAnchor: 'end', children: (_b = yAxisLabelTexts[index]) !== null && _b !== void 0 ? _b : '' })) : null] }, 'rule' + index)); }), Array.from(Array(xAxisNoOfSections)).map(function (item, index) { var x = leftXAfterMid - (leftXAfterMid * index) / xAxisNoOfSections; var unformattedXLabel = getXLabel(index); var xLabel = formatXAxisLabels ? formatXAxisLabels(unformattedXLabel) : unformattedXLabel; return (_jsxs(Fragment, { children: [showVerticalLines ? (_jsx("line", __assign({}, verticalLinesCommonProps, { x1: x, x2: x, stroke: verticalLinesStroke, strokeDasharray: verticalLinesStrokeDashArray }))) : null, showXAxisIndices ? (_jsx("line", __assign({}, xAxisIndicesCommonProps, { x1: x, x2: x, stroke: xAxisIndicesStroke }))) : null, showXAxisLabelTexts ? (_jsx("text", __assign({}, xAxisLabelsCommonProps, { x: x + xAxisLabelShiftX, stroke: xAxisLabelStroke, textAnchor: 'middle', children: xAxisLabelPrefix + xLabel + xAxisLabelSuffix }))) : null] }, 'x-axis' + index)); }), Array.from(Array(xAxisNoOfSections)).map(function (item, index) { if (!index && !showMidAxis) return null; var x = midAxisLabelWidth + leftXAfterMid + (leftXAfterMid * index) / xAxisNoOfSections; var unformattedXLabel = getXLabel(index); var xLabel = formatXAxisLabels ? formatXAxisLabels(unformattedXLabel) : unformattedXLabel; return (_jsxs(Fragment, { children: [showVerticalLines ? (_jsx("line", __assign({}, verticalLinesCommonProps, { x1: x, x2: x, stroke: verticalLinesStroke, strokeDasharray: verticalLinesStrokeDashArray }))) : null, showXAxisIndices ? (_jsx("line", __assign({}, xAxisIndicesCommonProps, { x1: x, x2: x, stroke: xAxisIndicesStroke }))) : null, showXAxisLabelTexts ? (_jsx("text", __assign({}, xAxisLabelsCommonProps, { x: x + xAxisLabelShiftX, stroke: xAxisLabelStroke, textAnchor: 'middle', children: xAxisLabelPrefix + xLabel + xAxisLabelSuffix }))) : null] }, 'x-axis' + index)); }), data.map(function (item, index) { var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19; var leftWidth = item.left * barWidthFactor; var rightWidth = item.right * barWidthFactor; var y = stepHeight * index + verticalMarginBetweenBars; var leftSurplusWidth = leftWidth - rightWidth; var rightSurplusWidth = rightWidth - leftWidth; var leftRadius = (_b = (_a = item.leftBarBorderRadius) !== null && _a !== void 0 ? _a : item.barBorderRadius) !== null && _b !== void 0 ? _b : leftBarBorderRadius; var rightRadius = (_d = (_c = item.rightBarBorderRadius) !== null && _c !== void 0 ? _c : item.barBorderRadius) !== null && _d !== void 0 ? _d : rightBarBorderRadius; var leftBorderWidth = (_f = (_e = item.leftBarBorderWidth) !== null && _e !== void 0 ? _e : item.barBorderWidth) !== null && _f !== void 0 ? _f : leftBarBorderWidth; var rightBorderWidth = (_h = (_g = item.rightBarBorderWidth) !== null && _g !== void 0 ? _g : item.barBorderWidth) !== null && _h !== void 0 ? _h : rightBarBorderWidth; var unFormattedLeftBarLabel = (_j = item.leftBarLabel) !== null && _j !== void 0 ? _j : (showValuesAsBarLabels ? item.left.toString() : ''); var leftBarLabel = formatBarLabels ? formatBarLabels(unFormattedLeftBarLabel) : unFormattedLeftBarLabel; var unFormattedRightBarLabel = (_k = item.rightBarLabel) !== null && _k !== void 0 ? _k : (showValuesAsBarLabels ? item.right.toString() : ''); var rightBarLabel = formatBarLabels ? formatBarLabels(unFormattedRightBarLabel) : unFormattedRightBarLabel; var leftLabelFontSize = (_l = item.leftBarLabelFontSize) !== null && _l !== void 0 ? _l : leftBarLabelFontSize; var leftLabelX = leftXAfterMid - leftWidth - leftBarBorderWidth / 2 - yAxisLabelWidth / 2 - leftBarLabelWidth / 2 + 28 - (leftBarLabel.length * leftLabelFontSize) / 2 + ((_o = (_m = item.leftBarLabelShift) !== null && _m !== void 0 ? _m : props.leftBarLabelShift) !== null && _o !== void 0 ? _o : 0); var rightLabelX = rightXAfterMid + rightBarBorderWidth / 2 + rightWidth + 3 + ((_q = (_p = item.rightBarLabelShift) !== null && _p !== void 0 ? _p : props.rightBarLabelShift) !== null && _q !== void 0 ? _q : 0); var leftBarCommonProps = { x: leftXAfterMid - leftWidth - leftBarBorderWidth / 2, y: y, width: leftWidth, height: stepHeight - verticalMarginBetweenBars * 2, rx: leftRadius, ry: leftRadius }; var rightBarCommonProps = { x: rightXAfterMid + rightBarBorderWidth / 2, y: y, width: rightWidth, height: stepHeight - verticalMarginBetweenBars * 2, rx: rightRadius, ry: rightRadius }; return (_jsxs(Fragment, { children: [barsMapToYAxisSections ? (_jsx("text", { x: yAxisLabelWidth - yAxisLabelTextMarginRight, y: stepHeight * (index + 0.5) + yAxisLabelFontSize / 2 - 2, stroke: yAxisLabelColor.toString(), fontSize: yAxisLabelFontSize, fontStyle: yAxisLabelFontStyle, fontWeight: yAxisLabelFontWeight, fontFamily: yAxisLabelFontFamily, textAnchor: 'end', children: (_s = (_r = item.yAxisLabel) !== null && _r !== void 0 ? _r : yAxisLabelTexts[index]) !== null && _s !== void 0 ? _s : '' })) : null, _jsx("rect", __assign({}, leftBarCommonProps, { fill: ((_t = item.leftBarColor) !== null && _t !== void 0 ? _t : leftBarColor).toString(), stroke: ((_u = item.leftBarBorderColor) !== null && _u !== void 0 ? _u : leftBarBorderColor).toString(), strokeWidth: leftBorderWidth, onClick: function () { var _a; return (_a = props.onLeftPress) === null || _a === void 0 ? void 0 : _a.call(props, item, index); } })), _jsx("clipPath", { id: 'cp-left' + index, children: _jsx("rect", __assign({}, leftBarCommonProps)) }), !allCornersRounded && leftWidth >= leftRadius ? (_jsxs(_Fragment, { children: [_jsx("rect", { x: leftXAfterMid - leftRadius, y: y, width: leftRadius, height: stepHeight - verticalMarginBetweenBars * 2, fill: ((_v = item.leftBarColor) !== null && _v !== void 0 ? _v : leftBarColor).toString() }), leftBorderWidth ? (_jsxs(_Fragment, { children: [_jsx("line", { x1: leftXAfterMid - leftRadius, y1: y, x2: leftXAfterMid, y2: y, stroke: ((_w = item.leftBarBorderColor) !== null && _w !== void 0 ? _w : leftBarBorderColor).toString(), strokeWidth: leftBorderWidth }), _jsx("line", { x1: leftXAfterMid - leftRadius, y1: y + stepHeight - verticalMarginBetweenBars * 2, x2: leftXAfterMid, y2: y + stepHeight - verticalMarginBetweenBars * 2, stroke: ((_x = item.leftBarBorderColor) !== null && _x !== void 0 ? _x : leftBarBorderColor).toString(), strokeWidth: leftBorderWidth })] })) : null] })) : null, leftBarLabel !== '' ? (_jsx("text", { x: leftLabelX, y: stepHeight * (index + 0.5) + yAxisLabelFontSize / 2 - 2, stroke: ((_y = item.leftBarLabelColor) !== null && _y !== void 0 ? _y : leftBarLabelColor).toString(), fontSize: leftLabelFontSize, fontStyle: (_z = item.leftBarLabelFontStyle) !== null && _z !== void 0 ? _z : leftBarLabelFontStyle, fontWeight: (_0 = item.leftBarLabelFontWeight) !== null && _0 !== void 0 ? _0 : leftBarLabelFontWeight, fontFamily: (_1 = item.leftBarLabelFontFamily) !== null && _1 !== void 0 ? _1 : leftBarLabelFontFamily, textAnchor: 'start', children: leftBarLabelPrefix + leftBarLabel + leftBarLabelSuffix })) : null, _jsx("rect", __assign({}, rightBarCommonProps, { fill: ((_2 = item.rightBarColor) !== null && _2 !== void 0 ? _2 : rightBarColor).toString(), stroke: ((_3 = item.rightBarBorderColor) !== null && _3 !== void 0 ? _3 : rightBarBorderColor).toString(), strokeWidth: rightBorderWidth, onCanPlay: function () { var _a; return (_a = props.onRightPress) === null || _a === void 0 ? void 0 : _a.call(props, item, index); } })), _jsx("clipPath", { id: 'cp-right' + index, children: _jsx("rect", __assign({}, rightBarCommonProps)) }), !allCornersRounded && rightWidth >= rightRadius ? (_jsxs(_Fragment, { children: [_jsx("rect", { x: rightXAfterMid, y: y, width: rightRadius, height: stepHeight - verticalMarginBetweenBars * 2, fill: ((_4 = item.rightBarColor) !== null && _4 !== void 0 ? _4 : rightBarColor).toString() }), rightBorderWidth ? (_jsxs(_Fragment, { children: [_jsx("line", { x1: rightXAfterMid, y1: y, x2: rightXAfterMid + rightRadius, y2: y, stroke: ((_5 = item.rightBarBorderColor) !== null && _5 !== void 0 ? _5 : rightBarBorderColor).toString(), strokeWidth: rightBorderWidth }), _jsx("line", { x1: rightXAfterMid, y1: y + stepHeight - verticalMarginBetweenBars * 2, x2: rightXAfterMid + rightRadius, y2: y + stepHeight - verticalMarginBetweenBars * 2, stroke: ((_6 = item.rightBarBorderColor) !== null && _6 !== void 0 ? _6 : rightBarBorderColor).toString(), strokeWidth: rightBorderWidth })] })) : null] })) : null, rightBarLabel !== '' ? (_jsx("text", { x: rightLabelX, y: stepHeight * (index + 0.5) + yAxisLabelFontSize / 2 - 2, stroke: ((_7 = item.rightBarLabelColor) !== null && _7 !== void 0 ? _7 : rightBarLabelColor).toString(), fontSize: (_8 = item.rightBarLabelFontSize) !== null && _8 !== void 0 ? _8 : rightBarLabelFontSize, fontStyle: (_9 = item.rightBarLabelFontStyle) !== null && _9 !== void 0 ? _9 : rightBarLabelFontStyle, fontWeight: (_10 = item.rightBarLabelFontWeight) !== null && _10 !== void 0 ? _10 : rightBarLabelFontWeight, fontFamily: (_11 = item.rightBarLabelFontFamily) !== null && _11 !== void 0 ? _11 : rightBarLabelFontFamily, textAnchor: 'start', children: rightBarLabelPrefix + rightBarLabel + rightBarLabelSuffix })) : null, (showSurplus || showSurplusLeft || item.showSurplus || item.showSurplusLeft) && leftSurplusWidth > 0 ? (_jsxs(_Fragment, { children: [_jsx("rect", { id: 'l-spls' + index, x: leftXAfterMid - leftWidth - leftBarBorderWidth / 2, y: y, width: leftSurplusWidth, height: stepHeight - verticalMarginBetweenBars * 2, stroke: ((_12 = item.leftSurplusBorderColor) !== null && _12 !== void 0 ? _12 : leftSurplusBorderColor).toString(), strokeWidth: (_13 = item.leftSurplusBorderWidth) !== null && _13 !== void 0 ? _13 : leftSurplusBorderWidth }), _jsx("use", { fill: ((_14 = item.leftSurplusColor) !== null && _14 !== void 0 ? _14 : leftSurplusColor).toString(), clipPath: '#cp-left' + index, href: '#l-spls' + index }), leftSurplusWidth >= leftRadius ? (_jsxs(_Fragment, { children: [_jsx("rect", { id: 'hide-in-left' + index, x: leftXAfterMid - leftWidth - leftBarBorderWidth + leftSurplusWidth - leftRadius, y: y, width: leftRadius, height: stepHeight - verticalMarginBetweenBars * 2 }), _jsx("use", { fill: ((_15 = item.leftSurplusColor) !== null && _15 !== void 0 ? _15 : leftSurplusColor).toString(), clipPath: "url(#cp-left".concat(index, ")"), href: '#hide-in-left' + index })] })) : null] })) : null, (showSurplus || showSurplusRight || item.showSurplus || item.showSurplusRight) && rightSurplusWidth > 0 ? (_jsxs(_Fragment, { children: [_jsx("rect", { id: 'r-spls' + index, x: rightXAfterMid + rightBarBorderWidth / 2 + rightWidth - rightSurplusWidth, y: y, width: rightSurplusWidth, height: stepHeight - verticalMarginBetweenBars * 2, stroke: ((_16 = item.rightSurplusBorderColor) !== null && _16 !== void 0 ? _16 : rightSurplusBorderColor).toString(), strokeWidth: (_17 = item.rightSurplusBorderWidth) !== null && _17 !== void 0 ? _17 : rightSurplusBorderWidth }), _jsx("use", { fill: ((_18 = item.rightSurplusColor) !== null && _18 !== void 0 ? _18 : rightSurplusColor).toString(), clipPath: '#cp-right' + index, href: '#r-spls' + index }), rightSurplusWidth >= rightRadius ? (_jsxs(_Fragment, { children: [_jsx("rect", { id: 'hide-in-right' + index, x: rightXAfterMid + rightBarBorderWidth / 2 + rightWidth - rightSurplusWidth, y: y, width: rightRadius, height: stepHeight - verticalMarginBetweenBars * 2 }), _jsx("use", { fill: ((_19 = item.rightSurplusColor) !== null && _19 !== void 0 ? _19 : rightSurplusColor).toString(), clipPath: "url(#cp-right".concat(index, ")"), href: '#hide-in-right' + index })] })) : null] })) : null] }, 'bars' + index)); }), showMidAxis ? (_jsxs(_Fragment, { children: [_jsx("line", __assign({}, midAxisLineCommonProps, { stroke: ((_g = (_f = props.midAxisLeftColor) !== null && _f !== void 0 ? _f : props.midAxisColor) !== null && _g !== void 0 ? _g : yAxisColor).toString(), x1: leftXAfterMid, x2: leftXAfterMid, strokeDasharray: midAxisStrokeDashArray })), _jsx("line", __assign({}, midAxisLineCommonProps, { stroke: ((_j = (_h = props.midAxisRightColor) !== null && _h !== void 0 ? _h : props.midAxisColor) !== null && _j !== void 0 ? _j : yAxisColor).toString(), x1: rightXAfterMid, x2: rightXAfterMid, strokeDasharray: midAxisStrokeDashArray })), data.map(function (item, index) { var _a, _b, _c, _d, _e, _f; var y = stepHeight * (index + 0.5); return (_jsx("text", { x: mid, y: y + midAxisLabelFontSize / 2, stroke: ((_a = item.midAxisLabelColor) !== null && _a !== void 0 ? _a : midAxisLabelColor).toString(), fontSize: (_b = item.midAxisLabelFontSize) !== null && _b !== void 0 ? _b : midAxisLabelFontSize, fontStyle: (_c = item.midAxisLabelFontStyle) !== null && _c !== void 0 ? _c : midAxisLabelFontStyle, fontWeight: (_d = item.midAxisLabelFontWeight) !== null && _d !== void 0 ? _d : midAxisLabelFontWeight, fontFamily: (_e = item.midAxisLabelFontFamily) !== null && _e !== void 0 ? _e : midAxisLabelFontFamily, textAnchor: 'middle', children: (_f = item.midAxisLabel) !== null && _f !== void 0 ? _f : '' }, 'ml' + index)); })] })) : null] }) })); }; //# sourceMappingURL=index.js.map