UNPKG

@patternfly/react-charts

Version:

This library provides a set of React chart components for use with the PatternFly reference implementation.

37 lines 2.19 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ChartBulletComparativeErrorMeasure = void 0; const tslib_1 = require("tslib"); const jsx_runtime_1 = require("react/jsx-runtime"); const react_1 = require("react"); const hoist_non_react_statics_1 = tslib_1.__importDefault(require("hoist-non-react-statics")); const victory_bar_1 = require("victory-bar"); const ChartContainer_1 = require("../ChartContainer/ChartContainer"); const chart_theme_types_1 = require("../ChartUtils/chart-theme-types"); const ChartBulletComparativeMeasure_1 = require("./ChartBulletComparativeMeasure"); const ChartBulletComparativeErrorMeasure = ({ allowTooltip = true, ariaDesc, ariaTitle, barWidth, constrainToVisibleArea = false, data, domain, horizontal = true, labelComponent, labels, measureComponent = (0, jsx_runtime_1.jsx)(ChartBulletComparativeMeasure_1.ChartBulletComparativeMeasure, {}), padding, standalone = true, themeColor, y, // destructure last theme = (0, chart_theme_types_1.getBulletComparativeErrorMeasureTheme)(themeColor), height = theme.bar.height, width = theme.bar.width }) => { // Comparative measure component const measure = (0, react_1.cloneElement)(measureComponent, Object.assign({ allowTooltip, ariaDesc, ariaTitle, barWidth, constrainToVisibleArea, data, domain, height, horizontal, labelComponent, labels, padding, standalone: false, theme, themeColor, width, y }, measureComponent.props)); return standalone ? ((0, jsx_runtime_1.jsx)(ChartContainer_1.ChartContainer, { desc: ariaDesc, height: height, title: ariaTitle, width: width, children: measure })) : ((0, jsx_runtime_1.jsx)(react_1.Fragment, { children: measure })); }; exports.ChartBulletComparativeErrorMeasure = ChartBulletComparativeErrorMeasure; exports.ChartBulletComparativeErrorMeasure.displayName = 'ChartBulletComparativeErrorMeasure'; // Note: VictoryBar.role must be hoisted (0, hoist_non_react_statics_1.default)(exports.ChartBulletComparativeErrorMeasure, victory_bar_1.VictoryBar); //# sourceMappingURL=ChartBulletComparativeErrorMeasure.js.map