@fluentui/react-charts 9.0.2 → 9.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +64 -7
- package/dist/index.d.ts +829 -94
- package/lib/AreaChart.js +1 -0
- package/lib/AreaChart.js.map +1 -0
- package/lib/HeatMapChart.js +1 -0
- package/lib/HeatMapChart.js.map +1 -0
- package/lib/HorizontalBarChartWithAxis.js +1 -0
- package/lib/HorizontalBarChartWithAxis.js.map +1 -0
- package/lib/SankeyChart.js +1 -0
- package/lib/SankeyChart.js.map +1 -0
- package/lib/VerticalStackedBarChart.js +1 -0
- package/lib/VerticalStackedBarChart.js.map +1 -0
- package/lib/components/AreaChart/AreaChart.js +775 -0
- package/lib/components/AreaChart/AreaChart.js.map +1 -0
- package/lib/components/AreaChart/AreaChart.types.js +4 -0
- package/lib/components/AreaChart/AreaChart.types.js.map +1 -0
- package/lib/components/AreaChart/index.js +3 -0
- package/lib/components/AreaChart/index.js.map +1 -0
- package/lib/components/AreaChart/useAreaChartStyles.styles.js +55 -0
- package/lib/components/AreaChart/useAreaChartStyles.styles.js.map +1 -0
- package/lib/components/CommonComponents/CartesianChart.js +30 -14
- package/lib/components/CommonComponents/CartesianChart.js.map +1 -1
- package/lib/components/CommonComponents/CartesianChart.types.js.map +1 -1
- package/lib/components/CommonComponents/ChartPopover.js +2 -2
- package/lib/components/CommonComponents/ChartPopover.js.map +1 -1
- package/lib/components/CommonComponents/useCartesianChartStyles.styles.js +7 -123
- package/lib/components/CommonComponents/useCartesianChartStyles.styles.js.map +1 -1
- package/lib/components/CommonComponents/useChartPopoverStyles.styles.js +11 -22
- package/lib/components/CommonComponents/useChartPopoverStyles.styles.js.map +1 -1
- package/lib/components/DeclarativeChart/DeclarativeChart.js +112 -65
- package/lib/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
- package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js +570 -159
- package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
- package/lib/components/DonutChart/Arc/Arc.js +1 -1
- package/lib/components/DonutChart/Arc/Arc.js.map +1 -1
- package/lib/components/DonutChart/DonutChart.js +1 -1
- package/lib/components/DonutChart/DonutChart.js.map +1 -1
- package/lib/components/DonutChart/Pie/usePieStyles.styles.js +2 -6
- package/lib/components/DonutChart/Pie/usePieStyles.styles.js.map +1 -1
- package/lib/components/GaugeChart/GaugeChart.js +4 -1
- package/lib/components/GaugeChart/GaugeChart.js.map +1 -1
- package/lib/components/GaugeChart/GaugeChart.types.js.map +1 -1
- package/lib/components/GaugeChart/useGaugeChartStyles.styles.js +13 -9
- package/lib/components/GaugeChart/useGaugeChartStyles.styles.js.map +1 -1
- package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js +9 -0
- package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js.map +1 -1
- package/lib/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.js +0 -9
- package/lib/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.js.map +1 -1
- package/lib/components/HeatMapChart/HeatMapChart.js +588 -0
- package/lib/components/HeatMapChart/HeatMapChart.js.map +1 -0
- package/lib/components/HeatMapChart/HeatMapChart.types.js +4 -0
- package/lib/components/HeatMapChart/HeatMapChart.types.js.map +1 -0
- package/lib/components/HeatMapChart/index.js +3 -0
- package/lib/components/HeatMapChart/index.js.map +1 -0
- package/lib/components/HeatMapChart/useHeatMapChartStyles.styles.js +37 -0
- package/lib/components/HeatMapChart/useHeatMapChartStyles.styles.js.map +1 -0
- package/lib/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.js +2 -9
- package/lib/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.js.map +1 -1
- package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js +571 -0
- package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js.map +1 -0
- package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.types.js +4 -0
- package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.types.js.map +1 -0
- package/lib/components/HorizontalBarChartWithAxis/index.js +3 -0
- package/lib/components/HorizontalBarChartWithAxis/index.js.map +1 -0
- package/lib/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.js +67 -0
- package/lib/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.js.map +1 -0
- package/lib/components/Legends/Legends.js +38 -37
- package/lib/components/Legends/Legends.js.map +1 -1
- package/lib/components/Legends/useLegendsStyles.styles.js +2 -3
- package/lib/components/Legends/useLegendsStyles.styles.js.map +1 -1
- package/lib/components/LineChart/LineChart.js +43 -35
- package/lib/components/LineChart/LineChart.js.map +1 -1
- package/lib/components/LineChart/useLineChartStyles.styles.js +1 -10
- package/lib/components/LineChart/useLineChartStyles.styles.js.map +1 -1
- package/lib/components/SankeyChart/SankeyChart.js +1023 -0
- package/lib/components/SankeyChart/SankeyChart.js.map +1 -0
- package/lib/components/SankeyChart/SankeyChart.types.js +3 -0
- package/lib/components/SankeyChart/SankeyChart.types.js.map +1 -0
- package/lib/components/SankeyChart/index.js +3 -0
- package/lib/components/SankeyChart/index.js.map +1 -0
- package/lib/components/SankeyChart/useSankeyChartStyles.styles.js +109 -0
- package/lib/components/SankeyChart/useSankeyChartStyles.styles.js.map +1 -0
- package/lib/components/ScatterChart/ScatterChart.js +46 -59
- package/lib/components/ScatterChart/ScatterChart.js.map +1 -1
- package/lib/components/ScatterChart/useScatterChartStyles.styles.js +1 -10
- package/lib/components/ScatterChart/useScatterChartStyles.styles.js.map +1 -1
- package/lib/components/VerticalBarChart/VerticalBarChart.js +165 -88
- package/lib/components/VerticalBarChart/VerticalBarChart.js.map +1 -1
- package/lib/components/VerticalBarChart/VerticalBarChart.types.js.map +1 -1
- package/lib/components/VerticalBarChart/useVerticalBarChartStyles.styles.js +3 -11
- package/lib/components/VerticalBarChart/useVerticalBarChartStyles.styles.js.map +1 -1
- package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.js +904 -0
- package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.js.map +1 -0
- package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.types.js +1 -0
- package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.types.js.map +1 -0
- package/lib/components/VerticalStackedBarChart/index.js +3 -0
- package/lib/components/VerticalStackedBarChart/index.js.map +1 -0
- package/lib/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.js +65 -0
- package/lib/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.js.map +1 -0
- package/lib/index.js +5 -0
- package/lib/index.js.map +1 -1
- package/lib/types/DataPoint.js +1 -3
- package/lib/types/DataPoint.js.map +1 -1
- package/lib/utilities/SVGTooltipText.js +49 -4
- package/lib/utilities/SVGTooltipText.js.map +1 -1
- package/lib/utilities/colors.js +20 -0
- package/lib/utilities/colors.js.map +1 -1
- package/lib/utilities/string.js +32 -0
- package/lib/utilities/string.js.map +1 -0
- package/lib/utilities/test-data.js +53 -0
- package/lib/utilities/test-data.js.map +1 -1
- package/lib/utilities/utilities.js +90 -18
- package/lib/utilities/utilities.js.map +1 -1
- package/lib-commonjs/AreaChart.js +6 -0
- package/lib-commonjs/AreaChart.js.map +1 -0
- package/lib-commonjs/HeatMapChart.js +6 -0
- package/lib-commonjs/HeatMapChart.js.map +1 -0
- package/lib-commonjs/HorizontalBarChartWithAxis.js +6 -0
- package/lib-commonjs/HorizontalBarChartWithAxis.js.map +1 -0
- package/lib-commonjs/SankeyChart.js +6 -0
- package/lib-commonjs/SankeyChart.js.map +1 -0
- package/lib-commonjs/VerticalStackedBarChart.js +6 -0
- package/lib-commonjs/VerticalStackedBarChart.js.map +1 -0
- package/lib-commonjs/components/AreaChart/AreaChart.js +781 -0
- package/lib-commonjs/components/AreaChart/AreaChart.js.map +1 -0
- package/lib-commonjs/components/AreaChart/AreaChart.types.js +7 -0
- package/lib-commonjs/components/AreaChart/AreaChart.types.js.map +1 -0
- package/lib-commonjs/components/AreaChart/index.js +8 -0
- package/lib-commonjs/components/AreaChart/index.js.map +1 -0
- package/lib-commonjs/components/AreaChart/useAreaChartStyles.styles.js +95 -0
- package/lib-commonjs/components/AreaChart/useAreaChartStyles.styles.js.map +1 -0
- package/lib-commonjs/components/CommonComponents/CartesianChart.js +29 -14
- package/lib-commonjs/components/CommonComponents/CartesianChart.js.map +1 -1
- package/lib-commonjs/components/CommonComponents/CartesianChart.types.js.map +1 -1
- package/lib-commonjs/components/CommonComponents/ChartPopover.js +2 -2
- package/lib-commonjs/components/CommonComponents/ChartPopover.js.map +1 -1
- package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.js +8 -198
- package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.js.map +1 -1
- package/lib-commonjs/components/CommonComponents/useChartPopoverStyles.styles.js +12 -37
- package/lib-commonjs/components/CommonComponents/useChartPopoverStyles.styles.js.map +1 -1
- package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js +120 -73
- package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
- package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js +592 -178
- package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
- package/lib-commonjs/components/DonutChart/Arc/Arc.js +1 -1
- package/lib-commonjs/components/DonutChart/Arc/Arc.js.map +1 -1
- package/lib-commonjs/components/DonutChart/DonutChart.js +1 -1
- package/lib-commonjs/components/DonutChart/DonutChart.js.map +1 -1
- package/lib-commonjs/components/DonutChart/Pie/usePieStyles.styles.js +3 -10
- package/lib-commonjs/components/DonutChart/Pie/usePieStyles.styles.js.map +1 -1
- package/lib-commonjs/components/GaugeChart/GaugeChart.js +4 -1
- package/lib-commonjs/components/GaugeChart/GaugeChart.js.map +1 -1
- package/lib-commonjs/components/GaugeChart/GaugeChart.types.js.map +1 -1
- package/lib-commonjs/components/GaugeChart/useGaugeChartStyles.styles.js +14 -8
- package/lib-commonjs/components/GaugeChart/useGaugeChartStyles.styles.js.map +1 -1
- package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js +9 -0
- package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js.map +1 -1
- package/lib-commonjs/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.js +0 -9
- package/lib-commonjs/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.js.map +1 -1
- package/lib-commonjs/components/HeatMapChart/HeatMapChart.js +599 -0
- package/lib-commonjs/components/HeatMapChart/HeatMapChart.js.map +1 -0
- package/lib-commonjs/components/HeatMapChart/HeatMapChart.types.js +7 -0
- package/lib-commonjs/components/HeatMapChart/HeatMapChart.types.js.map +1 -0
- package/lib-commonjs/components/HeatMapChart/index.js +8 -0
- package/lib-commonjs/components/HeatMapChart/index.js.map +1 -0
- package/lib-commonjs/components/HeatMapChart/useHeatMapChartStyles.styles.js +59 -0
- package/lib-commonjs/components/HeatMapChart/useHeatMapChartStyles.styles.js.map +1 -0
- package/lib-commonjs/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.js +2 -16
- package/lib-commonjs/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.js.map +1 -1
- package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js +580 -0
- package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js.map +1 -0
- package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.types.js +7 -0
- package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.types.js.map +1 -0
- package/lib-commonjs/components/HorizontalBarChartWithAxis/index.js +8 -0
- package/lib-commonjs/components/HorizontalBarChartWithAxis/index.js.map +1 -0
- package/lib-commonjs/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.js +107 -0
- package/lib-commonjs/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.js.map +1 -0
- package/lib-commonjs/components/Legends/Legends.js +37 -37
- package/lib-commonjs/components/Legends/Legends.js.map +1 -1
- package/lib-commonjs/components/Legends/useLegendsStyles.styles.js +2 -2
- package/lib-commonjs/components/Legends/useLegendsStyles.styles.js.map +1 -1
- package/lib-commonjs/components/LineChart/LineChart.js +41 -33
- package/lib-commonjs/components/LineChart/LineChart.js.map +1 -1
- package/lib-commonjs/components/LineChart/useLineChartStyles.styles.js +1 -10
- package/lib-commonjs/components/LineChart/useLineChartStyles.styles.js.map +1 -1
- package/lib-commonjs/components/SankeyChart/SankeyChart.js +1039 -0
- package/lib-commonjs/components/SankeyChart/SankeyChart.js.map +1 -0
- package/lib-commonjs/components/SankeyChart/SankeyChart.types.js +6 -0
- package/lib-commonjs/components/SankeyChart/SankeyChart.types.js.map +1 -0
- package/lib-commonjs/components/SankeyChart/index.js +8 -0
- package/lib-commonjs/components/SankeyChart/index.js.map +1 -0
- package/lib-commonjs/components/SankeyChart/useSankeyChartStyles.styles.js +179 -0
- package/lib-commonjs/components/SankeyChart/useSankeyChartStyles.styles.js.map +1 -0
- package/lib-commonjs/components/ScatterChart/ScatterChart.js +45 -58
- package/lib-commonjs/components/ScatterChart/ScatterChart.js.map +1 -1
- package/lib-commonjs/components/ScatterChart/useScatterChartStyles.styles.js +1 -10
- package/lib-commonjs/components/ScatterChart/useScatterChartStyles.styles.js.map +1 -1
- package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.js +164 -87
- package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.js.map +1 -1
- package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.types.js.map +1 -1
- package/lib-commonjs/components/VerticalBarChart/useVerticalBarChartStyles.styles.js +4 -11
- package/lib-commonjs/components/VerticalBarChart/useVerticalBarChartStyles.styles.js.map +1 -1
- package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.js +915 -0
- package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.js.map +1 -0
- package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.types.js +6 -0
- package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.types.js.map +1 -0
- package/lib-commonjs/components/VerticalStackedBarChart/index.js +8 -0
- package/lib-commonjs/components/VerticalStackedBarChart/index.js.map +1 -0
- package/lib-commonjs/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.js +113 -0
- package/lib-commonjs/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.js.map +1 -0
- package/lib-commonjs/index.js +5 -0
- package/lib-commonjs/index.js.map +1 -1
- package/lib-commonjs/types/DataPoint.js +1 -3
- package/lib-commonjs/types/DataPoint.js.map +1 -1
- package/lib-commonjs/utilities/SVGTooltipText.js +49 -4
- package/lib-commonjs/utilities/SVGTooltipText.js.map +1 -1
- package/lib-commonjs/utilities/colors.js +23 -0
- package/lib-commonjs/utilities/colors.js.map +1 -1
- package/lib-commonjs/utilities/string.js +29 -0
- package/lib-commonjs/utilities/string.js.map +1 -0
- package/lib-commonjs/utilities/test-data.js +59 -0
- package/lib-commonjs/utilities/test-data.js.map +1 -1
- package/lib-commonjs/utilities/utilities.js +94 -17
- package/lib-commonjs/utilities/utilities.js.map +1 -1
- package/package.json +11 -8
- package/lib/components/DeclarativeChart/PlotlySchema.js +0 -7
- package/lib/components/DeclarativeChart/PlotlySchema.js.map +0 -1
- package/lib-commonjs/components/DeclarativeChart/PlotlySchema.js +0 -10
- package/lib-commonjs/components/DeclarativeChart/PlotlySchema.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["HorizontalBarChartWithAxis.tsx"],"sourcesContent":["import * as React from 'react';\nimport { max as d3Max } from 'd3-array';\nimport { select as d3Select } from 'd3-selection';\nimport { scaleLinear as d3ScaleLinear, ScaleLinear as D3ScaleLinear, scaleBand as d3ScaleBand } from 'd3-scale';\nimport { Legend } from '../../components/Legends/Legends.types';\nimport { Legends } from '../../components/Legends/Legends';\nimport { useId } from '@fluentui/react-utilities';\nimport { useHorizontalBarChartWithAxisStyles } from './useHorizontalBarChartWithAxisStyles.styles';\nimport {\n AccessibilityProps,\n HorizontalBarChartWithAxisDataPoint,\n RefArrayData,\n Margins,\n ChartPopoverProps,\n Chart,\n} from '../../index';\nimport { ChildProps } from '../CommonComponents/CartesianChart.types';\nimport { CartesianChart } from '../CommonComponents/CartesianChart';\nimport { HorizontalBarChartWithAxisProps } from './HorizontalBarChartWithAxis.types';\nimport { ChartPopover } from '../CommonComponents/ChartPopover';\nimport {\n ChartTypes,\n IAxisData,\n getAccessibleDataObject,\n YAxisType,\n XAxisTypes,\n NumericAxis,\n StringAxis,\n getTypeOfAxis,\n getNextColor,\n areArraysEqual,\n useRtl,\n DataVizPalette,\n getColorFromToken,\n} from '../../utilities/index';\ntype ColorScale = (_p?: number) => string;\n\nexport const HorizontalBarChartWithAxis: React.FunctionComponent<HorizontalBarChartWithAxisProps> = React.forwardRef<\n HTMLDivElement,\n HorizontalBarChartWithAxisProps\n>((props, forwardedRef) => {\n const _refArray: RefArrayData[] = [];\n const _calloutId: string = useId('callout');\n const _isRtl: boolean = useRtl();\n const _tooltipId: string = useId('HBCWATooltipID_');\n const _xAxisType: XAxisTypes =\n props.data! && props.data!.length > 0\n ? (getTypeOfAxis(props.data![0].x, true) as XAxisTypes)\n : XAxisTypes.NumericAxis;\n const _yAxisType: YAxisType =\n props.data! && props.data!.length > 0\n ? (getTypeOfAxis(props.data![0].y, false) as YAxisType)\n : YAxisType.StringAxis;\n const _emptyChartId: string = useId('_HBCWithAxis_empty');\n let _points: HorizontalBarChartWithAxisDataPoint[] = [];\n let _barHeight: number = 0;\n let _colors: string[] = [];\n let _margins: Margins;\n let _bars: JSX.Element[];\n let _yAxisLabels: string[];\n let _xMax: number;\n let _calloutAnchorPoint: HorizontalBarChartWithAxisDataPoint | null;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n let tooltipElement: any;\n const cartesianChartRef = React.useRef<Chart>(null);\n\n const [color, setColor] = React.useState<string>('');\n const [dataForHoverCard, setDataForHoverCard] = React.useState<number>(0);\n const [isLegendSelected, setIsLegendSelected] = React.useState<boolean>(\n (props.legendProps?.selectedLegends && props.legendProps.selectedLegends.length > 0) ||\n props.legendProps?.selectedLegend !== undefined,\n );\n const [isLegendHovered, setIsLegendHovered] = React.useState<boolean>(false);\n const [selectedLegendTitle, setSelectedLegendTitle] = React.useState<string>(props.legendProps?.selectedLegend ?? '');\n const [xCalloutValue, setXCalloutValue] = React.useState<string>('');\n const [yCalloutValue, setYCalloutValue] = React.useState<string>('');\n const [selectedLegends, setSelectedLegends] = React.useState<string[]>(props.legendProps?.selectedLegends || []);\n const [dataPointCalloutProps, setDataPointCalloutProps] = React.useState<HorizontalBarChartWithAxisDataPoint>();\n const [callOutAccessibilityData, setCallOutAccessibilityData] = React.useState<AccessibilityProps>();\n const [isPopoverOpen, setPopoverOpen] = React.useState<boolean>(false);\n const [clickPosition, setClickPosition] = React.useState({ x: 0, y: 0 });\n const prevPropsRef = React.useRef<HorizontalBarChartWithAxisProps | null>(null);\n\n React.useEffect(() => {\n if (prevPropsRef.current) {\n const prevProps = prevPropsRef.current;\n if (!areArraysEqual(prevProps.legendProps?.selectedLegends, props.legendProps?.selectedLegends)) {\n setSelectedLegends(props.legendProps?.selectedLegends || []);\n }\n }\n prevPropsRef.current = props;\n }, [props]);\n\n React.useImperativeHandle(\n props.componentRef,\n () => ({\n chartContainer: cartesianChartRef.current?.chartContainer ?? null,\n }),\n [],\n );\n\n const classes = useHorizontalBarChartWithAxisStyles(props);\n function _adjustProps(): void {\n _points = props.data || [];\n _barHeight = props.barHeight || 32;\n const defaultPalette: string[] = [\n getColorFromToken(DataVizPalette.color6),\n getColorFromToken(DataVizPalette.color1),\n getColorFromToken(DataVizPalette.color5),\n getColorFromToken(DataVizPalette.color7),\n ];\n _colors = props.colors! || defaultPalette;\n }\n\n function _getMargins(margins: Margins) {\n _margins = margins;\n }\n\n function _renderContentForOnlyBars(point: HorizontalBarChartWithAxisDataPoint): JSX.Element {\n const { useSingleColor = false } = props;\n let selectedPointIndex = 0;\n props.data!.forEach((yDataPoint: HorizontalBarChartWithAxisDataPoint, index: number) => {\n if (yDataPoint.y === point.y) {\n selectedPointIndex = index;\n }\n });\n // eslint-disable-next-line @typescript-eslint/no-shadow\n let color: string;\n if (useSingleColor) {\n //if useSingle color , then check if user has given a palette or not\n // and pick the first color from that or else from our paltette.\n color = props.colors ? _createColors()(1) : getNextColor(1, 0);\n } else {\n color = point.color ? point.color : props.colors ? _createColors()(point.x) : getNextColor(selectedPointIndex, 0);\n }\n return (\n <>\n <ChartPopover\n XValue={point.xAxisCalloutData || point.x.toString()}\n legend={point.legend}\n YValue={point.yAxisCalloutData || point.y}\n color={color}\n culture={props.culture ?? 'en-us'}\n clickPosition={clickPosition}\n isPopoverOpen={isPopoverOpen}\n />\n </>\n );\n }\n\n // eslint-disable-next-line @typescript-eslint/no-shadow\n function _renderCallout(props?: HorizontalBarChartWithAxisDataPoint): JSX.Element | null {\n return props ? _renderContentForOnlyBars(props) : null;\n }\n\n function _getCustomizedCallout() {\n return props.onRenderCalloutPerDataPoint\n ? props.onRenderCalloutPerDataPoint(dataPointCalloutProps, _renderCallout)\n : null;\n }\n\n function _getGraphData(\n xScale: NumericAxis,\n yScale: NumericAxis | StringAxis,\n containerHeight: number,\n containerWidth: number,\n xElement?: SVGElement | null,\n yElement?: SVGElement | null,\n ) {\n return (_bars =\n _yAxisType === YAxisType.NumericAxis\n ? _createNumericBars(containerHeight, containerWidth, xElement!, yElement!)\n : _createStringBars(containerHeight, containerWidth, xElement!, yElement!));\n }\n\n function _createColors(): D3ScaleLinear<string, string> | ColorScale {\n const increment = _colors.length <= 1 ? 1 : 1 / (_colors.length - 1);\n const { useSingleColor = false } = props;\n if (useSingleColor) {\n return (_p?: number) => {\n const { colors } = props;\n return colors && colors.length > 0 ? colors[0] : getColorFromToken(DataVizPalette.color16);\n };\n }\n const domainValues = [];\n for (let i = 0; i < _colors.length; i++) {\n domainValues.push(increment * i * _xMax);\n }\n const colorScale = d3ScaleLinear<string>().domain(domainValues).range(_colors);\n return colorScale;\n }\n\n function _refCallback(element: SVGRectElement, legendTitle: string): void {\n _refArray.push({ index: legendTitle, refElement: element });\n }\n\n function _onBarHover(\n point: HorizontalBarChartWithAxisDataPoint,\n // eslint-disable-next-line @typescript-eslint/no-shadow\n color: string,\n mouseEvent: React.MouseEvent<SVGElement, MouseEvent>,\n ): void {\n mouseEvent.persist();\n // eslint-disable-next-line @typescript-eslint/no-shadow\n if ((isLegendSelected === false || _isLegendHighlighted(point.legend)) && _calloutAnchorPoint !== point) {\n _calloutAnchorPoint = point;\n setPopoverOpen(true);\n _updatePosition(mouseEvent.clientX, mouseEvent.clientY);\n setDataForHoverCard(point.x);\n setSelectedLegendTitle(point.legend!);\n setColor(props.useSingleColor || props.enableGradient ? color : point.color!);\n // To display callout value, if no callout value given, taking given point.x value as a string.\n setXCalloutValue(point.yAxisCalloutData! || point.y.toString());\n setYCalloutValue(point.xAxisCalloutData || point.x.toString());\n setDataPointCalloutProps(point);\n setCallOutAccessibilityData(point.callOutAccessibilityData);\n }\n }\n\n function _onBarLeave(): void {\n setPopoverOpen(false);\n }\n\n function _handleChartMouseLeave(): void {\n _calloutAnchorPoint = null;\n setPopoverOpen(false);\n }\n\n // eslint-disable-next-line @typescript-eslint/no-shadow\n function _onBarFocus(point: HorizontalBarChartWithAxisDataPoint, refArrayIndexNumber: number, color: string): void {\n if ((isLegendSelected === false || _isLegendHighlighted(point.legend)) && _calloutAnchorPoint !== point) {\n // eslint-disable-next-line @typescript-eslint/no-shadow\n _refArray.forEach((obj: RefArrayData, index: number) => {\n if (refArrayIndexNumber === index) {\n setPopoverOpen(true);\n setSelectedLegendTitle(point.legend!);\n setDataForHoverCard(point.x);\n setColor(props.useSingleColor ? color : point.color!);\n setXCalloutValue(point.yAxisCalloutData || point.y.toString());\n setYCalloutValue(point.xAxisCalloutData! || point.x.toString());\n setDataPointCalloutProps(point);\n setCallOutAccessibilityData(point.callOutAccessibilityData);\n }\n });\n }\n }\n\n function _getScales(\n containerHeight: number,\n containerWidth: number,\n isNumericScale: boolean,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ): { xBarScale: any; yBarScale: any } {\n if (isNumericScale) {\n const xMax = d3Max(_points, (point: HorizontalBarChartWithAxisDataPoint) => point.x as number)!;\n const yMax = d3Max(_points, (point: HorizontalBarChartWithAxisDataPoint) => point.y as number)!;\n const xBarScale = d3ScaleLinear()\n .domain(_isRtl ? [xMax, 0] : [0, xMax])\n .nice()\n .range([_margins.left!, containerWidth - _margins.right!]);\n const yBarScale = d3ScaleLinear()\n .domain([0, yMax])\n .range([containerHeight - _margins.bottom!, _margins.top!]);\n return { xBarScale, yBarScale };\n } else {\n const xMax = d3Max(_points, (point: HorizontalBarChartWithAxisDataPoint) => point.x as number)!;\n // please note these padding default values must be consistent in here\n // and CatrtesianChartBase w for more details refer example\n // http://using-d3js.com/04_07_ordinal_scales.html\n const yBarScale = d3ScaleBand()\n .domain(_yAxisLabels)\n .range([containerHeight - _margins.bottom! - _barHeight / 2, _margins.top! + _barHeight / 2])\n .padding(props.yAxisPadding || 0);\n\n const xBarScale = d3ScaleLinear()\n .domain(_isRtl ? [xMax, 0] : [0, xMax])\n .nice()\n .range([_margins.left!, containerWidth - _margins.right!]);\n return { xBarScale, yBarScale };\n }\n }\n\n function _createNumericBars(\n containerHeight: number,\n containerWidth: number,\n xElement: SVGElement,\n yElement: SVGElement,\n ): JSX.Element[] {\n const { useSingleColor = false } = props;\n const { xBarScale, yBarScale } = _getScales(containerHeight, containerWidth, true);\n const sortedBars: HorizontalBarChartWithAxisDataPoint[] = [..._points];\n sortedBars.sort((a, b) => {\n const aValue = typeof a.y === 'number' ? a.y : parseFloat(a.y);\n const bValue = typeof b.y === 'number' ? b.y : parseFloat(b.y);\n return bValue - aValue;\n });\n\n const bars = sortedBars.map((point: HorizontalBarChartWithAxisDataPoint, index: number) => {\n let shouldHighlight = true;\n if (isLegendHovered || isLegendSelected) {\n shouldHighlight = _isLegendHighlighted(point.legend);\n }\n const barHeight: number = Math.max(yBarScale(point.y), 0);\n if (barHeight < 1) {\n return <React.Fragment key={point.x}> </React.Fragment>;\n }\n let startColor: string;\n if (useSingleColor) {\n //if useSingle color , then check if user has given a palette or not\n // and pick the first color from that or else from our paltette.\n startColor = props.colors ? _createColors()(1) : getNextColor(1, 0);\n } else {\n startColor = props.colors ? _createColors()(point.x) : getNextColor(index, 0);\n }\n\n startColor = point.color && !useSingleColor ? point.color : startColor;\n\n return (\n <React.Fragment key={`${index}_${point.x}`}>\n <rect\n key={point.y}\n x={_isRtl ? xBarScale(point.x) : _margins.left!}\n y={yBarScale(point.y) - _barHeight / 2}\n data-is-focusable={shouldHighlight}\n width={\n _isRtl\n ? containerWidth - _margins.right! - Math.max(xBarScale(point.x), 0)\n : Math.max(xBarScale(point.x), 0) - _margins.left!\n }\n height={_barHeight}\n ref={(e: SVGRectElement) => {\n _refCallback(e, point.legend!);\n }}\n rx={props.roundCorners ? 3 : 0}\n onClick={point.onClick}\n onMouseOver={(event: React.MouseEvent<SVGElement, MouseEvent>) => _onBarHover(point, startColor, event)}\n aria-label={_getAriaLabel(point)}\n role=\"img\"\n aria-labelledby={`toolTip${_calloutId}`}\n onMouseLeave={_onBarLeave}\n onFocus={() => _onBarFocus(point, index, startColor)}\n onBlur={_onBarLeave}\n fill={startColor}\n opacity={shouldHighlight ? 1 : 0.1}\n tabIndex={point.legend !== '' ? 0 : undefined}\n />\n </React.Fragment>\n );\n });\n return bars;\n }\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n function _tooltipOfYAxislabels(ytooltipProps: any) {\n const { tooltipCls, yAxis, id } = ytooltipProps;\n if (yAxis === null) {\n return null;\n }\n const div = d3Select('body').append('div').attr('id', id).attr('class', tooltipCls).style('opacity', 0);\n const aa = yAxis!.selectAll('#BaseSpan')._groups[0];\n const baseSpanLength = aa && Object.keys(aa)!.length;\n const originalDataArray: string[] = [];\n for (let i = 0; i < baseSpanLength; i++) {\n const originalData = aa[i].dataset && (Object.values(aa[i].dataset)[0] as string);\n originalDataArray.push(originalData);\n }\n const tickObject = yAxis!.selectAll('.tick')._groups[0];\n const tickObjectLength = tickObject && Object.keys(tickObject)!.length;\n for (let i = 0; i < tickObjectLength; i++) {\n const d1 = tickObject[i];\n d3Select(d1)\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n .on('mouseover', (event: any, d) => {\n if (!tooltipElement) {\n div.style('opacity', 0.9);\n div\n .text(originalDataArray[i])\n .style('left', event.pageX + 'px')\n .style('top', event.pageY - 28 + 'px');\n }\n })\n .on('mouseout', d => {\n div.style('opacity', 0);\n });\n }\n }\n\n function _createStringBars(\n containerHeight: number,\n containerWidth: number,\n xElement: SVGElement,\n yElement: SVGElement,\n ): JSX.Element[] {\n const { xBarScale, yBarScale } = _getScales(containerHeight, containerWidth, false);\n const { useSingleColor = false } = props;\n const bars = _points.map((point: HorizontalBarChartWithAxisDataPoint, index: number) => {\n let shouldHighlight = true;\n if (isLegendHovered || isLegendSelected) {\n shouldHighlight = _isLegendHighlighted(point.legend);\n }\n const barHeight: number = Math.max(yBarScale(point.y), 0);\n if (barHeight < 1) {\n return <React.Fragment key={point.x}> </React.Fragment>;\n }\n let startColor: string;\n if (useSingleColor) {\n //if useSingle color , then check if user has given a palette or not\n // and pick the first color from that or else from our paltette.\n startColor = props.colors ? _createColors()(1) : getNextColor(1, 0);\n } else {\n startColor = props.colors ? _createColors()(point.x) : getNextColor(index, 0);\n }\n\n startColor = point.color && !useSingleColor ? point.color : startColor;\n\n return (\n <React.Fragment key={`${index}_${point.x}`}>\n <rect\n transform={`translate(0,${0.5 * (yBarScale.bandwidth() - _barHeight)})`}\n key={point.x}\n x={_isRtl ? xBarScale(point.x) : _margins.left!}\n y={yBarScale(point.y)}\n rx={props.roundCorners ? 3 : 0}\n width={\n _isRtl\n ? containerWidth - _margins.right! - Math.max(xBarScale(point.x), 0)\n : Math.max(xBarScale(point.x), 0) - _margins.left!\n }\n height={_barHeight}\n aria-labelledby={`toolTip${_calloutId}`}\n aria-label={_getAriaLabel(point)}\n role=\"img\"\n ref={(e: SVGRectElement) => {\n _refCallback(e, point.legend!);\n }}\n onClick={point.onClick}\n onMouseOver={(event: React.MouseEvent<SVGElement, MouseEvent>) => _onBarHover(point, startColor, event)}\n onMouseLeave={_onBarLeave}\n onBlur={_onBarLeave}\n data-is-focusable={shouldHighlight}\n opacity={shouldHighlight ? 1 : 0.1}\n onFocus={() => _onBarFocus(point, index, startColor)}\n fill={startColor}\n tabIndex={point.legend !== '' ? 0 : undefined}\n />\n </React.Fragment>\n );\n });\n\n // Removing un wanted tooltip div from DOM, when prop not provided, for proper cleanup\n // of unwanted DOM elements, to prevent flacky behaviour in tooltips , that might occur\n // in creating tooltips when tooltips are enabled( as we try to recreate a tspan with _tooltipId)\n if (!props.showYAxisLablesTooltip) {\n try {\n // eslint-disable-next-line @nx/workspace-no-restricted-globals\n document.getElementById(_tooltipId) && document.getElementById(_tooltipId)!.remove();\n //eslint-disable-next-line no-empty\n } catch (e) {}\n }\n // Used to display tooltip at y axis labels.\n if (props.showYAxisLablesTooltip) {\n const yAxisElement = d3Select(yElement).call(yBarScale);\n if (!tooltipElement) {\n try {\n // eslint-disable-next-line @nx/workspace-no-restricted-globals\n document.getElementById(_tooltipId) && document.getElementById(_tooltipId)!.remove();\n //eslint-disable-next-line no-empty\n } catch (e) {}\n }\n const ytooltipProps = {\n tooltipCls: classes.tooltip!,\n id: _tooltipId,\n yAxis: yAxisElement,\n };\n yAxisElement && _tooltipOfYAxislabels(ytooltipProps);\n }\n return bars;\n }\n\n function _onLegendHover(customMessage: string): void {\n if (!_isLegendSelected()) {\n setIsLegendHovered(true);\n setSelectedLegendTitle(customMessage);\n }\n }\n\n function _onLegendLeave(isLegendFocused?: boolean): void {\n if (!!isLegendFocused || !_isLegendSelected()) {\n setIsLegendHovered(false);\n setSelectedLegendTitle('');\n setIsLegendSelected(isLegendFocused ? false : _isLegendSelected());\n }\n }\n\n function _getLegendData(data: HorizontalBarChartWithAxisDataPoint[]): JSX.Element {\n const { useSingleColor } = props;\n const actions: Legend[] = [];\n\n data.forEach((point: HorizontalBarChartWithAxisDataPoint, _index: number) => {\n // eslint-disable-next-line @typescript-eslint/no-shadow\n const color: string = useSingleColor ? (props.colors ? _createColors()(1) : getNextColor(1, 0)) : point.color!;\n\n // mapping data to the format Legends component needs\n const legend: Legend = {\n title: point.legend!,\n color,\n hoverAction: () => {\n _handleChartMouseLeave();\n _onLegendHover(point.legend!);\n },\n // eslint-disable-next-line @typescript-eslint/no-shadow\n onMouseOutAction: (isLegendSelected?: boolean) => {\n _onLegendLeave(isLegendSelected);\n },\n };\n actions.push(legend);\n });\n const legends = (\n <Legends\n legends={actions}\n enabledWrapLines={props.enabledLegendsWrapLines}\n overflowText={props.legendsOverflowText}\n {...props.legendProps}\n onChange={_onLegendSelectionChange}\n />\n );\n return legends;\n }\n\n function _isLegendSelected(): boolean {\n return isLegendSelected!;\n }\n\n /**\n * This function checks if the given legend is highlighted or not.\n * A legend can be highlighted in 2 ways:\n * 1. selection: if the user clicks on it\n * 2. hovering: if there is no selected legend and the user hovers over it\n */\n function _isLegendHighlighted(legend?: string) {\n return _getHighlightedLegend().includes(legend!);\n }\n\n function _getHighlightedLegend() {\n return selectedLegends.length > 0 ? selectedLegends : selectedLegendTitle ? [selectedLegendTitle] : [];\n }\n\n function _onLegendSelectionChange(\n // eslint-disable-next-line @typescript-eslint/no-shadow\n selectedLegends: string[],\n event: React.MouseEvent<HTMLButtonElement>,\n currentLegend?: Legend,\n ): void {\n if (props.legendProps?.canSelectMultipleLegends) {\n setSelectedLegends(selectedLegends);\n setSelectedLegendTitle(currentLegend?.title!);\n } else {\n setSelectedLegends(selectedLegends.slice(-1));\n setSelectedLegendTitle(currentLegend?.title!);\n }\n setIsLegendSelected(selectedLegends.length > 0);\n if (props.legendProps?.onChange) {\n props.legendProps.onChange(selectedLegends, event, currentLegend);\n }\n }\n\n function _getAxisData(yAxisData: IAxisData) {\n if (yAxisData && yAxisData.yAxisDomainValues.length) {\n // For HBCWA x and y Values are swapped\n const { yAxisDomainValues: domainValue } = yAxisData;\n _xMax = Math.max(domainValue[domainValue.length - 1], props.xMaxValue || 0);\n }\n }\n function _getAriaLabel(point: HorizontalBarChartWithAxisDataPoint): string {\n const xValue = point.xAxisCalloutData || point.x;\n const yValue = point.yAxisCalloutData || point.y;\n return point.callOutAccessibilityData?.ariaLabel || `${xValue}. ` + `${yValue}.`;\n }\n\n function _getChartTitle(): string {\n const { chartTitle, data } = props;\n return (chartTitle ? `${chartTitle}. ` : '') + `Horizontal bar chart with ${data?.length || 0} bars. `;\n }\n\n function _isChartEmpty(): boolean {\n return !(props.data && props.data.length > 0);\n }\n\n function _updatePosition(newX: number, newY: number): void {\n const threshold = 1; // Set a threshold for movement\n const { x, y } = clickPosition;\n\n // Calculate the distance moved\n const distance = Math.sqrt(Math.pow(newX - x, 2) + Math.pow(newY - y, 2));\n // Update the position only if the distance moved is greater than the threshold\n if (distance > threshold) {\n setClickPosition({ x: newX, y: newY });\n setPopoverOpen(true);\n }\n }\n\n if (!_isChartEmpty()) {\n _adjustProps();\n const calloutProps: ChartPopoverProps = {\n color: color,\n legend: selectedLegendTitle,\n XValue: xCalloutValue,\n YValue: yCalloutValue ? yCalloutValue : dataForHoverCard,\n ...props.calloutProps,\n ...getAccessibleDataObject(callOutAccessibilityData),\n customCallout: {\n customizedCallout: _getCustomizedCallout() !== null ? _getCustomizedCallout()! : undefined,\n customCalloutProps: props.calloutPropsPerDataPoint\n ? props.calloutPropsPerDataPoint(dataPointCalloutProps!)\n : undefined,\n },\n isCartesian: true,\n isPopoverOpen,\n clickPosition,\n };\n const tickParams = {\n tickValues: props.tickValues,\n tickFormat: props.tickFormat,\n };\n\n const reversedBars = [..._points].reverse();\n _yAxisLabels = reversedBars.map((point: HorizontalBarChartWithAxisDataPoint) => point.y as string);\n _xMax = Math.max(d3Max(_points, (point: HorizontalBarChartWithAxisDataPoint) => point.x)!, props.xMaxValue || 0);\n const legendBars: JSX.Element = _getLegendData(_points);\n return (\n <CartesianChart\n {...props}\n chartTitle={_getChartTitle()}\n points={_points}\n chartType={ChartTypes.HorizontalBarChartWithAxis}\n xAxisType={_xAxisType}\n yAxisType={_yAxisType}\n stringDatasetForYAxisDomain={_yAxisLabels}\n calloutProps={calloutProps}\n tickParams={tickParams}\n legendBars={legendBars}\n barwidth={_barHeight}\n getmargins={_getMargins}\n getGraphData={_getGraphData}\n getAxisData={_getAxisData}\n onChartMouseLeave={_handleChartMouseLeave}\n componentRef={cartesianChartRef}\n /* eslint-disable react/jsx-no-bind */\n // eslint-disable-next-line @typescript-eslint/no-shadow\n children={(props: ChildProps) => {\n return (\n <>\n <g>{_bars}</g>\n </>\n );\n }}\n />\n );\n } else {\n return (\n <div id={_emptyChartId} role={'alert'} style={{ opacity: '0' }} aria-label={'Graph has no data to display'} />\n );\n }\n});\nHorizontalBarChartWithAxis.displayName = 'HorizontalBarChartWithAxis';\n"],"names":["React","max","d3Max","select","d3Select","scaleLinear","d3ScaleLinear","scaleBand","d3ScaleBand","Legends","useId","useHorizontalBarChartWithAxisStyles","CartesianChart","ChartPopover","ChartTypes","getAccessibleDataObject","YAxisType","XAxisTypes","getTypeOfAxis","getNextColor","areArraysEqual","useRtl","DataVizPalette","getColorFromToken","HorizontalBarChartWithAxis","forwardRef","props","forwardedRef","_refArray","_calloutId","_isRtl","_tooltipId","_xAxisType","data","length","x","NumericAxis","_yAxisType","y","StringAxis","_emptyChartId","_points","_barHeight","_colors","_margins","_bars","_yAxisLabels","_xMax","_calloutAnchorPoint","tooltipElement","cartesianChartRef","useRef","color","setColor","useState","dataForHoverCard","setDataForHoverCard","isLegendSelected","setIsLegendSelected","legendProps","selectedLegends","selectedLegend","undefined","isLegendHovered","setIsLegendHovered","selectedLegendTitle","setSelectedLegendTitle","xCalloutValue","setXCalloutValue","yCalloutValue","setYCalloutValue","setSelectedLegends","dataPointCalloutProps","setDataPointCalloutProps","callOutAccessibilityData","setCallOutAccessibilityData","isPopoverOpen","setPopoverOpen","clickPosition","setClickPosition","prevPropsRef","useEffect","current","prevProps","useImperativeHandle","componentRef","chartContainer","classes","_adjustProps","barHeight","defaultPalette","color6","color1","color5","color7","colors","_getMargins","margins","_renderContentForOnlyBars","point","useSingleColor","selectedPointIndex","forEach","yDataPoint","index","_createColors","XValue","xAxisCalloutData","toString","legend","YValue","yAxisCalloutData","culture","_renderCallout","_getCustomizedCallout","onRenderCalloutPerDataPoint","_getGraphData","xScale","yScale","containerHeight","containerWidth","xElement","yElement","_createNumericBars","_createStringBars","increment","_p","color16","domainValues","i","push","colorScale","domain","range","_refCallback","element","legendTitle","refElement","_onBarHover","mouseEvent","persist","_isLegendHighlighted","_updatePosition","clientX","clientY","enableGradient","_onBarLeave","_handleChartMouseLeave","_onBarFocus","refArrayIndexNumber","obj","_getScales","isNumericScale","xMax","yMax","xBarScale","nice","left","right","yBarScale","bottom","top","padding","yAxisPadding","sortedBars","sort","a","b","aValue","parseFloat","bValue","bars","map","shouldHighlight","Math","Fragment","key","startColor","rect","data-is-focusable","width","height","ref","e","rx","roundCorners","onClick","onMouseOver","event","aria-label","_getAriaLabel","role","aria-labelledby","onMouseLeave","onFocus","onBlur","fill","opacity","tabIndex","_tooltipOfYAxislabels","ytooltipProps","tooltipCls","yAxis","id","div","append","attr","style","aa","selectAll","_groups","baseSpanLength","Object","keys","originalDataArray","originalData","dataset","values","tickObject","tickObjectLength","d1","on","d","text","pageX","pageY","transform","bandwidth","showYAxisLablesTooltip","document","getElementById","remove","yAxisElement","call","tooltip","_onLegendHover","customMessage","_isLegendSelected","_onLegendLeave","isLegendFocused","_getLegendData","actions","_index","title","hoverAction","onMouseOutAction","legends","enabledWrapLines","enabledLegendsWrapLines","overflowText","legendsOverflowText","onChange","_onLegendSelectionChange","_getHighlightedLegend","includes","currentLegend","canSelectMultipleLegends","slice","_getAxisData","yAxisData","yAxisDomainValues","domainValue","xMaxValue","xValue","yValue","ariaLabel","_getChartTitle","chartTitle","_isChartEmpty","newX","newY","threshold","distance","sqrt","pow","calloutProps","customCallout","customizedCallout","customCalloutProps","calloutPropsPerDataPoint","isCartesian","tickParams","tickValues","tickFormat","reversedBars","reverse","legendBars","points","chartType","xAxisType","yAxisType","stringDatasetForYAxisDomain","barwidth","getmargins","getGraphData","getAxisData","onChartMouseLeave","children","g","displayName"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,OAAOC,KAAK,QAAQ,WAAW;AACxC,SAASC,UAAUC,QAAQ,QAAQ,eAAe;AAClD,SAASC,eAAeC,aAAa,EAAgCC,aAAaC,WAAW,QAAQ,WAAW;AAEhH,SAASC,OAAO,QAAQ,mCAAmC;AAC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gBACjFwN,oBAAoB5P,MAAM6P,wBAAwB,GAC9C7P,MAAM6P,wBAAwB,CAAC/M,yBAC/BV;YACN;YACA0N,aAAa;YACb5M;YACAE;QACF;QACA,MAAM2M,aAAa;YACjBC,YAAYhQ,MAAMgQ,UAAU;YAC5BC,YAAYjQ,MAAMiQ,UAAU;QAC9B;QAEA,MAAMC,eAAe;eAAInP;SAAQ,CAACoP,OAAO;QACzC/O,eAAe8O,aAAahH,GAAG,CAAC,CAACzE,QAA+CA,MAAM7D,CAAC;QACvFS,QAAQ+H,KAAK7K,GAAG,CAACC,MAAMuC,SAAS,CAAC0D,QAA+CA,MAAMhE,CAAC,GAAIT,MAAM4O,SAAS,IAAI;QAC9G,MAAMwB,aAA0B9C,eAAevM;QAC/C,qBACE,oBAAC7B;YACE,GAAGc,KAAK;YACTiP,YAAYD;YACZqB,QAAQtP;YACRuP,WAAWlR,WAAWU,0BAA0B;YAChDyQ,WAAWjQ;YACXkQ,WAAW7P;YACX8P,6BAA6BrP;YAC7BqO,cAAcA;YACdM,YAAYA;YACZK,YAAYA;YACZM,UAAU1P;YACV2P,YAAYrM;YACZsM,cAAclL;YACdmL,aAAarC;YACbsC,mBAAmBrJ;YACnB9D,cAAcnC;YACd,oCAAoC,GACpC,wDAAwD;YACxDuP,UAAU,CAAC/Q;gBACT,qBACE,wDACE,oBAACgR,WAAG7P;YAGV;;IAGN,OAAO;QACL,qBACE,oBAAC+J;YAAID,IAAInK;YAAeuJ,MAAM;YAASgB,OAAO;gBAAEV,SAAS;YAAI;YAAGR,cAAY;;IAEhF;AACF,GAAG;AACHrK,2BAA2BmR,WAAW,GAAG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["HorizontalBarChartWithAxis.types.ts"],"sourcesContent":["import { RenderFunction } from '../../utilities/index';\nimport {\n CartesianChartProps,\n CartesianChartStyleProps,\n CartesianChartStyles,\n HorizontalBarChartWithAxisDataPoint,\n} from '../../index';\n\n/**\n * Horizontal Bar Chart with Axis properties\n * {@docCategory HorizontalBarChartWithAxis}\n */\nexport interface HorizontalBarChartWithAxisProps extends CartesianChartProps {\n /**\n * Data to render in the chart.\n */\n data?: HorizontalBarChartWithAxisDataPoint[];\n\n /**\n * Define a custom callout renderer for a data point.\n */\n onRenderCalloutPerDataPoint?: RenderFunction<HorizontalBarChartWithAxisDataPoint>;\n\n /**\n * Width of each bar in the chart.\n */\n barHeight?: number;\n\n /**\n * Colors from which to select the color of each bar.\n */\n colors?: string[];\n\n /**\n * chart title for the chart\n */\n chartTitle?: string;\n\n /**\n * This prop makes sure that all the bars are of same color.\n * it will take the first color from the array of colors in\n * prop `colors` or if `colors` prop is not given then default color is palette.blueLight\n * @default false\n */\n useSingleColor?: boolean;\n\n /**\n * Call to provide customized styling that will layer on top of the variant rules.\n */\n styles?: HorizontalBarChartWithAxisStyles;\n\n /**\n * The prop used to define the culture to localized the numbers\n */\n culture?: string;\n\n /**\n * it's padding between bar's or lines in the graph\n */\n yAxisPadding?: number;\n\n /**\n *@default false\n *Used for to elipse y axis labes and show tooltip on x axis labels\n */\n showYAxisLablesTooltip?: boolean;\n\n /**\n *@default false\n *Used for showing complete y axis lables */\n showYAxisLables?: boolean;\n\n /**\n * @default false\n * The prop used to enable gradient fill color for the chart.\n */\n enableGradient?: boolean;\n\n /**\n * @default false\n * The prop used to enable rounded corners for the bars.\n */\n roundCorners?: boolean;\n}\n\n/**\n * Horizontal Bar Chart with Axis style properties\n * {@docCategory HorizontalBarChartWithAxis}\n */\nexport interface HorizontalBarChartWithAxisStyleProps extends CartesianChartStyleProps {\n /**\n * color of the datapoint legend\n */\n legendColor?: string;\n}\n\n/**\n * Horizontal Bar Chart with Axis styles\n * {@docCategory HorizontalBarChartWithAxis}\n */\nexport interface HorizontalBarChartWithAxisStyles extends CartesianChartStyles {\n /**\n * Style for the chart label.\n *\n */\n chartLabel?: string;\n\n /**\n * Style for the line representing the domain of the x-axis.\n *\n */\n xAxisDomain?: string;\n\n /**\n * Style for the lines representing the ticks along the x-axis.\n *\n */\n xAxisTicks?: string;\n\n /**\n * Style for the text labeling each tick along the x-axis.\n *\n */\n xAxisText?: string;\n\n /**\n * Style for the line representing the domain of the y-axis.\n *\n */\n yAxisDomain?: string;\n\n /**\n * Style for the lines representing the ticks along the y-axis.\n *\n */\n yAxisTicks?: string;\n\n /**\n * Style for the text labeling each tick along the y-axis.\n *\n */\n yAxisText?: string;\n\n /**\n * Style to change the opacity of bars in dataviz when we hover on a single bar or legends\n */\n opacityChangeOnHover: string;\n}\n"],"names":[],"rangeMappings":";;;","mappings":"AAgGA;;;CAGC,GACD,WA+CC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["index.ts"],"sourcesContent":["export * from './HorizontalBarChartWithAxis';\nexport * from './HorizontalBarChartWithAxis.types';\nexport * from '../../types/index';\n"],"names":[],"rangeMappings":";;","mappings":"AAAA,cAAc,+BAA+B;AAC7C,cAAc,qCAAqC;AACnD,cAAc,oBAAoB"}
|
package/lib/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.js
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { __styles, mergeClasses, shorthands } from '@griffel/react';
|
|
2
|
+
import { tokens, typographyStyles } from '@fluentui/react-theme';
|
|
3
|
+
export const hbcWithAxisClassNames = {
|
|
4
|
+
opacityChangeOnHover: 'fui-hbcwa__opacityChangeOnHover',
|
|
5
|
+
xAxisTicks: 'fui-hbcwa__xAxisTicks',
|
|
6
|
+
tooltip: 'fui-hbcwa__tooltip',
|
|
7
|
+
chartLabel: '',
|
|
8
|
+
xAxisDomain: '',
|
|
9
|
+
xAxisText: '',
|
|
10
|
+
yAxisDomain: '',
|
|
11
|
+
yAxisTicks: '',
|
|
12
|
+
yAxisText: '',
|
|
13
|
+
root: '',
|
|
14
|
+
xAxis: '',
|
|
15
|
+
yAxis: '',
|
|
16
|
+
legendContainer: '',
|
|
17
|
+
hover: '',
|
|
18
|
+
descriptionMessage: '',
|
|
19
|
+
axisTitle: '',
|
|
20
|
+
chartTitle: '',
|
|
21
|
+
shapeStyles: '',
|
|
22
|
+
chartWrapper: ''
|
|
23
|
+
};
|
|
24
|
+
const useStyles = /*#__PURE__*/__styles({
|
|
25
|
+
opacityChangeOnHover: {
|
|
26
|
+
abs64n: "f9das1l"
|
|
27
|
+
},
|
|
28
|
+
xAxisTicks: {},
|
|
29
|
+
tooltip: {
|
|
30
|
+
Bahqtrf: "fk6fouc",
|
|
31
|
+
Be2twd7: "fkhj508",
|
|
32
|
+
Bhrd7zp: "figsok6",
|
|
33
|
+
Bg96gwp: "f1i3iumi",
|
|
34
|
+
mc9l5x: "f22iagw",
|
|
35
|
+
Beiy3e4: "f1vx9l62",
|
|
36
|
+
z8tnut: "f17mpqex",
|
|
37
|
+
z189sj: ["f1vdfbxk", "f1f5gg8d"],
|
|
38
|
+
Byoj8tv: "fdvome7",
|
|
39
|
+
uwmqm3: ["f1f5gg8d", "f1vdfbxk"],
|
|
40
|
+
qhf8xq: "f1euv43f",
|
|
41
|
+
fsow6f: "f17mccla",
|
|
42
|
+
Bhzewxz: "fr6rvge",
|
|
43
|
+
De3pzq: "fxugw4r",
|
|
44
|
+
Beyfa6y: 0,
|
|
45
|
+
Bbmb7ep: 0,
|
|
46
|
+
Btl43ni: 0,
|
|
47
|
+
B7oj6ja: 0,
|
|
48
|
+
Dimara: "fq9zq91",
|
|
49
|
+
Bkecrkj: "f1aehjj5"
|
|
50
|
+
}
|
|
51
|
+
}, {
|
|
52
|
+
d: [".f9das1l{opacity:0.1;}", ".fk6fouc{font-family:var(--fontFamilyBase);}", ".fkhj508{font-size:var(--fontSizeBase300);}", ".figsok6{font-weight:var(--fontWeightRegular);}", ".f1i3iumi{line-height:var(--lineHeightBase300);}", ".f22iagw{display:flex;}", ".f1vx9l62{flex-direction:column;}", ".f17mpqex{padding-top:var(--spacingHorizontalS);}", ".f1vdfbxk{padding-right:var(--spacingHorizontalS);}", ".f1f5gg8d{padding-left:var(--spacingHorizontalS);}", ".fdvome7{padding-bottom:var(--spacingHorizontalS);}", ".f1euv43f{position:absolute;}", ".f17mccla{text-align:center;}", ".fr6rvge{top:var(--spacingVerticalNone);}", ".fxugw4r{background-color:var(--colorNeutralBackground1);}", [".fq9zq91{border-radius:var(--borderRadiusSmall);}", {
|
|
53
|
+
p: -1
|
|
54
|
+
}], ".f1aehjj5{pointer-events:none;}"]
|
|
55
|
+
});
|
|
56
|
+
/**
|
|
57
|
+
* Apply styling to the HorizontalBarChartWithAxis slots based on the state
|
|
58
|
+
*/
|
|
59
|
+
export const useHorizontalBarChartWithAxisStyles = props => {
|
|
60
|
+
const baseStyles = useStyles();
|
|
61
|
+
return {
|
|
62
|
+
opacityChangeOnHover: mergeClasses(hbcWithAxisClassNames.opacityChangeOnHover, baseStyles.opacityChangeOnHover),
|
|
63
|
+
xAxisTicks: mergeClasses(hbcWithAxisClassNames.xAxisTicks, baseStyles.xAxisTicks),
|
|
64
|
+
tooltip: mergeClasses(hbcWithAxisClassNames.tooltip, baseStyles.tooltip)
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
//# sourceMappingURL=useHorizontalBarChartWithAxisStyles.styles.js.map
|
package/lib/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["__styles","mergeClasses","shorthands","tokens","typographyStyles","hbcWithAxisClassNames","opacityChangeOnHover","xAxisTicks","tooltip","chartLabel","xAxisDomain","xAxisText","yAxisDomain","yAxisTicks","yAxisText","root","xAxis","yAxis","legendContainer","hover","descriptionMessage","axisTitle","chartTitle","shapeStyles","chartWrapper","useStyles","abs64n","Bahqtrf","Be2twd7","Bhrd7zp","Bg96gwp","mc9l5x","Beiy3e4","z8tnut","z189sj","Byoj8tv","uwmqm3","qhf8xq","fsow6f","Bhzewxz","De3pzq","Beyfa6y","Bbmb7ep","Btl43ni","B7oj6ja","Dimara","Bkecrkj","d","p","useHorizontalBarChartWithAxisStyles","props","baseStyles"],"sources":["useHorizontalBarChartWithAxisStyles.styles.js"],"sourcesContent":["import { makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport { tokens, typographyStyles } from '@fluentui/react-theme';\nexport const hbcWithAxisClassNames = {\n opacityChangeOnHover: 'fui-hbcwa__opacityChangeOnHover',\n xAxisTicks: 'fui-hbcwa__xAxisTicks',\n tooltip: 'fui-hbcwa__tooltip',\n chartLabel: '',\n xAxisDomain: '',\n xAxisText: '',\n yAxisDomain: '',\n yAxisTicks: '',\n yAxisText: '',\n root: '',\n xAxis: '',\n yAxis: '',\n legendContainer: '',\n hover: '',\n descriptionMessage: '',\n axisTitle: '',\n chartTitle: '',\n shapeStyles: '',\n chartWrapper: ''\n};\nconst useStyles = makeStyles({\n opacityChangeOnHover: {\n opacity: 0.1\n },\n xAxisTicks: {},\n tooltip: {\n ...typographyStyles.body1,\n display: 'flex',\n flexDirection: 'column',\n ...shorthands.padding(tokens.spacingHorizontalS),\n position: 'absolute',\n textAlign: 'center',\n top: tokens.spacingVerticalNone,\n backgroundColor: tokens.colorNeutralBackground1,\n borderRadius: tokens.borderRadiusSmall,\n pointerEvents: 'none'\n }\n});\n/**\n * Apply styling to the HorizontalBarChartWithAxis slots based on the state\n */ export const useHorizontalBarChartWithAxisStyles = (props)=>{\n const baseStyles = useStyles();\n return {\n opacityChangeOnHover: mergeClasses(hbcWithAxisClassNames.opacityChangeOnHover, baseStyles.opacityChangeOnHover),\n xAxisTicks: mergeClasses(hbcWithAxisClassNames.xAxisTicks, baseStyles.xAxisTicks),\n tooltip: mergeClasses(hbcWithAxisClassNames.tooltip, baseStyles.tooltip)\n };\n};\n"],"mappings":"AAAA,SAAAA,QAAA,EAAqBC,YAAY,EAAEC,UAAU,QAAQ,gBAAgB;AACrE,SAASC,MAAM,EAAEC,gBAAgB,QAAQ,uBAAuB;AAChE,OAAO,MAAMC,qBAAqB,GAAG;EACjCC,oBAAoB,EAAE,i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B,CAACG,OAAO,EAAE2C,UAAU,CAAC3C,OAAO;EAC3E,CAAC;AACL,CAAC","ignoreList":[]}
|
|
@@ -17,23 +17,31 @@ export const Legends = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
|
17
17
|
memorizeCurrent: true
|
|
18
18
|
});
|
|
19
19
|
React.useEffect(()=>{
|
|
20
|
-
|
|
20
|
+
var _props_selectedLegends;
|
|
21
|
+
const initialSelectedLegends = (_props_selectedLegends = props.selectedLegends) !== null && _props_selectedLegends !== void 0 ? _props_selectedLegends : props.defaultSelectedLegends;
|
|
22
|
+
var _props_selectedLegend;
|
|
23
|
+
const initialSelectedLegend = (_props_selectedLegend = props.selectedLegend) !== null && _props_selectedLegend !== void 0 ? _props_selectedLegend : props.defaultSelectedLegend;
|
|
24
|
+
let selectedLegendsState = {};
|
|
21
25
|
if (props.canSelectMultipleLegends) {
|
|
22
|
-
var
|
|
23
|
-
|
|
26
|
+
var _this;
|
|
27
|
+
selectedLegendsState = ((_this = initialSelectedLegends !== null && initialSelectedLegends !== void 0 ? initialSelectedLegends : []) === null || _this === void 0 ? void 0 : _this.reduce(// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
28
|
+
(combineDict, key)=>({
|
|
24
29
|
[key]: true,
|
|
25
|
-
...
|
|
30
|
+
...combineDict
|
|
26
31
|
}), {})) || {};
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
32
|
+
setSelectedLegends(selectedLegendsState);
|
|
33
|
+
} else if (initialSelectedLegend !== undefined) {
|
|
34
|
+
selectedLegendsState = {
|
|
35
|
+
[initialSelectedLegend]: true
|
|
30
36
|
};
|
|
37
|
+
setSelectedLegends(selectedLegendsState);
|
|
31
38
|
}
|
|
32
|
-
setSelectedLegends(defaultSelectedLegends);
|
|
33
39
|
}, [
|
|
34
40
|
props.canSelectMultipleLegends,
|
|
35
41
|
props.defaultSelectedLegend,
|
|
36
|
-
props.defaultSelectedLegends
|
|
42
|
+
props.defaultSelectedLegends,
|
|
43
|
+
props.selectedLegend,
|
|
44
|
+
props.selectedLegends
|
|
37
45
|
]);
|
|
38
46
|
_isLegendSelected = Object.keys(selectedLegends).length > 0;
|
|
39
47
|
const dataToRender = _generateData();
|
|
@@ -131,10 +139,16 @@ export const Legends = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
|
131
139
|
return dataItems;
|
|
132
140
|
}
|
|
133
141
|
/**
|
|
134
|
-
*
|
|
135
|
-
*
|
|
136
|
-
|
|
137
|
-
|
|
142
|
+
* Determine whether the component is in "controlled" mode for selections, where the selected legend(s) are
|
|
143
|
+
* determined entirely by props passed in from the parent component.
|
|
144
|
+
*/ function _isInControlledMode() {
|
|
145
|
+
return props.canSelectMultipleLegends ? props.selectedLegends !== undefined : props.selectedLegend !== undefined;
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* Get the new selected legends based on the legend that was clicked when multi-select is enabled.
|
|
149
|
+
* @param legend The legend that was clicked
|
|
150
|
+
* @returns An object with the new selected legend(s) state data.
|
|
151
|
+
*/ function _getNewSelectedLegendsForMultiselect(legend) {
|
|
138
152
|
let legendsSelected = {
|
|
139
153
|
...selectedLegends
|
|
140
154
|
};
|
|
@@ -149,38 +163,25 @@ export const Legends = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
|
149
163
|
legendsSelected = {};
|
|
150
164
|
}
|
|
151
165
|
}
|
|
152
|
-
setSelectedLegends(legendsSelected);
|
|
153
166
|
return legendsSelected;
|
|
154
167
|
}
|
|
155
168
|
/**
|
|
156
|
-
*
|
|
157
|
-
*
|
|
158
|
-
* @
|
|
159
|
-
*/ function
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
} else {
|
|
164
|
-
setSelectedLegends({
|
|
165
|
-
[legend.title]: true
|
|
166
|
-
});
|
|
167
|
-
return true;
|
|
168
|
-
}
|
|
169
|
+
* Get the new selected legends based on the legend that was clicked when single-select is enabled.
|
|
170
|
+
* @param legend The legend that was clicked
|
|
171
|
+
* @returns An object with the new selected legend state data.
|
|
172
|
+
*/ function _getNewSelectedLegendsForSingleSelect(legend) {
|
|
173
|
+
return selectedLegends[legend.title] ? {} : {
|
|
174
|
+
[legend.title]: true
|
|
175
|
+
};
|
|
169
176
|
}
|
|
170
177
|
function _onClick(legend, event) {
|
|
171
178
|
var _props_onChange, _legend_action;
|
|
172
179
|
const { canSelectMultipleLegends = false } = props;
|
|
173
|
-
|
|
174
|
-
if (
|
|
175
|
-
|
|
176
|
-
selectedLegends = Object.keys(nextSelectedLegends);
|
|
177
|
-
} else {
|
|
178
|
-
const isSelected = _canSelectOnlySingleLegend(legend);
|
|
179
|
-
selectedLegends = isSelected ? [
|
|
180
|
-
legend.title
|
|
181
|
-
] : [];
|
|
180
|
+
const nextSelectedLegends = canSelectMultipleLegends ? _getNewSelectedLegendsForMultiselect(legend) : _getNewSelectedLegendsForSingleSelect(legend);
|
|
181
|
+
if (!_isInControlledMode()) {
|
|
182
|
+
setSelectedLegends(nextSelectedLegends);
|
|
182
183
|
}
|
|
183
|
-
(_props_onChange = props.onChange) === null || _props_onChange === void 0 ? void 0 : _props_onChange.call(props,
|
|
184
|
+
(_props_onChange = props.onChange) === null || _props_onChange === void 0 ? void 0 : _props_onChange.call(props, Object.keys(nextSelectedLegends), event, legend);
|
|
184
185
|
(_legend_action = legend.action) === null || _legend_action === void 0 ? void 0 : _legend_action.call(legend);
|
|
185
186
|
}
|
|
186
187
|
function _onHoverOverLegend(legend) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["Legends.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { Button } from '@fluentui/react-button';\nimport { Legend, LegendsProps, LegendShape } from './Legends.types';\nimport { Shape } from './shape';\nimport { useLegendStyles } from './useLegendsStyles.styles';\nimport { Overflow, OverflowItem } from '@fluentui/react-overflow';\nimport { useFocusableGroup, useArrowNavigationGroup } from '@fluentui/react-tabster';\nimport { OverflowMenu } from './OverflowMenu';\nimport { tokens } from '@fluentui/react-theme';\n\n// This is an internal interface used for rendering the legends with unique key\ninterface LegendItem extends React.ButtonHTMLAttributes<HTMLButtonElement> {\n name?: string;\n title: string;\n action: VoidFunction;\n hoverAction: VoidFunction;\n onMouseOutAction: VoidFunction;\n color: string;\n shape?: LegendShape;\n key: number;\n opacity?: number;\n stripePattern?: boolean;\n isLineLegendInBarChart?: boolean;\n}\n\ninterface LegendMap {\n [key: string]: boolean;\n}\n\nexport interface LegendState {\n activeLegend: string;\n /** Set of legends selected, both for multiple selection and single selection */\n selectedLegends: LegendMap;\n}\nexport const Legends: React.FunctionComponent<LegendsProps> = React.forwardRef<HTMLDivElement, LegendsProps>(\n (props, forwardedRef) => {\n /** Boolean variable to check if one or more legends are selected */\n let _isLegendSelected = false;\n\n // set states separately for each instance of the component\n const [activeLegend, setActiveLegend] = React.useState('');\n const [selectedLegends, setSelectedLegends] = React.useState<LegendMap>({});\n const focusAttributes = useFocusableGroup();\n const arrowAttributes = useArrowNavigationGroup({ axis: 'horizontal', memorizeCurrent: true });\n\n React.useEffect(() => {\n let defaultSelectedLegends = {};\n if (props.canSelectMultipleLegends) {\n defaultSelectedLegends =\n props.defaultSelectedLegends?.reduce((combinedDict, key) => ({ [key]: true, ...combinedDict }), {}) || {};\n } else if (props.defaultSelectedLegend) {\n defaultSelectedLegends = { [props.defaultSelectedLegend]: true };\n }\n\n setSelectedLegends(defaultSelectedLegends);\n }, [props.canSelectMultipleLegends, props.defaultSelectedLegend, props.defaultSelectedLegends]);\n\n _isLegendSelected = Object.keys(selectedLegends).length > 0;\n const dataToRender = _generateData();\n const { overflowStyles, allowFocusOnLegends = true, canSelectMultipleLegends = false } = props;\n const classes = useLegendStyles(props);\n const itemIds = dataToRender.map((_item, index) => index.toString());\n const overflowHoverCardLegends: JSX.Element[] = [];\n props.legends.map((legend, index) => {\n const hoverCardElement = _renderButton(legend, index);\n overflowHoverCardLegends.push(hoverCardElement);\n });\n const overflowString = props.overflowText ? props.overflowText : 'more';\n return props.enabledWrapLines ? renderWrappedLegends() : renderLegends();\n\n function renderLegends(): JSX.Element {\n return (\n <div\n {...focusAttributes}\n {...arrowAttributes}\n {...(allowFocusOnLegends && {\n role: 'listbox',\n 'aria-label': 'Legends',\n 'aria-multiselectable': canSelectMultipleLegends,\n })}\n className={classes.root}\n >\n <Overflow>\n <div className={classes.resizableArea} style={{ textAlign: props.centerLegends ? 'center' : 'unset' }}>\n {dataToRender.map((item, id) => (\n <OverflowItem key={id} id={id.toString()}>\n {_renderButton(item)}\n </OverflowItem>\n ))}\n <OverflowMenu itemIds={itemIds} title={`${overflowString}`} items={overflowHoverCardLegends} />\n </div>\n </Overflow>\n </div>\n );\n }\n\n function renderWrappedLegends(): JSX.Element {\n return (\n <div\n {...focusAttributes}\n {...arrowAttributes}\n {...(allowFocusOnLegends && {\n role: 'listbox',\n 'aria-label': 'Legends',\n 'aria-multiselectable': canSelectMultipleLegends,\n })}\n style={{ justifyContent: props.centerLegends ? 'center' : 'unset', flexWrap: 'wrap', ...overflowStyles }}\n className={classes.root}\n >\n <div className={classes.resizableArea} style={{ display: 'flex', flexWrap: 'wrap', overflow: 'auto' }}>\n {dataToRender.map((item, id) => (\n <div key={id} style={{ flex: '0 1 auto', margin: '4px' }}>\n {_renderButton(item)}\n </div>\n ))}\n </div>\n </div>\n );\n }\n\n function _generateData(): LegendItem[] {\n const { /*allowFocusOnLegends = true,*/ shape } = props;\n const dataItems: LegendItem[] = props.legends.map((legend: Legend, index: number) => {\n return {\n /* ...(allowFocusOnLegends && {\n nativeButtonProps: getIntrinsicElementProps(\n 'div',\n {\n legend,\n ...buttonProperties,\n },\n ['title'],\n ),\n 'aria-setsize': props.legends.length,\n 'aria-posinset': index + 1,\n }), */\n title: legend.title,\n action: legend.action!,\n hoverAction: legend.hoverAction!,\n onMouseOutAction: legend.onMouseOutAction!,\n color: legend.color,\n shape: shape ? shape : legend.shape,\n stripePattern: legend.stripePattern,\n isLineLegendInBarChart: legend.isLineLegendInBarChart,\n opacity: legend.opacity,\n key: index,\n };\n });\n return dataItems;\n }\n\n /**\n * This function will get called when there is an ability to\n * select multiple legends\n * @param legend ILegend\n */\n function _canSelectMultipleLegends(legend: Legend): { [key: string]: boolean } {\n let legendsSelected = { ...selectedLegends };\n if (legendsSelected[legend.title]) {\n // Delete entry for the deselected legend to make\n // the number of keys equal to the number of selected legends\n delete legendsSelected[legend.title];\n } else {\n legendsSelected[legend.title] = true;\n // Clear set if all legends are selected\n if (Object.keys(legendsSelected).length === props.legends.length) {\n legendsSelected = {};\n }\n }\n setSelectedLegends(legendsSelected);\n return legendsSelected;\n }\n\n /**\n * This function will get called when there is\n * ability to select only single legend\n * @param legend ILegend\n */\n\n function _canSelectOnlySingleLegend(legend: Legend): boolean {\n if (selectedLegends[legend.title]) {\n setSelectedLegends({});\n return false;\n } else {\n setSelectedLegends({ [legend.title]: true });\n return true;\n }\n }\n\n function _onClick(legend: Legend, event: React.MouseEvent<HTMLButtonElement>): void {\n const { canSelectMultipleLegends = false } = props;\n let selectedLegends: string[] = [];\n if (canSelectMultipleLegends) {\n const nextSelectedLegends = _canSelectMultipleLegends(legend);\n selectedLegends = Object.keys(nextSelectedLegends);\n } else {\n const isSelected = _canSelectOnlySingleLegend(legend);\n selectedLegends = isSelected ? [legend.title] : [];\n }\n props.onChange?.(selectedLegends, event, legend);\n legend.action?.();\n }\n\n function _onHoverOverLegend(legend: Legend) {\n if (legend.hoverAction) {\n setActiveLegend(legend.title);\n legend.hoverAction();\n }\n }\n\n function _onLeave(legend: Legend) {\n if (legend.onMouseOutAction) {\n setActiveLegend('');\n legend.onMouseOutAction();\n }\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n function _renderButton(data: any, index?: number) {\n const { allowFocusOnLegends = true } = props;\n const legend: Legend = {\n title: data.title,\n color: data.color,\n shape: data.shape,\n action: data.action,\n hoverAction: data.hoverAction,\n onMouseOutAction: data.onMouseOutAction,\n stripePattern: data.stripePattern,\n isLineLegendInBarChart: data.isLineLegendInBarChart,\n opacity: data.opacity,\n };\n const color = _getColor(legend.title, legend.color);\n const onClickHandler = (event: React.MouseEvent<HTMLButtonElement>) => {\n _onClick(legend, event);\n };\n const onHoverHandler = () => {\n _onHoverOverLegend(legend);\n };\n const onMouseOut = () => {\n _onLeave(legend);\n };\n const shape = _getShape(legend, color);\n return (\n <Button\n {...(allowFocusOnLegends && {\n 'aria-selected': !!selectedLegends[legend.title],\n role: 'option',\n 'aria-label': `${legend.title}`,\n 'aria-setsize': data['aria-setsize'],\n 'aria-posinset': data['aria-posinset'],\n })}\n {...(data.nativeButtonProps && { ...data.nativeButtonProps })}\n key={index}\n className={classes.legend}\n onClick={onClickHandler}\n onMouseOver={onHoverHandler}\n onMouseOut={onMouseOut}\n onFocus={onHoverHandler}\n onBlur={onMouseOut}\n appearance={'outline'}\n size=\"small\"\n style={{\n '--rect-height': legend.isLineLegendInBarChart ? '4px' : '12px',\n '--rect-backgroundColor': legend.stripePattern ? '' : color,\n '--rect-borderColor': legend.color ? legend.color : tokens.colorNeutralStroke1,\n '--rect-content': legend.stripePattern\n ? // eslint-disable-next-line @fluentui/max-len\n `repeating-linear-gradient(135deg, transparent, transparent 3px, ${color} 1px, ${color} 4px)`\n : '',\n }} /* eslint-enable react/jsx-no-bind */\n >\n {shape}\n <div className={classes.text} style={{ opacity: color === tokens.colorNeutralBackground1 ? '0.67' : '' }}>\n {legend.title}\n </div>\n </Button>\n );\n }\n\n function _getShape(legend: Legend, color: string): React.ReactNode | string {\n const svgParentProps: React.SVGAttributes<SVGElement> = {\n className: classes.shape,\n };\n const svgChildProps: React.SVGAttributes<SVGElement> = {\n fill: color,\n strokeWidth: 2,\n stroke: legend.color,\n };\n return (\n <Shape\n svgProps={svgParentProps}\n pathProps={svgChildProps}\n shape={legend.shape as LegendShape}\n classNameForNonSvg={classes.rect}\n style={\n {\n height: legend.isLineLegendInBarChart ? '4px' : '12px',\n backgroundColor: legend.stripePattern ? '' : color,\n borderColor: legend.color ? legend.color : tokens.colorNeutralStroke1,\n content: legend.stripePattern\n ? // eslint-disable-next-line @fluentui/max-len\n `repeating-linear-gradient(135deg, transparent, transparent 3px, ${color} 1px, ${color} 4px)`\n : '',\n '--rect-content-high-contrast': `linear-gradient(to right, ${color}, ${color})`,\n '--rect-opacity-high-contrast': color === tokens.colorNeutralBackground1 ? '0.6' : '',\n } as React.CSSProperties\n }\n />\n );\n }\n\n function _getColor(title: string, color: string): string {\n let legendColor = color;\n // if one or more legends are selected\n if (_isLegendSelected) {\n // if the given legend (title) is one of the selected legends\n if (selectedLegends[title]) {\n legendColor = color;\n }\n // if the given legend is unselected\n else {\n legendColor = tokens.colorNeutralBackground1;\n }\n }\n // if no legend is selected\n else {\n // if the given legend is hovered\n // or none of the legends is hovered\n if (activeLegend === title || activeLegend === '') {\n legendColor = color;\n }\n // if there is a hovered legend but the given legend is not the one\n else {\n legendColor = tokens.colorNeutralBackground1;\n }\n }\n return legendColor;\n }\n },\n);\nLegends.displayName = 'Legends';\n"],"names":["React","Button","Shape","useLegendStyles","Overflow","OverflowItem","useFocusableGroup","useArrowNavigationGroup","OverflowMenu","tokens","Legends","forwardRef","props","forwardedRef","_isLegendSelected","activeLegend","setActiveLegend","useState","selectedLegends","setSelectedLegends","focusAttributes","arrowAttributes","axis","memorizeCurrent","useEffect","defaultSelectedLegends","canSelectMultipleLegends","reduce","combinedDict","key","defaultSelectedLegend","Object","keys","length","dataToRender","_generateData","overflowStyles","allowFocusOnLegends","classes","itemIds","map","_item","index","toString","overflowHoverCardLegends","legends","legend","hoverCardElement","_renderButton","push","overflowString","overflowText","enabledWrapLines","renderWrappedLegends","renderLegends","div","role","className","root","resizableArea","style","textAlign","centerLegends","item","id","title","items","justifyContent","flexWrap","display","overflow","flex","margin","shape","dataItems","action","hoverAction","onMouseOutAction","color","stripePattern","isLineLegendInBarChart","opacity","_canSelectMultipleLegends","legendsSelected","_canSelectOnlySingleLegend","_onClick","event","nextSelectedLegends","isSelected","onChange","_onHoverOverLegend","_onLeave","data","_getColor","onClickHandler","onHoverHandler","onMouseOut","_getShape","nativeButtonProps","onClick","onMouseOver","onFocus","onBlur","appearance","size","colorNeutralStroke1","text","colorNeutralBackground1","svgParentProps","svgChildProps","fill","strokeWidth","stroke","svgProps","pathProps","classNameForNonSvg","rect","height","backgroundColor","borderColor","content","legendColor","displayName"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,YAAYA,WAAW,QAAQ;AAE/B,SAASC,MAAM,QAAQ,yBAAyB;AAEhD,SAASC,KAAK,QAAQ,UAAU;AAChC,SAASC,eAAe,QAAQ,4BAA4B;AAC5D,SAASC,QAAQ,EAAEC,YAAY,QAAQ,2BAA2B;AAClE,SAASC,iBAAiB,EAAEC,uBAAuB,QAAQ,0BAA0B;AACrF,SAASC,YAAY,QAAQ,iBAAiB;AAC9C,SAASC,MAAM,QAAQ,wBAAwB;AA0B/C,OAAO,MAAMC,wBAAiDV,MAAMW,UAAU,CAC5E,CAACC,OAAOC;IACN,kEAAkE,GAClE,IAAIC,oBAAoB;IAExB,2DAA2D;IAC3D,MAAM,CAACC,cAAcC,gBAAgB,GAAGhB,MAAMiB,QAAQ,CAAC;IACvD,MAAM,CAACC,iBAAiBC,mBAAmB,GAAGnB,MAAMiB,QAAQ,CAAY,CAAC;IACzE,MAAMG,kBAAkBd;IACxB,MAAMe,kBAAkBd,wBAAwB;QAAEe,MAAM;QAAcC,iBAAiB;IA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AAOiC,aAAa,GAEzB,CAAC,gEAAgE,EAAED,MAAM,MAAM,EAAEA,MAAM,KAAK,CAAC,GAC7F;gBACJ,gCAAgC,CAAC,0BAA0B,EAAEA,MAAM,EAAE,EAAEA,MAAM,CAAC,CAAC;gBAC/E,gCAAgCA,UAAUrE,OAAOkG,uBAAuB,GAAG,QAAQ;YACrF;;IAIR;IAEA,SAASd,UAAU5B,KAAa,EAAEa,KAAa;QAC7C,IAAI2C,cAAc3C;QAClB,sCAAsC;QACtC,IAAIhE,mBAAmB;YACrB,6DAA6D;YAC7D,IAAII,eAAe,CAAC+C,MAAM,EAAE;gBAC1BwD,cAAc3C;YAChB,OAEK;gBACH2C,cAAchH,OAAOkG,uBAAuB;YAC9C;QACF,OAEK;YACH,iCAAiC;YACjC,oCAAoC;YACpC,IAAI5F,iBAAiBkD,SAASlD,iBAAiB,IAAI;gBACjD0G,cAAc3C;YAChB,OAEK;gBACH2C,cAAchH,OAAOkG,uBAAuB;YAC9C;QACF;QACA,OAAOc;IACT;AACF,GACA;AACF/G,QAAQgH,WAAW,GAAG"}
|
|
1
|
+
{"version":3,"sources":["Legends.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { Button } from '@fluentui/react-button';\nimport { Legend, LegendsProps, LegendShape } from './Legends.types';\nimport { Shape } from './shape';\nimport { useLegendStyles } from './useLegendsStyles.styles';\nimport { Overflow, OverflowItem } from '@fluentui/react-overflow';\nimport { useFocusableGroup, useArrowNavigationGroup } from '@fluentui/react-tabster';\nimport { OverflowMenu } from './OverflowMenu';\nimport { tokens } from '@fluentui/react-theme';\n\n// This is an internal interface used for rendering the legends with unique key\ninterface LegendItem extends React.ButtonHTMLAttributes<HTMLButtonElement> {\n name?: string;\n title: string;\n action: VoidFunction;\n hoverAction: VoidFunction;\n onMouseOutAction: VoidFunction;\n color: string;\n shape?: LegendShape;\n key: number;\n opacity?: number;\n stripePattern?: boolean;\n isLineLegendInBarChart?: boolean;\n}\n\ninterface LegendMap {\n [key: string]: boolean;\n}\n\nexport interface LegendState {\n activeLegend: string;\n /** Set of legends selected, both for multiple selection and single selection */\n selectedLegends: LegendMap;\n}\nexport const Legends: React.FunctionComponent<LegendsProps> = React.forwardRef<HTMLDivElement, LegendsProps>(\n (props, forwardedRef) => {\n /** Boolean variable to check if one or more legends are selected */\n let _isLegendSelected = false;\n\n // set states separately for each instance of the component\n const [activeLegend, setActiveLegend] = React.useState('');\n const [selectedLegends, setSelectedLegends] = React.useState<LegendMap>({});\n const focusAttributes = useFocusableGroup();\n const arrowAttributes = useArrowNavigationGroup({ axis: 'horizontal', memorizeCurrent: true });\n\n React.useEffect(() => {\n const initialSelectedLegends = props.selectedLegends ?? props.defaultSelectedLegends;\n const initialSelectedLegend = props.selectedLegend ?? props.defaultSelectedLegend;\n let selectedLegendsState = {};\n if (props.canSelectMultipleLegends) {\n selectedLegendsState =\n (initialSelectedLegends ?? [])?.reduce(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (combineDict: any, key: any) => ({ [key]: true, ...combineDict }),\n {},\n ) || {};\n setSelectedLegends(selectedLegendsState);\n } else if (initialSelectedLegend !== undefined) {\n selectedLegendsState = { [initialSelectedLegend]: true };\n setSelectedLegends(selectedLegendsState);\n }\n }, [\n props.canSelectMultipleLegends,\n props.defaultSelectedLegend,\n props.defaultSelectedLegends,\n props.selectedLegend,\n props.selectedLegends,\n ]);\n\n _isLegendSelected = Object.keys(selectedLegends).length > 0;\n const dataToRender = _generateData();\n const { overflowStyles, allowFocusOnLegends = true, canSelectMultipleLegends = false } = props;\n const classes = useLegendStyles(props);\n const itemIds = dataToRender.map((_item, index) => index.toString());\n const overflowHoverCardLegends: JSX.Element[] = [];\n props.legends.map((legend, index) => {\n const hoverCardElement = _renderButton(legend, index);\n overflowHoverCardLegends.push(hoverCardElement);\n });\n const overflowString = props.overflowText ? props.overflowText : 'more';\n return props.enabledWrapLines ? renderWrappedLegends() : renderLegends();\n\n function renderLegends(): JSX.Element {\n return (\n <div\n {...focusAttributes}\n {...arrowAttributes}\n {...(allowFocusOnLegends && {\n role: 'listbox',\n 'aria-label': 'Legends',\n 'aria-multiselectable': canSelectMultipleLegends,\n })}\n className={classes.root}\n >\n <Overflow>\n <div className={classes.resizableArea} style={{ textAlign: props.centerLegends ? 'center' : 'unset' }}>\n {dataToRender.map((item, id) => (\n <OverflowItem key={id} id={id.toString()}>\n {_renderButton(item)}\n </OverflowItem>\n ))}\n <OverflowMenu itemIds={itemIds} title={`${overflowString}`} items={overflowHoverCardLegends} />\n </div>\n </Overflow>\n </div>\n );\n }\n\n function renderWrappedLegends(): JSX.Element {\n return (\n <div\n {...focusAttributes}\n {...arrowAttributes}\n {...(allowFocusOnLegends && {\n role: 'listbox',\n 'aria-label': 'Legends',\n 'aria-multiselectable': canSelectMultipleLegends,\n })}\n style={{ justifyContent: props.centerLegends ? 'center' : 'unset', flexWrap: 'wrap', ...overflowStyles }}\n className={classes.root}\n >\n <div className={classes.resizableArea} style={{ display: 'flex', flexWrap: 'wrap', overflow: 'auto' }}>\n {dataToRender.map((item, id) => (\n <div key={id} style={{ flex: '0 1 auto', margin: '4px' }}>\n {_renderButton(item)}\n </div>\n ))}\n </div>\n </div>\n );\n }\n\n function _generateData(): LegendItem[] {\n const { /*allowFocusOnLegends = true,*/ shape } = props;\n const dataItems: LegendItem[] = props.legends.map((legend: Legend, index: number) => {\n return {\n /* ...(allowFocusOnLegends && {\n nativeButtonProps: getIntrinsicElementProps(\n 'div',\n {\n legend,\n ...buttonProperties,\n },\n ['title'],\n ),\n 'aria-setsize': props.legends.length,\n 'aria-posinset': index + 1,\n }), */\n title: legend.title,\n action: legend.action!,\n hoverAction: legend.hoverAction!,\n onMouseOutAction: legend.onMouseOutAction!,\n color: legend.color,\n shape: shape ? shape : legend.shape,\n stripePattern: legend.stripePattern,\n isLineLegendInBarChart: legend.isLineLegendInBarChart,\n opacity: legend.opacity,\n key: index,\n };\n });\n return dataItems;\n }\n\n /**\n * Determine whether the component is in \"controlled\" mode for selections, where the selected legend(s) are\n * determined entirely by props passed in from the parent component.\n */\n function _isInControlledMode(): boolean {\n return props.canSelectMultipleLegends ? props.selectedLegends !== undefined : props.selectedLegend !== undefined;\n }\n\n /**\n * Get the new selected legends based on the legend that was clicked when multi-select is enabled.\n * @param legend The legend that was clicked\n * @returns An object with the new selected legend(s) state data.\n */\n function _getNewSelectedLegendsForMultiselect(legend: Legend): { [key: string]: boolean } {\n let legendsSelected = { ...selectedLegends };\n if (legendsSelected[legend.title]) {\n // Delete entry for the deselected legend to make\n // the number of keys equal to the number of selected legends\n delete legendsSelected[legend.title];\n } else {\n legendsSelected[legend.title] = true;\n // Clear set if all legends are selected\n if (Object.keys(legendsSelected).length === props.legends.length) {\n legendsSelected = {};\n }\n }\n return legendsSelected;\n }\n\n /**\n * Get the new selected legends based on the legend that was clicked when single-select is enabled.\n * @param legend The legend that was clicked\n * @returns An object with the new selected legend state data.\n */\n function _getNewSelectedLegendsForSingleSelect(legend: Legend): { [key: string]: boolean } {\n return selectedLegends[legend.title] ? {} : { [legend.title]: true };\n }\n\n function _onClick(legend: Legend, event: React.MouseEvent<HTMLButtonElement>): void {\n const { canSelectMultipleLegends = false } = props;\n const nextSelectedLegends = canSelectMultipleLegends\n ? _getNewSelectedLegendsForMultiselect(legend)\n : _getNewSelectedLegendsForSingleSelect(legend);\n\n if (!_isInControlledMode()) {\n setSelectedLegends(nextSelectedLegends);\n }\n props.onChange?.(Object.keys(nextSelectedLegends), event, legend);\n legend.action?.();\n }\n\n function _onHoverOverLegend(legend: Legend) {\n if (legend.hoverAction) {\n setActiveLegend(legend.title);\n legend.hoverAction();\n }\n }\n\n function _onLeave(legend: Legend) {\n if (legend.onMouseOutAction) {\n setActiveLegend('');\n legend.onMouseOutAction();\n }\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n function _renderButton(data: any, index?: number) {\n const { allowFocusOnLegends = true } = props;\n const legend: Legend = {\n title: data.title,\n color: data.color,\n shape: data.shape,\n action: data.action,\n hoverAction: data.hoverAction,\n onMouseOutAction: data.onMouseOutAction,\n stripePattern: data.stripePattern,\n isLineLegendInBarChart: data.isLineLegendInBarChart,\n opacity: data.opacity,\n };\n const color = _getColor(legend.title, legend.color);\n const onClickHandler = (event: React.MouseEvent<HTMLButtonElement>) => {\n _onClick(legend, event);\n };\n const onHoverHandler = () => {\n _onHoverOverLegend(legend);\n };\n const onMouseOut = () => {\n _onLeave(legend);\n };\n const shape = _getShape(legend, color);\n return (\n <Button\n {...(allowFocusOnLegends && {\n 'aria-selected': !!selectedLegends[legend.title],\n role: 'option',\n 'aria-label': `${legend.title}`,\n 'aria-setsize': data['aria-setsize'],\n 'aria-posinset': data['aria-posinset'],\n })}\n {...(data.nativeButtonProps && { ...data.nativeButtonProps })}\n key={index}\n className={classes.legend}\n onClick={onClickHandler}\n onMouseOver={onHoverHandler}\n onMouseOut={onMouseOut}\n onFocus={onHoverHandler}\n onBlur={onMouseOut}\n appearance={'outline'}\n size=\"small\"\n style={{\n '--rect-height': legend.isLineLegendInBarChart ? '4px' : '12px',\n '--rect-backgroundColor': legend.stripePattern ? '' : color,\n '--rect-borderColor': legend.color ? legend.color : tokens.colorNeutralStroke1,\n '--rect-content': legend.stripePattern\n ? // eslint-disable-next-line @fluentui/max-len\n `repeating-linear-gradient(135deg, transparent, transparent 3px, ${color} 1px, ${color} 4px)`\n : '',\n }} /* eslint-enable react/jsx-no-bind */\n >\n {shape}\n <div className={classes.text} style={{ opacity: color === tokens.colorNeutralBackground1 ? '0.67' : '' }}>\n {legend.title}\n </div>\n </Button>\n );\n }\n\n function _getShape(legend: Legend, color: string): React.ReactNode | string {\n const svgParentProps: React.SVGAttributes<SVGElement> = {\n className: classes.shape,\n };\n const svgChildProps: React.SVGAttributes<SVGElement> = {\n fill: color,\n strokeWidth: 2,\n stroke: legend.color,\n };\n return (\n <Shape\n svgProps={svgParentProps}\n pathProps={svgChildProps}\n shape={legend.shape as LegendShape}\n classNameForNonSvg={classes.rect}\n style={\n {\n height: legend.isLineLegendInBarChart ? '4px' : '12px',\n backgroundColor: legend.stripePattern ? '' : color,\n borderColor: legend.color ? legend.color : tokens.colorNeutralStroke1,\n content: legend.stripePattern\n ? // eslint-disable-next-line @fluentui/max-len\n `repeating-linear-gradient(135deg, transparent, transparent 3px, ${color} 1px, ${color} 4px)`\n : '',\n '--rect-content-high-contrast': `linear-gradient(to right, ${color}, ${color})`,\n '--rect-opacity-high-contrast': color === tokens.colorNeutralBackground1 ? '0.6' : '',\n } as React.CSSProperties\n }\n />\n );\n }\n\n function _getColor(title: string, color: string): string {\n let legendColor = color;\n // if one or more legends are selected\n if (_isLegendSelected) {\n // if the given legend (title) is one of the selected legends\n if (selectedLegends[title]) {\n legendColor = color;\n }\n // if the given legend is unselected\n else {\n legendColor = tokens.colorNeutralBackground1;\n }\n }\n // if no legend is selected\n else {\n // if the given legend is hovered\n // or none of the legends is hovered\n if (activeLegend === title || activeLegend === '') {\n legendColor = color;\n }\n // if there is a hovered legend but the given legend is not the one\n else {\n legendColor = tokens.colorNeutralBackground1;\n }\n }\n return legendColor;\n }\n },\n);\nLegends.displayName = 'Legends';\n"],"names":["React","Button","Shape","useLegendStyles","Overflow","OverflowItem","useFocusableGroup","useArrowNavigationGroup","OverflowMenu","tokens","Legends","forwardRef","props","forwardedRef","_isLegendSelected","activeLegend","setActiveLegend","useState","selectedLegends","setSelectedLegends","focusAttributes","arrowAttributes","axis","memorizeCurrent","useEffect","initialSelectedLegends","defaultSelectedLegends","initialSelectedLegend","selectedLegend","defaultSelectedLegend","selectedLegendsState","canSelectMultipleLegends","reduce","combineDict","key","undefined","Object","keys","length","dataToRender","_generateData","overflowStyles","allowFocusOnLegends","classes","itemIds","map","_item","index","toString","overflowHoverCardLegends","legends","legend","hoverCardElement","_renderButton","push","overflowString","overflowText","enabledWrapLines","renderWrappedLegends","renderLegends","div","role","className","root","resizableArea","style","textAlign","centerLegends","item","id","title","items","justifyContent","flexWrap","display","overflow","flex","margin","shape","dataItems","action","hoverAction","onMouseOutAction","color","stripePattern","isLineLegendInBarChart","opacity","_isInControlledMode","_getNewSelectedLegendsForMultiselect","legendsSelected","_getNewSelectedLegendsForSingleSelect","_onClick","event","nextSelectedLegends","onChange","_onHoverOverLegend","_onLeave","data","_getColor","onClickHandler","onHoverHandler","onMouseOut","_getShape","nativeButtonProps","onClick","onMouseOver","onFocus","onBlur","appearance","size","colorNeutralStroke1","text","colorNeutralBackground1","svgParentProps","svgChildProps","fill","strokeWidth","stroke","svgProps","pathProps","classNameForNonSvg","rect","height","backgroundColor","borderColor","content","legendColor","displayName"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,YAAYA,WAAW,QAAQ;AAE/B,SAASC,MAAM,QAAQ,yBAAyB;AAEhD,SAASC,KAAK,QAAQ,UAAU;AAChC,SAASC,eAAe,QAAQ,4BAA4B;AAC5D,SAASC,QAAQ,EAAEC,YAAY,QAAQ,2BAA2B;AAClE,SAASC,iBAAiB,EAAEC,uBAAuB,QAAQ,0BAA0B;AACrF,SAASC,YAAY,QAAQ,iBAAiB;AAC9C,SAASC,MAAM,QAAQ,wBAAwB;AA0B/C,OAAO,MAAMC,wBAAiDV,MAAMW,UAAU,CAC5E,CAACC,OAAOC;IACN,kEAAkE,GAClE,IAAIC,oBAAoB;IAExB,2DAA2D;IAC3D,MAAM,CAACC,cAAcC,gBAAgB,GAAGhB,MAAMiB,QAAQ,CAAC;IACvD,MAAM,CAACC,i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
85
|
+
Bvjb7m6: "fhv2zbx"
|
|
87
86
|
},
|
|
88
87
|
hoverChange: {
|
|
89
88
|
a9b677: "frx94fk",
|
|
@@ -112,7 +111,7 @@ const useStyles = /*#__PURE__*/__styles({
|
|
|
112
111
|
}, {
|
|
113
112
|
d: [".fz5stix{white-space:nowrap;}", ".fly5x3f{width:100%;}", ".f122n59{align-items:center;}", ".fpzxe1g{margin-top:-8px 0 0 -8px;}", ".f705vk6{margin-right:-8px 0 0 -8px;}", ".fqom4eq{margin-left:-8px 0 0 -8px;}", ".fzpzak3{margin-bottom:-8px 0 0 -8px;}", ".fc7pyfw{justify-content:left;}", ".fgbriwd{justify-content:right;}", ".f1k6fduh{cursor:pointer;}", ".f1ern45e{border-top-style:none;}", ".f1n71otn{border-right-style:none;}", ".f1deefiw{border-left-style:none;}", ".f1h8hb77{border-bottom-style:none;}", ".f17mpqex{padding-top:var(--spacingHorizontalS);}", ".f1vdfbxk{padding-right:var(--spacingHorizontalS);}", ".f1f5gg8d{padding-left:var(--spacingHorizontalS);}", ".fdvome7{padding-bottom:var(--spacingHorizontalS);}", ".fiwaqkr{text-transform:capitalize;}", ".frx94fk{width:12px;}", [".fpyyuzi{border:1px solid;}", {
|
|
114
113
|
p: -2
|
|
115
|
-
}], ".f1vcna3q{margin-right:var(--spacingHorizontalS);}", ".foyynoy{margin-left:var(--spacingHorizontalS);}", ".f3tsq5r{width:0;}", ".fniina8{height:0;}", ".fk1dseo{border-left-width:6px solid transparent;}", ".f1r9b9o{border-right-width:6px solid transparent;}", ".f1cm5upi{border-top-width:10.4px solid;}", ".fk6fouc{font-family:var(--fontFamilyBase);}", ".fy9rknc{font-size:var(--fontSizeBase200);}", ".figsok6{font-weight:var(--fontWeightRegular);}", ".fwrc4pm{line-height:var(--lineHeightBase200);}", ".f19n0e5{color:var(--colorNeutralForeground1);}", ".fvblgha{height:12px;}", ".f1d7653x{border-top-width:1px solid;}", ".f1maxq7k{border-right-width:1px solid;}", ".f16g4l54{border-left-width:1px solid;}", ".f1rzi0e7{border-bottom-width:1px solid;}", ".f10pi13n{position:relative;}", ".f1o700av{text-align:left;}", ".fes3tcz{text-align:right;}", ".f15ivbov{transform:translate(-50%, 0);}", ".fjwp9lj{transform:translate(50%, 0);}", ".f198g47y{top:auto;}", ".f1ktbn1t{left:50%;}", ".ffenbu1{right:50%;}", ".f93ek0f{min-width:200px;}", ".f1cgdal8{max-width:800px;}", ".f2b5gy5::after{padding-top:1px 4px 1px;}", ".fk27hbk::after{padding-right:1px 4px 1px;}", ".f1xelbol::after{padding-left:1px 4px 1px;}", ".f1gw7v5p::after{padding-bottom:1px 4px 1px;}", ".f196ehyi::after{border-top-width:-2px;}", ".frlu5y9::after{border-left-width:-2px;}", ".f109kcev::after{border-right-width:-2px;}"],
|
|
114
|
+
}], ".f1vcna3q{margin-right:var(--spacingHorizontalS);}", ".foyynoy{margin-left:var(--spacingHorizontalS);}", ".f3tsq5r{width:0;}", ".fniina8{height:0;}", ".fk1dseo{border-left-width:6px solid transparent;}", ".f1r9b9o{border-right-width:6px solid transparent;}", ".f1cm5upi{border-top-width:10.4px solid;}", ".fk6fouc{font-family:var(--fontFamilyBase);}", ".fy9rknc{font-size:var(--fontSizeBase200);}", ".figsok6{font-weight:var(--fontWeightRegular);}", ".fwrc4pm{line-height:var(--lineHeightBase200);}", ".f19n0e5{color:var(--colorNeutralForeground1);}", ".fhv2zbx{forced-color-adjust:auto;}", ".fvblgha{height:12px;}", ".f1d7653x{border-top-width:1px solid;}", ".f1maxq7k{border-right-width:1px solid;}", ".f16g4l54{border-left-width:1px solid;}", ".f1rzi0e7{border-bottom-width:1px solid;}", ".f10pi13n{position:relative;}", ".f1o700av{text-align:left;}", ".fes3tcz{text-align:right;}", ".f15ivbov{transform:translate(-50%, 0);}", ".fjwp9lj{transform:translate(50%, 0);}", ".f198g47y{top:auto;}", ".f1ktbn1t{left:50%;}", ".ffenbu1{right:50%;}", ".f93ek0f{min-width:200px;}", ".f1cgdal8{max-width:800px;}", ".f2b5gy5::after{padding-top:1px 4px 1px;}", ".fk27hbk::after{padding-right:1px 4px 1px;}", ".f1xelbol::after{padding-left:1px 4px 1px;}", ".f1gw7v5p::after{padding-bottom:1px 4px 1px;}", ".f196ehyi::after{border-top-width:-2px;}", ".frlu5y9::after{border-left-width:-2px;}", ".f109kcev::after{border-right-width:-2px;}"],
|
|
116
115
|
m: [["@media screen and (-ms-high-contrast: active),screen and (forced-colors: active){.fuhkvgp{color:WindowText;}}", {
|
|
117
116
|
m: "screen and (-ms-high-contrast: active), screen and (forced-colors: active)"
|
|
118
117
|
}], ["@media screen and (-ms-high-contrast: active),screen and (forced-colors: active){.f15mrrko{forced-color-adjust:none;}}", {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__styles","mergeClasses","shorthands","tokens","typographyStyles","HighContrastSelector","legendClassNames","root","legend","rect","shape","triangle","text","hoverChange","resizableArea","useStyles","Huce71","a9b677","Bt984gj","B6of3ja","t21cq0","jrapky","Frg6f3","Brf1p80","Bceei9c","icvyot","vrafjx","oivjwe","wvpqe5","z8tnut","z189sj","Byoj8tv","uwmqm3","B9bfxx9","Bs92zhm","B93v9kj","Ck9m1r","mkjk8h","zpeayv","Bcwlslt","Bgfg5da","B9xav0g","Bn0qgzm","B4g9neb","zhjwy3","ibv6hh","u1mtju","h3c5rm","Bekrc4i","i8vvqc","g2u3we","B4j52fo","irswps","Bqenvij","Bahqtrf","Be2twd7","Bhrd7zp","Bg96gwp","sj55zd","qhf8xq","fsow6f","Bz10aip","Bhzewxz","oyh7mz","Bf4jedk","B2u0y6b","smv486","u6pn5x","B4uzyy","Be2s5ez","xrcqlc","Bhxzhr1","d","p","m","useLegendStyles","props","_props_styles","_props_styles1","_props_styles2","_props_styles3","_props_styles4","_props_styles5","_props_styles6","_props_styles7","className","baseStyles","styles"],"sources":["useLegendsStyles.styles.js"],"sourcesContent":["import { makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport { tokens, typographyStyles } from '@fluentui/react-theme';\nimport { HighContrastSelector } from '../../utilities/index';\n/**\n * @internal\n */ export const legendClassNames = {\n root: 'fui-legend__root',\n legend: 'fui-legend__legend',\n rect: 'fui-legend__rect',\n shape: 'fui-legend__shape',\n triangle: 'fui-legend__triangle',\n text: 'fui-legend__text',\n hoverChange: 'fui-legend__hoverChange',\n resizableArea: 'fui-legend__resizableArea'\n};\nconst useStyles = makeStyles({\n root: {\n whiteSpace: 'nowrap',\n width: '100%',\n alignItems: 'center',\n ...shorthands.margin('-8px 0 0 -8px')\n },\n legend: {\n // setting display to flex does not work\n // display: 'flex',\n alignItems: 'center',\n justifyContent: 'left',\n cursor: 'pointer',\n ...shorthands.border('none'),\n ...shorthands.padding(tokens.spacingHorizontalS),\n textTransform: 'capitalize',\n [HighContrastSelector]: {\n color: 'WindowText',\n forcedColorAdjust: 'none'\n },\n '&:hover': {\n [HighContrastSelector]: {\n color: 'HighlightText',\n forcedColorAdjust: 'none'\n }\n }\n },\n rect: {\n [HighContrastSelector]: {\n content: 'var(--rect-content-high-contrast)',\n opacity: 'var(--rect-opacity-high-contrast)'\n },\n width: '12px',\n border: '1px solid',\n marginRight: tokens.spacingHorizontalS\n },\n shape: {\n marginRight: tokens.spacingHorizontalS\n },\n // TO DO Add props when these styles are used in the component\n triangle: {\n width: '0',\n height: '0',\n ...shorthands.borderLeft('6px solid transparent'),\n ...shorthands.borderRight('6px solid transparent'),\n ...shorthands.borderTop('10.4px solid'),\n marginRight: tokens.spacingHorizontalS\n },\n // TO DO Add props when these styles are used in the component\n text: {\n ...typographyStyles.caption1,\n color: tokens.colorNeutralForeground1,\n
|
|
1
|
+
{"version":3,"names":["__styles","mergeClasses","shorthands","tokens","typographyStyles","HighContrastSelector","legendClassNames","root","legend","rect","shape","triangle","text","hoverChange","resizableArea","useStyles","Huce71","a9b677","Bt984gj","B6of3ja","t21cq0","jrapky","Frg6f3","Brf1p80","Bceei9c","icvyot","vrafjx","oivjwe","wvpqe5","z8tnut","z189sj","Byoj8tv","uwmqm3","B9bfxx9","Bs92zhm","B93v9kj","Ck9m1r","mkjk8h","zpeayv","Bcwlslt","Bgfg5da","B9xav0g","Bn0qgzm","B4g9neb","zhjwy3","ibv6hh","u1mtju","h3c5rm","Bekrc4i","i8vvqc","g2u3we","B4j52fo","irswps","Bqenvij","Bahqtrf","Be2twd7","Bhrd7zp","Bg96gwp","sj55zd","Bvjb7m6","qhf8xq","fsow6f","Bz10aip","Bhzewxz","oyh7mz","Bf4jedk","B2u0y6b","smv486","u6pn5x","B4uzyy","Be2s5ez","xrcqlc","Bhxzhr1","d","p","m","useLegendStyles","props","_props_styles","_props_styles1","_props_styles2","_props_styles3","_props_styles4","_props_styles5","_props_styles6","_props_styles7","className","baseStyles","styles"],"sources":["useLegendsStyles.styles.js"],"sourcesContent":["import { makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport { tokens, typographyStyles } from '@fluentui/react-theme';\nimport { HighContrastSelector } from '../../utilities/index';\n/**\n * @internal\n */ export const legendClassNames = {\n root: 'fui-legend__root',\n legend: 'fui-legend__legend',\n rect: 'fui-legend__rect',\n shape: 'fui-legend__shape',\n triangle: 'fui-legend__triangle',\n text: 'fui-legend__text',\n hoverChange: 'fui-legend__hoverChange',\n resizableArea: 'fui-legend__resizableArea'\n};\nconst useStyles = makeStyles({\n root: {\n whiteSpace: 'nowrap',\n width: '100%',\n alignItems: 'center',\n ...shorthands.margin('-8px 0 0 -8px')\n },\n legend: {\n // setting display to flex does not work\n // display: 'flex',\n alignItems: 'center',\n justifyContent: 'left',\n cursor: 'pointer',\n ...shorthands.border('none'),\n ...shorthands.padding(tokens.spacingHorizontalS),\n textTransform: 'capitalize',\n [HighContrastSelector]: {\n color: 'WindowText',\n forcedColorAdjust: 'none'\n },\n '&:hover': {\n [HighContrastSelector]: {\n color: 'HighlightText',\n forcedColorAdjust: 'none'\n }\n }\n },\n rect: {\n [HighContrastSelector]: {\n content: 'var(--rect-content-high-contrast)',\n opacity: 'var(--rect-opacity-high-contrast)'\n },\n width: '12px',\n border: '1px solid',\n marginRight: tokens.spacingHorizontalS\n },\n shape: {\n marginRight: tokens.spacingHorizontalS\n },\n // TO DO Add props when these styles are used in the component\n triangle: {\n width: '0',\n height: '0',\n ...shorthands.borderLeft('6px solid transparent'),\n ...shorthands.borderRight('6px solid transparent'),\n ...shorthands.borderTop('10.4px solid'),\n marginRight: tokens.spacingHorizontalS\n },\n // TO DO Add props when these styles are used in the component\n text: {\n ...typographyStyles.caption1,\n color: tokens.colorNeutralForeground1,\n forcedColorAdjust: 'auto'\n },\n // TO DO Add props when these styles are used in the component\n hoverChange: {\n width: '12px',\n height: '12px',\n marginRight: tokens.spacingHorizontalS,\n ...shorthands.border('1px solid')\n },\n resizableArea: {\n position: 'relative',\n textAlign: 'left',\n transform: 'translate(-50%, 0)',\n top: 'auto',\n left: '50%',\n minWidth: '200px',\n maxWidth: '800px',\n '::after': {\n ...shorthands.padding('1px 4px 1px'),\n ...shorthands.borderTop('-2px'),\n ...shorthands.borderLeft('-2px')\n }\n }\n});\nexport const useLegendStyles = (props)=>{\n var _props_styles, _props_styles1, _props_styles2, _props_styles3, _props_styles4, _props_styles5, _props_styles6, _props_styles7;\n const { className } = props; // ToDo - width, barHeight is non enumerable. Need to be used inline.\n const baseStyles = useStyles();\n return {\n root: mergeClasses(legendClassNames.root, baseStyles.root, className, (_props_styles = props.styles) === null || _props_styles === void 0 ? void 0 : _props_styles.root),\n legend: mergeClasses(legendClassNames.legend, baseStyles.legend, (_props_styles1 = props.styles) === null || _props_styles1 === void 0 ? void 0 : _props_styles1.legend),\n rect: mergeClasses(legendClassNames.rect, baseStyles.rect, (_props_styles2 = props.styles) === null || _props_styles2 === void 0 ? void 0 : _props_styles2.rect),\n shape: mergeClasses(legendClassNames.shape, baseStyles.shape, (_props_styles3 = props.styles) === null || _props_styles3 === void 0 ? void 0 : _props_styles3.shape),\n triangle: mergeClasses(legendClassNames.triangle, baseStyles.triangle, (_props_styles4 = props.styles) === null || _props_styles4 === void 0 ? void 0 : _props_styles4.triangle),\n text: mergeClasses(legendClassNames.text, baseStyles.text, (_props_styles5 = props.styles) === null || _props_styles5 === void 0 ? void 0 : _props_styles5.text),\n hoverChange: mergeClasses(legendClassNames.hoverChange, baseStyles.hoverChange, (_props_styles6 = props.styles) === null || _props_styles6 === void 0 ? void 0 : _props_styles6.hoverChange),\n resizableArea: mergeClasses(legendClassNames.resizableArea, baseStyles.resizableArea, (_props_styles7 = props.styles) === null || _props_styles7 === void 0 ? void 0 : _props_styles7.resizableArea)\n };\n};\n"],"mappings":"AAAA,SAAAA,QAAA,EAAqBC,YAAY,EAAEC,UAAU,QAAQ,gBAAgB;AACrE,SAASC,MAAM,EAAEC,gBAAgB,QAAQ,uBAAuB;AAChE,SAASC,oBAAoB,QAAQ,uBAAuB;AAC5D;AACA;AACA;AAAI,OAAO,MAAMC,gBAAgB,GAAG;EAChCC,IAAI,EAAE,kBAAkB;EACxBC,MAAM,EAAE,oBAAoB;EAC5BC,IAAI,EAAE,kBAAkB;EACxBC,KAAK,EAAE,mBAAmB;EAC1BC,QAAQ,EAAE,sBAAsB;EAChCC,IAAI,EAAE,kBAAkB;EACxBC,WAAW,EAAE,yBAAyB;EACtCC,aAAa,EAAE;AACnB,CAAC;AACD,MAAMC,SAAS,gBAAGf,QAAA;EAAAO,IAAA;IAAAS,MAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;EAAA;EAAAd,MAAA;IAAAU,OAAA;IAAAK,OAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,MAAA;EAAA;EAAA5B,IAAA;IAAA6B,MAAA;IAAAC,OAAA;IAAAtB,MAAA;IAAAuB,OAAA;IAAAC,O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