UNPKG

@patternfly/react-charts

Version:

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

32 lines 1.75 kB
import { jsx as _jsx } from "react/jsx-runtime"; import { cloneElement, Fragment } from 'react'; import hoistNonReactStatics from 'hoist-non-react-statics'; import { VictoryBar } from 'victory-bar'; import { ChartBulletComparativeMeasure } from './ChartBulletComparativeMeasure'; import { ChartContainer } from '../ChartContainer/ChartContainer'; import { getBulletComparativeWarningMeasureTheme } from '../ChartUtils/chart-theme-types'; export const ChartBulletComparativeWarningMeasure = ({ allowTooltip = true, ariaDesc, ariaTitle, barWidth, constrainToVisibleArea = false, data, domain, horizontal = true, labelComponent, labels, measureComponent = _jsx(ChartBulletComparativeMeasure, {}), padding, standalone = true, themeColor, y, // destructure last theme = getBulletComparativeWarningMeasureTheme(themeColor), height = theme.bar.height, width = theme.bar.width }) => { // Comparative measure component const measure = 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 ? (_jsx(ChartContainer, { desc: ariaDesc, height: height, title: ariaTitle, width: width, children: measure })) : (_jsx(Fragment, { children: measure })); }; ChartBulletComparativeWarningMeasure.displayName = 'ChartBulletComparativeWarningMeasure'; // Note: VictoryBar.role must be hoisted hoistNonReactStatics(ChartBulletComparativeWarningMeasure, VictoryBar); //# sourceMappingURL=ChartBulletComparativeWarningMeasure.js.map