@patternfly/react-charts
Version:
This library provides a set of React chart components for use with the PatternFly reference implementation.
20 lines • 1.06 kB
JavaScript
import { __rest } from "tslib";
import { jsx as _jsx } from "react/jsx-runtime";
import { cloneElement } from 'react';
import hoistNonReactStatics from 'hoist-non-react-statics';
import { VictoryArea } from 'victory-area';
import { ChartContainer } from '../ChartContainer/ChartContainer';
import { getTheme } from '../ChartUtils/chart-theme';
export const ChartArea = (_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(VictoryArea, Object.assign({ containerComponent: container, theme: theme }, rest));
};
ChartArea.displayName = 'ChartArea';
// Note: VictoryArea.role must be hoisted
hoistNonReactStatics(ChartArea, VictoryArea);
//# sourceMappingURL=ChartArea.js.map