@fluentui/react-charts 0.0.0-nightly-20250423-1342.1 → 0.0.0-nightly-20250424-0405.1
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 +16 -16
- package/dist/index.d.ts +3305 -0
- package/lib/AreaChart.js +1 -0
- package/lib/AreaChart.js.map +1 -0
- package/lib/CartesianChart.js +1 -0
- package/lib/CartesianChart.js.map +1 -0
- package/lib/DeclarativeChart.js +1 -0
- package/lib/DeclarativeChart.js.map +1 -0
- package/lib/DonutChart.js +1 -0
- package/lib/DonutChart.js.map +1 -0
- package/lib/GaugeChart.js +1 -0
- package/lib/GaugeChart.js.map +1 -0
- package/lib/GroupedVerticalBarChart.js +1 -0
- package/lib/GroupedVerticalBarChart.js.map +1 -0
- package/lib/HeatMapChart.js +1 -0
- package/lib/HeatMapChart.js.map +1 -0
- package/lib/HorizontalBarChart.js +1 -0
- package/lib/HorizontalBarChart.js.map +1 -0
- package/lib/HorizontalBarChartWithAxis.js +1 -0
- package/lib/HorizontalBarChartWithAxis.js.map +1 -0
- package/lib/Legends.js +1 -0
- package/lib/Legends.js.map +1 -0
- package/lib/LineChart.js +1 -0
- package/lib/LineChart.js.map +1 -0
- package/lib/Popover.js +1 -0
- package/lib/Popover.js.map +1 -0
- package/lib/ResponsiveContainer.js +1 -0
- package/lib/ResponsiveContainer.js.map +1 -0
- package/lib/SankeyChart.js +1 -0
- package/lib/SankeyChart.js.map +1 -0
- package/lib/ScatterChart.js +1 -0
- package/lib/ScatterChart.js.map +1 -0
- package/lib/Sparkline.js +1 -0
- package/lib/Sparkline.js.map +1 -0
- package/lib/VerticalBarChart.js +1 -0
- package/lib/VerticalBarChart.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 +478 -0
- package/lib/components/CommonComponents/CartesianChart.js.map +1 -0
- package/lib/components/CommonComponents/CartesianChart.types.js +1 -0
- package/lib/components/CommonComponents/CartesianChart.types.js.map +1 -0
- package/lib/components/CommonComponents/ChartPopover.js +187 -0
- package/lib/components/CommonComponents/ChartPopover.js.map +1 -0
- package/lib/components/CommonComponents/ChartPopover.types.js +1 -0
- package/lib/components/CommonComponents/ChartPopover.types.js.map +1 -0
- package/lib/components/CommonComponents/index.js +4 -0
- package/lib/components/CommonComponents/index.js.map +1 -0
- package/lib/components/CommonComponents/useCartesianChartStyles.styles.js +113 -0
- package/lib/components/CommonComponents/useCartesianChartStyles.styles.js.map +1 -0
- package/lib/components/CommonComponents/useChartPopoverStyles.styles.js +167 -0
- package/lib/components/CommonComponents/useChartPopoverStyles.styles.js.map +1 -0
- package/lib/components/DeclarativeChart/DeclarativeChart.js +197 -0
- package/lib/components/DeclarativeChart/DeclarativeChart.js.map +1 -0
- package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js +811 -0
- package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -0
- package/lib/components/DeclarativeChart/imageExporter.js +221 -0
- package/lib/components/DeclarativeChart/imageExporter.js.map +1 -0
- package/lib/components/DeclarativeChart/index.js +1 -0
- package/lib/components/DeclarativeChart/index.js.map +1 -0
- package/lib/components/DonutChart/Arc/Arc.js +110 -0
- package/lib/components/DonutChart/Arc/Arc.js.map +1 -0
- package/lib/components/DonutChart/Arc/Arc.types.js +1 -0
- package/lib/components/DonutChart/Arc/Arc.types.js.map +1 -0
- package/lib/components/DonutChart/Arc/index.js +2 -0
- package/lib/components/DonutChart/Arc/index.js.map +1 -0
- package/lib/components/DonutChart/Arc/useArcStyles.styles.js +54 -0
- package/lib/components/DonutChart/Arc/useArcStyles.styles.js.map +1 -0
- package/lib/components/DonutChart/DonutChart.js +291 -0
- package/lib/components/DonutChart/DonutChart.js.map +1 -0
- package/lib/components/DonutChart/DonutChart.types.js +1 -0
- package/lib/components/DonutChart/DonutChart.types.js.map +1 -0
- package/lib/components/DonutChart/Pie/Pie.js +72 -0
- package/lib/components/DonutChart/Pie/Pie.js.map +1 -0
- package/lib/components/DonutChart/Pie/Pie.types.js +1 -0
- package/lib/components/DonutChart/Pie/Pie.types.js.map +1 -0
- package/lib/components/DonutChart/Pie/index.js +2 -0
- package/lib/components/DonutChart/Pie/index.js.map +1 -0
- package/lib/components/DonutChart/Pie/usePieStyles.styles.js +40 -0
- package/lib/components/DonutChart/Pie/usePieStyles.styles.js.map +1 -0
- package/lib/components/DonutChart/index.js +3 -0
- package/lib/components/DonutChart/index.js.map +1 -0
- package/lib/components/DonutChart/useDonutChartStyles.styles.js +58 -0
- package/lib/components/DonutChart/useDonutChartStyles.styles.js.map +1 -0
- package/lib/components/GaugeChart/GaugeChart.js +592 -0
- package/lib/components/GaugeChart/GaugeChart.js.map +1 -0
- package/lib/components/GaugeChart/GaugeChart.types.js +4 -0
- package/lib/components/GaugeChart/GaugeChart.types.js.map +1 -0
- package/lib/components/GaugeChart/index.js +3 -0
- package/lib/components/GaugeChart/index.js.map +1 -0
- package/lib/components/GaugeChart/useGaugeChartStyles.styles.js +178 -0
- package/lib/components/GaugeChart/useGaugeChartStyles.styles.js.map +1 -0
- package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js +501 -0
- package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js.map +1 -0
- package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.types.js +4 -0
- package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.types.js.map +1 -0
- package/lib/components/GroupedVerticalBarChart/index.js +3 -0
- package/lib/components/GroupedVerticalBarChart/index.js.map +1 -0
- package/lib/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.js +81 -0
- package/lib/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.js.map +1 -0
- 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/HorizontalBarChart.js +402 -0
- package/lib/components/HorizontalBarChart/HorizontalBarChart.js.map +1 -0
- package/lib/components/HorizontalBarChart/HorizontalBarChart.types.js +6 -0
- package/lib/components/HorizontalBarChart/HorizontalBarChart.types.js.map +1 -0
- package/lib/components/HorizontalBarChart/index.js +3 -0
- package/lib/components/HorizontalBarChart/index.js.map +1 -0
- package/lib/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.js +156 -0
- package/lib/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.js.map +1 -0
- 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 +303 -0
- package/lib/components/Legends/Legends.js.map +1 -0
- package/lib/components/Legends/Legends.types.js +1 -0
- package/lib/components/Legends/Legends.types.js.map +1 -0
- package/lib/components/Legends/OverflowMenu.js +25 -0
- package/lib/components/Legends/OverflowMenu.js.map +1 -0
- package/lib/components/Legends/index.js +3 -0
- package/lib/components/Legends/index.js.map +1 -0
- package/lib/components/Legends/shape.js +35 -0
- package/lib/components/Legends/shape.js.map +1 -0
- package/lib/components/Legends/useLegendsStyles.styles.js +146 -0
- package/lib/components/Legends/useLegendsStyles.styles.js.map +1 -0
- package/lib/components/LineChart/LineChart.js +1034 -0
- package/lib/components/LineChart/LineChart.js.map +1 -0
- package/lib/components/LineChart/LineChart.types.js +3 -0
- package/lib/components/LineChart/LineChart.types.js.map +1 -0
- package/lib/components/LineChart/eventAnnotation/EventAnnotation.js +119 -0
- package/lib/components/LineChart/eventAnnotation/EventAnnotation.js.map +1 -0
- package/lib/components/LineChart/eventAnnotation/LabelLink.js +57 -0
- package/lib/components/LineChart/eventAnnotation/LabelLink.js.map +1 -0
- package/lib/components/LineChart/eventAnnotation/Textbox.js +40 -0
- package/lib/components/LineChart/eventAnnotation/Textbox.js.map +1 -0
- package/lib/components/LineChart/index.js +4 -0
- package/lib/components/LineChart/index.js.map +1 -0
- package/lib/components/LineChart/useLineChartStyles.styles.js +56 -0
- package/lib/components/LineChart/useLineChartStyles.styles.js.map +1 -0
- package/lib/components/ResponsiveContainer/ResponsiveContainer.js +65 -0
- package/lib/components/ResponsiveContainer/ResponsiveContainer.js.map +1 -0
- package/lib/components/ResponsiveContainer/ResponsiveContainer.types.js +1 -0
- package/lib/components/ResponsiveContainer/ResponsiveContainer.types.js.map +1 -0
- package/lib/components/ResponsiveContainer/index.js +1 -0
- package/lib/components/ResponsiveContainer/index.js.map +1 -0
- package/lib/components/ResponsiveContainer/useResponsiveContainerStyles.styles.js +23 -0
- package/lib/components/ResponsiveContainer/useResponsiveContainerStyles.styles.js.map +1 -0
- 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 +465 -0
- package/lib/components/ScatterChart/ScatterChart.js.map +1 -0
- package/lib/components/ScatterChart/ScatterChart.types.js +4 -0
- package/lib/components/ScatterChart/ScatterChart.types.js.map +1 -0
- package/lib/components/ScatterChart/index.js +3 -0
- package/lib/components/ScatterChart/index.js.map +1 -0
- package/lib/components/ScatterChart/useScatterChartStyles.styles.js +56 -0
- package/lib/components/ScatterChart/useScatterChartStyles.styles.js.map +1 -0
- package/lib/components/Sparkline/Sparkline.js +119 -0
- package/lib/components/Sparkline/Sparkline.js.map +1 -0
- package/lib/components/Sparkline/Sparkline.types.js +4 -0
- package/lib/components/Sparkline/Sparkline.types.js.map +1 -0
- package/lib/components/Sparkline/index.js +3 -0
- package/lib/components/Sparkline/index.js.map +1 -0
- package/lib/components/Sparkline/useSparklineStyles.styles.js +49 -0
- package/lib/components/Sparkline/useSparklineStyles.styles.js.map +1 -0
- package/lib/components/VerticalBarChart/VerticalBarChart.js +926 -0
- package/lib/components/VerticalBarChart/VerticalBarChart.js.map +1 -0
- package/lib/components/VerticalBarChart/VerticalBarChart.types.js +4 -0
- package/lib/components/VerticalBarChart/VerticalBarChart.types.js.map +1 -0
- package/lib/components/VerticalBarChart/index.js +3 -0
- package/lib/components/VerticalBarChart/index.js.map +1 -0
- package/lib/components/VerticalBarChart/useVerticalBarChartStyles.styles.js +66 -0
- package/lib/components/VerticalBarChart/useVerticalBarChartStyles.styles.js.map +1 -0
- 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 +20 -0
- package/lib/index.js.map +1 -0
- package/lib/types/DataPoint.js +1 -0
- package/lib/types/DataPoint.js.map +1 -0
- package/lib/types/EventAnnotation.js +1 -0
- package/lib/types/EventAnnotation.js.map +1 -0
- package/lib/types/LegendDataItem.js +1 -0
- package/lib/types/LegendDataItem.js.map +1 -0
- package/lib/types/index.js +2 -0
- package/lib/types/index.js.map +1 -0
- package/lib/utilities/FocusableTooltipText.js +65 -0
- package/lib/utilities/FocusableTooltipText.js.map +1 -0
- package/lib/utilities/KeyCodes.js +8 -0
- package/lib/utilities/KeyCodes.js.map +1 -0
- package/lib/utilities/SVGTooltipText.js +183 -0
- package/lib/utilities/SVGTooltipText.js.map +1 -0
- package/lib/utilities/async-utils.js +380 -0
- package/lib/utilities/async-utils.js.map +1 -0
- package/lib/utilities/colors.js +269 -0
- package/lib/utilities/colors.js.map +1 -0
- package/lib/utilities/getWindow.js +25 -0
- package/lib/utilities/getWindow.js.map +1 -0
- package/lib/utilities/index.js +3 -0
- package/lib/utilities/index.js.map +1 -0
- package/lib/utilities/locale-util.js +15 -0
- package/lib/utilities/locale-util.js.map +1 -0
- package/lib/utilities/overflow-utils.js +27 -0
- package/lib/utilities/overflow-utils.js.map +1 -0
- package/lib/utilities/string.js +32 -0
- package/lib/utilities/string.js.map +1 -0
- package/lib/utilities/test-data.js +329 -0
- package/lib/utilities/test-data.js.map +1 -0
- package/lib/utilities/utilities.js +1405 -0
- package/lib/utilities/utilities.js.map +1 -0
- package/lib/utilities/vbc-utils.js +27 -0
- package/lib/utilities/vbc-utils.js.map +1 -0
- package/lib-commonjs/AreaChart.js +6 -0
- package/lib-commonjs/AreaChart.js.map +1 -0
- package/lib-commonjs/CartesianChart.js +6 -0
- package/lib-commonjs/CartesianChart.js.map +1 -0
- package/lib-commonjs/DeclarativeChart.js +6 -0
- package/lib-commonjs/DeclarativeChart.js.map +1 -0
- package/lib-commonjs/DonutChart.js +6 -0
- package/lib-commonjs/DonutChart.js.map +1 -0
- package/lib-commonjs/GaugeChart.js +6 -0
- package/lib-commonjs/GaugeChart.js.map +1 -0
- package/lib-commonjs/GroupedVerticalBarChart.js +6 -0
- package/lib-commonjs/GroupedVerticalBarChart.js.map +1 -0
- package/lib-commonjs/HeatMapChart.js +6 -0
- package/lib-commonjs/HeatMapChart.js.map +1 -0
- package/lib-commonjs/HorizontalBarChart.js +6 -0
- package/lib-commonjs/HorizontalBarChart.js.map +1 -0
- package/lib-commonjs/HorizontalBarChartWithAxis.js +6 -0
- package/lib-commonjs/HorizontalBarChartWithAxis.js.map +1 -0
- package/lib-commonjs/Legends.js +6 -0
- package/lib-commonjs/Legends.js.map +1 -0
- package/lib-commonjs/LineChart.js +6 -0
- package/lib-commonjs/LineChart.js.map +1 -0
- package/lib-commonjs/Popover.js +6 -0
- package/lib-commonjs/Popover.js.map +1 -0
- package/lib-commonjs/ResponsiveContainer.js +6 -0
- package/lib-commonjs/ResponsiveContainer.js.map +1 -0
- package/lib-commonjs/SankeyChart.js +6 -0
- package/lib-commonjs/SankeyChart.js.map +1 -0
- package/lib-commonjs/ScatterChart.js +6 -0
- package/lib-commonjs/ScatterChart.js.map +1 -0
- package/lib-commonjs/Sparkline.js +6 -0
- package/lib-commonjs/Sparkline.js.map +1 -0
- package/lib-commonjs/VerticalBarChart.js +6 -0
- package/lib-commonjs/VerticalBarChart.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 +484 -0
- package/lib-commonjs/components/CommonComponents/CartesianChart.js.map +1 -0
- package/lib-commonjs/components/CommonComponents/CartesianChart.types.js +6 -0
- package/lib-commonjs/components/CommonComponents/CartesianChart.types.js.map +1 -0
- package/lib-commonjs/components/CommonComponents/ChartPopover.js +197 -0
- package/lib-commonjs/components/CommonComponents/ChartPopover.js.map +1 -0
- package/lib-commonjs/components/CommonComponents/ChartPopover.types.js +4 -0
- package/lib-commonjs/components/CommonComponents/ChartPopover.types.js.map +1 -0
- package/lib-commonjs/components/CommonComponents/index.js +9 -0
- package/lib-commonjs/components/CommonComponents/index.js.map +1 -0
- package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.js +166 -0
- package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.js.map +1 -0
- package/lib-commonjs/components/CommonComponents/useChartPopoverStyles.styles.js +236 -0
- package/lib-commonjs/components/CommonComponents/useChartPopoverStyles.styles.js.map +1 -0
- package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js +205 -0
- package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js.map +1 -0
- package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js +859 -0
- package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -0
- package/lib-commonjs/components/DeclarativeChart/imageExporter.js +231 -0
- package/lib-commonjs/components/DeclarativeChart/imageExporter.js.map +1 -0
- package/lib-commonjs/components/DeclarativeChart/index.js +6 -0
- package/lib-commonjs/components/DeclarativeChart/index.js.map +1 -0
- package/lib-commonjs/components/DonutChart/Arc/Arc.js +117 -0
- package/lib-commonjs/components/DonutChart/Arc/Arc.js.map +1 -0
- package/lib-commonjs/components/DonutChart/Arc/Arc.types.js +4 -0
- package/lib-commonjs/components/DonutChart/Arc/Arc.types.js.map +1 -0
- package/lib-commonjs/components/DonutChart/Arc/index.js +7 -0
- package/lib-commonjs/components/DonutChart/Arc/index.js.map +1 -0
- package/lib-commonjs/components/DonutChart/Arc/useArcStyles.styles.js +83 -0
- package/lib-commonjs/components/DonutChart/Arc/useArcStyles.styles.js.map +1 -0
- package/lib-commonjs/components/DonutChart/DonutChart.js +298 -0
- package/lib-commonjs/components/DonutChart/DonutChart.js.map +1 -0
- package/lib-commonjs/components/DonutChart/DonutChart.types.js +6 -0
- package/lib-commonjs/components/DonutChart/DonutChart.types.js.map +1 -0
- package/lib-commonjs/components/DonutChart/Pie/Pie.js +79 -0
- package/lib-commonjs/components/DonutChart/Pie/Pie.js.map +1 -0
- package/lib-commonjs/components/DonutChart/Pie/Pie.types.js +4 -0
- package/lib-commonjs/components/DonutChart/Pie/Pie.types.js.map +1 -0
- package/lib-commonjs/components/DonutChart/Pie/index.js +7 -0
- package/lib-commonjs/components/DonutChart/Pie/index.js.map +1 -0
- package/lib-commonjs/components/DonutChart/Pie/usePieStyles.styles.js +54 -0
- package/lib-commonjs/components/DonutChart/Pie/usePieStyles.styles.js.map +1 -0
- package/lib-commonjs/components/DonutChart/index.js +8 -0
- package/lib-commonjs/components/DonutChart/index.js.map +1 -0
- package/lib-commonjs/components/DonutChart/useDonutChartStyles.styles.js +82 -0
- package/lib-commonjs/components/DonutChart/useDonutChartStyles.styles.js.map +1 -0
- package/lib-commonjs/components/GaugeChart/GaugeChart.js +621 -0
- package/lib-commonjs/components/GaugeChart/GaugeChart.js.map +1 -0
- package/lib-commonjs/components/GaugeChart/GaugeChart.types.js +7 -0
- package/lib-commonjs/components/GaugeChart/GaugeChart.types.js.map +1 -0
- package/lib-commonjs/components/GaugeChart/index.js +8 -0
- package/lib-commonjs/components/GaugeChart/index.js.map +1 -0
- package/lib-commonjs/components/GaugeChart/useGaugeChartStyles.styles.js +258 -0
- package/lib-commonjs/components/GaugeChart/useGaugeChartStyles.styles.js.map +1 -0
- package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js +507 -0
- package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js.map +1 -0
- package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.types.js +7 -0
- package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.types.js.map +1 -0
- package/lib-commonjs/components/GroupedVerticalBarChart/index.js +8 -0
- package/lib-commonjs/components/GroupedVerticalBarChart/index.js.map +1 -0
- package/lib-commonjs/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.js +130 -0
- package/lib-commonjs/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.js.map +1 -0
- 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/HorizontalBarChart.js +408 -0
- package/lib-commonjs/components/HorizontalBarChart/HorizontalBarChart.js.map +1 -0
- package/lib-commonjs/components/HorizontalBarChart/HorizontalBarChart.types.js +17 -0
- package/lib-commonjs/components/HorizontalBarChart/HorizontalBarChart.types.js.map +1 -0
- package/lib-commonjs/components/HorizontalBarChart/index.js +8 -0
- package/lib-commonjs/components/HorizontalBarChart/index.js.map +1 -0
- package/lib-commonjs/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.js +237 -0
- package/lib-commonjs/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.js.map +1 -0
- 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 +313 -0
- package/lib-commonjs/components/Legends/Legends.js.map +1 -0
- package/lib-commonjs/components/Legends/Legends.types.js +6 -0
- package/lib-commonjs/components/Legends/Legends.types.js.map +1 -0
- package/lib-commonjs/components/Legends/OverflowMenu.js +36 -0
- package/lib-commonjs/components/Legends/OverflowMenu.js.map +1 -0
- package/lib-commonjs/components/Legends/index.js +8 -0
- package/lib-commonjs/components/Legends/index.js.map +1 -0
- package/lib-commonjs/components/Legends/shape.js +46 -0
- package/lib-commonjs/components/Legends/shape.js.map +1 -0
- package/lib-commonjs/components/Legends/useLegendsStyles.styles.js +304 -0
- package/lib-commonjs/components/Legends/useLegendsStyles.styles.js.map +1 -0
- package/lib-commonjs/components/LineChart/LineChart.js +1040 -0
- package/lib-commonjs/components/LineChart/LineChart.js.map +1 -0
- package/lib-commonjs/components/LineChart/LineChart.types.js +6 -0
- package/lib-commonjs/components/LineChart/LineChart.types.js.map +1 -0
- package/lib-commonjs/components/LineChart/eventAnnotation/EventAnnotation.js +129 -0
- package/lib-commonjs/components/LineChart/eventAnnotation/EventAnnotation.js.map +1 -0
- package/lib-commonjs/components/LineChart/eventAnnotation/LabelLink.js +68 -0
- package/lib-commonjs/components/LineChart/eventAnnotation/LabelLink.js.map +1 -0
- package/lib-commonjs/components/LineChart/eventAnnotation/Textbox.js +51 -0
- package/lib-commonjs/components/LineChart/eventAnnotation/Textbox.js.map +1 -0
- package/lib-commonjs/components/LineChart/index.js +9 -0
- package/lib-commonjs/components/LineChart/index.js.map +1 -0
- package/lib-commonjs/components/LineChart/useLineChartStyles.styles.js +87 -0
- package/lib-commonjs/components/LineChart/useLineChartStyles.styles.js.map +1 -0
- package/lib-commonjs/components/ResponsiveContainer/ResponsiveContainer.js +76 -0
- package/lib-commonjs/components/ResponsiveContainer/ResponsiveContainer.js.map +1 -0
- package/lib-commonjs/components/ResponsiveContainer/ResponsiveContainer.types.js +6 -0
- package/lib-commonjs/components/ResponsiveContainer/ResponsiveContainer.types.js.map +1 -0
- package/lib-commonjs/components/ResponsiveContainer/index.js +6 -0
- package/lib-commonjs/components/ResponsiveContainer/index.js.map +1 -0
- package/lib-commonjs/components/ResponsiveContainer/useResponsiveContainerStyles.styles.js +47 -0
- package/lib-commonjs/components/ResponsiveContainer/useResponsiveContainerStyles.styles.js.map +1 -0
- 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 +471 -0
- package/lib-commonjs/components/ScatterChart/ScatterChart.js.map +1 -0
- package/lib-commonjs/components/ScatterChart/ScatterChart.types.js +7 -0
- package/lib-commonjs/components/ScatterChart/ScatterChart.types.js.map +1 -0
- package/lib-commonjs/components/ScatterChart/index.js +8 -0
- package/lib-commonjs/components/ScatterChart/index.js.map +1 -0
- package/lib-commonjs/components/ScatterChart/useScatterChartStyles.styles.js +87 -0
- package/lib-commonjs/components/ScatterChart/useScatterChartStyles.styles.js.map +1 -0
- package/lib-commonjs/components/Sparkline/Sparkline.js +125 -0
- package/lib-commonjs/components/Sparkline/Sparkline.js.map +1 -0
- package/lib-commonjs/components/Sparkline/Sparkline.types.js +7 -0
- package/lib-commonjs/components/Sparkline/Sparkline.types.js.map +1 -0
- package/lib-commonjs/components/Sparkline/index.js +8 -0
- package/lib-commonjs/components/Sparkline/index.js.map +1 -0
- package/lib-commonjs/components/Sparkline/useSparklineStyles.styles.js +77 -0
- package/lib-commonjs/components/Sparkline/useSparklineStyles.styles.js.map +1 -0
- package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.js +928 -0
- package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.js.map +1 -0
- package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.types.js +7 -0
- package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.types.js.map +1 -0
- package/lib-commonjs/components/VerticalBarChart/index.js +8 -0
- package/lib-commonjs/components/VerticalBarChart/index.js.map +1 -0
- package/lib-commonjs/components/VerticalBarChart/useVerticalBarChartStyles.styles.js +110 -0
- package/lib-commonjs/components/VerticalBarChart/useVerticalBarChartStyles.styles.js.map +1 -0
- 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 +25 -0
- package/lib-commonjs/index.js.map +1 -0
- package/lib-commonjs/types/DataPoint.js +4 -0
- package/lib-commonjs/types/DataPoint.js.map +1 -0
- package/lib-commonjs/types/EventAnnotation.js +6 -0
- package/lib-commonjs/types/EventAnnotation.js.map +1 -0
- package/lib-commonjs/types/LegendDataItem.js +4 -0
- package/lib-commonjs/types/LegendDataItem.js.map +1 -0
- package/lib-commonjs/types/index.js +7 -0
- package/lib-commonjs/types/index.js.map +1 -0
- package/lib-commonjs/utilities/FocusableTooltipText.js +75 -0
- package/lib-commonjs/utilities/FocusableTooltipText.js.map +1 -0
- package/lib-commonjs/utilities/KeyCodes.js +18 -0
- package/lib-commonjs/utilities/KeyCodes.js.map +1 -0
- package/lib-commonjs/utilities/SVGTooltipText.js +193 -0
- package/lib-commonjs/utilities/SVGTooltipText.js.map +1 -0
- package/lib-commonjs/utilities/async-utils.js +382 -0
- package/lib-commonjs/utilities/async-utils.js.map +1 -0
- package/lib-commonjs/utilities/colors.js +293 -0
- package/lib-commonjs/utilities/colors.js.map +1 -0
- package/lib-commonjs/utilities/getWindow.js +28 -0
- package/lib-commonjs/utilities/getWindow.js.map +1 -0
- package/lib-commonjs/utilities/index.js +8 -0
- package/lib-commonjs/utilities/index.js.map +1 -0
- package/lib-commonjs/utilities/locale-util.js +25 -0
- package/lib-commonjs/utilities/locale-util.js.map +1 -0
- package/lib-commonjs/utilities/overflow-utils.js +36 -0
- package/lib-commonjs/utilities/overflow-utils.js.map +1 -0
- package/lib-commonjs/utilities/string.js +29 -0
- package/lib-commonjs/utilities/string.js.map +1 -0
- package/lib-commonjs/utilities/test-data.js +383 -0
- package/lib-commonjs/utilities/test-data.js.map +1 -0
- package/lib-commonjs/utilities/utilities.js +1371 -0
- package/lib-commonjs/utilities/utilities.js.map +1 -0
- package/lib-commonjs/utilities/vbc-utils.js +45 -0
- package/lib-commonjs/utilities/vbc-utils.js.map +1 -0
- package/package.json +13 -13
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { __styles, mergeClasses, shorthands } from '@griffel/react';
|
|
2
|
+
import { tokens, typographyStyles } from '@fluentui/react-theme';
|
|
3
|
+
export const groupedVerticalBarChartClassNames = {
|
|
4
|
+
opacityChangeOnHover: 'fui-gvbc**opacityChangeOnHover',
|
|
5
|
+
tooltip: 'fui-gvbc**tooltip',
|
|
6
|
+
barLabel: 'fui-gvbc**barLabel',
|
|
7
|
+
root: '',
|
|
8
|
+
xAxis: '',
|
|
9
|
+
yAxis: '',
|
|
10
|
+
legendContainer: '',
|
|
11
|
+
hover: '',
|
|
12
|
+
descriptionMessage: '',
|
|
13
|
+
axisTitle: '',
|
|
14
|
+
chartTitle: '',
|
|
15
|
+
shapeStyles: '',
|
|
16
|
+
chartWrapper: ''
|
|
17
|
+
};
|
|
18
|
+
const useStyles = /*#__PURE__*/__styles({
|
|
19
|
+
opacityChangeOnHover: {
|
|
20
|
+
Bceei9c: "f158kwzp"
|
|
21
|
+
},
|
|
22
|
+
tooltip: {
|
|
23
|
+
Bahqtrf: "fk6fouc",
|
|
24
|
+
Be2twd7: "fkhj508",
|
|
25
|
+
Bhrd7zp: "figsok6",
|
|
26
|
+
Bg96gwp: "f1i3iumi",
|
|
27
|
+
mc9l5x: "f22iagw",
|
|
28
|
+
Beiy3e4: "f1vx9l62",
|
|
29
|
+
z8tnut: "f17mpqex",
|
|
30
|
+
z189sj: ["f1vdfbxk", "f1f5gg8d"],
|
|
31
|
+
Byoj8tv: "fdvome7",
|
|
32
|
+
uwmqm3: ["f1f5gg8d", "f1vdfbxk"],
|
|
33
|
+
qhf8xq: "f1euv43f",
|
|
34
|
+
fsow6f: "f17mccla",
|
|
35
|
+
Bhzewxz: "fr6rvge",
|
|
36
|
+
Bkfmm31: "f5q6cfr",
|
|
37
|
+
Bgh53k4: 0,
|
|
38
|
+
B2eet1l: 0,
|
|
39
|
+
De3pzq: 0,
|
|
40
|
+
Bcmaq0h: 0,
|
|
41
|
+
gk0gix: 0,
|
|
42
|
+
B20660r: 0,
|
|
43
|
+
B8a6bjv: 0,
|
|
44
|
+
Bpptf2m: 0,
|
|
45
|
+
e5kdtc: 0,
|
|
46
|
+
Bkjc3bi: 0,
|
|
47
|
+
ayd6f0: "fcm7iae",
|
|
48
|
+
Beyfa6y: 0,
|
|
49
|
+
Bbmb7ep: 0,
|
|
50
|
+
Btl43ni: 0,
|
|
51
|
+
B7oj6ja: 0,
|
|
52
|
+
Dimara: "fq9zq91",
|
|
53
|
+
Bkecrkj: "f1aehjj5",
|
|
54
|
+
sj55zd: "f19n0e5"
|
|
55
|
+
},
|
|
56
|
+
barLabel: {
|
|
57
|
+
Bahqtrf: "fk6fouc",
|
|
58
|
+
Be2twd7: "fy9rknc",
|
|
59
|
+
Bhrd7zp: "fl43uef",
|
|
60
|
+
Bg96gwp: "fwrc4pm",
|
|
61
|
+
Bkfmm31: "fhuob2q"
|
|
62
|
+
}
|
|
63
|
+
}, {
|
|
64
|
+
d: [".f158kwzp{cursor:default;}", ".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);}", ".f5q6cfr{fill:var(--colorNeutralBackground1);}", [".fcm7iae{background:var(--colorNeutralBackground1);}", {
|
|
65
|
+
p: -2
|
|
66
|
+
}], [".fq9zq91{border-radius:var(--borderRadiusSmall);}", {
|
|
67
|
+
p: -1
|
|
68
|
+
}], ".f1aehjj5{pointer-events:none;}", ".f19n0e5{color:var(--colorNeutralForeground1);}", ".fy9rknc{font-size:var(--fontSizeBase200);}", ".fl43uef{font-weight:var(--fontWeightSemibold);}", ".fwrc4pm{line-height:var(--lineHeightBase200);}", ".fhuob2q{fill:var(--colorNeutralForeground1);}"]
|
|
69
|
+
});
|
|
70
|
+
/**
|
|
71
|
+
* Apply styling to the GroupedVerticalBarChart slots based on the state
|
|
72
|
+
*/
|
|
73
|
+
export const useGroupedVerticalBarChartStyles_unstable = props => {
|
|
74
|
+
const baseStyles = useStyles();
|
|
75
|
+
return {
|
|
76
|
+
opacityChangeOnHover: mergeClasses(groupedVerticalBarChartClassNames.opacityChangeOnHover, baseStyles.opacityChangeOnHover /*props.styles?.opacityChangeOnHover*/),
|
|
77
|
+
tooltip: mergeClasses(groupedVerticalBarChartClassNames.tooltip, baseStyles.tooltip /*props.styles?.tooltip*/),
|
|
78
|
+
barLabel: mergeClasses(groupedVerticalBarChartClassNames.barLabel, baseStyles.barLabel /*props.styles?.barLabel*/)
|
|
79
|
+
};
|
|
80
|
+
};
|
|
81
|
+
//# sourceMappingURL=useGroupedVerticalBarChartStyles.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["__styles","mergeClasses","shorthands","tokens","typographyStyles","groupedVerticalBarChartClassNames","opacityChangeOnHover","tooltip","barLabel","root","xAxis","yAxis","legendContainer","hover","descriptionMessage","axisTitle","chartTitle","shapeStyles","chartWrapper","useStyles","Bceei9c","Bahqtrf","Be2twd7","Bhrd7zp","Bg96gwp","mc9l5x","Beiy3e4","z8tnut","z189sj","Byoj8tv","uwmqm3","qhf8xq","fsow6f","Bhzewxz","Bkfmm31","Bgh53k4","B2eet1l","De3pzq","Bcmaq0h","gk0gix","B20660r","B8a6bjv","Bpptf2m","e5kdtc","Bkjc3bi","ayd6f0","Beyfa6y","Bbmb7ep","Btl43ni","B7oj6ja","Dimara","Bkecrkj","sj55zd","d","p","useGroupedVerticalBarChartStyles_unstable","props","baseStyles"],"sources":["useGroupedVerticalBarChartStyles.styles.js"],"sourcesContent":["import { makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport { tokens, typographyStyles } from '@fluentui/react-theme';\nexport const groupedVerticalBarChartClassNames = {\n opacityChangeOnHover: 'fui-gvbc**opacityChangeOnHover',\n tooltip: 'fui-gvbc**tooltip',\n barLabel: 'fui-gvbc**barLabel',\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 cursor: 'default'\n },\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 fill: tokens.colorNeutralBackground1,\n background: tokens.colorNeutralBackground1,\n borderRadius: tokens.borderRadiusSmall,\n pointerEvents: 'none',\n color: tokens.colorNeutralForeground1\n },\n barLabel: {\n ...typographyStyles.caption1Strong,\n fill: tokens.colorNeutralForeground1\n }\n});\n/**\n * Apply styling to the GroupedVerticalBarChart slots based on the state\n */ export const useGroupedVerticalBarChartStyles_unstable = (props)=>{\n const baseStyles = useStyles();\n return {\n opacityChangeOnHover: mergeClasses(groupedVerticalBarChartClassNames.opacityChangeOnHover, baseStyles.opacityChangeOnHover /*props.styles?.opacityChangeOnHover*/ ),\n tooltip: mergeClasses(groupedVerticalBarChartClassNames.tooltip, baseStyles.tooltip /*props.styles?.tooltip*/ ),\n barLabel: mergeClasses(groupedVerticalBarChartClassNames.barLabel, baseStyles.barLabel /*props.styles?.barLabel*/ )\n };\n};\n"],"mappings":"AAAA,SAAAA,QAAA,EAAqBC,YAAY,EAAEC,UAAU,QAAQ,gBAAgB;AACrE,SAASC,MAAM,EAAEC,gBAAgB,QAAQ,uBAAuB;AAChE,OAAO,MAAMC,iCAAiC,GAAG;EAC7CC,oBAAoB,EAAE,gCAAgC;EACtDC,OAAO,EAAE,mBAAmB;EAC5BC,QAAQ,EAAE,oBAAoB;EAC9BC,IAAI,EAAE,EAAE;EACRC,KAAK,EAAE,EAAE;EACTC,KAAK,EAAE,EAAE;EACTC,eAAe,EAAE,EAAE;EACnBC,KAAK,EAAE,EAAE;EACTC,kBAAkB,EAAE,EAAE;EACtBC,SAAS,EAAE,EAAE;EACbC,UAAU,EAAE,EAAE;EACdC,WAAW,EAAE,EAAE;EACfC,YAAY,EAAE;AAClB,CAAC;AACD,MAAMC,SAAS,gBAAGnB,QAAA;EAAAM,oBAAA;IAAAc,OAAA;EAAA;EAAAb,OAAA;IAAAc,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,MAAA;EAAA;EAAA5C,QAAA;IAAAa,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAU,OAAA;EAAA;AAAA;EAAAmB,CAAA;IAAAC,CAAA;EAAA;IAAAA,CAAA;EAAA;AAAA,CAsBjB,CAAC;AACF;AACA;AACA;AAAI,OAAO,MAAMC,yCAAyC,GAAIC,KAAK,IAAG;EAClE,MAAMC,UAAU,GAAGtC,SAAS,CAAC,CAAC;EAC9B,OAAO;IACHb,oBAAoB,EAAEL,YAAY,CAACI,iCAAiC,CAACC,oBAAoB,EAAEmD,UAAU,CAACnD,oBAAoB,CAAC,sCAAuC,CAAC;IACnKC,OAAO,EAAEN,YAAY,CAACI,iCAAiC,CAACE,OAAO,EAAEkD,UAAU,CAAClD,OAAO,CAAC,yBAA0B,CAAC;IAC/GC,QAAQ,EAAEP,YAAY,CAACI,iCAAiC,CAACG,QAAQ,EAAEiD,UAAU,CAACjD,QAAQ,CAAC,0BAA2B;EACtH,CAAC;AACL,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,588 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { ChartTypes, convertToLocaleString, getAccessibleDataObject, getColorContrast, getTypeOfAxis, resolveCSSVariables, XAxisTypes, YAxisType } from '../../utilities/index';
|
|
3
|
+
import { CartesianChart } from '../CommonComponents/index';
|
|
4
|
+
import { useId } from '@fluentui/react-utilities';
|
|
5
|
+
import { tokens } from '@fluentui/react-theme';
|
|
6
|
+
import { useHeatMapChartStyles } from './useHeatMapChartStyles.styles';
|
|
7
|
+
import { Legends } from '../Legends/index';
|
|
8
|
+
import { scaleLinear as d3ScaleLinear } from 'd3-scale';
|
|
9
|
+
import { format as d3Format } from 'd3-format';
|
|
10
|
+
import { timeFormat as d3TimeFormat } from 'd3-time-format';
|
|
11
|
+
export const HeatMapChart = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
12
|
+
const classes = useHeatMapChartStyles(props);
|
|
13
|
+
const _stringXAxisDataPoints = React.useRef([]);
|
|
14
|
+
const _stringYAxisDataPoints = React.useRef([]);
|
|
15
|
+
const _dataSet = React.useRef({});
|
|
16
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
17
|
+
const _colorScale = React.useRef();
|
|
18
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
19
|
+
const _xAxisScale = React.useRef();
|
|
20
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
21
|
+
const _yAxisScale = React.useRef();
|
|
22
|
+
const _xAxisType = React.useRef();
|
|
23
|
+
const _yAxisType = React.useRef();
|
|
24
|
+
const _calloutAnchorPoint = React.useRef(null);
|
|
25
|
+
const _emptyChartId = useId('_HeatMap_empty');
|
|
26
|
+
const _margins = React.useRef({});
|
|
27
|
+
const cartesianChartRef = React.useRef(null);
|
|
28
|
+
const [selectedLegend, setSelectedLegend] = React.useState('');
|
|
29
|
+
const [activeLegend, setActiveLegend] = React.useState('');
|
|
30
|
+
const [isPopoverOpen, setPopoverOpen] = React.useState(false);
|
|
31
|
+
const [calloutLegend, setCalloutLegend] = React.useState('');
|
|
32
|
+
const [calloutTextColor, setCalloutTextColor] = React.useState('');
|
|
33
|
+
const [calloutYValue, setCalloutYValue] = React.useState('');
|
|
34
|
+
const [ratio, setRatio] = React.useState();
|
|
35
|
+
const [descriptionMessage, setDescriptionMessage] = React.useState('');
|
|
36
|
+
const [callOutAccessibilityData, setCallOutAccessibilityData] = React.useState();
|
|
37
|
+
const [clickPosition, setClickPosition] = React.useState({
|
|
38
|
+
x: 0,
|
|
39
|
+
y: 0
|
|
40
|
+
});
|
|
41
|
+
React.useImperativeHandle(props.componentRef, ()=>{
|
|
42
|
+
var _cartesianChartRef_current;
|
|
43
|
+
var _cartesianChartRef_current_chartContainer;
|
|
44
|
+
return {
|
|
45
|
+
chartContainer: (_cartesianChartRef_current_chartContainer = (_cartesianChartRef_current = cartesianChartRef.current) === null || _cartesianChartRef_current === void 0 ? void 0 : _cartesianChartRef_current.chartContainer) !== null && _cartesianChartRef_current_chartContainer !== void 0 ? _cartesianChartRef_current_chartContainer : null
|
|
46
|
+
};
|
|
47
|
+
}, []);
|
|
48
|
+
const _getXandY = ()=>{
|
|
49
|
+
let x = '';
|
|
50
|
+
let y = '';
|
|
51
|
+
props.data.forEach((item)=>{
|
|
52
|
+
if (item.data && item.data.length > 0) {
|
|
53
|
+
x = item.data[0].x;
|
|
54
|
+
y = item.data[0].y;
|
|
55
|
+
return {
|
|
56
|
+
x,
|
|
57
|
+
y
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
return {
|
|
62
|
+
x,
|
|
63
|
+
y
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
const _getMargins = (margins)=>{
|
|
67
|
+
_margins.current = margins;
|
|
68
|
+
};
|
|
69
|
+
const _getOpacity = (legendTitle)=>{
|
|
70
|
+
const opacity = _legendHighlighted(legendTitle) || _noLegendHighlighted() ? '1' : '0.1';
|
|
71
|
+
return opacity;
|
|
72
|
+
};
|
|
73
|
+
const _onRectFocus = (id, data, focusEvent)=>{
|
|
74
|
+
const boundingRect = focusEvent.currentTarget.getBoundingClientRect();
|
|
75
|
+
const clientX = boundingRect.left + boundingRect.width / 2;
|
|
76
|
+
const clientY = boundingRect.top + boundingRect.height / 2;
|
|
77
|
+
updatePosition(clientX, clientY);
|
|
78
|
+
/** Show the callout if highlighted rectangle is focused and Hide it if unhighlighted rectangle is focused */ setPopoverOpen(selectedLegend === '' || selectedLegend === data.legend);
|
|
79
|
+
setCalloutYValue(`${data.rectText}`);
|
|
80
|
+
setCalloutTextColor(Number.isNaN(data.value) ? tokens.colorNeutralForeground1 : _colorScale.current(data.value));
|
|
81
|
+
setCalloutLegend(data.legend);
|
|
82
|
+
setRatio(data.ratio);
|
|
83
|
+
setDescriptionMessage(data.descriptionMessage || '');
|
|
84
|
+
setCallOutAccessibilityData(data.callOutAccessibilityData);
|
|
85
|
+
};
|
|
86
|
+
const _onRectMouseOver = (id, data, mouseEvent)=>{
|
|
87
|
+
mouseEvent.persist();
|
|
88
|
+
if (_calloutAnchorPoint.current !== data) {
|
|
89
|
+
_calloutAnchorPoint.current = data;
|
|
90
|
+
updatePosition(mouseEvent.clientX, mouseEvent.clientY);
|
|
91
|
+
/** Show the callout if highlighted rectangle is hovered and Hide it if unhighlighted rectangle is hovered */ setPopoverOpen(selectedLegend === '' || selectedLegend === data.legend);
|
|
92
|
+
setCalloutYValue(`${data.rectText}`);
|
|
93
|
+
setCalloutTextColor(Number.isNaN(data.value) ? tokens.colorNeutralForeground1 : _colorScale.current(data.value));
|
|
94
|
+
setCalloutLegend(data.legend);
|
|
95
|
+
setRatio(data.ratio);
|
|
96
|
+
setDescriptionMessage(data.descriptionMessage || '');
|
|
97
|
+
setCallOutAccessibilityData(data.callOutAccessibilityData);
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
const _onRectBlurOrMouseOut = ()=>{
|
|
101
|
+
/**/ };
|
|
102
|
+
const _handleChartMouseLeave = ()=>{
|
|
103
|
+
_calloutAnchorPoint.current = null;
|
|
104
|
+
setPopoverOpen(false);
|
|
105
|
+
};
|
|
106
|
+
const _getInvertedTextColor = (color)=>{
|
|
107
|
+
return color === tokens.colorNeutralForeground1 ? tokens.colorNeutralBackground1 : tokens.colorNeutralForeground1;
|
|
108
|
+
};
|
|
109
|
+
/**
|
|
110
|
+
* This is the function which is responsible for
|
|
111
|
+
* drawing the rectangle in the graph and also
|
|
112
|
+
* attaching dom events to that rectangles
|
|
113
|
+
*/ const _createRectangles = ()=>{
|
|
114
|
+
const rectangles = [];
|
|
115
|
+
const yAxisDataPoints = _stringYAxisDataPoints.current.slice().reverse();
|
|
116
|
+
/**
|
|
117
|
+
* yAxisDataPoint is noting but the DataPoint
|
|
118
|
+
* which will be rendered on the y-axis
|
|
119
|
+
*/ yAxisDataPoints.forEach((yAxisDataPoint)=>{
|
|
120
|
+
let index = 0;
|
|
121
|
+
_stringXAxisDataPoints.current.forEach((xAxisDataPoint)=>{
|
|
122
|
+
var _dataSet_current_yAxisDataPoint_index, _dataSet_current_yAxisDataPoint_index1;
|
|
123
|
+
let rectElement;
|
|
124
|
+
const id = `x${xAxisDataPoint}y${yAxisDataPoint}`;
|
|
125
|
+
if (((_dataSet_current_yAxisDataPoint_index = _dataSet.current[yAxisDataPoint][index]) === null || _dataSet_current_yAxisDataPoint_index === void 0 ? void 0 : _dataSet_current_yAxisDataPoint_index.x) === xAxisDataPoint && typeof ((_dataSet_current_yAxisDataPoint_index1 = _dataSet.current[yAxisDataPoint][index]) === null || _dataSet_current_yAxisDataPoint_index1 === void 0 ? void 0 : _dataSet_current_yAxisDataPoint_index1.value) === 'number') {
|
|
126
|
+
var _cartesianChartRef_current;
|
|
127
|
+
/**
|
|
128
|
+
* dataPointObject is an object where it contains information on single
|
|
129
|
+
* data point such as x, y , value, rectText property of the rectangle
|
|
130
|
+
*/ const dataPointObject = _dataSet.current[yAxisDataPoint][index];
|
|
131
|
+
let styleRules = '';
|
|
132
|
+
let foregroundColor = tokens.colorNeutralForeground1;
|
|
133
|
+
if ((_cartesianChartRef_current = cartesianChartRef.current) === null || _cartesianChartRef_current === void 0 ? void 0 : _cartesianChartRef_current.chartContainer) {
|
|
134
|
+
styleRules = resolveCSSVariables(cartesianChartRef.current.chartContainer, foregroundColor);
|
|
135
|
+
}
|
|
136
|
+
const contrastRatio = getColorContrast(styleRules, _colorScale.current(dataPointObject.value));
|
|
137
|
+
if (contrastRatio < 3) {
|
|
138
|
+
foregroundColor = _getInvertedTextColor(foregroundColor);
|
|
139
|
+
}
|
|
140
|
+
rectElement = /*#__PURE__*/ React.createElement("g", {
|
|
141
|
+
key: id,
|
|
142
|
+
role: "img",
|
|
143
|
+
"aria-label": _getAriaLabel(dataPointObject),
|
|
144
|
+
tabIndex: _legendHighlighted(dataPointObject.legend) || _noLegendHighlighted() ? 0 : -1,
|
|
145
|
+
fillOpacity: _getOpacity(dataPointObject.legend),
|
|
146
|
+
transform: `translate(${_xAxisScale.current(dataPointObject.x)}, ${_yAxisScale.current(dataPointObject.y)})`,
|
|
147
|
+
onFocus: (e)=>_onRectFocus(id, dataPointObject, e),
|
|
148
|
+
onBlur: _onRectBlurOrMouseOut,
|
|
149
|
+
onMouseOver: (e)=>_onRectMouseOver(id, dataPointObject, e),
|
|
150
|
+
onMouseOut: _onRectBlurOrMouseOut
|
|
151
|
+
}, /*#__PURE__*/ React.createElement("rect", {
|
|
152
|
+
fill: _colorScale.current(dataPointObject.value),
|
|
153
|
+
width: _xAxisScale.current.bandwidth(),
|
|
154
|
+
height: _yAxisScale.current.bandwidth(),
|
|
155
|
+
onClick: dataPointObject.onClick
|
|
156
|
+
}), /*#__PURE__*/ React.createElement("text", {
|
|
157
|
+
dominantBaseline: 'middle',
|
|
158
|
+
textAnchor: 'middle',
|
|
159
|
+
className: classes.text,
|
|
160
|
+
transform: `translate(${_xAxisScale.current.bandwidth() / 2}, ${_yAxisScale.current.bandwidth() / 2})`,
|
|
161
|
+
fill: foregroundColor
|
|
162
|
+
}, convertToLocaleString(dataPointObject.rectText, props.culture)));
|
|
163
|
+
index++;
|
|
164
|
+
} else {
|
|
165
|
+
const dataPointObject = {
|
|
166
|
+
x: xAxisDataPoint,
|
|
167
|
+
y: yAxisDataPoint,
|
|
168
|
+
value: NaN,
|
|
169
|
+
rectText: 'No data available',
|
|
170
|
+
legend: ''
|
|
171
|
+
};
|
|
172
|
+
rectElement = /*#__PURE__*/ React.createElement("g", {
|
|
173
|
+
key: id,
|
|
174
|
+
role: "img",
|
|
175
|
+
"aria-label": _getAriaLabel(dataPointObject),
|
|
176
|
+
tabIndex: _noLegendHighlighted() ? 0 : -1,
|
|
177
|
+
transform: `translate(${_xAxisScale.current(dataPointObject.x)}, ${_yAxisScale.current(dataPointObject.y)})`,
|
|
178
|
+
onFocus: (e)=>_onRectFocus(id, dataPointObject, e),
|
|
179
|
+
onBlur: _onRectBlurOrMouseOut,
|
|
180
|
+
onMouseOver: (e)=>_onRectMouseOver(id, dataPointObject, e),
|
|
181
|
+
onMouseOut: _onRectBlurOrMouseOut
|
|
182
|
+
}, /*#__PURE__*/ React.createElement("rect", {
|
|
183
|
+
fill: "transparent",
|
|
184
|
+
width: _xAxisScale.current.bandwidth(),
|
|
185
|
+
height: _yAxisScale.current.bandwidth()
|
|
186
|
+
}));
|
|
187
|
+
}
|
|
188
|
+
rectangles.push(rectElement);
|
|
189
|
+
});
|
|
190
|
+
});
|
|
191
|
+
return rectangles;
|
|
192
|
+
};
|
|
193
|
+
/**
|
|
194
|
+
* when the legend is hovered we need to highlight
|
|
195
|
+
* all the rectangles which fall under that category
|
|
196
|
+
* and un-highlight the rest of them
|
|
197
|
+
* @param legendTitle
|
|
198
|
+
*/ const _onLegendHover = (legendTitle)=>{
|
|
199
|
+
setActiveLegend(legendTitle);
|
|
200
|
+
};
|
|
201
|
+
/**
|
|
202
|
+
* when the mouse is out from the legend , we need
|
|
203
|
+
* to show the graph in initial mode.
|
|
204
|
+
*/ const _onLegendLeave = ()=>{
|
|
205
|
+
setActiveLegend('');
|
|
206
|
+
};
|
|
207
|
+
/**
|
|
208
|
+
* @param legendTitle
|
|
209
|
+
* when the legend is clicked we need to highlight
|
|
210
|
+
* all the rectangles which fall under that category
|
|
211
|
+
* and un highlight the rest of them
|
|
212
|
+
*/ const _onLegendClick = (legendTitle)=>{
|
|
213
|
+
/**
|
|
214
|
+
* check if the legend is already selceted,
|
|
215
|
+
* if yes, un-select the legend, else
|
|
216
|
+
* set the selected legend state to legendTitle
|
|
217
|
+
*/ if (selectedLegend === legendTitle) {
|
|
218
|
+
setSelectedLegend('');
|
|
219
|
+
} else {
|
|
220
|
+
setSelectedLegend(legendTitle);
|
|
221
|
+
}
|
|
222
|
+
};
|
|
223
|
+
const _createLegendBars = ()=>{
|
|
224
|
+
const { data, legendProps } = props;
|
|
225
|
+
const legends = [];
|
|
226
|
+
data.forEach((item)=>{
|
|
227
|
+
const legend = {
|
|
228
|
+
title: item.legend,
|
|
229
|
+
color: _colorScale.current(item.value),
|
|
230
|
+
action: ()=>{
|
|
231
|
+
_onLegendClick(item.legend);
|
|
232
|
+
},
|
|
233
|
+
hoverAction: ()=>{
|
|
234
|
+
_handleChartMouseLeave();
|
|
235
|
+
_onLegendHover(item.legend);
|
|
236
|
+
},
|
|
237
|
+
onMouseOutAction: ()=>{
|
|
238
|
+
_onLegendLeave();
|
|
239
|
+
}
|
|
240
|
+
};
|
|
241
|
+
legends.push(legend);
|
|
242
|
+
});
|
|
243
|
+
return /*#__PURE__*/ React.createElement(Legends, {
|
|
244
|
+
...legendProps,
|
|
245
|
+
legends: legends
|
|
246
|
+
});
|
|
247
|
+
};
|
|
248
|
+
const _getColorScale = ()=>{
|
|
249
|
+
const { domainValuesForColorScale, rangeValuesForColorScale } = props;
|
|
250
|
+
return d3ScaleLinear().domain(domainValuesForColorScale).range(rangeValuesForColorScale);
|
|
251
|
+
};
|
|
252
|
+
const _getXIndex = (value)=>{
|
|
253
|
+
if (_xAxisType.current === XAxisTypes.DateAxis) {
|
|
254
|
+
return `${value.getTime()}`;
|
|
255
|
+
} else if (_xAxisType.current === XAxisTypes.StringAxis) {
|
|
256
|
+
return value;
|
|
257
|
+
} else if (_xAxisType.current === XAxisTypes.NumericAxis) {
|
|
258
|
+
return `${value}`;
|
|
259
|
+
} else {
|
|
260
|
+
return '';
|
|
261
|
+
}
|
|
262
|
+
};
|
|
263
|
+
const _getYIndex = (value)=>{
|
|
264
|
+
if (_yAxisType.current === YAxisType.DateAxis) {
|
|
265
|
+
return `${value.getTime()}`;
|
|
266
|
+
} else if (_yAxisType.current === YAxisType.StringAxis) {
|
|
267
|
+
return value;
|
|
268
|
+
} else if (_yAxisType.current === YAxisType.NumericAxis) {
|
|
269
|
+
return `${value}`;
|
|
270
|
+
} else {
|
|
271
|
+
return '';
|
|
272
|
+
}
|
|
273
|
+
};
|
|
274
|
+
const { xAxisStringFormatter } = props;
|
|
275
|
+
const _getFormattedLabelForXAxisDataPoint = React.useCallback((point)=>{
|
|
276
|
+
return xAxisStringFormatter ? xAxisStringFormatter(point) : point;
|
|
277
|
+
}, [
|
|
278
|
+
xAxisStringFormatter
|
|
279
|
+
]);
|
|
280
|
+
const { yAxisStringFormatter } = props;
|
|
281
|
+
const _getFormattedLabelForYAxisDataPoint = React.useCallback((point)=>{
|
|
282
|
+
return yAxisStringFormatter ? yAxisStringFormatter(point) : point;
|
|
283
|
+
}, [
|
|
284
|
+
yAxisStringFormatter
|
|
285
|
+
]);
|
|
286
|
+
/**
|
|
287
|
+
* This function will return the final sorted and formatted x-axis points
|
|
288
|
+
* which will be rendered on the x-axis
|
|
289
|
+
* @param points
|
|
290
|
+
* @returns x-axis points
|
|
291
|
+
*/ const _getXAxisDataPoints = React.useCallback((points)=>{
|
|
292
|
+
let xAxisPoints = [];
|
|
293
|
+
const unFormattedXAxisDataPoints = Object.keys(points).sort((a, b)=>{
|
|
294
|
+
if (_xAxisType.current === XAxisTypes.DateAxis || _xAxisType.current === XAxisTypes.NumericAxis) {
|
|
295
|
+
return +a - +b;
|
|
296
|
+
} else {
|
|
297
|
+
return props.sortOrder === 'none' ? 0 : a.toLowerCase() > b.toLowerCase() ? 1 : -1;
|
|
298
|
+
}
|
|
299
|
+
});
|
|
300
|
+
xAxisPoints = unFormattedXAxisDataPoints.map((xPoint)=>{
|
|
301
|
+
if (_xAxisType.current === XAxisTypes.DateAxis) {
|
|
302
|
+
return _getStringFormattedDate(xPoint, props.xAxisDateFormatString);
|
|
303
|
+
} else if (_xAxisType.current === XAxisTypes.NumericAxis) {
|
|
304
|
+
return _getStringFormattedNumber(xPoint, props.xAxisNumberFormatString);
|
|
305
|
+
} else {
|
|
306
|
+
return _getFormattedLabelForXAxisDataPoint(xPoint);
|
|
307
|
+
}
|
|
308
|
+
});
|
|
309
|
+
return xAxisPoints;
|
|
310
|
+
}, [
|
|
311
|
+
_getFormattedLabelForXAxisDataPoint,
|
|
312
|
+
props.sortOrder,
|
|
313
|
+
props.xAxisDateFormatString,
|
|
314
|
+
props.xAxisNumberFormatString
|
|
315
|
+
]);
|
|
316
|
+
/**
|
|
317
|
+
* This function will return the final sorted and formatted y-axis points
|
|
318
|
+
* which will be rendered on the y-axis
|
|
319
|
+
* @param points
|
|
320
|
+
* @returns yaxis points
|
|
321
|
+
*/ const _getYAxisDataPoints = React.useCallback((points)=>{
|
|
322
|
+
let yAxisPoints = [];
|
|
323
|
+
const unFormattedYAxisDataPoints = Object.keys(points).sort((a, b)=>{
|
|
324
|
+
if (_yAxisType.current === YAxisType.DateAxis || _yAxisType.current === YAxisType.NumericAxis) {
|
|
325
|
+
return +a - +b;
|
|
326
|
+
} else {
|
|
327
|
+
return props.sortOrder === 'none' ? 0 : a.toLowerCase() > b.toLowerCase() ? 1 : -1;
|
|
328
|
+
}
|
|
329
|
+
});
|
|
330
|
+
yAxisPoints = unFormattedYAxisDataPoints.map((yPoint)=>{
|
|
331
|
+
if (_yAxisType.current === YAxisType.DateAxis) {
|
|
332
|
+
return _getStringFormattedDate(yPoint, props.yAxisDateFormatString);
|
|
333
|
+
} else if (_yAxisType.current === YAxisType.NumericAxis) {
|
|
334
|
+
return _getStringFormattedNumber(yPoint, props.yAxisNumberFormatString);
|
|
335
|
+
} else {
|
|
336
|
+
return _getFormattedLabelForYAxisDataPoint(yPoint);
|
|
337
|
+
}
|
|
338
|
+
});
|
|
339
|
+
return yAxisPoints;
|
|
340
|
+
}, [
|
|
341
|
+
_getFormattedLabelForYAxisDataPoint,
|
|
342
|
+
props.sortOrder,
|
|
343
|
+
props.yAxisDateFormatString,
|
|
344
|
+
props.yAxisNumberFormatString
|
|
345
|
+
]);
|
|
346
|
+
/**
|
|
347
|
+
* This will create a new data set based on the prop
|
|
348
|
+
* @data
|
|
349
|
+
* We will be using This data set to contsruct our rectangles
|
|
350
|
+
* in the chart, we use this data set becuase, when we loop in this
|
|
351
|
+
* data and build the heat map, it will support accessibility as
|
|
352
|
+
* specified in the figma
|
|
353
|
+
*/ const _createNewDataSet = React.useCallback((data, xAxisDateFormatString, xAxisNumberFormatString, yAxisDateFormatString, yAxisNumberFormatString)=>{
|
|
354
|
+
/**
|
|
355
|
+
* please do not destructure any of the props here,
|
|
356
|
+
* instead send them as parameter to this functions so that
|
|
357
|
+
* this functions get called whenever the prop changes
|
|
358
|
+
*/ const flattenData = [];
|
|
359
|
+
/**
|
|
360
|
+
* below for each loop will store all the datapoints in the one array.
|
|
361
|
+
* basically it will flatten the nestesd array (data prop) into single array
|
|
362
|
+
* of object. where each object contains x, y, rectText , value and legend propety of single
|
|
363
|
+
* data point.
|
|
364
|
+
*/ data.forEach((item)=>{
|
|
365
|
+
item.data.forEach((point)=>{
|
|
366
|
+
flattenData.push({
|
|
367
|
+
...point,
|
|
368
|
+
legend: item.legend
|
|
369
|
+
});
|
|
370
|
+
});
|
|
371
|
+
});
|
|
372
|
+
const yPoints = {};
|
|
373
|
+
const uniqueYPoints = {};
|
|
374
|
+
const uniqueXPoints = {};
|
|
375
|
+
flattenData.forEach((item)=>{
|
|
376
|
+
const posX = _getXIndex(item.x);
|
|
377
|
+
const posY = _getYIndex(item.y);
|
|
378
|
+
uniqueXPoints[posX] = '1';
|
|
379
|
+
uniqueYPoints[posY] = '1';
|
|
380
|
+
/** we will check if the property(posY) is already there in object, if Yes,
|
|
381
|
+
* then we will append the item in the Array related to the pos, if not
|
|
382
|
+
* then we will simply append the item in the new Array and
|
|
383
|
+
* assign that array to the property (posY) in the Object
|
|
384
|
+
* and finally we will get the array of Objects associated to each
|
|
385
|
+
* property (which is nothing but y data point) and object in the
|
|
386
|
+
* array are noting but x data points associated to the property y
|
|
387
|
+
*/ if (yPoints[posY]) {
|
|
388
|
+
yPoints[posY] = [
|
|
389
|
+
...yPoints[posY],
|
|
390
|
+
item
|
|
391
|
+
];
|
|
392
|
+
} else {
|
|
393
|
+
yPoints[posY] = [
|
|
394
|
+
item
|
|
395
|
+
];
|
|
396
|
+
}
|
|
397
|
+
});
|
|
398
|
+
/**
|
|
399
|
+
* we will now sort(ascending) the array's of y data point based on the x value
|
|
400
|
+
* sorting is important to achive the accessibility order of the
|
|
401
|
+
* rectangles and then format the x and y datapoints respectively
|
|
402
|
+
*/ Object.keys(yPoints).forEach((item)=>{
|
|
403
|
+
yPoints[item].sort((a, b)=>{
|
|
404
|
+
if (_xAxisType.current === XAxisTypes.StringAxis) {
|
|
405
|
+
return props.sortOrder === 'none' ? 0 : a.x.toLowerCase() > b.x.toLowerCase() ? 1 : -1;
|
|
406
|
+
} else if (_xAxisType.current === XAxisTypes.DateAxis) {
|
|
407
|
+
return a.x.getTime() - b.x.getTime();
|
|
408
|
+
} else if (_xAxisType.current === XAxisTypes.NumericAxis) {
|
|
409
|
+
return +a.x > +b.x ? 1 : -1;
|
|
410
|
+
} else {
|
|
411
|
+
return a.x > b.x ? 1 : -1;
|
|
412
|
+
}
|
|
413
|
+
}).forEach((datapoint)=>{
|
|
414
|
+
if (_xAxisType.current === XAxisTypes.DateAxis) {
|
|
415
|
+
datapoint.x = _getStringFormattedDate(datapoint.x, xAxisDateFormatString);
|
|
416
|
+
}
|
|
417
|
+
if (_xAxisType.current === XAxisTypes.NumericAxis) {
|
|
418
|
+
datapoint.x = _getStringFormattedNumber(datapoint.x, xAxisNumberFormatString);
|
|
419
|
+
}
|
|
420
|
+
if (_xAxisType.current === XAxisTypes.StringAxis) {
|
|
421
|
+
datapoint.x = _getFormattedLabelForXAxisDataPoint(datapoint.x);
|
|
422
|
+
}
|
|
423
|
+
if (_yAxisType.current === YAxisType.DateAxis) {
|
|
424
|
+
datapoint.y = _getStringFormattedDate(datapoint.y, yAxisDateFormatString);
|
|
425
|
+
}
|
|
426
|
+
if (_yAxisType.current === YAxisType.NumericAxis) {
|
|
427
|
+
datapoint.y = _getStringFormattedNumber(datapoint.y, yAxisNumberFormatString);
|
|
428
|
+
}
|
|
429
|
+
if (_yAxisType.current === YAxisType.StringAxis) {
|
|
430
|
+
datapoint.y = _getFormattedLabelForYAxisDataPoint(datapoint.y);
|
|
431
|
+
}
|
|
432
|
+
});
|
|
433
|
+
});
|
|
434
|
+
/**
|
|
435
|
+
* if y-axis data points are of type date or number or if we have string formatter,
|
|
436
|
+
* then we need to change data points to their respective string
|
|
437
|
+
* format, becuase in the private variable this._stringYAxisDatapoints, points will be stored in
|
|
438
|
+
* string format. and in here `yPoint` are not so we need to change, so that
|
|
439
|
+
* function `this._createRectangles` should work perfetcly while looping, and if we don't change
|
|
440
|
+
* then `this._createRectangles` will fail while looping, causing the error
|
|
441
|
+
* Cannot read property 'forEach' of undefined
|
|
442
|
+
*/ Object.keys(yPoints).forEach((yPoint)=>{
|
|
443
|
+
if (_yAxisType.current === YAxisType.DateAxis) {
|
|
444
|
+
yPoints[_getStringFormattedDate(yPoint, yAxisDateFormatString)] = yPoints[yPoint];
|
|
445
|
+
} else if (_yAxisType.current === YAxisType.NumericAxis) {
|
|
446
|
+
yPoints[`${_getStringFormattedNumber(yPoint, yAxisNumberFormatString)}`] = yPoints[yPoint];
|
|
447
|
+
} else {
|
|
448
|
+
yPoints[_getFormattedLabelForYAxisDataPoint(yPoint)] = yPoints[yPoint];
|
|
449
|
+
}
|
|
450
|
+
});
|
|
451
|
+
/**
|
|
452
|
+
* assigning new data set
|
|
453
|
+
*/ const dataSet = yPoints;
|
|
454
|
+
/**
|
|
455
|
+
* These are the Y axis data points which will get rendered in the
|
|
456
|
+
* Y axis in graph
|
|
457
|
+
*/ const yAxisPoints = _getYAxisDataPoints(uniqueYPoints);
|
|
458
|
+
/**
|
|
459
|
+
* These are the x axis data points which will get rendered in the
|
|
460
|
+
* x axis in the graph
|
|
461
|
+
*/ const xAxisPoints = _getXAxisDataPoints(uniqueXPoints);
|
|
462
|
+
return {
|
|
463
|
+
dataSet,
|
|
464
|
+
yAxisPoints,
|
|
465
|
+
xAxisPoints
|
|
466
|
+
};
|
|
467
|
+
}, [
|
|
468
|
+
_getFormattedLabelForXAxisDataPoint,
|
|
469
|
+
_getFormattedLabelForYAxisDataPoint,
|
|
470
|
+
_getXAxisDataPoints,
|
|
471
|
+
_getYAxisDataPoints,
|
|
472
|
+
props.sortOrder
|
|
473
|
+
]);
|
|
474
|
+
const _getStringFormattedDate = (point, formatString)=>{
|
|
475
|
+
const date = new Date();
|
|
476
|
+
date.setTime(+point);
|
|
477
|
+
return d3TimeFormat(formatString || '%b/%d')(date);
|
|
478
|
+
};
|
|
479
|
+
const _getStringFormattedNumber = (point, formatString)=>{
|
|
480
|
+
return d3Format(formatString || '.2~s')(+point);
|
|
481
|
+
};
|
|
482
|
+
/**
|
|
483
|
+
* This function checks if the given legend is highlighted or not.
|
|
484
|
+
* A legend can be highlighted in 2 ways:
|
|
485
|
+
* 1. selection: if the user clicks on it
|
|
486
|
+
* 2. hovering: if there is no selected legend and the user hovers over it
|
|
487
|
+
*/ const _legendHighlighted = (legendTitle)=>{
|
|
488
|
+
return selectedLegend === legendTitle || selectedLegend === '' && activeLegend === legendTitle;
|
|
489
|
+
};
|
|
490
|
+
/**
|
|
491
|
+
* This function checks if none of the legends is selected or hovered.
|
|
492
|
+
*/ const _noLegendHighlighted = ()=>{
|
|
493
|
+
return selectedLegend === '' && activeLegend === '';
|
|
494
|
+
};
|
|
495
|
+
const _getAriaLabel = (point)=>{
|
|
496
|
+
var _point_callOutAccessibilityData;
|
|
497
|
+
const xValue = point.x;
|
|
498
|
+
const yValue = point.y;
|
|
499
|
+
const legend = point.legend;
|
|
500
|
+
const zValue = point.ratio ? `${point.ratio[0]}/${point.ratio[1]}` : point.rectText || point.value;
|
|
501
|
+
const description = point.descriptionMessage;
|
|
502
|
+
return ((_point_callOutAccessibilityData = point.callOutAccessibilityData) === null || _point_callOutAccessibilityData === void 0 ? void 0 : _point_callOutAccessibilityData.ariaLabel) || `${xValue}, ${yValue}. ${legend}, ${zValue}.` + (description ? ` ${description}.` : '');
|
|
503
|
+
};
|
|
504
|
+
const _isChartEmpty = ()=>{
|
|
505
|
+
return !(props.data && props.data.length > 0);
|
|
506
|
+
};
|
|
507
|
+
const _getChartTitle = ()=>{
|
|
508
|
+
const { chartTitle } = props;
|
|
509
|
+
const numDataPoints = props.data.reduce((acc, curr)=>acc + curr.data.length, 0);
|
|
510
|
+
return (chartTitle ? `${chartTitle}. ` : '') + `Heat map chart with ${numDataPoints} data points. `;
|
|
511
|
+
};
|
|
512
|
+
const updatePosition = (newX, newY)=>{
|
|
513
|
+
const threshold = 1; // Set a threshold for movement
|
|
514
|
+
const { x, y } = clickPosition;
|
|
515
|
+
// Calculate the distance moved
|
|
516
|
+
const distance = Math.sqrt(Math.pow(newX - x, 2) + Math.pow(newY - y, 2));
|
|
517
|
+
// Update the position only if the distance moved is greater than the threshold
|
|
518
|
+
if (distance > threshold) {
|
|
519
|
+
setClickPosition({
|
|
520
|
+
x: newX,
|
|
521
|
+
y: newY
|
|
522
|
+
});
|
|
523
|
+
}
|
|
524
|
+
};
|
|
525
|
+
const { x, y } = _getXandY();
|
|
526
|
+
_xAxisType.current = getTypeOfAxis(x, true);
|
|
527
|
+
_yAxisType.current = getTypeOfAxis(y, false);
|
|
528
|
+
const { data, xAxisDateFormatString, xAxisNumberFormatString, yAxisDateFormatString, yAxisNumberFormatString } = props;
|
|
529
|
+
_colorScale.current = _getColorScale();
|
|
530
|
+
const { dataSet, xAxisPoints, yAxisPoints } = React.useMemo(()=>_createNewDataSet(data, xAxisDateFormatString, xAxisNumberFormatString, yAxisDateFormatString, yAxisNumberFormatString), [
|
|
531
|
+
_createNewDataSet,
|
|
532
|
+
data,
|
|
533
|
+
xAxisDateFormatString,
|
|
534
|
+
xAxisNumberFormatString,
|
|
535
|
+
yAxisDateFormatString,
|
|
536
|
+
yAxisNumberFormatString
|
|
537
|
+
]);
|
|
538
|
+
_dataSet.current = dataSet;
|
|
539
|
+
_stringYAxisDataPoints.current = yAxisPoints;
|
|
540
|
+
_stringXAxisDataPoints.current = xAxisPoints;
|
|
541
|
+
const calloutProps = {
|
|
542
|
+
...props.calloutProps,
|
|
543
|
+
isPopoverOpen,
|
|
544
|
+
YValue: calloutYValue,
|
|
545
|
+
legend: calloutLegend,
|
|
546
|
+
color: calloutTextColor,
|
|
547
|
+
ratio,
|
|
548
|
+
descriptionMessage,
|
|
549
|
+
clickPosition,
|
|
550
|
+
...getAccessibleDataObject(callOutAccessibilityData, 'text', false)
|
|
551
|
+
};
|
|
552
|
+
const tickParams = {
|
|
553
|
+
tickValues: props.tickValues,
|
|
554
|
+
tickFormat: props.tickFormat
|
|
555
|
+
};
|
|
556
|
+
return !_isChartEmpty() ? /*#__PURE__*/ React.createElement(CartesianChart, {
|
|
557
|
+
...props,
|
|
558
|
+
chartTitle: _getChartTitle(),
|
|
559
|
+
points: data,
|
|
560
|
+
chartType: ChartTypes.HeatMapChart,
|
|
561
|
+
xAxisType: XAxisTypes.StringAxis,
|
|
562
|
+
yAxisType: YAxisType.StringAxis,
|
|
563
|
+
calloutProps: calloutProps,
|
|
564
|
+
datasetForXAxisDomain: _stringXAxisDataPoints.current,
|
|
565
|
+
stringDatasetForYAxisDomain: _stringYAxisDataPoints.current,
|
|
566
|
+
getmargins: _getMargins,
|
|
567
|
+
xAxisTickCount: _stringXAxisDataPoints.current.length,
|
|
568
|
+
xAxistickSize: 0,
|
|
569
|
+
xAxisPadding: 0.02,
|
|
570
|
+
yAxisPadding: 0.02,
|
|
571
|
+
legendBars: _createLegendBars(),
|
|
572
|
+
onChartMouseLeave: _handleChartMouseLeave,
|
|
573
|
+
componentRef: cartesianChartRef,
|
|
574
|
+
tickParams: tickParams,
|
|
575
|
+
/* eslint-disable react/jsx-no-bind */ children: (p)=>{
|
|
576
|
+
_xAxisScale.current = p.xScale;
|
|
577
|
+
_yAxisScale.current = p.yScale;
|
|
578
|
+
return _createRectangles();
|
|
579
|
+
}
|
|
580
|
+
}) : /*#__PURE__*/ React.createElement("div", {
|
|
581
|
+
id: _emptyChartId,
|
|
582
|
+
role: 'alert',
|
|
583
|
+
style: {
|
|
584
|
+
opacity: '0'
|
|
585
|
+
},
|
|
586
|
+
"aria-label": 'Graph has no data to display'
|
|
587
|
+
});
|
|
588
|
+
});
|