UNPKG

@patternfly/react-charts

Version:

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

19 lines 1.21 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 { VictoryTooltip } from 'victory-tooltip'; import { ChartLabel } from '../ChartLabel/ChartLabel'; import { getTheme } from '../ChartUtils/chart-theme'; export const ChartTooltip = (_a) => { var { constrainToVisibleArea = false, labelComponent = _jsx(ChartLabel, {}), // Note that Victory provides its own label component here labelTextAnchor, themeColor, // destructure last theme = getTheme(themeColor) } = _a, rest = __rest(_a, ["constrainToVisibleArea", "labelComponent", "labelTextAnchor", "themeColor", "theme"]); const chartLabelComponent = cloneElement(labelComponent, Object.assign({ textAnchor: labelTextAnchor, theme }, labelComponent.props)); return (_jsx(VictoryTooltip, Object.assign({ constrainToVisibleArea: constrainToVisibleArea, labelComponent: chartLabelComponent, theme: theme }, rest))); }; ChartTooltip.displayName = 'ChartTooltip'; // Note: VictoryTooltip.defaultEvents must be hoisted hoistNonReactStatics(ChartTooltip, VictoryTooltip); //# sourceMappingURL=ChartTooltip.js.map