UNPKG

@patternfly/react-charts

Version:

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

20 lines 1.11 kB
import { __rest } from "tslib"; import { jsx as _jsx } from "react/jsx-runtime"; import { cloneElement } from 'react'; import hoistNonReactStatics from 'hoist-non-react-statics'; import { VictoryBoxPlot } from 'victory-box-plot'; import { ChartContainer } from '../ChartContainer/ChartContainer'; import { getTheme } from '../ChartUtils/chart-theme'; export const ChartBoxPlot = (_a) => { var { containerComponent = _jsx(ChartContainer, {}), themeColor, // destructure last theme = getTheme(themeColor) } = _a, rest = __rest(_a, ["containerComponent", "themeColor", "theme"]); // Clone so users can override container props const container = cloneElement(containerComponent, Object.assign({ theme }, containerComponent.props)); // Note: containerComponent is required for theme return _jsx(VictoryBoxPlot, Object.assign({ containerComponent: container, theme: theme }, rest)); }; ChartBoxPlot.displayName = 'ChartBoxPlot'; // Note: VictoryBar.getDomain & VictoryBar.role must be hoisted hoistNonReactStatics(ChartBoxPlot, VictoryBoxPlot); //# sourceMappingURL=ChartBoxPlot.js.map