@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
JavaScript
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 { ChartContainer } from '../ChartContainer/ChartContainer';
import { getBulletComparativeErrorMeasureTheme } from '../ChartUtils/chart-theme-types';
import { ChartBulletComparativeMeasure } from './ChartBulletComparativeMeasure';
export const ChartBulletComparativeErrorMeasure = ({ allowTooltip = true, ariaDesc, ariaTitle, barWidth, constrainToVisibleArea = false, data, domain, horizontal = true, labelComponent, labels, measureComponent = _jsx(ChartBulletComparativeMeasure, {}), padding, standalone = true, themeColor, y,
// destructure last
theme = getBulletComparativeErrorMeasureTheme(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 }));
};
ChartBulletComparativeErrorMeasure.displayName = 'ChartBulletComparativeErrorMeasure';
// Note: VictoryBar.role must be hoisted
hoistNonReactStatics(ChartBulletComparativeErrorMeasure, VictoryBar);
//# sourceMappingURL=ChartBulletComparativeErrorMeasure.js.map