UNPKG

@patternfly/react-charts

Version:

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

32 lines 1.74 kB
import * as React from 'react'; import hoistNonReactStatics from 'hoist-non-react-statics'; import { VictoryBar } from 'victory-bar'; import { ChartContainer } from '../ChartContainer'; import { getBulletComparativeErrorMeasureTheme } from '../ChartUtils'; import { ChartBulletComparativeMeasure } from './ChartBulletComparativeMeasure'; export const ChartBulletComparativeErrorMeasure = ({ allowTooltip = true, ariaDesc, ariaTitle, barWidth, constrainToVisibleArea = false, data, domain, horizontal = true, labelComponent, labels, measureComponent = React.createElement(ChartBulletComparativeMeasure, null), padding, standalone = true, themeColor, // eslint-disable-next-line @typescript-eslint/no-unused-vars themeVariant, y, // destructure last theme = getBulletComparativeErrorMeasureTheme(themeColor), height = theme.bar.height, width = theme.bar.width }) => { // Comparative measure component const measure = React.cloneElement(measureComponent, Object.assign({ allowTooltip, ariaDesc, ariaTitle, barWidth, constrainToVisibleArea, data, domain, height, horizontal, labelComponent, labels, padding, standalone: false, theme, width, y }, measureComponent.props)); return standalone ? (React.createElement(ChartContainer, { desc: ariaDesc, height: height, title: ariaTitle, width: width }, measure)) : (React.createElement(React.Fragment, null, measure)); }; ChartBulletComparativeErrorMeasure.displayName = 'ChartBulletComparativeErrorMeasure'; // Note: VictoryBar.role must be hoisted hoistNonReactStatics(ChartBulletComparativeErrorMeasure, VictoryBar); //# sourceMappingURL=ChartBulletComparativeErrorMeasure.js.map