@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
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { axisRight as d3AxisRight, axisBottom as d3AxisBottom, axisLeft as d3AxisLeft } from 'd3-axis';
|
|
2
|
-
import { max as d3Max, min as d3Min, ticks as d3Ticks, nice as d3nice } from 'd3-array';
|
|
2
|
+
import { max as d3Max, min as d3Min, ticks as d3Ticks, nice as d3nice, sum as d3Sum, mean as d3Mean, median as d3Median } from 'd3-array';
|
|
3
3
|
import { scaleLinear as d3ScaleLinear, scaleBand as d3ScaleBand, scaleUtc as d3ScaleUtc, scaleTime as d3ScaleTime } from 'd3-scale';
|
|
4
4
|
import { select as d3Select, selectAll as d3SelectAll } from 'd3-selection';
|
|
5
5
|
import { format as d3Format } from 'd3-format';
|
|
@@ -10,8 +10,7 @@ import { formatPrefix as d3FormatPrefix } from 'd3-format';
|
|
|
10
10
|
import { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';
|
|
11
11
|
import { formatDateToLocaleString, formatToLocaleString, getMultiLevelDateTimeFormatOptions } from '@fluentui/chart-utilities';
|
|
12
12
|
export const MIN_DOMAIN_MARGIN = 8;
|
|
13
|
-
export var ChartTypes
|
|
14
|
-
(function(ChartTypes) {
|
|
13
|
+
export var ChartTypes = /*#__PURE__*/ function(ChartTypes) {
|
|
15
14
|
ChartTypes[ChartTypes["AreaChart"] = 0] = "AreaChart";
|
|
16
15
|
ChartTypes[ChartTypes["LineChart"] = 1] = "LineChart";
|
|
17
16
|
ChartTypes[ChartTypes["VerticalBarChart"] = 2] = "VerticalBarChart";
|
|
@@ -20,19 +19,21 @@ export var ChartTypes;
|
|
|
20
19
|
ChartTypes[ChartTypes["HeatMapChart"] = 5] = "HeatMapChart";
|
|
21
20
|
ChartTypes[ChartTypes["HorizontalBarChartWithAxis"] = 6] = "HorizontalBarChartWithAxis";
|
|
22
21
|
ChartTypes[ChartTypes["ScatterChart"] = 7] = "ScatterChart";
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
(
|
|
22
|
+
ChartTypes[ChartTypes["GanttChart"] = 8] = "GanttChart";
|
|
23
|
+
return ChartTypes;
|
|
24
|
+
}({});
|
|
25
|
+
export var XAxisTypes = /*#__PURE__*/ function(XAxisTypes) {
|
|
26
26
|
XAxisTypes[XAxisTypes["NumericAxis"] = 0] = "NumericAxis";
|
|
27
27
|
XAxisTypes[XAxisTypes["DateAxis"] = 1] = "DateAxis";
|
|
28
28
|
XAxisTypes[XAxisTypes["StringAxis"] = 2] = "StringAxis";
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
return XAxisTypes;
|
|
30
|
+
}({});
|
|
31
|
+
export var YAxisType = /*#__PURE__*/ function(YAxisType) {
|
|
32
32
|
YAxisType[YAxisType["NumericAxis"] = 0] = "NumericAxis";
|
|
33
33
|
YAxisType[YAxisType["DateAxis"] = 1] = "DateAxis";
|
|
34
34
|
YAxisType[YAxisType["StringAxis"] = 2] = "StringAxis";
|
|
35
|
-
|
|
35
|
+
return YAxisType;
|
|
36
|
+
}({});
|
|
36
37
|
function yAxisTickFormatterInternal(value, limitWidth = false) {
|
|
37
38
|
// Use SI format prefix with 2 decimal places without insignificant trailing zeros
|
|
38
39
|
let formatter = d3FormatPrefix('.2~', value);
|
|
@@ -85,7 +86,10 @@ function yAxisTickFormatterInternal(value, limitWidth = false) {
|
|
|
85
86
|
tickCount = Math.min(Math.max(1, Math.floor(Math.abs(end - start) / longestLabelWidth)), 10);
|
|
86
87
|
}
|
|
87
88
|
const xAxis = d3AxisBottom(xAxisScale).tickSize(xAxistickSize).tickPadding(tickPadding).ticks(tickCount).tickFormat(tickFormat);
|
|
88
|
-
if (
|
|
89
|
+
if ([
|
|
90
|
+
6,
|
|
91
|
+
8
|
|
92
|
+
].includes(chartType)) {
|
|
89
93
|
xAxis.tickSizeInner(-(xAxisParams.containerHeight - xAxisParams.margins.top));
|
|
90
94
|
}
|
|
91
95
|
if (tickParams.tickValues) {
|
|
@@ -239,7 +243,7 @@ function yAxisTickFormatterInternal(value, limitWidth = false) {
|
|
|
239
243
|
const formatter = timeFormat(MULTI_LEVEL_DATE_TIME_FORMATS[startLevel][endLevel]);
|
|
240
244
|
return formatter;
|
|
241
245
|
}
|
|
242
|
-
function getDateFormatLevel(date, useUTC) {
|
|
246
|
+
export function getDateFormatLevel(date, useUTC) {
|
|
243
247
|
const timeSecond = useUTC ? d3UtcSecond : d3TimeSecond;
|
|
244
248
|
const timeMinute = useUTC ? d3UtcMinute : d3TimeMinute;
|
|
245
249
|
const timeHour = useUTC ? d3UtcHour : d3TimeHour;
|
|
@@ -290,7 +294,7 @@ function getDateFormatLevel(date, useUTC) {
|
|
|
290
294
|
* @export
|
|
291
295
|
* @param {IXAxisParams} xAxisParams
|
|
292
296
|
* @param {ITickParams} tickParams
|
|
293
|
-
*/ export function createDateXAxis(xAxisParams, tickParams, culture, options, timeFormatLocale, customDateTimeFormatter, useUTC) {
|
|
297
|
+
*/ export function createDateXAxis(xAxisParams, tickParams, culture, options, timeFormatLocale, customDateTimeFormatter, useUTC, chartType) {
|
|
294
298
|
const { domainNRangeValues, xAxisElement, tickPadding = 6, xAxistickSize = 6, xAxisCount } = xAxisParams;
|
|
295
299
|
const isUtcSet = useUTC === true || useUTC === 'utc';
|
|
296
300
|
const xAxisScale = isUtcSet ? d3ScaleUtc() : d3ScaleTime();
|
|
@@ -337,6 +341,11 @@ function getDateFormatLevel(date, useUTC) {
|
|
|
337
341
|
const maxPossibleTickCount = Math.min(Math.max(1, Math.floor(Math.abs(end - start) / longestLabelWidth)), 10);
|
|
338
342
|
tickCount = Math.min(maxPossibleTickCount, xAxisCount !== null && xAxisCount !== void 0 ? xAxisCount : tickCount);
|
|
339
343
|
const xAxis = d3AxisBottom(xAxisScale).tickSize(xAxistickSize).tickPadding(tickPadding).ticks(tickCount).tickFormat(tickFormat);
|
|
344
|
+
if ([
|
|
345
|
+
8
|
|
346
|
+
].includes(chartType)) {
|
|
347
|
+
xAxis.tickSizeInner(-(xAxisParams.containerHeight - xAxisParams.margins.top));
|
|
348
|
+
}
|
|
340
349
|
tickParams.tickValues ? xAxis.tickValues(tickParams.tickValues) : '';
|
|
341
350
|
if (xAxisElement) {
|
|
342
351
|
d3Select(xAxisElement).call(xAxis).selectAll('text').attr('aria-hidden', 'true');
|
|
@@ -1182,7 +1191,7 @@ export function tooltipOfAxislabels(axistooltipProps) {
|
|
|
1182
1191
|
};
|
|
1183
1192
|
}
|
|
1184
1193
|
/**
|
|
1185
|
-
*
|
|
1194
|
+
* Finds the min and max values of the vertical bar chart y axis data point.
|
|
1186
1195
|
* @export
|
|
1187
1196
|
* @param {VerticalBarChartDataPoint[]} points
|
|
1188
1197
|
* @returns {{ startValue: number; endValue: number }}
|
|
@@ -1204,9 +1213,9 @@ export function tooltipOfAxislabels(axistooltipProps) {
|
|
|
1204
1213
|
};
|
|
1205
1214
|
}
|
|
1206
1215
|
/**
|
|
1207
|
-
*
|
|
1216
|
+
* Finds the min and max values of the horizontal bar chart y axis data point.
|
|
1208
1217
|
* @export
|
|
1209
|
-
* @param {
|
|
1218
|
+
* @param {HorizontalBarChartWithAxisDataPoint[]|GanttChartDataPoint[]} points
|
|
1210
1219
|
* @returns {{ startValue: number; endValue: number }}
|
|
1211
1220
|
*/ export function findHBCWANumericMinMaxOfY(points, yAxisType) {
|
|
1212
1221
|
if (yAxisType !== undefined && yAxisType === 0) {
|
|
@@ -1248,8 +1257,10 @@ export function tooltipOfAxislabels(axistooltipProps) {
|
|
|
1248
1257
|
}
|
|
1249
1258
|
}
|
|
1250
1259
|
};
|
|
1251
|
-
|
|
1252
|
-
|
|
1260
|
+
/**
|
|
1261
|
+
* we need to make sure that if we add any property to this, then
|
|
1262
|
+
* we need to also add that in pointTypes below and vise-versa
|
|
1263
|
+
*/ export var Points = /*#__PURE__*/ function(Points) {
|
|
1253
1264
|
Points[Points["circle"] = 0] = "circle";
|
|
1254
1265
|
Points[Points["square"] = 1] = "square";
|
|
1255
1266
|
Points[Points["triangle"] = 2] = "triangle";
|
|
@@ -1258,11 +1269,12 @@ export var Points;
|
|
|
1258
1269
|
Points[Points["hexagon"] = 5] = "hexagon";
|
|
1259
1270
|
Points[Points["pentagon"] = 6] = "pentagon";
|
|
1260
1271
|
Points[Points["octagon"] = 7] = "octagon";
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1272
|
+
return Points;
|
|
1273
|
+
}({});
|
|
1274
|
+
export var CustomPoints = /*#__PURE__*/ function(CustomPoints) {
|
|
1264
1275
|
CustomPoints[CustomPoints["dottedLine"] = 0] = "dottedLine";
|
|
1265
|
-
|
|
1276
|
+
return CustomPoints;
|
|
1277
|
+
}({});
|
|
1266
1278
|
/**
|
|
1267
1279
|
* we need to make sure that if we add any property to this, then
|
|
1268
1280
|
* we need to also add that in enum Point and vise-versa
|
|
@@ -1369,14 +1381,14 @@ export function formatScientificLimitWidth(value) {
|
|
|
1369
1381
|
}
|
|
1370
1382
|
const DEFAULT_BAR_WIDTH = 16;
|
|
1371
1383
|
const MIN_BAR_WIDTH = 1;
|
|
1372
|
-
export const getBarWidth = (barWidthProp, maxBarWidthProp, adjustedValue = DEFAULT_BAR_WIDTH)=>{
|
|
1384
|
+
export const getBarWidth = (barWidthProp, maxBarWidthProp, adjustedValue = DEFAULT_BAR_WIDTH, modeProp)=>{
|
|
1373
1385
|
let barWidth;
|
|
1374
|
-
if (
|
|
1386
|
+
if (barWidthProp === 'auto' || modeProp === 'histogram') {
|
|
1387
|
+
barWidth = adjustedValue;
|
|
1388
|
+
} else if (typeof barWidthProp === 'number') {
|
|
1375
1389
|
barWidth = barWidthProp;
|
|
1376
|
-
} else if (barWidthProp === 'default' || typeof barWidthProp === 'undefined') {
|
|
1377
|
-
barWidth = Math.min(adjustedValue, DEFAULT_BAR_WIDTH);
|
|
1378
1390
|
} else {
|
|
1379
|
-
barWidth = adjustedValue;
|
|
1391
|
+
barWidth = Math.min(adjustedValue, DEFAULT_BAR_WIDTH);
|
|
1380
1392
|
}
|
|
1381
1393
|
if (typeof maxBarWidthProp === 'number') {
|
|
1382
1394
|
barWidth = Math.min(barWidth, maxBarWidthProp);
|
|
@@ -1481,3 +1493,104 @@ export const truncateString = (str, maxLength, ellipsis = '...')=>{
|
|
|
1481
1493
|
}
|
|
1482
1494
|
return str.slice(0, maxLength) + ellipsis;
|
|
1483
1495
|
};
|
|
1496
|
+
const categoryOrderRegex = /(category|total|sum|min|max|mean|median) (ascending|descending)/;
|
|
1497
|
+
/**
|
|
1498
|
+
* @see {@link https://github.com/plotly/plotly.js/blob/master/src/plots/plots.js#L3041}
|
|
1499
|
+
*/ export const sortAxisCategories = (categoryToValues, categoryOrder)=>{
|
|
1500
|
+
if (Array.isArray(categoryOrder)) {
|
|
1501
|
+
const result = [];
|
|
1502
|
+
const seen = new Set();
|
|
1503
|
+
// Add elements from categoryOrder array that are in categoryToValues, in the array's order
|
|
1504
|
+
categoryOrder.forEach((category)=>{
|
|
1505
|
+
if (categoryToValues[category] && !seen.has(category)) {
|
|
1506
|
+
result.push(category);
|
|
1507
|
+
seen.add(category);
|
|
1508
|
+
}
|
|
1509
|
+
});
|
|
1510
|
+
// Append any keys from categoryToValues not already in result
|
|
1511
|
+
Object.keys(categoryToValues).forEach((category)=>{
|
|
1512
|
+
if (!seen.has(category)) {
|
|
1513
|
+
result.push(category);
|
|
1514
|
+
}
|
|
1515
|
+
});
|
|
1516
|
+
return result;
|
|
1517
|
+
}
|
|
1518
|
+
const match = categoryOrder === null || categoryOrder === void 0 ? void 0 : categoryOrder.match(categoryOrderRegex);
|
|
1519
|
+
if (match) {
|
|
1520
|
+
const aggregator = match[1];
|
|
1521
|
+
const order = match[2];
|
|
1522
|
+
if (aggregator === 'category') {
|
|
1523
|
+
const result = Object.keys(categoryToValues).sort();
|
|
1524
|
+
return order === 'descending' ? result.reverse() : result;
|
|
1525
|
+
}
|
|
1526
|
+
const aggFn = {
|
|
1527
|
+
min: d3Min,
|
|
1528
|
+
max: d3Max,
|
|
1529
|
+
sum: d3Sum,
|
|
1530
|
+
total: d3Sum,
|
|
1531
|
+
mean: d3Mean,
|
|
1532
|
+
median: d3Median
|
|
1533
|
+
};
|
|
1534
|
+
const sortAscending = (a, b)=>{
|
|
1535
|
+
return a[1] - b[1];
|
|
1536
|
+
};
|
|
1537
|
+
const sortDescending = (a, b)=>{
|
|
1538
|
+
return b[1] - a[1];
|
|
1539
|
+
};
|
|
1540
|
+
const categoriesAggregatedValue = [];
|
|
1541
|
+
Object.keys(categoryToValues).forEach((category)=>{
|
|
1542
|
+
categoriesAggregatedValue.push([
|
|
1543
|
+
category,
|
|
1544
|
+
aggFn[aggregator](categoryToValues[category]) || 0
|
|
1545
|
+
]);
|
|
1546
|
+
});
|
|
1547
|
+
categoriesAggregatedValue.sort(order === 'descending' ? sortDescending : sortAscending);
|
|
1548
|
+
return categoriesAggregatedValue.map(([category])=>category);
|
|
1549
|
+
}
|
|
1550
|
+
return Object.keys(categoryToValues);
|
|
1551
|
+
};
|
|
1552
|
+
export function copyStyle(properties, fromEl, toEl) {
|
|
1553
|
+
const styles = getComputedStyle(fromEl);
|
|
1554
|
+
if (Array.isArray(properties)) {
|
|
1555
|
+
properties.forEach((prop)=>{
|
|
1556
|
+
d3Select(toEl).style(prop, styles.getPropertyValue(prop));
|
|
1557
|
+
});
|
|
1558
|
+
} else {
|
|
1559
|
+
Object.entries(properties).forEach(([fromProp, toProp])=>{
|
|
1560
|
+
d3Select(toEl).style(toProp, styles.getPropertyValue(fromProp));
|
|
1561
|
+
});
|
|
1562
|
+
}
|
|
1563
|
+
}
|
|
1564
|
+
let measurementSpanCounter = 0;
|
|
1565
|
+
function getUniqueMeasurementSpanId() {
|
|
1566
|
+
measurementSpanCounter++;
|
|
1567
|
+
return `measurement_span_${measurementSpanCounter}`;
|
|
1568
|
+
}
|
|
1569
|
+
const MEASUREMENT_SPAN_STYLE = {
|
|
1570
|
+
position: 'absolute',
|
|
1571
|
+
visibility: 'hidden',
|
|
1572
|
+
top: '-20000px',
|
|
1573
|
+
left: 0,
|
|
1574
|
+
padding: 0,
|
|
1575
|
+
margin: 0,
|
|
1576
|
+
border: 'none',
|
|
1577
|
+
whiteSpace: 'pre'
|
|
1578
|
+
};
|
|
1579
|
+
export const createMeasurementSpan = (text, className, parentElement)=>{
|
|
1580
|
+
const MEASUREMENT_SPAN_ID = getUniqueMeasurementSpanId();
|
|
1581
|
+
let measurementSpan = document.getElementById(MEASUREMENT_SPAN_ID);
|
|
1582
|
+
if (!measurementSpan) {
|
|
1583
|
+
measurementSpan = document.createElement('span');
|
|
1584
|
+
measurementSpan.setAttribute('id', MEASUREMENT_SPAN_ID);
|
|
1585
|
+
measurementSpan.setAttribute('aria-hidden', 'true');
|
|
1586
|
+
if (parentElement) {
|
|
1587
|
+
parentElement.appendChild(measurementSpan);
|
|
1588
|
+
} else {
|
|
1589
|
+
document.body.appendChild(measurementSpan);
|
|
1590
|
+
}
|
|
1591
|
+
}
|
|
1592
|
+
measurementSpan.setAttribute('class', className);
|
|
1593
|
+
Object.assign(measurementSpan.style, MEASUREMENT_SPAN_STYLE);
|
|
1594
|
+
measurementSpan.textContent = `${text}`;
|
|
1595
|
+
return measurementSpan;
|
|
1596
|
+
};
|