@fluentui/react-charts 9.1.9 → 9.2.0
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 +47 -2
- package/dist/index.d.ts +348 -11
- 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 +1 -0
- package/lib/FunnelChart.js.map +1 -0
- 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 +24 -8
- 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 +15 -7
- 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 +5 -5
- 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 +18 -4
- 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 +400 -0
- package/lib/components/FunnelChart/FunnelChart.js.map +1 -0
- package/lib/components/FunnelChart/FunnelChart.types.js +1 -0
- package/lib/components/FunnelChart/FunnelChart.types.js.map +1 -0
- package/lib/components/FunnelChart/funnelGeometry.js +220 -0
- package/lib/components/FunnelChart/funnelGeometry.js.map +1 -0
- package/lib/components/FunnelChart/index.js +2 -0
- package/lib/components/FunnelChart/index.js.map +1 -0
- package/lib/components/FunnelChart/useFunnelChartStyles.styles.js +58 -0
- package/lib/components/FunnelChart/useFunnelChartStyles.styles.js.map +1 -0
- 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 +547 -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 +9 -2
- 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 +77 -60
- 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 +11 -3
- 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 +18 -5
- 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 +28 -10
- 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 +57 -14
- package/lib/components/Legends/useLegendsStyles.styles.js.map +1 -1
- package/lib/components/Legends/useLegendsStyles.styles.raw.js +138 -0
- package/lib/components/Legends/useLegendsStyles.styles.raw.js.map +1 -0
- package/lib/components/LineChart/LineChart.js +23 -9
- 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 +5 -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 +19 -5
- 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 +71 -31
- 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 +26 -12
- 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 +2 -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 +12 -0
- package/lib/utilities/colors.js.map +1 -1
- package/lib/utilities/getWindow.js.map +1 -1
- package/lib/utilities/image-export-utils.js +256 -0
- package/lib/utilities/image-export-utils.js.map +1 -0
- 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 +140 -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 +6 -0
- package/lib-commonjs/FunnelChart.js.map +1 -0
- 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 +23 -7
- 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 +14 -6
- 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 +5 -5
- 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 +17 -3
- 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 +411 -0
- package/lib-commonjs/components/FunnelChart/FunnelChart.js.map +1 -0
- package/lib-commonjs/components/FunnelChart/FunnelChart.types.js +6 -0
- package/lib-commonjs/components/FunnelChart/FunnelChart.types.js.map +1 -0
- package/lib-commonjs/components/FunnelChart/funnelGeometry.js +248 -0
- package/lib-commonjs/components/FunnelChart/funnelGeometry.js.map +1 -0
- package/lib-commonjs/components/FunnelChart/index.js +7 -0
- package/lib-commonjs/components/FunnelChart/index.js.map +1 -0
- package/lib-commonjs/components/FunnelChart/useFunnelChartStyles.styles.js +79 -0
- package/lib-commonjs/components/FunnelChart/useFunnelChartStyles.styles.js.map +1 -0
- 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 +558 -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 +9 -2
- 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 +77 -60
- 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 +10 -2
- 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 +18 -5
- 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 +28 -10
- 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 +101 -28
- package/lib-commonjs/components/Legends/useLegendsStyles.styles.js.map +1 -1
- package/lib-commonjs/components/Legends/useLegendsStyles.styles.raw.js +174 -0
- package/lib-commonjs/components/Legends/useLegendsStyles.styles.raw.js.map +1 -0
- package/lib-commonjs/components/LineChart/LineChart.js +23 -9
- 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 +5 -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 +18 -4
- 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 +71 -31
- 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 +26 -12
- 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 +2 -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 +18 -0
- package/lib-commonjs/utilities/colors.js.map +1 -1
- package/lib-commonjs/utilities/getWindow.js.map +1 -1
- package/lib-commonjs/utilities/image-export-utils.js +274 -0
- package/lib-commonjs/utilities/image-export-utils.js.map +1 -0
- 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 +142 -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 +12 -22
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/FunnelChart/FunnelChart.types.ts"],"sourcesContent":["import * as React from 'react';\nimport { ChartPopoverProps } from '../CommonComponents/ChartPopover.types';\nimport { LegendsProps } from '../Legends/index';\n\n/**\n * Data point for funnel chart\n * {@docCategory FunnelChart}\n */\nexport interface FunnelChartDataPoint {\n /**\n * Stage name or identifier\n */\n stage: string | number;\n /**\n * Sub-values for stacked funnel charts\n * Each sub-value represents a category within the stage\n */\n subValues?: Array<{ category: string; value: number; color: string }>;\n /**\n * Value for the stage (used for non-stacked funnel charts)\n */\n value?: number;\n /**\n * Color for the stage (used for non-stacked funnel charts)\n */\n color?: string;\n}\n\n/**\n * Funnel Chart component props\n * {@docCategory FunnelChart}\n */\nexport interface FunnelChartProps {\n /**\n * Data points for the funnel chart\n */\n data: FunnelChartDataPoint[];\n /**\n * Title for the chart\n */\n chartTitle?: string;\n /**\n * Width of the chart\n */\n width?: number;\n\n /**\n * Height of the chart\n */\n height?: number;\n\n /**\n * Decides whether to show/hide legends\n * @defaultvalue false\n */\n hideLegend?: boolean;\n\n /**\n * Props for the legends in the chart\n */\n legendProps?: Partial<LegendsProps>;\n\n /**\n * Props for the callout in the chart\n */\n calloutProps?: ChartPopoverProps;\n\n /**\n * Call to provide customized styling that will layer on top of the variant rules\n */\n styles?: FunnelChartStyles;\n\n /**\n * Defines the culture to localize the numbers and dates\n */\n culture?: string;\n\n /**\n * Reference to the chart component\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n componentRef?: React.RefObject<any>;\n\n /**\n * Additional CSS class(es) to apply to the chart\n */\n className?: string;\n\n /**\n * Orientation of the funnel chart\n * @defaultvalue 'horizontal'\n */\n orientation?: 'horizontal' | 'vertical';\n}\n\n/**\n * Funnel Chart style properties\n * {@docCategory FunnelChart}\n */\nexport interface FunnelChartStyleProps {\n /**\n * Additional CSS class(es) to apply to the chart\n */\n className?: string;\n /**\n * Width of the chart\n */\n chartWidth: number;\n /**\n * Height of the chart\n */\n chartHeight: number;\n}\n\n/**\n * Funnel Chart styles\n * {@docCategory FunnelChart}\n */\nexport interface FunnelChartStyles {\n /**\n * Styles for the root element\n */\n root?: string;\n\n /**\n * Styles for the chart\n */\n chart?: string;\n\n /**\n * Styles for text elements\n */\n text?: string;\n\n /**\n * Styles for the callout root element\n */\n calloutContentRoot?: string;\n}\n"],"names":["React"],"mappings":";;;;;iEAAuB,QAAQ"}
|
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
function _export(target, all) {
|
|
6
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: all[name]
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
_export(exports, {
|
|
12
|
+
getHorizontalFunnelSegmentGeometry: function() {
|
|
13
|
+
return getHorizontalFunnelSegmentGeometry;
|
|
14
|
+
},
|
|
15
|
+
getSegmentTextProps: function() {
|
|
16
|
+
return getSegmentTextProps;
|
|
17
|
+
},
|
|
18
|
+
getStackedHorizontalFunnelSegmentGeometry: function() {
|
|
19
|
+
return getStackedHorizontalFunnelSegmentGeometry;
|
|
20
|
+
},
|
|
21
|
+
getStackedVerticalFunnelSegmentGeometry: function() {
|
|
22
|
+
return getStackedVerticalFunnelSegmentGeometry;
|
|
23
|
+
},
|
|
24
|
+
getVerticalFunnelSegmentGeometry: function() {
|
|
25
|
+
return getVerticalFunnelSegmentGeometry;
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
|
|
29
|
+
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
|
|
30
|
+
function getVerticalFunnelSegmentGeometry({ d, i, data, funnelWidth, funnelHeight, isRTL }) {
|
|
31
|
+
const segmentHeight = funnelHeight / data.length;
|
|
32
|
+
const widthScale = (value)=>value / Math.max(...data.map((dataPoint)=>dataPoint.value)) * funnelWidth;
|
|
33
|
+
const topWidth = widthScale(d.value);
|
|
34
|
+
const bottomWidth = i < data.length - 1 ? widthScale(data[i + 1].value) : 0;
|
|
35
|
+
const xOffset = (funnelWidth - topWidth) / 2;
|
|
36
|
+
const nextXOffset = (funnelWidth - bottomWidth) / 2;
|
|
37
|
+
const xStart = isRTL ? funnelWidth - xOffset : xOffset;
|
|
38
|
+
const xEnd = isRTL ? funnelWidth - nextXOffset : nextXOffset;
|
|
39
|
+
const isLastSegment = i === data.length - 1;
|
|
40
|
+
const textY = isLastSegment ? i * segmentHeight + segmentHeight * 0.33 : i * segmentHeight + segmentHeight / 2;
|
|
41
|
+
const textX = funnelWidth / 2;
|
|
42
|
+
let availableWidth = topWidth;
|
|
43
|
+
if (isLastSegment) {
|
|
44
|
+
const yFromTop = textY - i * segmentHeight;
|
|
45
|
+
const widthAtY = topWidth * (1 - yFromTop / segmentHeight);
|
|
46
|
+
availableWidth = Math.max(widthAtY * 0.8, 0);
|
|
47
|
+
} else {
|
|
48
|
+
availableWidth = Math.min(topWidth, bottomWidth) * 0.9;
|
|
49
|
+
}
|
|
50
|
+
const pathD = `M${xStart},${i * segmentHeight}
|
|
51
|
+
L${funnelWidth - xStart},${i * segmentHeight}
|
|
52
|
+
L${funnelWidth - xEnd},${(i + 1) * segmentHeight}
|
|
53
|
+
L${xEnd},${(i + 1) * segmentHeight}
|
|
54
|
+
Z`;
|
|
55
|
+
return {
|
|
56
|
+
pathD,
|
|
57
|
+
textX,
|
|
58
|
+
textY,
|
|
59
|
+
availableWidth
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
function getHorizontalFunnelSegmentGeometry({ d, i, data, funnelWidth, funnelHeight, isRTL }) {
|
|
63
|
+
const segmentWidth = funnelWidth / data.length;
|
|
64
|
+
const heightScale = (value)=>value / Math.max(...data.map((dataPoint)=>dataPoint.value)) * funnelHeight;
|
|
65
|
+
const leftHeight = heightScale(d.value);
|
|
66
|
+
const rightHeight = i < data.length - 1 ? heightScale(data[i + 1].value) : 0;
|
|
67
|
+
const yOffset = (funnelHeight - leftHeight) / 2;
|
|
68
|
+
const nextYOffset = (funnelHeight - rightHeight) / 2;
|
|
69
|
+
const x0 = i * segmentWidth;
|
|
70
|
+
const x1 = (i + 1) * segmentWidth;
|
|
71
|
+
const isLastSegment = i === data.length - 1;
|
|
72
|
+
let textX;
|
|
73
|
+
let textY;
|
|
74
|
+
let availableWidth = segmentWidth * 0.8;
|
|
75
|
+
if (isLastSegment) {
|
|
76
|
+
// For the triangular last segment, position text at 1/4 from the left edge
|
|
77
|
+
textX = x0 + (x1 - x0) * 0.25;
|
|
78
|
+
textY = funnelHeight / 2;
|
|
79
|
+
// For triangular segments, we need to check both height and width constraints
|
|
80
|
+
// The segment needs to be large enough to contain text
|
|
81
|
+
const segmentArea = leftHeight * segmentWidth / 2; // Area of triangle
|
|
82
|
+
const minAreaForText = 800; // Minimum area needed to show text
|
|
83
|
+
if (leftHeight < 40 || segmentArea < minAreaForText) {
|
|
84
|
+
// Hide text if height is too small or area is insufficient
|
|
85
|
+
availableWidth = 0;
|
|
86
|
+
} else {
|
|
87
|
+
// Calculate available width at text position
|
|
88
|
+
const widthAtTextPosition = (x1 - x0) * 0.75;
|
|
89
|
+
availableWidth = widthAtTextPosition * 0.6;
|
|
90
|
+
}
|
|
91
|
+
} else {
|
|
92
|
+
textX = (x0 + x1) / 2;
|
|
93
|
+
textY = funnelHeight / 2;
|
|
94
|
+
const minHeight = Math.min(leftHeight, rightHeight);
|
|
95
|
+
availableWidth = minHeight > 20 ? segmentWidth * 0.8 : 0;
|
|
96
|
+
}
|
|
97
|
+
const pathD = `M${x0},${yOffset}
|
|
98
|
+
L${x1},${nextYOffset}
|
|
99
|
+
L${x1},${funnelHeight - nextYOffset}
|
|
100
|
+
L${x0},${funnelHeight - yOffset}
|
|
101
|
+
Z`;
|
|
102
|
+
return {
|
|
103
|
+
pathD,
|
|
104
|
+
textX,
|
|
105
|
+
textY,
|
|
106
|
+
availableWidth
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
function getStackedVerticalFunnelSegmentGeometry({ i, k, stages, totals, maxTotal, funnelWidth, funnelHeight }) {
|
|
110
|
+
var _next_subValues;
|
|
111
|
+
const segmentHeight = funnelHeight / stages.length;
|
|
112
|
+
const cur = stages[i];
|
|
113
|
+
const next = stages[i + 1] || {
|
|
114
|
+
subValues: []
|
|
115
|
+
};
|
|
116
|
+
const curTotal = totals[i] || 1;
|
|
117
|
+
const nextTotal = totals[i + 1] || 0;
|
|
118
|
+
let cumTop = 0;
|
|
119
|
+
let cumBot = 0;
|
|
120
|
+
for(let idx = 0; idx < k; idx++){
|
|
121
|
+
var _next_subValues1;
|
|
122
|
+
const v = cur.subValues[idx];
|
|
123
|
+
const vNext = (_next_subValues1 = next.subValues) === null || _next_subValues1 === void 0 ? void 0 : _next_subValues1.find((x)=>x.category === v.category);
|
|
124
|
+
const val = v.value;
|
|
125
|
+
const nextVal = vNext ? vNext.value : 0;
|
|
126
|
+
cumTop += val / curTotal * (curTotal / maxTotal) * funnelWidth;
|
|
127
|
+
cumBot += (nextVal / nextTotal || 0) * (nextTotal / maxTotal) * funnelWidth;
|
|
128
|
+
}
|
|
129
|
+
const v = cur.subValues[k];
|
|
130
|
+
const vNext = (_next_subValues = next.subValues) === null || _next_subValues === void 0 ? void 0 : _next_subValues.find((x)=>x.category === v.category);
|
|
131
|
+
const val = v.value;
|
|
132
|
+
const nextVal = vNext ? vNext.value : 0;
|
|
133
|
+
const topW = val / curTotal * (curTotal / maxTotal) * funnelWidth;
|
|
134
|
+
const botW = (nextVal / nextTotal || 0) * (nextTotal / maxTotal) * funnelWidth;
|
|
135
|
+
const topStart = (funnelWidth - curTotal / maxTotal * funnelWidth) / 2 + cumTop;
|
|
136
|
+
const topEnd = topStart + topW;
|
|
137
|
+
const botStart = (funnelWidth - nextTotal / maxTotal * funnelWidth) / 2 + cumBot;
|
|
138
|
+
const botEnd = botStart + botW;
|
|
139
|
+
const textX = (topStart + topEnd + botStart + botEnd) / 4;
|
|
140
|
+
const isLastSegment = i === stages.length - 1;
|
|
141
|
+
const textY = isLastSegment ? i * segmentHeight + segmentHeight * 0.33 : (i + 0.5) * segmentHeight;
|
|
142
|
+
// Calculate available width based on this specific segment's width
|
|
143
|
+
let availableWidth;
|
|
144
|
+
if (isLastSegment) {
|
|
145
|
+
// For triangular last segment, use the width at text Y position
|
|
146
|
+
const yFromTop = textY - i * segmentHeight;
|
|
147
|
+
const widthRatio = 1 - yFromTop / segmentHeight;
|
|
148
|
+
availableWidth = topW * widthRatio;
|
|
149
|
+
} else {
|
|
150
|
+
// For trapezoidal segments, use the actual segment width
|
|
151
|
+
availableWidth = Math.min(topW, botW);
|
|
152
|
+
}
|
|
153
|
+
const pathD = `M${topStart},${i * segmentHeight}
|
|
154
|
+
L${topEnd},${i * segmentHeight}
|
|
155
|
+
L${botEnd},${(i + 1) * segmentHeight}
|
|
156
|
+
L${botStart},${(i + 1) * segmentHeight}
|
|
157
|
+
Z`;
|
|
158
|
+
return {
|
|
159
|
+
pathD,
|
|
160
|
+
textX,
|
|
161
|
+
textY,
|
|
162
|
+
availableWidth
|
|
163
|
+
};
|
|
164
|
+
}
|
|
165
|
+
function getStackedHorizontalFunnelSegmentGeometry({ i, k, stages, totals, maxTotal, funnelWidth, funnelHeight }) {
|
|
166
|
+
var _next_subValues;
|
|
167
|
+
const segmentWidth = funnelWidth / stages.length;
|
|
168
|
+
const cur = stages[i];
|
|
169
|
+
const next = stages[i + 1] || {
|
|
170
|
+
subValues: []
|
|
171
|
+
};
|
|
172
|
+
const curTotal = totals[i] || 1;
|
|
173
|
+
const nextTotal = totals[i + 1] || 0;
|
|
174
|
+
let cumTop = 0;
|
|
175
|
+
let cumBot = 0;
|
|
176
|
+
for(let idx = 0; idx < k; idx++){
|
|
177
|
+
var _next_subValues1;
|
|
178
|
+
const v = cur.subValues[idx];
|
|
179
|
+
const vNext = (_next_subValues1 = next.subValues) === null || _next_subValues1 === void 0 ? void 0 : _next_subValues1.find((x)=>x.category === v.category);
|
|
180
|
+
const val = v.value;
|
|
181
|
+
const nextVal = vNext ? vNext.value : 0;
|
|
182
|
+
cumTop += val / curTotal * (curTotal / maxTotal) * funnelHeight;
|
|
183
|
+
cumBot += (nextVal / nextTotal || 0) * (nextTotal / maxTotal) * funnelHeight;
|
|
184
|
+
}
|
|
185
|
+
const v = cur.subValues[k];
|
|
186
|
+
const vNext = (_next_subValues = next.subValues) === null || _next_subValues === void 0 ? void 0 : _next_subValues.find((x)=>x.category === v.category);
|
|
187
|
+
const val = v.value;
|
|
188
|
+
const nextVal = vNext ? vNext.value : 0;
|
|
189
|
+
const topH = val / curTotal * (curTotal / maxTotal) * funnelHeight;
|
|
190
|
+
const botH = (nextVal / nextTotal || 0) * (nextTotal / maxTotal) * funnelHeight;
|
|
191
|
+
const leftStart = i * segmentWidth;
|
|
192
|
+
const leftEnd = (i + 1) * segmentWidth;
|
|
193
|
+
const topStart = (funnelHeight - curTotal / maxTotal * funnelHeight) / 2 + cumTop;
|
|
194
|
+
const topEnd = topStart + topH;
|
|
195
|
+
const botStart = (funnelHeight - nextTotal / maxTotal * funnelHeight) / 2 + cumBot;
|
|
196
|
+
const botEnd = botStart + botH;
|
|
197
|
+
const isLastSegment = i === stages.length - 1;
|
|
198
|
+
let textX;
|
|
199
|
+
let textY;
|
|
200
|
+
let availableWidth;
|
|
201
|
+
if (isLastSegment) {
|
|
202
|
+
textX = leftStart + (leftEnd - leftStart) * 0.25;
|
|
203
|
+
textY = (topStart + topEnd) / 2;
|
|
204
|
+
// For triangular segments, calculate available width at text position
|
|
205
|
+
const segmentWidthAtTextPos = (leftEnd - leftStart) * 0.5;
|
|
206
|
+
availableWidth = segmentWidthAtTextPos * 0.8;
|
|
207
|
+
// For triangular last segments, also check if there's enough height
|
|
208
|
+
// The segment area should be large enough to contain text
|
|
209
|
+
const segmentArea = topH * segmentWidth / 2;
|
|
210
|
+
if (topH < 24 || segmentArea < 600) {
|
|
211
|
+
availableWidth = 0;
|
|
212
|
+
}
|
|
213
|
+
} else {
|
|
214
|
+
textX = (leftStart + leftEnd) / 2;
|
|
215
|
+
textY = (topStart + topEnd + botStart + botEnd) / 4;
|
|
216
|
+
// For trapezoidal segments, use full segment width
|
|
217
|
+
availableWidth = Math.abs(leftEnd - leftStart) * 0.9;
|
|
218
|
+
// Check if the segment has sufficient height for text
|
|
219
|
+
// For non-last segments, we need to ensure there's enough vertical space
|
|
220
|
+
const avgHeight = (topH + botH) / 2;
|
|
221
|
+
if (avgHeight < 20) {
|
|
222
|
+
availableWidth = 0;
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
const pathD = `M${leftStart},${topStart}
|
|
226
|
+
L${leftEnd},${botStart}
|
|
227
|
+
L${leftEnd},${botEnd}
|
|
228
|
+
L${leftStart},${topEnd}
|
|
229
|
+
Z`;
|
|
230
|
+
return {
|
|
231
|
+
pathD,
|
|
232
|
+
textX,
|
|
233
|
+
textY,
|
|
234
|
+
availableWidth
|
|
235
|
+
};
|
|
236
|
+
}
|
|
237
|
+
function getSegmentTextProps({ availableWidth, minTextWidth = 24, textX, textY, value, culture, onMouseOver, onMouseMove, onMouseOut }) {
|
|
238
|
+
return {
|
|
239
|
+
show: availableWidth > minTextWidth && availableWidth > 0,
|
|
240
|
+
x: textX,
|
|
241
|
+
y: textY,
|
|
242
|
+
value,
|
|
243
|
+
culture,
|
|
244
|
+
onMouseOver,
|
|
245
|
+
onMouseMove,
|
|
246
|
+
onMouseOut
|
|
247
|
+
};
|
|
248
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/FunnelChart/funnelGeometry.ts"],"sourcesContent":["import * as React from 'react';\nimport { FunnelChartDataPoint } from './FunnelChart.types';\n\nexport interface FunnelSegmentGeometry {\n pathD: string;\n textX: number;\n textY: number;\n availableWidth: number;\n}\n\nexport interface StackedFunnelSegmentGeometry {\n pathD: string;\n textX: number;\n textY: number;\n availableWidth: number;\n}\n\ninterface SubValue {\n category: string;\n value: number;\n color: string;\n}\n\ninterface Stage {\n subValues: SubValue[];\n}\n\nexport function getVerticalFunnelSegmentGeometry({\n d,\n i,\n data,\n funnelWidth,\n funnelHeight,\n isRTL,\n}: {\n d: FunnelChartDataPoint;\n i: number;\n data: FunnelChartDataPoint[];\n funnelWidth: number;\n funnelHeight: number;\n isRTL: boolean;\n}): FunnelSegmentGeometry {\n const segmentHeight = funnelHeight / data.length;\n const widthScale = (value: number) => (value / Math.max(...data.map(dataPoint => dataPoint.value!))) * funnelWidth;\n const topWidth = widthScale(d.value!);\n const bottomWidth = i < data.length - 1 ? widthScale(data[i + 1].value!) : 0;\n const xOffset = (funnelWidth - topWidth) / 2;\n const nextXOffset = (funnelWidth - bottomWidth) / 2;\n const xStart = isRTL ? funnelWidth - xOffset : xOffset;\n const xEnd = isRTL ? funnelWidth - nextXOffset : nextXOffset;\n\n const isLastSegment = i === data.length - 1;\n const textY = isLastSegment ? i * segmentHeight + segmentHeight * 0.33 : i * segmentHeight + segmentHeight / 2;\n\n const textX = funnelWidth / 2;\n let availableWidth = topWidth;\n if (isLastSegment) {\n const yFromTop = textY - i * segmentHeight;\n const widthAtY = topWidth * (1 - yFromTop / segmentHeight);\n availableWidth = Math.max(widthAtY * 0.8, 0);\n } else {\n availableWidth = Math.min(topWidth, bottomWidth) * 0.9;\n }\n const pathD = `M${xStart},${i * segmentHeight}\n L${funnelWidth - xStart},${i * segmentHeight}\n L${funnelWidth - xEnd},${(i + 1) * segmentHeight}\n L${xEnd},${(i + 1) * segmentHeight}\n Z`;\n return { pathD, textX, textY, availableWidth };\n}\n\nexport function getHorizontalFunnelSegmentGeometry({\n d,\n i,\n data,\n funnelWidth,\n funnelHeight,\n isRTL,\n}: {\n d: FunnelChartDataPoint;\n i: number;\n data: FunnelChartDataPoint[];\n funnelWidth: number;\n funnelHeight: number;\n isRTL: boolean;\n}): FunnelSegmentGeometry {\n const segmentWidth = funnelWidth / data.length;\n const heightScale = (value: number) => (value / Math.max(...data.map(dataPoint => dataPoint.value!))) * funnelHeight;\n const leftHeight = heightScale(d.value!);\n const rightHeight = i < data.length - 1 ? heightScale(data[i + 1].value!) : 0;\n const yOffset = (funnelHeight - leftHeight) / 2;\n const nextYOffset = (funnelHeight - rightHeight) / 2;\n const x0 = i * segmentWidth;\n const x1 = (i + 1) * segmentWidth;\n\n const isLastSegment = i === data.length - 1;\n let textX: number;\n let textY: number;\n let availableWidth = segmentWidth * 0.8;\n\n if (isLastSegment) {\n // For the triangular last segment, position text at 1/4 from the left edge\n textX = x0 + (x1 - x0) * 0.25;\n textY = funnelHeight / 2;\n\n // For triangular segments, we need to check both height and width constraints\n // The segment needs to be large enough to contain text\n const segmentArea = (leftHeight * segmentWidth) / 2; // Area of triangle\n const minAreaForText = 800; // Minimum area needed to show text\n\n if (leftHeight < 40 || segmentArea < minAreaForText) {\n // Hide text if height is too small or area is insufficient\n availableWidth = 0;\n } else {\n // Calculate available width at text position\n const widthAtTextPosition = (x1 - x0) * 0.75;\n availableWidth = widthAtTextPosition * 0.6;\n }\n } else {\n textX = (x0 + x1) / 2;\n textY = funnelHeight / 2;\n const minHeight = Math.min(leftHeight, rightHeight);\n availableWidth = minHeight > 20 ? segmentWidth * 0.8 : 0;\n }\n\n const pathD = `M${x0},${yOffset}\n L${x1},${nextYOffset}\n L${x1},${funnelHeight - nextYOffset}\n L${x0},${funnelHeight - yOffset}\n Z`;\n return { pathD, textX, textY, availableWidth };\n}\n\nexport function getStackedVerticalFunnelSegmentGeometry({\n i,\n k,\n stages,\n totals,\n maxTotal,\n funnelWidth,\n funnelHeight,\n}: {\n i: number;\n k: number;\n stages: Stage[];\n totals: number[];\n maxTotal: number;\n funnelWidth: number;\n funnelHeight: number;\n}): StackedFunnelSegmentGeometry {\n const segmentHeight = funnelHeight / stages.length;\n const cur = stages[i];\n const next = stages[i + 1] || { subValues: [] };\n const curTotal = totals[i] || 1;\n const nextTotal = totals[i + 1] || 0;\n\n let cumTop = 0;\n let cumBot = 0;\n for (let idx = 0; idx < k; idx++) {\n const v = cur.subValues[idx];\n const vNext = next.subValues?.find((x: SubValue) => x.category === v.category);\n const val = v.value;\n const nextVal = vNext ? vNext.value : 0;\n cumTop += (val / curTotal) * (curTotal / maxTotal) * funnelWidth;\n cumBot += (nextVal / nextTotal || 0) * (nextTotal / maxTotal) * funnelWidth;\n }\n const v = cur.subValues[k];\n const vNext = next.subValues?.find((x: SubValue) => x.category === v.category);\n const val = v.value;\n const nextVal = vNext ? vNext.value : 0;\n const topW = (val / curTotal) * (curTotal / maxTotal) * funnelWidth;\n const botW = (nextVal / nextTotal || 0) * (nextTotal / maxTotal) * funnelWidth;\n const topStart = (funnelWidth - (curTotal / maxTotal) * funnelWidth) / 2 + cumTop;\n const topEnd = topStart + topW;\n const botStart = (funnelWidth - (nextTotal / maxTotal) * funnelWidth) / 2 + cumBot;\n const botEnd = botStart + botW;\n const textX = (topStart + topEnd + botStart + botEnd) / 4;\n\n const isLastSegment = i === stages.length - 1;\n const textY = isLastSegment ? i * segmentHeight + segmentHeight * 0.33 : (i + 0.5) * segmentHeight;\n\n // Calculate available width based on this specific segment's width\n let availableWidth: number;\n if (isLastSegment) {\n // For triangular last segment, use the width at text Y position\n const yFromTop = textY - i * segmentHeight;\n const widthRatio = 1 - yFromTop / segmentHeight;\n availableWidth = topW * widthRatio;\n } else {\n // For trapezoidal segments, use the actual segment width\n availableWidth = Math.min(topW, botW);\n }\n\n const pathD = `M${topStart},${i * segmentHeight}\n L${topEnd},${i * segmentHeight}\n L${botEnd},${(i + 1) * segmentHeight}\n L${botStart},${(i + 1) * segmentHeight}\n Z`;\n return { pathD, textX, textY, availableWidth };\n}\n\nexport function getStackedHorizontalFunnelSegmentGeometry({\n i,\n k,\n stages,\n totals,\n maxTotal,\n funnelWidth,\n funnelHeight,\n}: {\n i: number;\n k: number;\n stages: Stage[];\n totals: number[];\n maxTotal: number;\n funnelWidth: number;\n funnelHeight: number;\n}): StackedFunnelSegmentGeometry {\n const segmentWidth = funnelWidth / stages.length;\n const cur = stages[i];\n const next = stages[i + 1] || { subValues: [] };\n const curTotal = totals[i] || 1;\n const nextTotal = totals[i + 1] || 0;\n\n let cumTop = 0;\n let cumBot = 0;\n for (let idx = 0; idx < k; idx++) {\n const v = cur.subValues[idx];\n const vNext = next.subValues?.find((x: SubValue) => x.category === v.category);\n const val = v.value;\n const nextVal = vNext ? vNext.value : 0;\n cumTop += (val / curTotal) * (curTotal / maxTotal) * funnelHeight;\n cumBot += (nextVal / nextTotal || 0) * (nextTotal / maxTotal) * funnelHeight;\n }\n const v = cur.subValues[k];\n const vNext = next.subValues?.find((x: SubValue) => x.category === v.category);\n const val = v.value;\n const nextVal = vNext ? vNext.value : 0;\n const topH = (val / curTotal) * (curTotal / maxTotal) * funnelHeight;\n const botH = (nextVal / nextTotal || 0) * (nextTotal / maxTotal) * funnelHeight;\n const leftStart = i * segmentWidth;\n const leftEnd = (i + 1) * segmentWidth;\n const topStart = (funnelHeight - (curTotal / maxTotal) * funnelHeight) / 2 + cumTop;\n const topEnd = topStart + topH;\n const botStart = (funnelHeight - (nextTotal / maxTotal) * funnelHeight) / 2 + cumBot;\n const botEnd = botStart + botH;\n\n const isLastSegment = i === stages.length - 1;\n let textX: number;\n let textY: number;\n let availableWidth: number;\n\n if (isLastSegment) {\n textX = leftStart + (leftEnd - leftStart) * 0.25;\n textY = (topStart + topEnd) / 2;\n // For triangular segments, calculate available width at text position\n const segmentWidthAtTextPos = (leftEnd - leftStart) * 0.5;\n availableWidth = segmentWidthAtTextPos * 0.8;\n\n // For triangular last segments, also check if there's enough height\n // The segment area should be large enough to contain text\n const segmentArea = (topH * segmentWidth) / 2;\n if (topH < 24 || segmentArea < 600) {\n availableWidth = 0;\n }\n } else {\n textX = (leftStart + leftEnd) / 2;\n textY = (topStart + topEnd + botStart + botEnd) / 4;\n // For trapezoidal segments, use full segment width\n availableWidth = Math.abs(leftEnd - leftStart) * 0.9;\n\n // Check if the segment has sufficient height for text\n // For non-last segments, we need to ensure there's enough vertical space\n const avgHeight = (topH + botH) / 2;\n if (avgHeight < 20) {\n availableWidth = 0;\n }\n }\n\n const pathD = `M${leftStart},${topStart}\n L${leftEnd},${botStart}\n L${leftEnd},${botEnd}\n L${leftStart},${topEnd}\n Z`;\n return { pathD, textX, textY, availableWidth };\n}\n\nexport function getSegmentTextProps({\n availableWidth,\n minTextWidth = 24,\n textX,\n textY,\n value,\n culture,\n onMouseOver,\n onMouseMove,\n onMouseOut,\n}: {\n availableWidth: number;\n minTextWidth?: number;\n textX: number;\n textY: number;\n value: number;\n culture: string | undefined;\n onMouseOver: ((event: React.MouseEvent<SVGElement>) => void) | undefined;\n onMouseMove: ((event: React.MouseEvent<SVGElement>) => void) | undefined;\n onMouseOut: (() => void) | undefined;\n}) {\n return {\n show: availableWidth > minTextWidth && availableWidth > 0,\n x: textX,\n y: textY,\n value,\n culture,\n onMouseOver,\n onMouseMove,\n onMouseOut,\n };\n}\n"],"names":["React","getVerticalFunnelSegmentGeometry","d","i","data","funnelWidth","funnelHeight","isRTL","segmentHeight","length","widthScale","value","Math","max","map","dataPoint","topWidth","bottomWidth","xOffset","nextXOffset","xStart","xEnd","isLastSegment","textY","textX","availableWidth","yFromTop","widthAtY","min","pathD","getHorizontalFunnelSegmentGeometry","segmentWidth","heightScale","leftHeight","rightHeight","yOffset","nextYOffset","x0","x1","segmentArea","minAreaForText","widthAtTextPosition","minHeight","getStackedVerticalFunnelSegmentGeometry","k","stages","totals","maxTotal","next","cur","subValues","curTotal","nextTotal","cumTop","cumBot","idx","v","vNext","find","x","category","val","nextVal","topW","botW","topStart","topEnd","botStart","botEnd","widthRatio","getStackedHorizontalFunnelSegmentGeometry","topH","botH","leftStart","leftEnd","segmentWidthAtTextPos","abs","avgHeight","getSegmentTextProps","minTextWidth","culture","onMouseOver","onMouseMove","onMouseOut","show","y"],"mappings":";;;;;;;;;;;IAuEgB8B,kCAAAA;;;uBAwNAgD;eAAAA;;IAtFAR,yCAAAA;;;IApEA3B,uCAAAA;;;IA1GA1C,gCAAAA;;;;;iEA3BO,QAAQ;AA2BxB,0CAA0C,EAC/CC,CAAC,EACDC,CAAC,EACDC,IAAI,EACJC,WAAW,EACXC,YAAY,EACZC,KAAK,EAQN;IACC,MAAMC,gBAAgBF,eAAeF,KAAKK,MAAM;IAChD,MAAMC,aAAa,CAACC,QAAmBA,QAAQC,KAAKC,GAAG,IAAIT,KAAKU,GAAG,CAACC,CAAAA,YAAaA,UAAUJ,KAAK,KAAON;IACvG,MAAMW,WAAWN,WAAWR,EAAES,KAAK;IACnC,MAAMM,cAAcd,IAAIC,KAAKK,MAAM,GAAG,IAAIC,WAAWN,IAAI,CAACD,IAAI,EAAE,CAACQ,KAAK,IAAK;IAC3E,MAAMO,UAAWb,CAAAA,cAAcW,QAAAA,CAAO,GAAK;IAC3C,MAAMG,cAAed,CAAAA,cAAcY,WA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I,QAAQ,CAAC,CAAC,EAAE4C,UAAU,CAAC,EAAER,SAAS;KACrC,EAAES,QAAQ,CAAC,EAAEP,SAAS;KACtB,EAAEO,QAAQ,CAAC,EAAEN,OAAO;KACpB,EAAEK,UAAU,CAAC,EAAEP,OAAO;KACtB,CAAC;IACJ,OAAO;QAAErC;QAAOL;QAAOD;QAAOE;IAAe;AAC/C;AAEO,6BAA6B,EAClCA,cAAc,EACdsD,eAAe,EAAE,EACjBvD,KAAK,EACLD,KAAK,EACLZ,KAAK,EACLqE,OAAO,EACPC,WAAW,EACXC,WAAW,EACXC,UAAU,EAWX;IACC,OAAO;QACLC,MAAM3D,iBAAiBsD,gBAAgBtD,iBAAiB;QACxDkC,GAAGnC;QACH6D,GAAG9D;QACHZ;QACAqE;QACAC;QACAC;QACAC;IACF;AACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/FunnelChart/index.ts"],"sourcesContent":["export * from './FunnelChart';\nexport * from './FunnelChart.types';\n"],"names":[],"mappings":";;;;;uBAAc,gBAAgB;uBAChB,sBAAsB"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
function _export(target, all) {
|
|
6
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: all[name]
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
_export(exports, {
|
|
12
|
+
funnelClassNames: function() {
|
|
13
|
+
return funnelClassNames;
|
|
14
|
+
},
|
|
15
|
+
useFunnelChartStyles: function() {
|
|
16
|
+
return useFunnelChartStyles;
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
const _react = require("@griffel/react");
|
|
20
|
+
const funnelClassNames = {
|
|
21
|
+
root: 'fui-funnel__root',
|
|
22
|
+
chart: 'fui-funnel__chart',
|
|
23
|
+
text: 'fui-funnel__text',
|
|
24
|
+
calloutContentRoot: 'fui-funnel__callout-content-root'
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* Base Styles
|
|
28
|
+
*/ const useStyles = /*#__PURE__*/ (0, _react.__styles)({
|
|
29
|
+
root: {
|
|
30
|
+
Bt984gj: "f122n59",
|
|
31
|
+
a9b677: "fly5x3f",
|
|
32
|
+
Bqenvij: "f1l02sjl",
|
|
33
|
+
Bahqtrf: "fk6fouc",
|
|
34
|
+
Be2twd7: "fkhj508",
|
|
35
|
+
Bhrd7zp: "figsok6",
|
|
36
|
+
qhf8xq: "f10pi13n"
|
|
37
|
+
},
|
|
38
|
+
chart: {
|
|
39
|
+
mc9l5x: "ftgm304",
|
|
40
|
+
a9b677: "fly5x3f",
|
|
41
|
+
Bqenvij: "f1l02sjl"
|
|
42
|
+
},
|
|
43
|
+
text: {
|
|
44
|
+
Bkecrkj: "f1aehjj5",
|
|
45
|
+
Bhrd7zp: "fl43uef",
|
|
46
|
+
Bkfmm31: "fhuob2q",
|
|
47
|
+
Bahqtrf: "fk6fouc",
|
|
48
|
+
Be2twd7: "fkhj508"
|
|
49
|
+
},
|
|
50
|
+
calloutContentRoot: {
|
|
51
|
+
B2u0y6b: "f15g8at8"
|
|
52
|
+
}
|
|
53
|
+
}, {
|
|
54
|
+
d: [
|
|
55
|
+
".f122n59{align-items:center;}",
|
|
56
|
+
".fly5x3f{width:100%;}",
|
|
57
|
+
".f1l02sjl{height:100%;}",
|
|
58
|
+
".fk6fouc{font-family:var(--fontFamilyBase);}",
|
|
59
|
+
".fkhj508{font-size:var(--fontSizeBase300);}",
|
|
60
|
+
".figsok6{font-weight:var(--fontWeightRegular);}",
|
|
61
|
+
".f10pi13n{position:relative;}",
|
|
62
|
+
".ftgm304{display:block;}",
|
|
63
|
+
".f1aehjj5{pointer-events:none;}",
|
|
64
|
+
".fl43uef{font-weight:var(--fontWeightSemibold);}",
|
|
65
|
+
".fhuob2q{fill:var(--colorNeutralForeground1);}",
|
|
66
|
+
".f15g8at8{max-width:238px;}"
|
|
67
|
+
]
|
|
68
|
+
});
|
|
69
|
+
const useFunnelChartStyles = (props)=>{
|
|
70
|
+
var _props_styles, _props_styles1, _props_styles2, _props_styles3;
|
|
71
|
+
const { className } = props;
|
|
72
|
+
const baseStyles = useStyles();
|
|
73
|
+
return {
|
|
74
|
+
root: (0, _react.mergeClasses)(funnelClassNames.root, baseStyles.root, className, (_props_styles = props.styles) === null || _props_styles === void 0 ? void 0 : _props_styles.root),
|
|
75
|
+
chart: (0, _react.mergeClasses)(funnelClassNames.chart, baseStyles.chart, (_props_styles1 = props.styles) === null || _props_styles1 === void 0 ? void 0 : _props_styles1.chart),
|
|
76
|
+
text: (0, _react.mergeClasses)(funnelClassNames.text, baseStyles.text, (_props_styles2 = props.styles) === null || _props_styles2 === void 0 ? void 0 : _props_styles2.text),
|
|
77
|
+
calloutContentRoot: (0, _react.mergeClasses)(baseStyles.calloutContentRoot, (_props_styles3 = props.styles) === null || _props_styles3 === void 0 ? void 0 : _props_styles3.calloutContentRoot)
|
|
78
|
+
};
|
|
79
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["useFunnelChartStyles.styles.js"],"sourcesContent":["import { makeStyles, mergeClasses } from '@griffel/react';\nimport { tokens } from '@fluentui/react-theme';\n/**\n * @internal\n */ export const funnelClassNames = {\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 * Base Styles\n */ const 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 * Apply styling to the FunnelChart component\n */ export const useFunnelChartStyles = (props)=>{\n var _props_styles, _props_styles1, _props_styles2, _props_styles3;\n const { className } = props;\n const baseStyles = useStyles();\n return {\n root: mergeClasses(funnelClassNames.root, baseStyles.root, className, (_props_styles = props.styles) === null || _props_styles === void 0 ? void 0 : _props_styles.root),\n chart: mergeClasses(funnelClassNames.chart, baseStyles.chart, (_props_styles1 = props.styles) === null || _props_styles1 === void 0 ? void 0 : _props_styles1.chart),\n text: mergeClasses(funnelClassNames.text, baseStyles.text, (_props_styles2 = props.styles) === null || _props_styles2 === void 0 ? void 0 : _props_styles2.text),\n calloutContentRoot: mergeClasses(baseStyles.calloutContentRoot, (_props_styles3 = props.styles) === null || _props_styles3 === void 0 ? void 0 : _props_styles3.calloutContentRoot)\n };\n};\n"],"names":["__styles","mergeClasses","tokens","funnelClassNames","root","chart","text","calloutContentRoot","useStyles","Bt984gj","a9b677","Bqenvij","Bahqtrf","Be2twd7","Bhrd7zp","qhf8xq","mc9l5x","Bkecrkj","Bkfmm31","B2u0y6b","d","useFunnelChartStyles","props","_props_styles","_props_styles1","_props_styles2","_props_styles3","className","baseStyles","styles"],"mappings":";;;;;;;;;;;IAIiBG,gBAAgB;;;wBAoCI;eAApBkB;;;uBAxCwB,gBAAgB;AAI9C,yBAAyB;IAChCjB,IAAI,EAAE,kBAAkB;IACxBC,KAAK,EAAE,mBAAmB;IAC1BC,IAAI,EAAE,kBAAkB;IACxBC,kBAAkB,EAAE;AACxB,CAAC;AACD;;CAEA,GAAI,MAAMC,SAAS,GAAA,WAAA,OAAGR,eAAA,EAAA;IAAAI,IAAA,EAAA;QAAAK,OAAA,EAAA;QAAAC,MAAA,EAAA;QAAAC,OAAA,EAAA;QAAAC,OAAA,EAAA;QAAAC,OAAA,EAAA;QAAAC,OAAA,EAAA;QAAAC,MAAA,EAAA;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G,KAAK,CAAC,GAAGA,cAAc,CAACnB,IAAI,CAAC;QAChKC,kBAAkB,MAAEN,mBAAY,EAAC2B,UAAU,CAACrB,kBAAkB,EAAE,CAACmB,cAAc,GAAGJ,KAAK,CAACO,MAAAA,AAAM,MAAM,IAAI,IAAIH,cAAc,KAAK,KAAK,CAAC,GAAG,KAAK,CAAC,GAAGA,cAAc,CAACnB,kBAAkB;IACtL,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
function _export(target, all) {
|
|
6
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: all[name]
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
_export(exports, {
|
|
12
|
+
funnelClassNames: function() {
|
|
13
|
+
return funnelClassNames;
|
|
14
|
+
},
|
|
15
|
+
useFunnelChartStyles: function() {
|
|
16
|
+
return useFunnelChartStyles;
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
const _react = require("@griffel/react");
|
|
20
|
+
const _reacttheme = require("@fluentui/react-theme");
|
|
21
|
+
const funnelClassNames = {
|
|
22
|
+
root: 'fui-funnel__root',
|
|
23
|
+
chart: 'fui-funnel__chart',
|
|
24
|
+
text: 'fui-funnel__text',
|
|
25
|
+
calloutContentRoot: 'fui-funnel__callout-content-root'
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* Base Styles
|
|
29
|
+
*/ const useStyles = (0, _react.makeStyles)({
|
|
30
|
+
root: {
|
|
31
|
+
alignItems: 'center',
|
|
32
|
+
width: '100%',
|
|
33
|
+
height: '100%',
|
|
34
|
+
fontFamily: _reacttheme.tokens.fontFamilyBase,
|
|
35
|
+
fontSize: _reacttheme.tokens.fontSizeBase300,
|
|
36
|
+
fontWeight: _reacttheme.tokens.fontWeightRegular,
|
|
37
|
+
position: 'relative'
|
|
38
|
+
},
|
|
39
|
+
chart: {
|
|
40
|
+
display: 'block',
|
|
41
|
+
width: '100%',
|
|
42
|
+
height: '100%'
|
|
43
|
+
},
|
|
44
|
+
text: {
|
|
45
|
+
pointerEvents: 'none',
|
|
46
|
+
fontWeight: _reacttheme.tokens.fontWeightSemibold,
|
|
47
|
+
fill: _reacttheme.tokens.colorNeutralForeground1,
|
|
48
|
+
fontFamily: _reacttheme.tokens.fontFamilyBase,
|
|
49
|
+
fontSize: _reacttheme.tokens.fontSizeBase300
|
|
50
|
+
},
|
|
51
|
+
calloutContentRoot: {
|
|
52
|
+
maxWidth: '238px'
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
const useFunnelChartStyles = (props)=>{
|
|
56
|
+
var _props_styles, _props_styles1, _props_styles2, _props_styles3;
|
|
57
|
+
const { className } = props;
|
|
58
|
+
const baseStyles = useStyles();
|
|
59
|
+
return {
|
|
60
|
+
root: (0, _react.mergeClasses)(funnelClassNames.root, baseStyles.root, className, (_props_styles = props.styles) === null || _props_styles === void 0 ? void 0 : _props_styles.root),
|
|
61
|
+
chart: (0, _react.mergeClasses)(funnelClassNames.chart, baseStyles.chart, (_props_styles1 = props.styles) === null || _props_styles1 === void 0 ? void 0 : _props_styles1.chart),
|
|
62
|
+
text: (0, _react.mergeClasses)(funnelClassNames.text, baseStyles.text, (_props_styles2 = props.styles) === null || _props_styles2 === void 0 ? void 0 : _props_styles2.text),
|
|
63
|
+
calloutContentRoot: (0, _react.mergeClasses)(baseStyles.calloutContentRoot, (_props_styles3 = props.styles) === null || _props_styles3 === void 0 ? void 0 : _props_styles3.calloutContentRoot)
|
|
64
|
+
};
|
|
65
|
+
};
|
|
@@ -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":";;;;;;;;;;;IAQaG,gBAAAA;;;IAwCAsB,oBAAAA;;;;uBAhD4B,iBAAiB;4BACnC,wBAAwB;AAOxC,yBAA4D;IACjErB,MAAM;IACNC,OAAO;IACPC,MA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