@fluentui/react-charts 0.0.0-nightly-20250728-0406.1 → 0.0.0-nightly-20250730-0406.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 +34 -15
- package/dist/index.d.ts +198 -10
- package/lib/AreaChart.js.map +1 -1
- package/lib/CartesianChart.js.map +1 -1
- package/lib/DeclarativeChart.js.map +1 -1
- package/lib/DonutChart.js.map +1 -1
- package/lib/FunnelChart.js.map +1 -1
- package/lib/GanttChart.js +1 -0
- package/lib/GanttChart.js.map +1 -0
- package/lib/GaugeChart.js.map +1 -1
- package/lib/GroupedVerticalBarChart.js.map +1 -1
- package/lib/HeatMapChart.js.map +1 -1
- package/lib/HorizontalBarChart.js.map +1 -1
- package/lib/HorizontalBarChartWithAxis.js.map +1 -1
- package/lib/Legends.js.map +1 -1
- package/lib/LineChart.js.map +1 -1
- package/lib/Popover.js.map +1 -1
- package/lib/ResponsiveContainer.js.map +1 -1
- package/lib/SankeyChart.js.map +1 -1
- package/lib/ScatterChart.js.map +1 -1
- package/lib/Sparkline.js.map +1 -1
- package/lib/VerticalBarChart.js.map +1 -1
- package/lib/VerticalStackedBarChart.js.map +1 -1
- package/lib/components/AreaChart/AreaChart.js +3 -3
- package/lib/components/AreaChart/AreaChart.js.map +1 -1
- package/lib/components/AreaChart/AreaChart.types.js.map +1 -1
- package/lib/components/AreaChart/index.js.map +1 -1
- package/lib/components/AreaChart/useAreaChartStyles.styles.js +1 -2
- package/lib/components/AreaChart/useAreaChartStyles.styles.raw.js +41 -0
- package/lib/components/AreaChart/useAreaChartStyles.styles.raw.js.map +1 -0
- package/lib/components/CommonComponents/CartesianChart.js +12 -8
- 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.map +1 -1
- package/lib/components/CommonComponents/ChartPopover.types.js.map +1 -1
- package/lib/components/CommonComponents/index.js.map +1 -1
- package/lib/components/CommonComponents/useCartesianChartStyles.styles.js +1 -2
- package/lib/components/CommonComponents/useCartesianChartStyles.styles.raw.js +128 -0
- package/lib/components/CommonComponents/useCartesianChartStyles.styles.raw.js.map +1 -0
- package/lib/components/CommonComponents/useChartPopoverStyles.styles.js +1 -2
- package/lib/components/CommonComponents/useChartPopoverStyles.styles.raw.js +126 -0
- package/lib/components/CommonComponents/useChartPopoverStyles.styles.raw.js.map +1 -0
- package/lib/components/DeclarativeChart/DeclarativeChart.js +6 -1
- package/lib/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
- package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js +44 -13
- package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
- package/lib/components/DeclarativeChart/imageExporter.js +1 -0
- package/lib/components/DeclarativeChart/imageExporter.js.map +1 -1
- package/lib/components/DeclarativeChart/index.js.map +1 -1
- package/lib/components/DonutChart/Arc/Arc.js.map +1 -1
- package/lib/components/DonutChart/Arc/Arc.types.js.map +1 -1
- package/lib/components/DonutChart/Arc/index.js.map +1 -1
- package/lib/components/DonutChart/Arc/useArcStyles.styles.js +1 -2
- package/lib/components/DonutChart/Arc/useArcStyles.styles.raw.js +44 -0
- package/lib/components/DonutChart/Arc/useArcStyles.styles.raw.js.map +1 -0
- package/lib/components/DonutChart/DonutChart.js.map +1 -1
- package/lib/components/DonutChart/DonutChart.types.js.map +1 -1
- package/lib/components/DonutChart/Pie/Pie.js.map +1 -1
- package/lib/components/DonutChart/Pie/Pie.types.js.map +1 -1
- package/lib/components/DonutChart/Pie/index.js.map +1 -1
- package/lib/components/DonutChart/Pie/usePieStyles.styles.js +1 -2
- package/lib/components/DonutChart/Pie/usePieStyles.styles.raw.js +29 -0
- package/lib/components/DonutChart/Pie/usePieStyles.styles.raw.js.map +1 -0
- package/lib/components/DonutChart/index.js.map +1 -1
- package/lib/components/DonutChart/useDonutChartStyles.styles.js +1 -2
- package/lib/components/DonutChart/useDonutChartStyles.styles.raw.js +45 -0
- package/lib/components/DonutChart/useDonutChartStyles.styles.raw.js.map +1 -0
- package/lib/components/FunnelChart/FunnelChart.js.map +1 -1
- package/lib/components/FunnelChart/FunnelChart.types.js.map +1 -1
- package/lib/components/FunnelChart/funnelGeometry.js.map +1 -1
- package/lib/components/FunnelChart/index.js.map +1 -1
- package/lib/components/FunnelChart/useFunnelChartStyles.styles.js +1 -2
- package/lib/components/FunnelChart/useFunnelChartStyles.styles.raw.js +51 -0
- package/lib/components/FunnelChart/useFunnelChartStyles.styles.raw.js.map +1 -0
- package/lib/components/GanttChart/GanttChart.js +530 -0
- package/lib/components/GanttChart/GanttChart.js.map +1 -0
- package/lib/components/GanttChart/GanttChart.types.js +4 -0
- package/lib/components/GanttChart/GanttChart.types.js.map +1 -0
- package/lib/components/GanttChart/index.js +2 -0
- package/lib/components/GanttChart/index.js.map +1 -0
- package/lib/components/GanttChart/useGanttChartStyles.styles.js +24 -0
- package/lib/components/GanttChart/useGanttChartStyles.styles.js.map +1 -0
- package/lib/components/GanttChart/useGanttChartStyles.styles.raw.js +23 -0
- package/lib/components/GanttChart/useGanttChartStyles.styles.raw.js.map +1 -0
- package/lib/components/GaugeChart/GaugeChart.js.map +1 -1
- package/lib/components/GaugeChart/GaugeChart.types.js.map +1 -1
- package/lib/components/GaugeChart/index.js.map +1 -1
- package/lib/components/GaugeChart/useGaugeChartStyles.styles.js +1 -2
- package/lib/components/GaugeChart/useGaugeChartStyles.styles.raw.js +142 -0
- package/lib/components/GaugeChart/useGaugeChartStyles.styles.raw.js.map +1 -0
- package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js +61 -56
- package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js.map +1 -1
- package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.types.js.map +1 -1
- package/lib/components/GroupedVerticalBarChart/index.js.map +1 -1
- package/lib/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.js +1 -2
- package/lib/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.raw.js +53 -0
- package/lib/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.raw.js.map +1 -0
- package/lib/components/HeatMapChart/HeatMapChart.js.map +1 -1
- package/lib/components/HeatMapChart/HeatMapChart.types.js.map +1 -1
- package/lib/components/HeatMapChart/index.js.map +1 -1
- package/lib/components/HeatMapChart/useHeatMapChartStyles.styles.js +1 -2
- package/lib/components/HeatMapChart/useHeatMapChartStyles.styles.raw.js +38 -0
- package/lib/components/HeatMapChart/useHeatMapChartStyles.styles.raw.js.map +1 -0
- package/lib/components/HorizontalBarChart/HorizontalBarChart.js +23 -26
- package/lib/components/HorizontalBarChart/HorizontalBarChart.js.map +1 -1
- package/lib/components/HorizontalBarChart/HorizontalBarChart.types.js +5 -3
- package/lib/components/HorizontalBarChart/HorizontalBarChart.types.js.map +1 -1
- package/lib/components/HorizontalBarChart/index.js.map +1 -1
- package/lib/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.js +1 -2
- package/lib/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.raw.js +120 -0
- package/lib/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.raw.js.map +1 -0
- package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js.map +1 -1
- package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.types.js.map +1 -1
- package/lib/components/HorizontalBarChartWithAxis/index.js.map +1 -1
- package/lib/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.js +1 -2
- package/lib/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.raw.js +39 -0
- package/lib/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.raw.js.map +1 -0
- package/lib/components/Legends/Legends.js +7 -8
- package/lib/components/Legends/Legends.js.map +1 -1
- package/lib/components/Legends/Legends.types.js.map +1 -1
- package/lib/components/Legends/OverflowMenu.js.map +1 -1
- package/lib/components/Legends/index.js.map +1 -1
- package/lib/components/Legends/shape.js +3 -3
- package/lib/components/Legends/shape.js.map +1 -1
- package/lib/components/Legends/useLegendsStyles.styles.js +33 -6
- package/lib/components/Legends/useLegendsStyles.styles.js.map +1 -1
- package/lib/components/Legends/useLegendsStyles.styles.raw.js +125 -0
- package/lib/components/Legends/useLegendsStyles.styles.raw.js.map +1 -0
- package/lib/components/LineChart/LineChart.js +3 -3
- package/lib/components/LineChart/LineChart.js.map +1 -1
- package/lib/components/LineChart/LineChart.types.js.map +1 -1
- package/lib/components/LineChart/eventAnnotation/EventAnnotation.js.map +1 -1
- package/lib/components/LineChart/eventAnnotation/LabelLink.js.map +1 -1
- package/lib/components/LineChart/eventAnnotation/Textbox.js +2 -1
- package/lib/components/LineChart/eventAnnotation/Textbox.js.map +1 -1
- package/lib/components/LineChart/index.js.map +1 -1
- package/lib/components/LineChart/useLineChartStyles.styles.js +1 -2
- package/lib/components/LineChart/useLineChartStyles.styles.raw.js +52 -0
- package/lib/components/LineChart/useLineChartStyles.styles.raw.js.map +1 -0
- package/lib/components/ResponsiveContainer/ResponsiveContainer.js.map +1 -1
- package/lib/components/ResponsiveContainer/ResponsiveContainer.types.js.map +1 -1
- package/lib/components/ResponsiveContainer/index.js.map +1 -1
- package/lib/components/ResponsiveContainer/useResponsiveChildStyles.styles.js +1 -2
- package/lib/components/ResponsiveContainer/useResponsiveChildStyles.styles.raw.js +28 -0
- package/lib/components/ResponsiveContainer/useResponsiveChildStyles.styles.raw.js.map +1 -0
- package/lib/components/ResponsiveContainer/withResponsiveContainer.js.map +1 -1
- package/lib/components/SankeyChart/SankeyChart.js.map +1 -1
- package/lib/components/SankeyChart/SankeyChart.types.js.map +1 -1
- package/lib/components/SankeyChart/index.js.map +1 -1
- package/lib/components/SankeyChart/useSankeyChartStyles.styles.js +1 -2
- package/lib/components/SankeyChart/useSankeyChartStyles.styles.raw.js +77 -0
- package/lib/components/SankeyChart/useSankeyChartStyles.styles.raw.js.map +1 -0
- package/lib/components/ScatterChart/ScatterChart.js.map +1 -1
- package/lib/components/ScatterChart/ScatterChart.types.js.map +1 -1
- package/lib/components/ScatterChart/index.js.map +1 -1
- package/lib/components/ScatterChart/useScatterChartStyles.styles.js +1 -2
- package/lib/components/ScatterChart/useScatterChartStyles.styles.raw.js +43 -0
- package/lib/components/ScatterChart/useScatterChartStyles.styles.raw.js.map +1 -0
- package/lib/components/Sparkline/Sparkline.js.map +1 -1
- package/lib/components/Sparkline/Sparkline.types.js.map +1 -1
- package/lib/components/Sparkline/index.js.map +1 -1
- package/lib/components/Sparkline/useSparklineStyles.styles.js +1 -2
- package/lib/components/Sparkline/useSparklineStyles.styles.raw.js +30 -0
- package/lib/components/Sparkline/useSparklineStyles.styles.raw.js.map +1 -0
- package/lib/components/VerticalBarChart/VerticalBarChart.js +56 -29
- package/lib/components/VerticalBarChart/VerticalBarChart.js.map +1 -1
- package/lib/components/VerticalBarChart/VerticalBarChart.types.js.map +1 -1
- package/lib/components/VerticalBarChart/index.js.map +1 -1
- package/lib/components/VerticalBarChart/useVerticalBarChartStyles.styles.js +1 -2
- package/lib/components/VerticalBarChart/useVerticalBarChartStyles.styles.raw.js +58 -0
- package/lib/components/VerticalBarChart/useVerticalBarChartStyles.styles.raw.js.map +1 -0
- package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.js +17 -10
- package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.js.map +1 -1
- package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.types.js.map +1 -1
- package/lib/components/VerticalStackedBarChart/index.js.map +1 -1
- package/lib/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.js +1 -2
- package/lib/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.raw.js +49 -0
- package/lib/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.raw.js.map +1 -0
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -1
- package/lib/types/DataPoint.js +3 -1
- package/lib/types/DataPoint.js.map +1 -1
- package/lib/types/EventAnnotation.js.map +1 -1
- package/lib/types/LegendDataItem.js.map +1 -1
- package/lib/types/index.js.map +1 -1
- package/lib/utilities/FocusableTooltipText.js.map +1 -1
- package/lib/utilities/KeyCodes.js.map +1 -1
- package/lib/utilities/SVGTooltipText.js +2 -0
- package/lib/utilities/SVGTooltipText.js.map +1 -1
- package/lib/utilities/async-utils.js.map +1 -1
- package/lib/utilities/colors.js.map +1 -1
- package/lib/utilities/getWindow.js.map +1 -1
- package/lib/utilities/index.js.map +1 -1
- package/lib/utilities/overflow-utils.js.map +1 -1
- package/lib/utilities/string.js.map +1 -1
- package/lib/utilities/test-data.js +236 -0
- package/lib/utilities/test-data.js.map +1 -1
- package/lib/utilities/utilities.js +95 -27
- package/lib/utilities/utilities.js.map +1 -1
- package/lib/utilities/vbc-utils.js +2 -2
- package/lib/utilities/vbc-utils.js.map +1 -1
- package/lib-commonjs/AreaChart.js.map +1 -1
- package/lib-commonjs/CartesianChart.js.map +1 -1
- package/lib-commonjs/DeclarativeChart.js.map +1 -1
- package/lib-commonjs/DonutChart.js.map +1 -1
- package/lib-commonjs/FunnelChart.js.map +1 -1
- package/lib-commonjs/GanttChart.js +6 -0
- package/lib-commonjs/GanttChart.js.map +1 -0
- package/lib-commonjs/GaugeChart.js.map +1 -1
- package/lib-commonjs/GroupedVerticalBarChart.js.map +1 -1
- package/lib-commonjs/HeatMapChart.js.map +1 -1
- package/lib-commonjs/HorizontalBarChart.js.map +1 -1
- package/lib-commonjs/HorizontalBarChartWithAxis.js.map +1 -1
- package/lib-commonjs/Legends.js.map +1 -1
- package/lib-commonjs/LineChart.js.map +1 -1
- package/lib-commonjs/Popover.js.map +1 -1
- package/lib-commonjs/ResponsiveContainer.js.map +1 -1
- package/lib-commonjs/SankeyChart.js.map +1 -1
- package/lib-commonjs/ScatterChart.js.map +1 -1
- package/lib-commonjs/Sparkline.js.map +1 -1
- package/lib-commonjs/VerticalBarChart.js.map +1 -1
- package/lib-commonjs/VerticalStackedBarChart.js.map +1 -1
- package/lib-commonjs/components/AreaChart/AreaChart.js +3 -3
- package/lib-commonjs/components/AreaChart/AreaChart.js.map +1 -1
- package/lib-commonjs/components/AreaChart/AreaChart.types.js.map +1 -1
- package/lib-commonjs/components/AreaChart/index.js.map +1 -1
- package/lib-commonjs/components/AreaChart/useAreaChartStyles.styles.js +1 -1
- package/lib-commonjs/components/AreaChart/useAreaChartStyles.styles.js.map +1 -1
- package/lib-commonjs/components/AreaChart/useAreaChartStyles.styles.raw.js +57 -0
- package/lib-commonjs/components/AreaChart/useAreaChartStyles.styles.raw.js.map +1 -0
- package/lib-commonjs/components/CommonComponents/CartesianChart.js +11 -7
- 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.map +1 -1
- package/lib-commonjs/components/CommonComponents/ChartPopover.types.js.map +1 -1
- package/lib-commonjs/components/CommonComponents/index.js.map +1 -1
- package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.js +1 -1
- package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.js.map +1 -1
- package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.raw.js +142 -0
- package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.raw.js.map +1 -0
- package/lib-commonjs/components/CommonComponents/useChartPopoverStyles.styles.js +1 -1
- package/lib-commonjs/components/CommonComponents/useChartPopoverStyles.styles.js.map +1 -1
- package/lib-commonjs/components/CommonComponents/useChartPopoverStyles.styles.raw.js +140 -0
- package/lib-commonjs/components/CommonComponents/useChartPopoverStyles.styles.raw.js.map +1 -0
- package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js +5 -0
- package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
- package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js +47 -13
- package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
- package/lib-commonjs/components/DeclarativeChart/imageExporter.js +1 -0
- package/lib-commonjs/components/DeclarativeChart/imageExporter.js.map +1 -1
- package/lib-commonjs/components/DeclarativeChart/index.js.map +1 -1
- package/lib-commonjs/components/DonutChart/Arc/Arc.js.map +1 -1
- package/lib-commonjs/components/DonutChart/Arc/Arc.types.js.map +1 -1
- package/lib-commonjs/components/DonutChart/Arc/index.js.map +1 -1
- package/lib-commonjs/components/DonutChart/Arc/useArcStyles.styles.js +1 -1
- package/lib-commonjs/components/DonutChart/Arc/useArcStyles.styles.js.map +1 -1
- package/lib-commonjs/components/DonutChart/Arc/useArcStyles.styles.raw.js +58 -0
- package/lib-commonjs/components/DonutChart/Arc/useArcStyles.styles.raw.js.map +1 -0
- package/lib-commonjs/components/DonutChart/DonutChart.js.map +1 -1
- package/lib-commonjs/components/DonutChart/DonutChart.types.js.map +1 -1
- package/lib-commonjs/components/DonutChart/Pie/Pie.js.map +1 -1
- package/lib-commonjs/components/DonutChart/Pie/Pie.types.js.map +1 -1
- package/lib-commonjs/components/DonutChart/Pie/index.js.map +1 -1
- package/lib-commonjs/components/DonutChart/Pie/usePieStyles.styles.js +1 -1
- package/lib-commonjs/components/DonutChart/Pie/usePieStyles.styles.js.map +1 -1
- package/lib-commonjs/components/DonutChart/Pie/usePieStyles.styles.raw.js +43 -0
- package/lib-commonjs/components/DonutChart/Pie/usePieStyles.styles.raw.js.map +1 -0
- package/lib-commonjs/components/DonutChart/index.js.map +1 -1
- package/lib-commonjs/components/DonutChart/useDonutChartStyles.styles.js +1 -1
- package/lib-commonjs/components/DonutChart/useDonutChartStyles.styles.js.map +1 -1
- package/lib-commonjs/components/DonutChart/useDonutChartStyles.styles.raw.js +59 -0
- package/lib-commonjs/components/DonutChart/useDonutChartStyles.styles.raw.js.map +1 -0
- package/lib-commonjs/components/FunnelChart/FunnelChart.js.map +1 -1
- package/lib-commonjs/components/FunnelChart/FunnelChart.types.js.map +1 -1
- package/lib-commonjs/components/FunnelChart/funnelGeometry.js.map +1 -1
- package/lib-commonjs/components/FunnelChart/index.js.map +1 -1
- package/lib-commonjs/components/FunnelChart/useFunnelChartStyles.styles.js +1 -1
- package/lib-commonjs/components/FunnelChart/useFunnelChartStyles.styles.js.map +1 -1
- package/lib-commonjs/components/FunnelChart/useFunnelChartStyles.styles.raw.js +65 -0
- package/lib-commonjs/components/FunnelChart/useFunnelChartStyles.styles.raw.js.map +1 -0
- package/lib-commonjs/components/GanttChart/GanttChart.js +541 -0
- package/lib-commonjs/components/GanttChart/GanttChart.js.map +1 -0
- package/lib-commonjs/components/GanttChart/GanttChart.types.js +7 -0
- package/lib-commonjs/components/GanttChart/GanttChart.types.js.map +1 -0
- package/lib-commonjs/components/GanttChart/index.js +7 -0
- package/lib-commonjs/components/GanttChart/index.js.map +1 -0
- package/lib-commonjs/components/GanttChart/useGanttChartStyles.styles.js +39 -0
- package/lib-commonjs/components/GanttChart/useGanttChartStyles.styles.js.map +1 -0
- package/lib-commonjs/components/GanttChart/useGanttChartStyles.styles.raw.js +39 -0
- package/lib-commonjs/components/GanttChart/useGanttChartStyles.styles.raw.js.map +1 -0
- 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/index.js.map +1 -1
- package/lib-commonjs/components/GaugeChart/useGaugeChartStyles.styles.js +1 -1
- package/lib-commonjs/components/GaugeChart/useGaugeChartStyles.styles.js.map +1 -1
- package/lib-commonjs/components/GaugeChart/useGaugeChartStyles.styles.raw.js +160 -0
- package/lib-commonjs/components/GaugeChart/useGaugeChartStyles.styles.raw.js.map +1 -0
- package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js +61 -56
- package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js.map +1 -1
- package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.types.js.map +1 -1
- package/lib-commonjs/components/GroupedVerticalBarChart/index.js.map +1 -1
- package/lib-commonjs/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.js +1 -1
- package/lib-commonjs/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.js.map +1 -1
- package/lib-commonjs/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.raw.js +69 -0
- package/lib-commonjs/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.raw.js.map +1 -0
- package/lib-commonjs/components/HeatMapChart/HeatMapChart.js.map +1 -1
- package/lib-commonjs/components/HeatMapChart/HeatMapChart.types.js.map +1 -1
- package/lib-commonjs/components/HeatMapChart/index.js.map +1 -1
- package/lib-commonjs/components/HeatMapChart/useHeatMapChartStyles.styles.js +1 -1
- package/lib-commonjs/components/HeatMapChart/useHeatMapChartStyles.styles.js.map +1 -1
- package/lib-commonjs/components/HeatMapChart/useHeatMapChartStyles.styles.raw.js +56 -0
- package/lib-commonjs/components/HeatMapChart/useHeatMapChartStyles.styles.raw.js.map +1 -0
- package/lib-commonjs/components/HorizontalBarChart/HorizontalBarChart.js +23 -26
- package/lib-commonjs/components/HorizontalBarChart/HorizontalBarChart.js.map +1 -1
- package/lib-commonjs/components/HorizontalBarChart/HorizontalBarChart.types.js +3 -3
- package/lib-commonjs/components/HorizontalBarChart/HorizontalBarChart.types.js.map +1 -1
- package/lib-commonjs/components/HorizontalBarChart/index.js.map +1 -1
- package/lib-commonjs/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.js +1 -1
- package/lib-commonjs/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.js.map +1 -1
- package/lib-commonjs/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.raw.js +134 -0
- package/lib-commonjs/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.raw.js.map +1 -0
- package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js.map +1 -1
- package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.types.js.map +1 -1
- package/lib-commonjs/components/HorizontalBarChartWithAxis/index.js.map +1 -1
- package/lib-commonjs/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.js +1 -1
- package/lib-commonjs/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.js.map +1 -1
- package/lib-commonjs/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.raw.js +55 -0
- package/lib-commonjs/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.raw.js.map +1 -0
- package/lib-commonjs/components/Legends/Legends.js +7 -8
- package/lib-commonjs/components/Legends/Legends.js.map +1 -1
- package/lib-commonjs/components/Legends/Legends.types.js.map +1 -1
- package/lib-commonjs/components/Legends/OverflowMenu.js.map +1 -1
- package/lib-commonjs/components/Legends/index.js.map +1 -1
- package/lib-commonjs/components/Legends/shape.js +2 -2
- package/lib-commonjs/components/Legends/shape.js.map +1 -1
- package/lib-commonjs/components/Legends/useLegendsStyles.styles.js +46 -5
- package/lib-commonjs/components/Legends/useLegendsStyles.styles.js.map +1 -1
- package/lib-commonjs/components/Legends/useLegendsStyles.styles.raw.js +141 -0
- package/lib-commonjs/components/Legends/useLegendsStyles.styles.raw.js.map +1 -0
- package/lib-commonjs/components/LineChart/LineChart.js +3 -3
- package/lib-commonjs/components/LineChart/LineChart.js.map +1 -1
- package/lib-commonjs/components/LineChart/LineChart.types.js.map +1 -1
- package/lib-commonjs/components/LineChart/eventAnnotation/EventAnnotation.js.map +1 -1
- package/lib-commonjs/components/LineChart/eventAnnotation/LabelLink.js.map +1 -1
- package/lib-commonjs/components/LineChart/eventAnnotation/Textbox.js +2 -1
- package/lib-commonjs/components/LineChart/eventAnnotation/Textbox.js.map +1 -1
- package/lib-commonjs/components/LineChart/index.js.map +1 -1
- package/lib-commonjs/components/LineChart/useLineChartStyles.styles.js +1 -1
- package/lib-commonjs/components/LineChart/useLineChartStyles.styles.js.map +1 -1
- package/lib-commonjs/components/LineChart/useLineChartStyles.styles.raw.js +66 -0
- package/lib-commonjs/components/LineChart/useLineChartStyles.styles.raw.js.map +1 -0
- package/lib-commonjs/components/ResponsiveContainer/ResponsiveContainer.js.map +1 -1
- package/lib-commonjs/components/ResponsiveContainer/ResponsiveContainer.types.js.map +1 -1
- package/lib-commonjs/components/ResponsiveContainer/index.js.map +1 -1
- package/lib-commonjs/components/ResponsiveContainer/useResponsiveChildStyles.styles.js +1 -1
- package/lib-commonjs/components/ResponsiveContainer/useResponsiveChildStyles.styles.js.map +1 -1
- package/lib-commonjs/components/ResponsiveContainer/useResponsiveChildStyles.styles.raw.js +46 -0
- package/lib-commonjs/components/ResponsiveContainer/useResponsiveChildStyles.styles.raw.js.map +1 -0
- package/lib-commonjs/components/ResponsiveContainer/withResponsiveContainer.js.map +1 -1
- package/lib-commonjs/components/SankeyChart/SankeyChart.js.map +1 -1
- package/lib-commonjs/components/SankeyChart/SankeyChart.types.js.map +1 -1
- package/lib-commonjs/components/SankeyChart/index.js.map +1 -1
- package/lib-commonjs/components/SankeyChart/useSankeyChartStyles.styles.js +1 -1
- package/lib-commonjs/components/SankeyChart/useSankeyChartStyles.styles.js.map +1 -1
- package/lib-commonjs/components/SankeyChart/useSankeyChartStyles.styles.raw.js +95 -0
- package/lib-commonjs/components/SankeyChart/useSankeyChartStyles.styles.raw.js.map +1 -0
- package/lib-commonjs/components/ScatterChart/ScatterChart.js.map +1 -1
- package/lib-commonjs/components/ScatterChart/ScatterChart.types.js.map +1 -1
- package/lib-commonjs/components/ScatterChart/index.js.map +1 -1
- package/lib-commonjs/components/ScatterChart/useScatterChartStyles.styles.js +1 -1
- package/lib-commonjs/components/ScatterChart/useScatterChartStyles.styles.js.map +1 -1
- package/lib-commonjs/components/ScatterChart/useScatterChartStyles.styles.raw.js +57 -0
- package/lib-commonjs/components/ScatterChart/useScatterChartStyles.styles.raw.js.map +1 -0
- package/lib-commonjs/components/Sparkline/Sparkline.js.map +1 -1
- package/lib-commonjs/components/Sparkline/Sparkline.types.js.map +1 -1
- package/lib-commonjs/components/Sparkline/index.js.map +1 -1
- package/lib-commonjs/components/Sparkline/useSparklineStyles.styles.js +1 -1
- package/lib-commonjs/components/Sparkline/useSparklineStyles.styles.js.map +1 -1
- package/lib-commonjs/components/Sparkline/useSparklineStyles.styles.raw.js +44 -0
- package/lib-commonjs/components/Sparkline/useSparklineStyles.styles.raw.js.map +1 -0
- package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.js +56 -29
- 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/index.js.map +1 -1
- package/lib-commonjs/components/VerticalBarChart/useVerticalBarChartStyles.styles.js +1 -1
- package/lib-commonjs/components/VerticalBarChart/useVerticalBarChartStyles.styles.js.map +1 -1
- package/lib-commonjs/components/VerticalBarChart/useVerticalBarChartStyles.styles.raw.js +74 -0
- package/lib-commonjs/components/VerticalBarChart/useVerticalBarChartStyles.styles.raw.js.map +1 -0
- package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.js +17 -10
- package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.js.map +1 -1
- package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.types.js.map +1 -1
- package/lib-commonjs/components/VerticalStackedBarChart/index.js.map +1 -1
- package/lib-commonjs/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.js +1 -1
- package/lib-commonjs/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.js.map +1 -1
- package/lib-commonjs/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.raw.js +67 -0
- package/lib-commonjs/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.raw.js.map +1 -0
- package/lib-commonjs/index.js +1 -0
- package/lib-commonjs/index.js.map +1 -1
- package/lib-commonjs/types/DataPoint.js +3 -1
- package/lib-commonjs/types/DataPoint.js.map +1 -1
- package/lib-commonjs/types/EventAnnotation.js.map +1 -1
- package/lib-commonjs/types/LegendDataItem.js.map +1 -1
- package/lib-commonjs/types/index.js.map +1 -1
- package/lib-commonjs/utilities/FocusableTooltipText.js.map +1 -1
- package/lib-commonjs/utilities/KeyCodes.js.map +1 -1
- package/lib-commonjs/utilities/SVGTooltipText.js +2 -0
- package/lib-commonjs/utilities/SVGTooltipText.js.map +1 -1
- package/lib-commonjs/utilities/async-utils.js.map +1 -1
- package/lib-commonjs/utilities/colors.js.map +1 -1
- package/lib-commonjs/utilities/getWindow.js.map +1 -1
- package/lib-commonjs/utilities/index.js.map +1 -1
- package/lib-commonjs/utilities/overflow-utils.js.map +1 -1
- package/lib-commonjs/utilities/string.js.map +1 -1
- package/lib-commonjs/utilities/test-data.js +245 -0
- package/lib-commonjs/utilities/test-data.js.map +1 -1
- package/lib-commonjs/utilities/utilities.js +91 -22
- package/lib-commonjs/utilities/utilities.js.map +1 -1
- package/lib-commonjs/utilities/vbc-utils.js +2 -2
- package/lib-commonjs/utilities/vbc-utils.js.map +1 -1
- package/package.json +14 -24
|
@@ -55,5 +55,4 @@ export const useFunnelChartStyles = props => {
|
|
|
55
55
|
text: mergeClasses(funnelClassNames.text, baseStyles.text, (_props_styles2 = props.styles) === null || _props_styles2 === void 0 ? void 0 : _props_styles2.text),
|
|
56
56
|
calloutContentRoot: mergeClasses(baseStyles.calloutContentRoot, (_props_styles3 = props.styles) === null || _props_styles3 === void 0 ? void 0 : _props_styles3.calloutContentRoot)
|
|
57
57
|
};
|
|
58
|
-
};
|
|
59
|
-
//# sourceMappingURL=useFunnelChartStyles.styles.js.map
|
|
58
|
+
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { makeStyles, mergeClasses } from '@griffel/react';
|
|
2
|
+
import { tokens } from '@fluentui/react-theme';
|
|
3
|
+
/**
|
|
4
|
+
* @internal
|
|
5
|
+
*/ export const funnelClassNames = {
|
|
6
|
+
root: 'fui-funnel__root',
|
|
7
|
+
chart: 'fui-funnel__chart',
|
|
8
|
+
text: 'fui-funnel__text',
|
|
9
|
+
calloutContentRoot: 'fui-funnel__callout-content-root'
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Base Styles
|
|
13
|
+
*/ const useStyles = makeStyles({
|
|
14
|
+
root: {
|
|
15
|
+
alignItems: 'center',
|
|
16
|
+
width: '100%',
|
|
17
|
+
height: '100%',
|
|
18
|
+
fontFamily: tokens.fontFamilyBase,
|
|
19
|
+
fontSize: tokens.fontSizeBase300,
|
|
20
|
+
fontWeight: tokens.fontWeightRegular,
|
|
21
|
+
position: 'relative'
|
|
22
|
+
},
|
|
23
|
+
chart: {
|
|
24
|
+
display: 'block',
|
|
25
|
+
width: '100%',
|
|
26
|
+
height: '100%'
|
|
27
|
+
},
|
|
28
|
+
text: {
|
|
29
|
+
pointerEvents: 'none',
|
|
30
|
+
fontWeight: tokens.fontWeightSemibold,
|
|
31
|
+
fill: tokens.colorNeutralForeground1,
|
|
32
|
+
fontFamily: tokens.fontFamilyBase,
|
|
33
|
+
fontSize: tokens.fontSizeBase300
|
|
34
|
+
},
|
|
35
|
+
calloutContentRoot: {
|
|
36
|
+
maxWidth: '238px'
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
/**
|
|
40
|
+
* Apply styling to the FunnelChart component
|
|
41
|
+
*/ export const useFunnelChartStyles = (props)=>{
|
|
42
|
+
var _props_styles, _props_styles1, _props_styles2, _props_styles3;
|
|
43
|
+
const { className } = props;
|
|
44
|
+
const baseStyles = useStyles();
|
|
45
|
+
return {
|
|
46
|
+
root: mergeClasses(funnelClassNames.root, baseStyles.root, className, (_props_styles = props.styles) === null || _props_styles === void 0 ? void 0 : _props_styles.root),
|
|
47
|
+
chart: mergeClasses(funnelClassNames.chart, baseStyles.chart, (_props_styles1 = props.styles) === null || _props_styles1 === void 0 ? void 0 : _props_styles1.chart),
|
|
48
|
+
text: mergeClasses(funnelClassNames.text, baseStyles.text, (_props_styles2 = props.styles) === null || _props_styles2 === void 0 ? void 0 : _props_styles2.text),
|
|
49
|
+
calloutContentRoot: mergeClasses(baseStyles.calloutContentRoot, (_props_styles3 = props.styles) === null || _props_styles3 === void 0 ? void 0 : _props_styles3.calloutContentRoot)
|
|
50
|
+
};
|
|
51
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/FunnelChart/useFunnelChartStyles.styles.ts"],"sourcesContent":["import { makeStyles, mergeClasses } from '@griffel/react';\nimport { tokens } from '@fluentui/react-theme';\nimport { FunnelChartProps, FunnelChartStyles } from './index';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\n\n/**\n * @internal\n */\nexport const funnelClassNames: SlotClassNames<FunnelChartStyles> = {\n root: 'fui-funnel__root',\n chart: 'fui-funnel__chart',\n text: 'fui-funnel__text',\n calloutContentRoot: 'fui-funnel__callout-content-root',\n};\n\n/**\n * Base Styles\n */\nconst useStyles = makeStyles({\n root: {\n alignItems: 'center',\n width: '100%',\n height: '100%',\n fontFamily: tokens.fontFamilyBase,\n fontSize: tokens.fontSizeBase300,\n fontWeight: tokens.fontWeightRegular,\n position: 'relative',\n },\n chart: {\n display: 'block',\n width: '100%',\n height: '100%',\n },\n text: {\n pointerEvents: 'none',\n fontWeight: tokens.fontWeightSemibold,\n fill: tokens.colorNeutralForeground1,\n fontFamily: tokens.fontFamilyBase,\n fontSize: tokens.fontSizeBase300,\n },\n calloutContentRoot: {\n maxWidth: '238px',\n },\n});\n\n/**\n * Apply styling to the FunnelChart component\n */\nexport const useFunnelChartStyles = (props: FunnelChartProps): FunnelChartStyles => {\n const { className } = props;\n const baseStyles = useStyles();\n\n return {\n root: mergeClasses(funnelClassNames.root, baseStyles.root, className, props.styles?.root),\n chart: mergeClasses(funnelClassNames.chart, baseStyles.chart, props.styles?.chart),\n text: mergeClasses(funnelClassNames.text, baseStyles.text, props.styles?.text),\n calloutContentRoot: mergeClasses(baseStyles.calloutContentRoot, props.styles?.calloutContentRoot),\n };\n};\n"],"names":["makeStyles","mergeClasses","tokens","funnelClassNames","root","chart","text","calloutContentRoot","useStyles","alignItems","width","height","fontFamily","fontFamilyBase","fontSize","fontSizeBase300","fontWeight","fontWeightRegular","position","display","pointerEvents","fontWeightSemibold","fill","colorNeutralForeground1","maxWidth","useFunnelChartStyles","props","className","baseStyles","styles"],"mappings":"AAAA,SAASA,UAAU,EAAEC,YAAY,QAAQ,iBAAiB;AAC1D,SAASC,MAAM,QAAQ,wBAAwB;AAI/C;;CAEC,GACD,OAAO,MAAMC,mBAAsD;IACjEC,MAAM;IACNC,OAAO;IACPC,MAAM;IACNC,oBAAoB;AACtB,EAAE;AAEF;;CAEC,GACD,MAAMC,YAAYR,WAAW;IAC3BI,MAAM;QACJK,YAAY;QACZC,OAAO;QACPC,QAAQ;QACRC,YAAYV,OAAOW,cAAc;QACjCC,UAAUZ,OAAOa,eAAe;QAChCC,YAAYd,OAAOe,iBAAiB;QACpCC,UAAU;IACZ;IACAb,OAAO;QACLc,SAAS;QACTT,OAAO;QACPC,QAAQ;IACV;IACAL,MAAM;QACJc,eAAe;QACfJ,YAAYd,OAAOmB,kBAAkB;QACrCC,MAAMpB,OAAOqB,uBAAuB;QACpCX,YAAYV,OAAOW,cAAc;QACjCC,UAAUZ,OAAOa,eAAe;IAClC;IACAR,oBAAoB;QAClBiB,UAAU;IACZ;AACF;AAEA;;CAEC,GACD,OAAO,MAAMC,uBAAuB,CAACC;QAKqCA,eACRA,gBACHA,gBACKA;IAPlE,MAAM,EAAEC,SAAS,EAAE,GAAGD;IACtB,MAAME,aAAapB;IAEnB,OAAO;QACLJ,MAAMH,aAAaE,iBAAiBC,IAAI,EAAEwB,WAAWxB,IAAI,EAAEuB,YAAWD,gBAAAA,MAAMG,MAAM,cAAZH,oCAAAA,cAActB,IAAI;QACxFC,OAAOJ,aAAaE,iBAAiBE,KAAK,EAAEuB,WAAWvB,KAAK,GAAEqB,iBAAAA,MAAMG,MAAM,cAAZH,qCAAAA,eAAcrB,KAAK;QACjFC,MAAML,aAAaE,iBAAiBG,IAAI,EAAEsB,WAAWtB,IAAI,GAAEoB,iBAAAA,MAAMG,MAAM,cAAZH,qCAAAA,eAAcpB,IAAI;QAC7EC,oBAAoBN,aAAa2B,WAAWrB,kBAAkB,GAAEmB,iBAAAA,MAAMG,MAAM,cAAZH,qCAAAA,eAAcnB,kBAAkB;IAClG;AACF,EAAE"}
|
|
@@ -0,0 +1,530 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { max as d3Max, min as d3Min } from 'd3-array';
|
|
3
|
+
import { useId } from '@fluentui/react-utilities';
|
|
4
|
+
import { Legends } from '../Legends/index';
|
|
5
|
+
import { CartesianChart } from '../CommonComponents/index';
|
|
6
|
+
import { ChartPopover } from '../CommonComponents/ChartPopover';
|
|
7
|
+
import { ChartTypes, YAxisType, XAxisTypes, getTypeOfAxis, getNextColor, findHBCWANumericMinMaxOfY, createYAxisForHorizontalBarChartWithAxis, createStringYAxisForHorizontalBarChartWithAxis, areArraysEqual, MIN_DOMAIN_MARGIN, sortAxisCategories, calculateAppropriateBarWidth, getColorFromToken, getScalePadding, getDateFormatLevel } from '../../utilities/index';
|
|
8
|
+
import { formatDateToLocaleString, getMultiLevelDateTimeFormatOptions } from '@fluentui/chart-utilities';
|
|
9
|
+
const DEFAULT_BAR_HEIGHT = 24;
|
|
10
|
+
const MIN_BAR_HEIGHT = 1;
|
|
11
|
+
export const GanttChart = /*#__PURE__*/ React.forwardRef(({ useUTC = true, yAxisCategoryOrder = 'default', maxBarHeight = 24, ...props }, forwardedRef)=>{
|
|
12
|
+
var _props_legendProps;
|
|
13
|
+
const _barHeight = React.useRef(DEFAULT_BAR_HEIGHT);
|
|
14
|
+
const _margins = React.useRef({});
|
|
15
|
+
const _calloutAnchorPoint = React.useRef(null);
|
|
16
|
+
const _emptyChartId = useId('Gantt_empty');
|
|
17
|
+
const _legendId = useId('gantt_legend');
|
|
18
|
+
const _legendMap = React.useRef({});
|
|
19
|
+
const _prevProps = React.useRef({});
|
|
20
|
+
const [calloutColor, setCalloutColor] = React.useState('');
|
|
21
|
+
const [hoveredLegend, setHoveredLegend] = React.useState('');
|
|
22
|
+
const [calloutLegend, setCalloutLegend] = React.useState('');
|
|
23
|
+
const [xCalloutValue, setXCalloutValue] = React.useState('');
|
|
24
|
+
const [yCalloutValue, setYCalloutValue] = React.useState('');
|
|
25
|
+
const [selectedLegends, setSelectedLegends] = React.useState(((_props_legendProps = props.legendProps) === null || _props_legendProps === void 0 ? void 0 : _props_legendProps.selectedLegends) || []);
|
|
26
|
+
const [calloutDataPoint, setCalloutDataPoint] = React.useState();
|
|
27
|
+
const [clickPosition, setClickPosition] = React.useState({
|
|
28
|
+
x: 0,
|
|
29
|
+
y: 0
|
|
30
|
+
});
|
|
31
|
+
const [isPopoverOpen, setPopoverOpen] = React.useState(false);
|
|
32
|
+
React.useEffect(()=>{
|
|
33
|
+
var _prevProps_current_legendProps, _props_legendProps;
|
|
34
|
+
if (!areArraysEqual((_prevProps_current_legendProps = _prevProps.current.legendProps) === null || _prevProps_current_legendProps === void 0 ? void 0 : _prevProps_current_legendProps.selectedLegends, (_props_legendProps = props.legendProps) === null || _props_legendProps === void 0 ? void 0 : _props_legendProps.selectedLegends)) {
|
|
35
|
+
var _props_legendProps1;
|
|
36
|
+
setSelectedLegends(((_props_legendProps1 = props.legendProps) === null || _props_legendProps1 === void 0 ? void 0 : _props_legendProps1.selectedLegends) || []);
|
|
37
|
+
}
|
|
38
|
+
_prevProps.current = props;
|
|
39
|
+
}, [
|
|
40
|
+
props
|
|
41
|
+
]);
|
|
42
|
+
const _points = React.useMemo(()=>{
|
|
43
|
+
var _props_data;
|
|
44
|
+
_legendMap.current = {};
|
|
45
|
+
let colorIndex = 0;
|
|
46
|
+
var _props_data_map;
|
|
47
|
+
return (_props_data_map = (_props_data = props.data) === null || _props_data === void 0 ? void 0 : _props_data.map((point)=>{
|
|
48
|
+
const legend = `${point.legend}`;
|
|
49
|
+
if (!_legendMap.current[legend]) {
|
|
50
|
+
let startColor = point.color ? getColorFromToken(point.color) : getNextColor(colorIndex, 0);
|
|
51
|
+
let endColor = startColor;
|
|
52
|
+
if (props.enableGradient) {
|
|
53
|
+
var _point_gradient, _point_gradient1;
|
|
54
|
+
startColor = (_point_gradient = point.gradient) === null || _point_gradient === void 0 ? void 0 : _point_gradient[0];
|
|
55
|
+
endColor = (_point_gradient1 = point.gradient) === null || _point_gradient1 === void 0 ? void 0 : _point_gradient1[1];
|
|
56
|
+
}
|
|
57
|
+
_legendMap.current[legend] = {
|
|
58
|
+
id: `${_legendId}_${colorIndex}`,
|
|
59
|
+
startColor,
|
|
60
|
+
endColor
|
|
61
|
+
};
|
|
62
|
+
colorIndex += 1;
|
|
63
|
+
}
|
|
64
|
+
const { startColor, endColor } = _legendMap.current[legend];
|
|
65
|
+
return {
|
|
66
|
+
...point,
|
|
67
|
+
color: startColor,
|
|
68
|
+
...props.enableGradient ? {
|
|
69
|
+
gradient: [
|
|
70
|
+
startColor,
|
|
71
|
+
endColor
|
|
72
|
+
]
|
|
73
|
+
} : {}
|
|
74
|
+
};
|
|
75
|
+
})) !== null && _props_data_map !== void 0 ? _props_data_map : [];
|
|
76
|
+
}, [
|
|
77
|
+
props.data,
|
|
78
|
+
props.enableGradient
|
|
79
|
+
]);
|
|
80
|
+
const _xAxisType = React.useMemo(()=>{
|
|
81
|
+
if (_points.length > 0) {
|
|
82
|
+
return getTypeOfAxis(_points[0].x.start, true);
|
|
83
|
+
}
|
|
84
|
+
return XAxisTypes.DateAxis;
|
|
85
|
+
}, [
|
|
86
|
+
_points
|
|
87
|
+
]);
|
|
88
|
+
const _yAxisType = React.useMemo(()=>{
|
|
89
|
+
if (_points.length > 0) {
|
|
90
|
+
return getTypeOfAxis(_points[0].y, false);
|
|
91
|
+
}
|
|
92
|
+
return YAxisType.StringAxis;
|
|
93
|
+
}, [
|
|
94
|
+
_points
|
|
95
|
+
]);
|
|
96
|
+
const _yAxisPadding = React.useMemo(()=>{
|
|
97
|
+
return getScalePadding(props.yAxisPadding, undefined, 1 / 2);
|
|
98
|
+
}, [
|
|
99
|
+
props.yAxisPadding
|
|
100
|
+
]);
|
|
101
|
+
const _dateFormatOptions = React.useMemo(()=>{
|
|
102
|
+
if (_xAxisType !== XAxisTypes.DateAxis) {
|
|
103
|
+
return undefined;
|
|
104
|
+
}
|
|
105
|
+
let lowestFormatLevel = 100;
|
|
106
|
+
let highestFormatLevel = -1;
|
|
107
|
+
_points.forEach((p)=>{
|
|
108
|
+
const startFormatLevel = getDateFormatLevel(p.x.start, useUTC);
|
|
109
|
+
const endFormatLevel = getDateFormatLevel(p.x.end, useUTC);
|
|
110
|
+
lowestFormatLevel = Math.min(lowestFormatLevel, startFormatLevel, endFormatLevel);
|
|
111
|
+
highestFormatLevel = Math.max(highestFormatLevel, startFormatLevel, endFormatLevel);
|
|
112
|
+
});
|
|
113
|
+
return getMultiLevelDateTimeFormatOptions(lowestFormatLevel, highestFormatLevel);
|
|
114
|
+
}, [
|
|
115
|
+
useUTC,
|
|
116
|
+
_points,
|
|
117
|
+
_xAxisType
|
|
118
|
+
]);
|
|
119
|
+
const _mapYValueToXValues = React.useCallback(()=>{
|
|
120
|
+
const yValueToXValues = {};
|
|
121
|
+
_points.forEach((point)=>{
|
|
122
|
+
if (!yValueToXValues[point.y]) {
|
|
123
|
+
yValueToXValues[point.y] = [];
|
|
124
|
+
}
|
|
125
|
+
yValueToXValues[point.y].push(+point.x.end - +point.x.start);
|
|
126
|
+
});
|
|
127
|
+
return yValueToXValues;
|
|
128
|
+
}, [
|
|
129
|
+
_points
|
|
130
|
+
]);
|
|
131
|
+
const _getOrderedYAxisLabels = React.useCallback(()=>{
|
|
132
|
+
const yValueToXValues = _mapYValueToXValues();
|
|
133
|
+
if (_yAxisType !== YAxisType.StringAxis) {
|
|
134
|
+
return Object.keys(yValueToXValues).sort((a, b)=>+a - +b);
|
|
135
|
+
}
|
|
136
|
+
if (yAxisCategoryOrder === 'default') {
|
|
137
|
+
return Object.keys(yValueToXValues).reverse();
|
|
138
|
+
}
|
|
139
|
+
return sortAxisCategories(yValueToXValues, yAxisCategoryOrder);
|
|
140
|
+
}, [
|
|
141
|
+
_mapYValueToXValues,
|
|
142
|
+
_yAxisType,
|
|
143
|
+
yAxisCategoryOrder
|
|
144
|
+
]);
|
|
145
|
+
const _yAxisLabels = React.useMemo(()=>_getOrderedYAxisLabels(), [
|
|
146
|
+
_getOrderedYAxisLabels
|
|
147
|
+
]);
|
|
148
|
+
const _getDomainNRangeValues = React.useCallback((points, margins, containerWidth, chartType, isRTL, xAxisType, barWidth, tickValues, shiftX)=>{
|
|
149
|
+
const xValues = [];
|
|
150
|
+
points.forEach((point)=>{
|
|
151
|
+
xValues.push(point.x.start, point.x.end);
|
|
152
|
+
});
|
|
153
|
+
const xMin = d3Min(xValues) || 0;
|
|
154
|
+
const xMax = d3Max(xValues) || 0;
|
|
155
|
+
return {
|
|
156
|
+
dStartValue: isRTL ? xMax : xMin,
|
|
157
|
+
dEndValue: isRTL ? xMin : xMax,
|
|
158
|
+
rStartValue: margins.left + (isRTL ? 0 : shiftX),
|
|
159
|
+
rEndValue: containerWidth - margins.right - (isRTL ? shiftX : 0)
|
|
160
|
+
};
|
|
161
|
+
}, []);
|
|
162
|
+
const _getMargins = React.useCallback((margins)=>{
|
|
163
|
+
_margins.current = margins;
|
|
164
|
+
}, []);
|
|
165
|
+
const _getFormattedXValue = React.useCallback((point)=>{
|
|
166
|
+
let formattedStartX;
|
|
167
|
+
let formattedEndX;
|
|
168
|
+
if (_xAxisType === XAxisTypes.DateAxis) {
|
|
169
|
+
formattedStartX = formatDateToLocaleString(point.x.start, props.culture, useUTC, false, _dateFormatOptions);
|
|
170
|
+
formattedEndX = formatDateToLocaleString(point.x.end, props.culture, useUTC, false, _dateFormatOptions);
|
|
171
|
+
} else {
|
|
172
|
+
formattedStartX = point.x.start.toString();
|
|
173
|
+
formattedEndX = point.x.end.toString();
|
|
174
|
+
}
|
|
175
|
+
return `${formattedStartX} - ${formattedEndX}`;
|
|
176
|
+
}, [
|
|
177
|
+
props.culture,
|
|
178
|
+
useUTC,
|
|
179
|
+
_dateFormatOptions,
|
|
180
|
+
_xAxisType
|
|
181
|
+
]);
|
|
182
|
+
const _getCustomizedCallout = React.useCallback(()=>{
|
|
183
|
+
const defaultRender = (point)=>{
|
|
184
|
+
return point ? /*#__PURE__*/ React.createElement(ChartPopover, {
|
|
185
|
+
isPopoverOpen: isPopoverOpen,
|
|
186
|
+
clickPosition: clickPosition,
|
|
187
|
+
XValue: point.yAxisCalloutData || point.y.toString(),
|
|
188
|
+
legend: point.legend,
|
|
189
|
+
YValue: point.xAxisCalloutData || _getFormattedXValue(point),
|
|
190
|
+
color: point.color,
|
|
191
|
+
culture: props.culture
|
|
192
|
+
}) : null;
|
|
193
|
+
};
|
|
194
|
+
return props.onRenderCalloutPerDataPoint ? props.onRenderCalloutPerDataPoint(calloutDataPoint, defaultRender) : null;
|
|
195
|
+
//eslint-disable-next-line react-hooks/exhaustive-deps
|
|
196
|
+
}, [
|
|
197
|
+
_getFormattedXValue,
|
|
198
|
+
calloutDataPoint,
|
|
199
|
+
props.culture,
|
|
200
|
+
props.onRenderCalloutPerDataPoint
|
|
201
|
+
]);
|
|
202
|
+
const _getAriaLabel = React.useCallback((point)=>{
|
|
203
|
+
var _point_callOutAccessibilityData;
|
|
204
|
+
const xValue = point.xAxisCalloutData || _getFormattedXValue(point);
|
|
205
|
+
const yValue = point.yAxisCalloutData || point.y;
|
|
206
|
+
return ((_point_callOutAccessibilityData = point.callOutAccessibilityData) === null || _point_callOutAccessibilityData === void 0 ? void 0 : _point_callOutAccessibilityData.ariaLabel) || `${yValue}. ` + (point.legend ? `${point.legend}, ` : '') + `${xValue}.`;
|
|
207
|
+
}, [
|
|
208
|
+
_getFormattedXValue
|
|
209
|
+
]);
|
|
210
|
+
const _getHighlightedLegend = React.useCallback(()=>{
|
|
211
|
+
return selectedLegends.length > 0 ? selectedLegends : hoveredLegend ? [
|
|
212
|
+
hoveredLegend
|
|
213
|
+
] : [];
|
|
214
|
+
}, [
|
|
215
|
+
hoveredLegend,
|
|
216
|
+
selectedLegends
|
|
217
|
+
]);
|
|
218
|
+
/**
|
|
219
|
+
* This function checks if the given legend is highlighted or not.
|
|
220
|
+
* A legend can be highlighted in 2 ways:
|
|
221
|
+
* 1. selection: if the user clicks on it
|
|
222
|
+
* 2. hovering: if there is no selected legend and the user hovers over it
|
|
223
|
+
*/ const _legendHighlighted = React.useCallback((legend)=>{
|
|
224
|
+
return _getHighlightedLegend().includes(`${legend}`);
|
|
225
|
+
}, [
|
|
226
|
+
_getHighlightedLegend
|
|
227
|
+
]);
|
|
228
|
+
/**
|
|
229
|
+
* This function checks if none of the legends is selected or hovered.
|
|
230
|
+
*/ const _noLegendHighlighted = React.useCallback(()=>{
|
|
231
|
+
return _getHighlightedLegend().length === 0;
|
|
232
|
+
}, [
|
|
233
|
+
_getHighlightedLegend
|
|
234
|
+
]);
|
|
235
|
+
const _showCallout = React.useCallback((target, point)=>{
|
|
236
|
+
if (!(_noLegendHighlighted() || _legendHighlighted(point.legend)) || _calloutAnchorPoint.current === point) {
|
|
237
|
+
return;
|
|
238
|
+
}
|
|
239
|
+
if ('clientX' in target && 'clientY' in target) {
|
|
240
|
+
updatePosition(target.clientX, target.clientY);
|
|
241
|
+
} else {
|
|
242
|
+
const rect = target.target.getBoundingClientRect();
|
|
243
|
+
updatePosition(rect.left, rect.top);
|
|
244
|
+
}
|
|
245
|
+
_calloutAnchorPoint.current = point;
|
|
246
|
+
setPopoverOpen(true);
|
|
247
|
+
setCalloutLegend(point.legend);
|
|
248
|
+
setCalloutColor(point.color);
|
|
249
|
+
setXCalloutValue(point.yAxisCalloutData || point.y.toString());
|
|
250
|
+
setYCalloutValue(point.xAxisCalloutData || _getFormattedXValue(point));
|
|
251
|
+
setCalloutDataPoint(point);
|
|
252
|
+
}, [
|
|
253
|
+
_getFormattedXValue,
|
|
254
|
+
_legendHighlighted,
|
|
255
|
+
_noLegendHighlighted
|
|
256
|
+
]);
|
|
257
|
+
const _onBarFocus = React.useCallback((point, focusEvent)=>{
|
|
258
|
+
_showCallout(focusEvent, point);
|
|
259
|
+
}, [
|
|
260
|
+
_showCallout
|
|
261
|
+
]);
|
|
262
|
+
const _onBarHover = React.useCallback((point, mouseEvent)=>{
|
|
263
|
+
_showCallout(mouseEvent, point);
|
|
264
|
+
}, [
|
|
265
|
+
_showCallout
|
|
266
|
+
]);
|
|
267
|
+
const _onBarLeave = React.useCallback(()=>{
|
|
268
|
+
// do nothing
|
|
269
|
+
}, []);
|
|
270
|
+
const _handleChartMouseLeave = React.useCallback(()=>{
|
|
271
|
+
_calloutAnchorPoint.current = null;
|
|
272
|
+
setPopoverOpen(false);
|
|
273
|
+
setCalloutLegend('');
|
|
274
|
+
setCalloutColor('');
|
|
275
|
+
setXCalloutValue('');
|
|
276
|
+
setYCalloutValue('');
|
|
277
|
+
setCalloutDataPoint(undefined);
|
|
278
|
+
}, []);
|
|
279
|
+
const _getBarHeight = React.useCallback((adjustedValue)=>{
|
|
280
|
+
let barHeight;
|
|
281
|
+
if (typeof props.barHeight === 'number') {
|
|
282
|
+
barHeight = props.barHeight;
|
|
283
|
+
} else {
|
|
284
|
+
barHeight = adjustedValue;
|
|
285
|
+
}
|
|
286
|
+
if (typeof maxBarHeight === 'number') {
|
|
287
|
+
barHeight = Math.min(barHeight, maxBarHeight);
|
|
288
|
+
}
|
|
289
|
+
barHeight = Math.max(barHeight, MIN_BAR_HEIGHT);
|
|
290
|
+
return barHeight;
|
|
291
|
+
}, [
|
|
292
|
+
maxBarHeight,
|
|
293
|
+
props.barHeight
|
|
294
|
+
]);
|
|
295
|
+
const _getOrderedDataPoints = React.useCallback(()=>{
|
|
296
|
+
const result = [];
|
|
297
|
+
const yValueToPoints = {};
|
|
298
|
+
_points.forEach((point)=>{
|
|
299
|
+
if (!yValueToPoints[point.y]) {
|
|
300
|
+
yValueToPoints[point.y] = [];
|
|
301
|
+
}
|
|
302
|
+
yValueToPoints[point.y].push(point);
|
|
303
|
+
});
|
|
304
|
+
for(let i = _yAxisLabels.length - 1; i >= 0; i--){
|
|
305
|
+
const yValue = _yAxisLabels[i];
|
|
306
|
+
if (yValueToPoints[yValue]) {
|
|
307
|
+
result.push(...yValueToPoints[yValue].sort((a, b)=>+a.x.start - +b.x.start));
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
return result;
|
|
311
|
+
}, [
|
|
312
|
+
_points,
|
|
313
|
+
_yAxisLabels
|
|
314
|
+
]);
|
|
315
|
+
const _createBars = React.useCallback(({ xScale, yScalePrimary: yScale })=>{
|
|
316
|
+
const getGradientId = (legend)=>{
|
|
317
|
+
const legendId = _legendMap.current[`${legend}`].id;
|
|
318
|
+
return `${legendId}_gradient`;
|
|
319
|
+
};
|
|
320
|
+
const gradientDefs = [];
|
|
321
|
+
if (props.enableGradient) {
|
|
322
|
+
Object.keys(_legendMap.current).forEach((legend, index)=>{
|
|
323
|
+
const { startColor, endColor } = _legendMap.current[legend];
|
|
324
|
+
gradientDefs.push(/*#__PURE__*/ React.createElement("linearGradient", {
|
|
325
|
+
key: index,
|
|
326
|
+
id: getGradientId(legend)
|
|
327
|
+
}, /*#__PURE__*/ React.createElement("stop", {
|
|
328
|
+
offset: "0",
|
|
329
|
+
stopColor: startColor
|
|
330
|
+
}), /*#__PURE__*/ React.createElement("stop", {
|
|
331
|
+
offset: "100%",
|
|
332
|
+
stopColor: endColor
|
|
333
|
+
})));
|
|
334
|
+
});
|
|
335
|
+
}
|
|
336
|
+
let scaleBandwidth = 0;
|
|
337
|
+
if (_yAxisType === YAxisType.StringAxis) {
|
|
338
|
+
scaleBandwidth = yScale.bandwidth();
|
|
339
|
+
_barHeight.current = _getBarHeight(scaleBandwidth);
|
|
340
|
+
}
|
|
341
|
+
const points = _getOrderedDataPoints();
|
|
342
|
+
const bars = points.map((point, index)=>{
|
|
343
|
+
const rectStartX = xScale(point.x.start);
|
|
344
|
+
const rectEndX = xScale(point.x.end);
|
|
345
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
346
|
+
const rectY = yScale(point.y) + (scaleBandwidth - _barHeight.current) / 2;
|
|
347
|
+
const shouldHighlight = _noLegendHighlighted() || _legendHighlighted(point.legend);
|
|
348
|
+
return /*#__PURE__*/ React.createElement("rect", {
|
|
349
|
+
key: index,
|
|
350
|
+
x: Math.min(rectStartX, rectEndX),
|
|
351
|
+
y: rectY,
|
|
352
|
+
width: Math.abs(rectEndX - rectStartX),
|
|
353
|
+
height: _barHeight.current,
|
|
354
|
+
rx: props.roundCorners ? 3 : 0,
|
|
355
|
+
fill: props.enableGradient ? `url(#${getGradientId(point.legend)})` : point.color,
|
|
356
|
+
opacity: shouldHighlight ? 1 : 0.1,
|
|
357
|
+
onClick: point.onClick,
|
|
358
|
+
onMouseOver: (event)=>_onBarHover(point, event),
|
|
359
|
+
onMouseLeave: _onBarLeave,
|
|
360
|
+
onFocus: (event)=>_onBarFocus(point, event),
|
|
361
|
+
onBlur: _onBarLeave,
|
|
362
|
+
tabIndex: shouldHighlight ? 0 : -1,
|
|
363
|
+
role: "img",
|
|
364
|
+
"aria-label": _getAriaLabel(point)
|
|
365
|
+
});
|
|
366
|
+
});
|
|
367
|
+
return /*#__PURE__*/ React.createElement("g", null, gradientDefs.length > 0 ? /*#__PURE__*/ React.createElement("defs", null, gradientDefs) : null, bars);
|
|
368
|
+
}, [
|
|
369
|
+
_getAriaLabel,
|
|
370
|
+
_getBarHeight,
|
|
371
|
+
_getOrderedDataPoints,
|
|
372
|
+
_legendHighlighted,
|
|
373
|
+
_noLegendHighlighted,
|
|
374
|
+
_onBarFocus,
|
|
375
|
+
_onBarHover,
|
|
376
|
+
_onBarLeave,
|
|
377
|
+
_yAxisType,
|
|
378
|
+
props.enableGradient,
|
|
379
|
+
props.roundCorners
|
|
380
|
+
]);
|
|
381
|
+
const _onLegendHover = React.useCallback((legend)=>{
|
|
382
|
+
setHoveredLegend(legend);
|
|
383
|
+
}, []);
|
|
384
|
+
const _onLegendLeave = React.useCallback(()=>{
|
|
385
|
+
setHoveredLegend('');
|
|
386
|
+
}, []);
|
|
387
|
+
const _onLegendSelectionChange = React.useCallback((_selectedLegends, event, currentLegend)=>{
|
|
388
|
+
var _props_legendProps, _props_legendProps1;
|
|
389
|
+
if ((_props_legendProps = props.legendProps) === null || _props_legendProps === void 0 ? void 0 : _props_legendProps.canSelectMultipleLegends) {
|
|
390
|
+
setSelectedLegends(_selectedLegends);
|
|
391
|
+
} else {
|
|
392
|
+
setSelectedLegends(_selectedLegends.slice(-1));
|
|
393
|
+
}
|
|
394
|
+
if ((_props_legendProps1 = props.legendProps) === null || _props_legendProps1 === void 0 ? void 0 : _props_legendProps1.onChange) {
|
|
395
|
+
props.legendProps.onChange(_selectedLegends, event, currentLegend);
|
|
396
|
+
}
|
|
397
|
+
}, [
|
|
398
|
+
props.legendProps
|
|
399
|
+
]);
|
|
400
|
+
const _getLegendData = React.useCallback(()=>{
|
|
401
|
+
const actions = [];
|
|
402
|
+
Object.keys(_legendMap.current).forEach((legendTitle)=>{
|
|
403
|
+
const legend = {
|
|
404
|
+
title: legendTitle,
|
|
405
|
+
color: _legendMap.current[legendTitle].startColor,
|
|
406
|
+
hoverAction: ()=>{
|
|
407
|
+
_handleChartMouseLeave();
|
|
408
|
+
_onLegendHover(legendTitle);
|
|
409
|
+
},
|
|
410
|
+
onMouseOutAction: ()=>{
|
|
411
|
+
_onLegendLeave();
|
|
412
|
+
}
|
|
413
|
+
};
|
|
414
|
+
actions.push(legend);
|
|
415
|
+
});
|
|
416
|
+
const legends = /*#__PURE__*/ React.createElement(Legends, {
|
|
417
|
+
legends: actions,
|
|
418
|
+
enabledWrapLines: props.enabledLegendsWrapLines,
|
|
419
|
+
overflowText: props.legendsOverflowText,
|
|
420
|
+
onChange: _onLegendSelectionChange,
|
|
421
|
+
...props.legendProps
|
|
422
|
+
});
|
|
423
|
+
return legends;
|
|
424
|
+
}, [
|
|
425
|
+
_handleChartMouseLeave,
|
|
426
|
+
_onLegendHover,
|
|
427
|
+
_onLegendLeave,
|
|
428
|
+
_onLegendSelectionChange,
|
|
429
|
+
props.enabledLegendsWrapLines,
|
|
430
|
+
props.legendProps,
|
|
431
|
+
props.legendsOverflowText
|
|
432
|
+
]);
|
|
433
|
+
const _getChartTitle = React.useCallback(()=>{
|
|
434
|
+
return (props.chartTitle ? `${props.chartTitle}. ` : '') + `Gantt chart with ${_points.length} data points. `;
|
|
435
|
+
}, [
|
|
436
|
+
_points.length,
|
|
437
|
+
props.chartTitle
|
|
438
|
+
]);
|
|
439
|
+
const _isChartEmpty = React.useCallback(()=>{
|
|
440
|
+
return _points.length === 0;
|
|
441
|
+
}, [
|
|
442
|
+
_points.length
|
|
443
|
+
]);
|
|
444
|
+
const _getYDomainMargins = React.useCallback((containerHeight)=>{
|
|
445
|
+
let domainMargin = MIN_DOMAIN_MARGIN;
|
|
446
|
+
const ySet = new Set();
|
|
447
|
+
_points.forEach((point)=>{
|
|
448
|
+
ySet.add(point.y);
|
|
449
|
+
});
|
|
450
|
+
const uniqueY = Array.from(ySet);
|
|
451
|
+
/** Total height available to render the bars */ const totalHeight = containerHeight - (_margins.current.top + MIN_DOMAIN_MARGIN) - (_margins.current.bottom + MIN_DOMAIN_MARGIN);
|
|
452
|
+
if (_yAxisType !== YAxisType.StringAxis) {
|
|
453
|
+
_barHeight.current = _getBarHeight(calculateAppropriateBarWidth(uniqueY, totalHeight, _yAxisPadding));
|
|
454
|
+
domainMargin += _barHeight.current / 2;
|
|
455
|
+
}
|
|
456
|
+
return {
|
|
457
|
+
..._margins.current,
|
|
458
|
+
top: _margins.current.top + domainMargin,
|
|
459
|
+
bottom: _margins.current.bottom + domainMargin
|
|
460
|
+
};
|
|
461
|
+
}, [
|
|
462
|
+
_getBarHeight,
|
|
463
|
+
_points,
|
|
464
|
+
_yAxisPadding,
|
|
465
|
+
_yAxisType
|
|
466
|
+
]);
|
|
467
|
+
function updatePosition(newX, newY) {
|
|
468
|
+
const threshold = 1; // Set a threshold for movement
|
|
469
|
+
const { x, y } = clickPosition;
|
|
470
|
+
// Calculate the distance moved
|
|
471
|
+
const distance = Math.sqrt(Math.pow(newX - x, 2) + Math.pow(newY - y, 2));
|
|
472
|
+
// Update the position only if the distance moved is greater than the threshold
|
|
473
|
+
if (distance > threshold) {
|
|
474
|
+
setClickPosition({
|
|
475
|
+
x: newX,
|
|
476
|
+
y: newY
|
|
477
|
+
});
|
|
478
|
+
setPopoverOpen(true);
|
|
479
|
+
}
|
|
480
|
+
}
|
|
481
|
+
if (!_isChartEmpty()) {
|
|
482
|
+
_barHeight.current = _getBarHeight(DEFAULT_BAR_HEIGHT);
|
|
483
|
+
const calloutProps = {
|
|
484
|
+
isPopoverOpen,
|
|
485
|
+
clickPosition,
|
|
486
|
+
color: calloutColor,
|
|
487
|
+
legend: calloutLegend,
|
|
488
|
+
XValue: xCalloutValue,
|
|
489
|
+
YValue: yCalloutValue,
|
|
490
|
+
...props.calloutProps
|
|
491
|
+
};
|
|
492
|
+
const tickParams = {
|
|
493
|
+
tickValues: props.tickValues,
|
|
494
|
+
tickFormat: props.tickFormat
|
|
495
|
+
};
|
|
496
|
+
return /*#__PURE__*/ React.createElement(CartesianChart, {
|
|
497
|
+
...props,
|
|
498
|
+
yAxisPadding: _yAxisPadding,
|
|
499
|
+
chartTitle: _getChartTitle(),
|
|
500
|
+
points: _points,
|
|
501
|
+
chartType: ChartTypes.GanttChart,
|
|
502
|
+
xAxisType: _xAxisType,
|
|
503
|
+
yAxisType: _yAxisType,
|
|
504
|
+
stringDatasetForYAxisDomain: _yAxisLabels,
|
|
505
|
+
calloutProps: calloutProps,
|
|
506
|
+
tickParams: tickParams,
|
|
507
|
+
legendBars: _getLegendData(),
|
|
508
|
+
createYAxis: createYAxisForHorizontalBarChartWithAxis,
|
|
509
|
+
getDomainNRangeValues: _getDomainNRangeValues,
|
|
510
|
+
createStringYAxis: createStringYAxisForHorizontalBarChartWithAxis,
|
|
511
|
+
getMinMaxOfYAxis: findHBCWANumericMinMaxOfY,
|
|
512
|
+
customizedCallout: _getCustomizedCallout(),
|
|
513
|
+
getmargins: _getMargins,
|
|
514
|
+
getYDomainMargins: _getYDomainMargins,
|
|
515
|
+
onChartMouseLeave: _handleChartMouseLeave,
|
|
516
|
+
useUTC: useUTC,
|
|
517
|
+
children: _createBars
|
|
518
|
+
});
|
|
519
|
+
} else {
|
|
520
|
+
return /*#__PURE__*/ React.createElement("div", {
|
|
521
|
+
id: _emptyChartId,
|
|
522
|
+
role: 'alert',
|
|
523
|
+
style: {
|
|
524
|
+
opacity: '0'
|
|
525
|
+
},
|
|
526
|
+
"aria-label": 'Graph has no data to display'
|
|
527
|
+
});
|
|
528
|
+
}
|
|
529
|
+
});
|
|
530
|
+
GanttChart.displayName = 'GanttChart';
|