UNPKG

@patternfly/react-charts

Version:

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

27 lines 1.54 kB
import { __rest } from "tslib"; import * as React from 'react'; import hoistNonReactStatics from 'hoist-non-react-statics'; import { VictoryScatter } from 'victory-scatter'; import { ChartContainer } from '../ChartContainer'; import { ChartScatterStyles } from '../ChartTheme'; import { getTheme } from '../ChartUtils'; export var ChartScatterSortOrder; (function (ChartScatterSortOrder) { ChartScatterSortOrder["ascending"] = "ascending"; ChartScatterSortOrder["descending"] = "descending"; })(ChartScatterSortOrder || (ChartScatterSortOrder = {})); export const ChartScatter = (_a) => { var { containerComponent = React.createElement(ChartContainer, null), themeColor, // eslint-disable-next-line @typescript-eslint/no-unused-vars themeVariant, // destructure last theme = getTheme(themeColor), size = ({ active }) => (active ? ChartScatterStyles.activeSize : ChartScatterStyles.size) } = _a, rest = __rest(_a, ["containerComponent", "themeColor", "themeVariant", "theme", "size"]); // Clone so users can override container props const container = React.cloneElement(containerComponent, Object.assign({ theme }, containerComponent.props)); // Note: containerComponent is required for theme return React.createElement(VictoryScatter, Object.assign({ containerComponent: container, size: size, theme: theme }, rest)); }; ChartScatter.displayName = 'ChartScatter'; // Note: VictoryLine.role must be hoisted hoistNonReactStatics(ChartScatter, VictoryScatter); //# sourceMappingURL=ChartScatter.js.map