@fluentui/react-charts 0.0.0-nightly-20250423-1342.1 → 0.0.0-nightly-20250424-0405.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -16
- package/dist/index.d.ts +3305 -0
- package/lib/AreaChart.js +1 -0
- package/lib/AreaChart.js.map +1 -0
- package/lib/CartesianChart.js +1 -0
- package/lib/CartesianChart.js.map +1 -0
- package/lib/DeclarativeChart.js +1 -0
- package/lib/DeclarativeChart.js.map +1 -0
- package/lib/DonutChart.js +1 -0
- package/lib/DonutChart.js.map +1 -0
- package/lib/GaugeChart.js +1 -0
- package/lib/GaugeChart.js.map +1 -0
- package/lib/GroupedVerticalBarChart.js +1 -0
- package/lib/GroupedVerticalBarChart.js.map +1 -0
- package/lib/HeatMapChart.js +1 -0
- package/lib/HeatMapChart.js.map +1 -0
- package/lib/HorizontalBarChart.js +1 -0
- package/lib/HorizontalBarChart.js.map +1 -0
- package/lib/HorizontalBarChartWithAxis.js +1 -0
- package/lib/HorizontalBarChartWithAxis.js.map +1 -0
- package/lib/Legends.js +1 -0
- package/lib/Legends.js.map +1 -0
- package/lib/LineChart.js +1 -0
- package/lib/LineChart.js.map +1 -0
- package/lib/Popover.js +1 -0
- package/lib/Popover.js.map +1 -0
- package/lib/ResponsiveContainer.js +1 -0
- package/lib/ResponsiveContainer.js.map +1 -0
- package/lib/SankeyChart.js +1 -0
- package/lib/SankeyChart.js.map +1 -0
- package/lib/ScatterChart.js +1 -0
- package/lib/ScatterChart.js.map +1 -0
- package/lib/Sparkline.js +1 -0
- package/lib/Sparkline.js.map +1 -0
- package/lib/VerticalBarChart.js +1 -0
- package/lib/VerticalBarChart.js.map +1 -0
- package/lib/VerticalStackedBarChart.js +1 -0
- package/lib/VerticalStackedBarChart.js.map +1 -0
- package/lib/components/AreaChart/AreaChart.js +775 -0
- package/lib/components/AreaChart/AreaChart.js.map +1 -0
- package/lib/components/AreaChart/AreaChart.types.js +4 -0
- package/lib/components/AreaChart/AreaChart.types.js.map +1 -0
- package/lib/components/AreaChart/index.js +3 -0
- package/lib/components/AreaChart/index.js.map +1 -0
- package/lib/components/AreaChart/useAreaChartStyles.styles.js +55 -0
- package/lib/components/AreaChart/useAreaChartStyles.styles.js.map +1 -0
- package/lib/components/CommonComponents/CartesianChart.js +478 -0
- package/lib/components/CommonComponents/CartesianChart.js.map +1 -0
- package/lib/components/CommonComponents/CartesianChart.types.js +1 -0
- package/lib/components/CommonComponents/CartesianChart.types.js.map +1 -0
- package/lib/components/CommonComponents/ChartPopover.js +187 -0
- package/lib/components/CommonComponents/ChartPopover.js.map +1 -0
- package/lib/components/CommonComponents/ChartPopover.types.js +1 -0
- package/lib/components/CommonComponents/ChartPopover.types.js.map +1 -0
- package/lib/components/CommonComponents/index.js +4 -0
- package/lib/components/CommonComponents/index.js.map +1 -0
- package/lib/components/CommonComponents/useCartesianChartStyles.styles.js +113 -0
- package/lib/components/CommonComponents/useCartesianChartStyles.styles.js.map +1 -0
- package/lib/components/CommonComponents/useChartPopoverStyles.styles.js +167 -0
- package/lib/components/CommonComponents/useChartPopoverStyles.styles.js.map +1 -0
- package/lib/components/DeclarativeChart/DeclarativeChart.js +197 -0
- package/lib/components/DeclarativeChart/DeclarativeChart.js.map +1 -0
- package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js +811 -0
- package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -0
- package/lib/components/DeclarativeChart/imageExporter.js +221 -0
- package/lib/components/DeclarativeChart/imageExporter.js.map +1 -0
- package/lib/components/DeclarativeChart/index.js +1 -0
- package/lib/components/DeclarativeChart/index.js.map +1 -0
- package/lib/components/DonutChart/Arc/Arc.js +110 -0
- package/lib/components/DonutChart/Arc/Arc.js.map +1 -0
- package/lib/components/DonutChart/Arc/Arc.types.js +1 -0
- package/lib/components/DonutChart/Arc/Arc.types.js.map +1 -0
- package/lib/components/DonutChart/Arc/index.js +2 -0
- package/lib/components/DonutChart/Arc/index.js.map +1 -0
- package/lib/components/DonutChart/Arc/useArcStyles.styles.js +54 -0
- package/lib/components/DonutChart/Arc/useArcStyles.styles.js.map +1 -0
- package/lib/components/DonutChart/DonutChart.js +291 -0
- package/lib/components/DonutChart/DonutChart.js.map +1 -0
- package/lib/components/DonutChart/DonutChart.types.js +1 -0
- package/lib/components/DonutChart/DonutChart.types.js.map +1 -0
- package/lib/components/DonutChart/Pie/Pie.js +72 -0
- package/lib/components/DonutChart/Pie/Pie.js.map +1 -0
- package/lib/components/DonutChart/Pie/Pie.types.js +1 -0
- package/lib/components/DonutChart/Pie/Pie.types.js.map +1 -0
- package/lib/components/DonutChart/Pie/index.js +2 -0
- package/lib/components/DonutChart/Pie/index.js.map +1 -0
- package/lib/components/DonutChart/Pie/usePieStyles.styles.js +40 -0
- package/lib/components/DonutChart/Pie/usePieStyles.styles.js.map +1 -0
- package/lib/components/DonutChart/index.js +3 -0
- package/lib/components/DonutChart/index.js.map +1 -0
- package/lib/components/DonutChart/useDonutChartStyles.styles.js +58 -0
- package/lib/components/DonutChart/useDonutChartStyles.styles.js.map +1 -0
- package/lib/components/GaugeChart/GaugeChart.js +592 -0
- package/lib/components/GaugeChart/GaugeChart.js.map +1 -0
- package/lib/components/GaugeChart/GaugeChart.types.js +4 -0
- package/lib/components/GaugeChart/GaugeChart.types.js.map +1 -0
- package/lib/components/GaugeChart/index.js +3 -0
- package/lib/components/GaugeChart/index.js.map +1 -0
- package/lib/components/GaugeChart/useGaugeChartStyles.styles.js +178 -0
- package/lib/components/GaugeChart/useGaugeChartStyles.styles.js.map +1 -0
- package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js +501 -0
- package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js.map +1 -0
- package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.types.js +4 -0
- package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.types.js.map +1 -0
- package/lib/components/GroupedVerticalBarChart/index.js +3 -0
- package/lib/components/GroupedVerticalBarChart/index.js.map +1 -0
- package/lib/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.js +81 -0
- package/lib/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.js.map +1 -0
- package/lib/components/HeatMapChart/HeatMapChart.js +588 -0
- package/lib/components/HeatMapChart/HeatMapChart.js.map +1 -0
- package/lib/components/HeatMapChart/HeatMapChart.types.js +4 -0
- package/lib/components/HeatMapChart/HeatMapChart.types.js.map +1 -0
- package/lib/components/HeatMapChart/index.js +3 -0
- package/lib/components/HeatMapChart/index.js.map +1 -0
- package/lib/components/HeatMapChart/useHeatMapChartStyles.styles.js +37 -0
- package/lib/components/HeatMapChart/useHeatMapChartStyles.styles.js.map +1 -0
- package/lib/components/HorizontalBarChart/HorizontalBarChart.js +402 -0
- package/lib/components/HorizontalBarChart/HorizontalBarChart.js.map +1 -0
- package/lib/components/HorizontalBarChart/HorizontalBarChart.types.js +6 -0
- package/lib/components/HorizontalBarChart/HorizontalBarChart.types.js.map +1 -0
- package/lib/components/HorizontalBarChart/index.js +3 -0
- package/lib/components/HorizontalBarChart/index.js.map +1 -0
- package/lib/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.js +156 -0
- package/lib/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.js.map +1 -0
- package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js +571 -0
- package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js.map +1 -0
- package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.types.js +4 -0
- package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.types.js.map +1 -0
- package/lib/components/HorizontalBarChartWithAxis/index.js +3 -0
- package/lib/components/HorizontalBarChartWithAxis/index.js.map +1 -0
- package/lib/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.js +67 -0
- package/lib/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.js.map +1 -0
- package/lib/components/Legends/Legends.js +303 -0
- package/lib/components/Legends/Legends.js.map +1 -0
- package/lib/components/Legends/Legends.types.js +1 -0
- package/lib/components/Legends/Legends.types.js.map +1 -0
- package/lib/components/Legends/OverflowMenu.js +25 -0
- package/lib/components/Legends/OverflowMenu.js.map +1 -0
- package/lib/components/Legends/index.js +3 -0
- package/lib/components/Legends/index.js.map +1 -0
- package/lib/components/Legends/shape.js +35 -0
- package/lib/components/Legends/shape.js.map +1 -0
- package/lib/components/Legends/useLegendsStyles.styles.js +146 -0
- package/lib/components/Legends/useLegendsStyles.styles.js.map +1 -0
- package/lib/components/LineChart/LineChart.js +1034 -0
- package/lib/components/LineChart/LineChart.js.map +1 -0
- package/lib/components/LineChart/LineChart.types.js +3 -0
- package/lib/components/LineChart/LineChart.types.js.map +1 -0
- package/lib/components/LineChart/eventAnnotation/EventAnnotation.js +119 -0
- package/lib/components/LineChart/eventAnnotation/EventAnnotation.js.map +1 -0
- package/lib/components/LineChart/eventAnnotation/LabelLink.js +57 -0
- package/lib/components/LineChart/eventAnnotation/LabelLink.js.map +1 -0
- package/lib/components/LineChart/eventAnnotation/Textbox.js +40 -0
- package/lib/components/LineChart/eventAnnotation/Textbox.js.map +1 -0
- package/lib/components/LineChart/index.js +4 -0
- package/lib/components/LineChart/index.js.map +1 -0
- package/lib/components/LineChart/useLineChartStyles.styles.js +56 -0
- package/lib/components/LineChart/useLineChartStyles.styles.js.map +1 -0
- package/lib/components/ResponsiveContainer/ResponsiveContainer.js +65 -0
- package/lib/components/ResponsiveContainer/ResponsiveContainer.js.map +1 -0
- package/lib/components/ResponsiveContainer/ResponsiveContainer.types.js +1 -0
- package/lib/components/ResponsiveContainer/ResponsiveContainer.types.js.map +1 -0
- package/lib/components/ResponsiveContainer/index.js +1 -0
- package/lib/components/ResponsiveContainer/index.js.map +1 -0
- package/lib/components/ResponsiveContainer/useResponsiveContainerStyles.styles.js +23 -0
- package/lib/components/ResponsiveContainer/useResponsiveContainerStyles.styles.js.map +1 -0
- package/lib/components/SankeyChart/SankeyChart.js +1023 -0
- package/lib/components/SankeyChart/SankeyChart.js.map +1 -0
- package/lib/components/SankeyChart/SankeyChart.types.js +3 -0
- package/lib/components/SankeyChart/SankeyChart.types.js.map +1 -0
- package/lib/components/SankeyChart/index.js +3 -0
- package/lib/components/SankeyChart/index.js.map +1 -0
- package/lib/components/SankeyChart/useSankeyChartStyles.styles.js +109 -0
- package/lib/components/SankeyChart/useSankeyChartStyles.styles.js.map +1 -0
- package/lib/components/ScatterChart/ScatterChart.js +465 -0
- package/lib/components/ScatterChart/ScatterChart.js.map +1 -0
- package/lib/components/ScatterChart/ScatterChart.types.js +4 -0
- package/lib/components/ScatterChart/ScatterChart.types.js.map +1 -0
- package/lib/components/ScatterChart/index.js +3 -0
- package/lib/components/ScatterChart/index.js.map +1 -0
- package/lib/components/ScatterChart/useScatterChartStyles.styles.js +56 -0
- package/lib/components/ScatterChart/useScatterChartStyles.styles.js.map +1 -0
- package/lib/components/Sparkline/Sparkline.js +119 -0
- package/lib/components/Sparkline/Sparkline.js.map +1 -0
- package/lib/components/Sparkline/Sparkline.types.js +4 -0
- package/lib/components/Sparkline/Sparkline.types.js.map +1 -0
- package/lib/components/Sparkline/index.js +3 -0
- package/lib/components/Sparkline/index.js.map +1 -0
- package/lib/components/Sparkline/useSparklineStyles.styles.js +49 -0
- package/lib/components/Sparkline/useSparklineStyles.styles.js.map +1 -0
- package/lib/components/VerticalBarChart/VerticalBarChart.js +926 -0
- package/lib/components/VerticalBarChart/VerticalBarChart.js.map +1 -0
- package/lib/components/VerticalBarChart/VerticalBarChart.types.js +4 -0
- package/lib/components/VerticalBarChart/VerticalBarChart.types.js.map +1 -0
- package/lib/components/VerticalBarChart/index.js +3 -0
- package/lib/components/VerticalBarChart/index.js.map +1 -0
- package/lib/components/VerticalBarChart/useVerticalBarChartStyles.styles.js +66 -0
- package/lib/components/VerticalBarChart/useVerticalBarChartStyles.styles.js.map +1 -0
- package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.js +904 -0
- package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.js.map +1 -0
- package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.types.js +1 -0
- package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.types.js.map +1 -0
- package/lib/components/VerticalStackedBarChart/index.js +3 -0
- package/lib/components/VerticalStackedBarChart/index.js.map +1 -0
- package/lib/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.js +65 -0
- package/lib/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.js.map +1 -0
- package/lib/index.js +20 -0
- package/lib/index.js.map +1 -0
- package/lib/types/DataPoint.js +1 -0
- package/lib/types/DataPoint.js.map +1 -0
- package/lib/types/EventAnnotation.js +1 -0
- package/lib/types/EventAnnotation.js.map +1 -0
- package/lib/types/LegendDataItem.js +1 -0
- package/lib/types/LegendDataItem.js.map +1 -0
- package/lib/types/index.js +2 -0
- package/lib/types/index.js.map +1 -0
- package/lib/utilities/FocusableTooltipText.js +65 -0
- package/lib/utilities/FocusableTooltipText.js.map +1 -0
- package/lib/utilities/KeyCodes.js +8 -0
- package/lib/utilities/KeyCodes.js.map +1 -0
- package/lib/utilities/SVGTooltipText.js +183 -0
- package/lib/utilities/SVGTooltipText.js.map +1 -0
- package/lib/utilities/async-utils.js +380 -0
- package/lib/utilities/async-utils.js.map +1 -0
- package/lib/utilities/colors.js +269 -0
- package/lib/utilities/colors.js.map +1 -0
- package/lib/utilities/getWindow.js +25 -0
- package/lib/utilities/getWindow.js.map +1 -0
- package/lib/utilities/index.js +3 -0
- package/lib/utilities/index.js.map +1 -0
- package/lib/utilities/locale-util.js +15 -0
- package/lib/utilities/locale-util.js.map +1 -0
- package/lib/utilities/overflow-utils.js +27 -0
- package/lib/utilities/overflow-utils.js.map +1 -0
- package/lib/utilities/string.js +32 -0
- package/lib/utilities/string.js.map +1 -0
- package/lib/utilities/test-data.js +329 -0
- package/lib/utilities/test-data.js.map +1 -0
- package/lib/utilities/utilities.js +1405 -0
- package/lib/utilities/utilities.js.map +1 -0
- package/lib/utilities/vbc-utils.js +27 -0
- package/lib/utilities/vbc-utils.js.map +1 -0
- package/lib-commonjs/AreaChart.js +6 -0
- package/lib-commonjs/AreaChart.js.map +1 -0
- package/lib-commonjs/CartesianChart.js +6 -0
- package/lib-commonjs/CartesianChart.js.map +1 -0
- package/lib-commonjs/DeclarativeChart.js +6 -0
- package/lib-commonjs/DeclarativeChart.js.map +1 -0
- package/lib-commonjs/DonutChart.js +6 -0
- package/lib-commonjs/DonutChart.js.map +1 -0
- package/lib-commonjs/GaugeChart.js +6 -0
- package/lib-commonjs/GaugeChart.js.map +1 -0
- package/lib-commonjs/GroupedVerticalBarChart.js +6 -0
- package/lib-commonjs/GroupedVerticalBarChart.js.map +1 -0
- package/lib-commonjs/HeatMapChart.js +6 -0
- package/lib-commonjs/HeatMapChart.js.map +1 -0
- package/lib-commonjs/HorizontalBarChart.js +6 -0
- package/lib-commonjs/HorizontalBarChart.js.map +1 -0
- package/lib-commonjs/HorizontalBarChartWithAxis.js +6 -0
- package/lib-commonjs/HorizontalBarChartWithAxis.js.map +1 -0
- package/lib-commonjs/Legends.js +6 -0
- package/lib-commonjs/Legends.js.map +1 -0
- package/lib-commonjs/LineChart.js +6 -0
- package/lib-commonjs/LineChart.js.map +1 -0
- package/lib-commonjs/Popover.js +6 -0
- package/lib-commonjs/Popover.js.map +1 -0
- package/lib-commonjs/ResponsiveContainer.js +6 -0
- package/lib-commonjs/ResponsiveContainer.js.map +1 -0
- package/lib-commonjs/SankeyChart.js +6 -0
- package/lib-commonjs/SankeyChart.js.map +1 -0
- package/lib-commonjs/ScatterChart.js +6 -0
- package/lib-commonjs/ScatterChart.js.map +1 -0
- package/lib-commonjs/Sparkline.js +6 -0
- package/lib-commonjs/Sparkline.js.map +1 -0
- package/lib-commonjs/VerticalBarChart.js +6 -0
- package/lib-commonjs/VerticalBarChart.js.map +1 -0
- package/lib-commonjs/VerticalStackedBarChart.js +6 -0
- package/lib-commonjs/VerticalStackedBarChart.js.map +1 -0
- package/lib-commonjs/components/AreaChart/AreaChart.js +781 -0
- package/lib-commonjs/components/AreaChart/AreaChart.js.map +1 -0
- package/lib-commonjs/components/AreaChart/AreaChart.types.js +7 -0
- package/lib-commonjs/components/AreaChart/AreaChart.types.js.map +1 -0
- package/lib-commonjs/components/AreaChart/index.js +8 -0
- package/lib-commonjs/components/AreaChart/index.js.map +1 -0
- package/lib-commonjs/components/AreaChart/useAreaChartStyles.styles.js +95 -0
- package/lib-commonjs/components/AreaChart/useAreaChartStyles.styles.js.map +1 -0
- package/lib-commonjs/components/CommonComponents/CartesianChart.js +484 -0
- package/lib-commonjs/components/CommonComponents/CartesianChart.js.map +1 -0
- package/lib-commonjs/components/CommonComponents/CartesianChart.types.js +6 -0
- package/lib-commonjs/components/CommonComponents/CartesianChart.types.js.map +1 -0
- package/lib-commonjs/components/CommonComponents/ChartPopover.js +197 -0
- package/lib-commonjs/components/CommonComponents/ChartPopover.js.map +1 -0
- package/lib-commonjs/components/CommonComponents/ChartPopover.types.js +4 -0
- package/lib-commonjs/components/CommonComponents/ChartPopover.types.js.map +1 -0
- package/lib-commonjs/components/CommonComponents/index.js +9 -0
- package/lib-commonjs/components/CommonComponents/index.js.map +1 -0
- package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.js +166 -0
- package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.js.map +1 -0
- package/lib-commonjs/components/CommonComponents/useChartPopoverStyles.styles.js +236 -0
- package/lib-commonjs/components/CommonComponents/useChartPopoverStyles.styles.js.map +1 -0
- package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js +205 -0
- package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js.map +1 -0
- package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js +859 -0
- package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -0
- package/lib-commonjs/components/DeclarativeChart/imageExporter.js +231 -0
- package/lib-commonjs/components/DeclarativeChart/imageExporter.js.map +1 -0
- package/lib-commonjs/components/DeclarativeChart/index.js +6 -0
- package/lib-commonjs/components/DeclarativeChart/index.js.map +1 -0
- package/lib-commonjs/components/DonutChart/Arc/Arc.js +117 -0
- package/lib-commonjs/components/DonutChart/Arc/Arc.js.map +1 -0
- package/lib-commonjs/components/DonutChart/Arc/Arc.types.js +4 -0
- package/lib-commonjs/components/DonutChart/Arc/Arc.types.js.map +1 -0
- package/lib-commonjs/components/DonutChart/Arc/index.js +7 -0
- package/lib-commonjs/components/DonutChart/Arc/index.js.map +1 -0
- package/lib-commonjs/components/DonutChart/Arc/useArcStyles.styles.js +83 -0
- package/lib-commonjs/components/DonutChart/Arc/useArcStyles.styles.js.map +1 -0
- package/lib-commonjs/components/DonutChart/DonutChart.js +298 -0
- package/lib-commonjs/components/DonutChart/DonutChart.js.map +1 -0
- package/lib-commonjs/components/DonutChart/DonutChart.types.js +6 -0
- package/lib-commonjs/components/DonutChart/DonutChart.types.js.map +1 -0
- package/lib-commonjs/components/DonutChart/Pie/Pie.js +79 -0
- package/lib-commonjs/components/DonutChart/Pie/Pie.js.map +1 -0
- package/lib-commonjs/components/DonutChart/Pie/Pie.types.js +4 -0
- package/lib-commonjs/components/DonutChart/Pie/Pie.types.js.map +1 -0
- package/lib-commonjs/components/DonutChart/Pie/index.js +7 -0
- package/lib-commonjs/components/DonutChart/Pie/index.js.map +1 -0
- package/lib-commonjs/components/DonutChart/Pie/usePieStyles.styles.js +54 -0
- package/lib-commonjs/components/DonutChart/Pie/usePieStyles.styles.js.map +1 -0
- package/lib-commonjs/components/DonutChart/index.js +8 -0
- package/lib-commonjs/components/DonutChart/index.js.map +1 -0
- package/lib-commonjs/components/DonutChart/useDonutChartStyles.styles.js +82 -0
- package/lib-commonjs/components/DonutChart/useDonutChartStyles.styles.js.map +1 -0
- package/lib-commonjs/components/GaugeChart/GaugeChart.js +621 -0
- package/lib-commonjs/components/GaugeChart/GaugeChart.js.map +1 -0
- package/lib-commonjs/components/GaugeChart/GaugeChart.types.js +7 -0
- package/lib-commonjs/components/GaugeChart/GaugeChart.types.js.map +1 -0
- package/lib-commonjs/components/GaugeChart/index.js +8 -0
- package/lib-commonjs/components/GaugeChart/index.js.map +1 -0
- package/lib-commonjs/components/GaugeChart/useGaugeChartStyles.styles.js +258 -0
- package/lib-commonjs/components/GaugeChart/useGaugeChartStyles.styles.js.map +1 -0
- package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js +507 -0
- package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js.map +1 -0
- package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.types.js +7 -0
- package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.types.js.map +1 -0
- package/lib-commonjs/components/GroupedVerticalBarChart/index.js +8 -0
- package/lib-commonjs/components/GroupedVerticalBarChart/index.js.map +1 -0
- package/lib-commonjs/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.js +130 -0
- package/lib-commonjs/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.js.map +1 -0
- package/lib-commonjs/components/HeatMapChart/HeatMapChart.js +599 -0
- package/lib-commonjs/components/HeatMapChart/HeatMapChart.js.map +1 -0
- package/lib-commonjs/components/HeatMapChart/HeatMapChart.types.js +7 -0
- package/lib-commonjs/components/HeatMapChart/HeatMapChart.types.js.map +1 -0
- package/lib-commonjs/components/HeatMapChart/index.js +8 -0
- package/lib-commonjs/components/HeatMapChart/index.js.map +1 -0
- package/lib-commonjs/components/HeatMapChart/useHeatMapChartStyles.styles.js +59 -0
- package/lib-commonjs/components/HeatMapChart/useHeatMapChartStyles.styles.js.map +1 -0
- package/lib-commonjs/components/HorizontalBarChart/HorizontalBarChart.js +408 -0
- package/lib-commonjs/components/HorizontalBarChart/HorizontalBarChart.js.map +1 -0
- package/lib-commonjs/components/HorizontalBarChart/HorizontalBarChart.types.js +17 -0
- package/lib-commonjs/components/HorizontalBarChart/HorizontalBarChart.types.js.map +1 -0
- package/lib-commonjs/components/HorizontalBarChart/index.js +8 -0
- package/lib-commonjs/components/HorizontalBarChart/index.js.map +1 -0
- package/lib-commonjs/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.js +237 -0
- package/lib-commonjs/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.js.map +1 -0
- package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js +580 -0
- package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js.map +1 -0
- package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.types.js +7 -0
- package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.types.js.map +1 -0
- package/lib-commonjs/components/HorizontalBarChartWithAxis/index.js +8 -0
- package/lib-commonjs/components/HorizontalBarChartWithAxis/index.js.map +1 -0
- package/lib-commonjs/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.js +107 -0
- package/lib-commonjs/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.js.map +1 -0
- package/lib-commonjs/components/Legends/Legends.js +313 -0
- package/lib-commonjs/components/Legends/Legends.js.map +1 -0
- package/lib-commonjs/components/Legends/Legends.types.js +6 -0
- package/lib-commonjs/components/Legends/Legends.types.js.map +1 -0
- package/lib-commonjs/components/Legends/OverflowMenu.js +36 -0
- package/lib-commonjs/components/Legends/OverflowMenu.js.map +1 -0
- package/lib-commonjs/components/Legends/index.js +8 -0
- package/lib-commonjs/components/Legends/index.js.map +1 -0
- package/lib-commonjs/components/Legends/shape.js +46 -0
- package/lib-commonjs/components/Legends/shape.js.map +1 -0
- package/lib-commonjs/components/Legends/useLegendsStyles.styles.js +304 -0
- package/lib-commonjs/components/Legends/useLegendsStyles.styles.js.map +1 -0
- package/lib-commonjs/components/LineChart/LineChart.js +1040 -0
- package/lib-commonjs/components/LineChart/LineChart.js.map +1 -0
- package/lib-commonjs/components/LineChart/LineChart.types.js +6 -0
- package/lib-commonjs/components/LineChart/LineChart.types.js.map +1 -0
- package/lib-commonjs/components/LineChart/eventAnnotation/EventAnnotation.js +129 -0
- package/lib-commonjs/components/LineChart/eventAnnotation/EventAnnotation.js.map +1 -0
- package/lib-commonjs/components/LineChart/eventAnnotation/LabelLink.js +68 -0
- package/lib-commonjs/components/LineChart/eventAnnotation/LabelLink.js.map +1 -0
- package/lib-commonjs/components/LineChart/eventAnnotation/Textbox.js +51 -0
- package/lib-commonjs/components/LineChart/eventAnnotation/Textbox.js.map +1 -0
- package/lib-commonjs/components/LineChart/index.js +9 -0
- package/lib-commonjs/components/LineChart/index.js.map +1 -0
- package/lib-commonjs/components/LineChart/useLineChartStyles.styles.js +87 -0
- package/lib-commonjs/components/LineChart/useLineChartStyles.styles.js.map +1 -0
- package/lib-commonjs/components/ResponsiveContainer/ResponsiveContainer.js +76 -0
- package/lib-commonjs/components/ResponsiveContainer/ResponsiveContainer.js.map +1 -0
- package/lib-commonjs/components/ResponsiveContainer/ResponsiveContainer.types.js +6 -0
- package/lib-commonjs/components/ResponsiveContainer/ResponsiveContainer.types.js.map +1 -0
- package/lib-commonjs/components/ResponsiveContainer/index.js +6 -0
- package/lib-commonjs/components/ResponsiveContainer/index.js.map +1 -0
- package/lib-commonjs/components/ResponsiveContainer/useResponsiveContainerStyles.styles.js +47 -0
- package/lib-commonjs/components/ResponsiveContainer/useResponsiveContainerStyles.styles.js.map +1 -0
- package/lib-commonjs/components/SankeyChart/SankeyChart.js +1039 -0
- package/lib-commonjs/components/SankeyChart/SankeyChart.js.map +1 -0
- package/lib-commonjs/components/SankeyChart/SankeyChart.types.js +6 -0
- package/lib-commonjs/components/SankeyChart/SankeyChart.types.js.map +1 -0
- package/lib-commonjs/components/SankeyChart/index.js +8 -0
- package/lib-commonjs/components/SankeyChart/index.js.map +1 -0
- package/lib-commonjs/components/SankeyChart/useSankeyChartStyles.styles.js +179 -0
- package/lib-commonjs/components/SankeyChart/useSankeyChartStyles.styles.js.map +1 -0
- package/lib-commonjs/components/ScatterChart/ScatterChart.js +471 -0
- package/lib-commonjs/components/ScatterChart/ScatterChart.js.map +1 -0
- package/lib-commonjs/components/ScatterChart/ScatterChart.types.js +7 -0
- package/lib-commonjs/components/ScatterChart/ScatterChart.types.js.map +1 -0
- package/lib-commonjs/components/ScatterChart/index.js +8 -0
- package/lib-commonjs/components/ScatterChart/index.js.map +1 -0
- package/lib-commonjs/components/ScatterChart/useScatterChartStyles.styles.js +87 -0
- package/lib-commonjs/components/ScatterChart/useScatterChartStyles.styles.js.map +1 -0
- package/lib-commonjs/components/Sparkline/Sparkline.js +125 -0
- package/lib-commonjs/components/Sparkline/Sparkline.js.map +1 -0
- package/lib-commonjs/components/Sparkline/Sparkline.types.js +7 -0
- package/lib-commonjs/components/Sparkline/Sparkline.types.js.map +1 -0
- package/lib-commonjs/components/Sparkline/index.js +8 -0
- package/lib-commonjs/components/Sparkline/index.js.map +1 -0
- package/lib-commonjs/components/Sparkline/useSparklineStyles.styles.js +77 -0
- package/lib-commonjs/components/Sparkline/useSparklineStyles.styles.js.map +1 -0
- package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.js +928 -0
- package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.js.map +1 -0
- package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.types.js +7 -0
- package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.types.js.map +1 -0
- package/lib-commonjs/components/VerticalBarChart/index.js +8 -0
- package/lib-commonjs/components/VerticalBarChart/index.js.map +1 -0
- package/lib-commonjs/components/VerticalBarChart/useVerticalBarChartStyles.styles.js +110 -0
- package/lib-commonjs/components/VerticalBarChart/useVerticalBarChartStyles.styles.js.map +1 -0
- package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.js +915 -0
- package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.js.map +1 -0
- package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.types.js +6 -0
- package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.types.js.map +1 -0
- package/lib-commonjs/components/VerticalStackedBarChart/index.js +8 -0
- package/lib-commonjs/components/VerticalStackedBarChart/index.js.map +1 -0
- package/lib-commonjs/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.js +113 -0
- package/lib-commonjs/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.js.map +1 -0
- package/lib-commonjs/index.js +25 -0
- package/lib-commonjs/index.js.map +1 -0
- package/lib-commonjs/types/DataPoint.js +4 -0
- package/lib-commonjs/types/DataPoint.js.map +1 -0
- package/lib-commonjs/types/EventAnnotation.js +6 -0
- package/lib-commonjs/types/EventAnnotation.js.map +1 -0
- package/lib-commonjs/types/LegendDataItem.js +4 -0
- package/lib-commonjs/types/LegendDataItem.js.map +1 -0
- package/lib-commonjs/types/index.js +7 -0
- package/lib-commonjs/types/index.js.map +1 -0
- package/lib-commonjs/utilities/FocusableTooltipText.js +75 -0
- package/lib-commonjs/utilities/FocusableTooltipText.js.map +1 -0
- package/lib-commonjs/utilities/KeyCodes.js +18 -0
- package/lib-commonjs/utilities/KeyCodes.js.map +1 -0
- package/lib-commonjs/utilities/SVGTooltipText.js +193 -0
- package/lib-commonjs/utilities/SVGTooltipText.js.map +1 -0
- package/lib-commonjs/utilities/async-utils.js +382 -0
- package/lib-commonjs/utilities/async-utils.js.map +1 -0
- package/lib-commonjs/utilities/colors.js +293 -0
- package/lib-commonjs/utilities/colors.js.map +1 -0
- package/lib-commonjs/utilities/getWindow.js +28 -0
- package/lib-commonjs/utilities/getWindow.js.map +1 -0
- package/lib-commonjs/utilities/index.js +8 -0
- package/lib-commonjs/utilities/index.js.map +1 -0
- package/lib-commonjs/utilities/locale-util.js +25 -0
- package/lib-commonjs/utilities/locale-util.js.map +1 -0
- package/lib-commonjs/utilities/overflow-utils.js +36 -0
- package/lib-commonjs/utilities/overflow-utils.js.map +1 -0
- package/lib-commonjs/utilities/string.js +29 -0
- package/lib-commonjs/utilities/string.js.map +1 -0
- package/lib-commonjs/utilities/test-data.js +383 -0
- package/lib-commonjs/utilities/test-data.js.map +1 -0
- package/lib-commonjs/utilities/utilities.js +1371 -0
- package/lib-commonjs/utilities/utilities.js.map +1 -0
- package/lib-commonjs/utilities/vbc-utils.js +45 -0
- package/lib-commonjs/utilities/vbc-utils.js.map +1 -0
- package/package.json +13 -13
|
@@ -0,0 +1,1371 @@
|
|
|
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
|
+
ChartTypes: function() {
|
|
13
|
+
return ChartTypes;
|
|
14
|
+
},
|
|
15
|
+
CustomPoints: function() {
|
|
16
|
+
return CustomPoints;
|
|
17
|
+
},
|
|
18
|
+
HighContrastSelector: function() {
|
|
19
|
+
return HighContrastSelector;
|
|
20
|
+
},
|
|
21
|
+
HighContrastSelectorBlack: function() {
|
|
22
|
+
return HighContrastSelectorBlack;
|
|
23
|
+
},
|
|
24
|
+
HighContrastSelectorWhite: function() {
|
|
25
|
+
return HighContrastSelectorWhite;
|
|
26
|
+
},
|
|
27
|
+
Points: function() {
|
|
28
|
+
return Points;
|
|
29
|
+
},
|
|
30
|
+
XAxisTypes: function() {
|
|
31
|
+
return XAxisTypes;
|
|
32
|
+
},
|
|
33
|
+
YAxisType: function() {
|
|
34
|
+
return YAxisType;
|
|
35
|
+
},
|
|
36
|
+
areArraysEqual: function() {
|
|
37
|
+
return areArraysEqual;
|
|
38
|
+
},
|
|
39
|
+
calculateLongestLabelWidth: function() {
|
|
40
|
+
return calculateLongestLabelWidth;
|
|
41
|
+
},
|
|
42
|
+
calloutData: function() {
|
|
43
|
+
return calloutData;
|
|
44
|
+
},
|
|
45
|
+
convertToLocaleString: function() {
|
|
46
|
+
return convertToLocaleString;
|
|
47
|
+
},
|
|
48
|
+
createDateXAxis: function() {
|
|
49
|
+
return createDateXAxis;
|
|
50
|
+
},
|
|
51
|
+
createNumericXAxis: function() {
|
|
52
|
+
return createNumericXAxis;
|
|
53
|
+
},
|
|
54
|
+
createStringXAxis: function() {
|
|
55
|
+
return createStringXAxis;
|
|
56
|
+
},
|
|
57
|
+
createStringYAxis: function() {
|
|
58
|
+
return createStringYAxis;
|
|
59
|
+
},
|
|
60
|
+
createStringYAxisForHorizontalBarChartWithAxis: function() {
|
|
61
|
+
return createStringYAxisForHorizontalBarChartWithAxis;
|
|
62
|
+
},
|
|
63
|
+
createStringYAxisForOtherCharts: function() {
|
|
64
|
+
return createStringYAxisForOtherCharts;
|
|
65
|
+
},
|
|
66
|
+
createWrapOfXLabels: function() {
|
|
67
|
+
return createWrapOfXLabels;
|
|
68
|
+
},
|
|
69
|
+
createYAxis: function() {
|
|
70
|
+
return createYAxis;
|
|
71
|
+
},
|
|
72
|
+
createYAxisForHorizontalBarChartWithAxis: function() {
|
|
73
|
+
return createYAxisForHorizontalBarChartWithAxis;
|
|
74
|
+
},
|
|
75
|
+
createYAxisForOtherCharts: function() {
|
|
76
|
+
return createYAxisForOtherCharts;
|
|
77
|
+
},
|
|
78
|
+
createYAxisLabels: function() {
|
|
79
|
+
return createYAxisLabels;
|
|
80
|
+
},
|
|
81
|
+
domainRageOfVerticalNumeric: function() {
|
|
82
|
+
return domainRageOfVerticalNumeric;
|
|
83
|
+
},
|
|
84
|
+
domainRangeOfDateForAreaLineVerticalBarChart: function() {
|
|
85
|
+
return domainRangeOfDateForAreaLineVerticalBarChart;
|
|
86
|
+
},
|
|
87
|
+
domainRangeOfDateForScatterChart: function() {
|
|
88
|
+
return domainRangeOfDateForScatterChart;
|
|
89
|
+
},
|
|
90
|
+
domainRangeOfNumericForAreaChart: function() {
|
|
91
|
+
return domainRangeOfNumericForAreaChart;
|
|
92
|
+
},
|
|
93
|
+
domainRangeOfNumericForHorizontalBarChartWithAxis: function() {
|
|
94
|
+
return domainRangeOfNumericForHorizontalBarChartWithAxis;
|
|
95
|
+
},
|
|
96
|
+
domainRangeOfNumericForScatterChart: function() {
|
|
97
|
+
return domainRangeOfNumericForScatterChart;
|
|
98
|
+
},
|
|
99
|
+
domainRangeOfVSBCNumeric: function() {
|
|
100
|
+
return domainRangeOfVSBCNumeric;
|
|
101
|
+
},
|
|
102
|
+
domainRangeOfXStringAxis: function() {
|
|
103
|
+
return domainRangeOfXStringAxis;
|
|
104
|
+
},
|
|
105
|
+
find: function() {
|
|
106
|
+
return find;
|
|
107
|
+
},
|
|
108
|
+
findHBCWANumericMinMaxOfY: function() {
|
|
109
|
+
return findHBCWANumericMinMaxOfY;
|
|
110
|
+
},
|
|
111
|
+
findIndex: function() {
|
|
112
|
+
return findIndex;
|
|
113
|
+
},
|
|
114
|
+
findNumericMinMaxOfY: function() {
|
|
115
|
+
return findNumericMinMaxOfY;
|
|
116
|
+
},
|
|
117
|
+
findVSBCNumericMinMaxOfY: function() {
|
|
118
|
+
return findVSBCNumericMinMaxOfY;
|
|
119
|
+
},
|
|
120
|
+
findVerticalNumericMinMaxOfY: function() {
|
|
121
|
+
return findVerticalNumericMinMaxOfY;
|
|
122
|
+
},
|
|
123
|
+
formatDate: function() {
|
|
124
|
+
return formatDate;
|
|
125
|
+
},
|
|
126
|
+
formatValueWithSIPrefix: function() {
|
|
127
|
+
return formatValueWithSIPrefix;
|
|
128
|
+
},
|
|
129
|
+
getAccessibleDataObject: function() {
|
|
130
|
+
return getAccessibleDataObject;
|
|
131
|
+
},
|
|
132
|
+
getBarWidth: function() {
|
|
133
|
+
return getBarWidth;
|
|
134
|
+
},
|
|
135
|
+
getCurveFactory: function() {
|
|
136
|
+
return getCurveFactory;
|
|
137
|
+
},
|
|
138
|
+
getDomainNRangeValues: function() {
|
|
139
|
+
return getDomainNRangeValues;
|
|
140
|
+
},
|
|
141
|
+
getMinMaxOfYAxis: function() {
|
|
142
|
+
return getMinMaxOfYAxis;
|
|
143
|
+
},
|
|
144
|
+
getScalePadding: function() {
|
|
145
|
+
return getScalePadding;
|
|
146
|
+
},
|
|
147
|
+
getSecureProps: function() {
|
|
148
|
+
return getSecureProps;
|
|
149
|
+
},
|
|
150
|
+
getTypeOfAxis: function() {
|
|
151
|
+
return getTypeOfAxis;
|
|
152
|
+
},
|
|
153
|
+
getUnique: function() {
|
|
154
|
+
return getUnique;
|
|
155
|
+
},
|
|
156
|
+
getXAxisType: function() {
|
|
157
|
+
return getXAxisType;
|
|
158
|
+
},
|
|
159
|
+
isScalePaddingDefined: function() {
|
|
160
|
+
return isScalePaddingDefined;
|
|
161
|
+
},
|
|
162
|
+
pointTypes: function() {
|
|
163
|
+
return pointTypes;
|
|
164
|
+
},
|
|
165
|
+
prepareDatapoints: function() {
|
|
166
|
+
return prepareDatapoints;
|
|
167
|
+
},
|
|
168
|
+
resolveCSSVariables: function() {
|
|
169
|
+
return resolveCSSVariables;
|
|
170
|
+
},
|
|
171
|
+
rotateXAxisLabels: function() {
|
|
172
|
+
return rotateXAxisLabels;
|
|
173
|
+
},
|
|
174
|
+
silceOrAppendToArray: function() {
|
|
175
|
+
return silceOrAppendToArray;
|
|
176
|
+
},
|
|
177
|
+
tooltipOfXAxislabels: function() {
|
|
178
|
+
return tooltipOfXAxislabels;
|
|
179
|
+
},
|
|
180
|
+
useRtl: function() {
|
|
181
|
+
return useRtl;
|
|
182
|
+
},
|
|
183
|
+
wrapContent: function() {
|
|
184
|
+
return wrapContent;
|
|
185
|
+
},
|
|
186
|
+
wrapTextInsideDonut: function() {
|
|
187
|
+
return wrapTextInsideDonut;
|
|
188
|
+
}
|
|
189
|
+
});
|
|
190
|
+
const _d3axis = require("d3-axis");
|
|
191
|
+
const _d3array = require("d3-array");
|
|
192
|
+
const _d3scale = require("d3-scale");
|
|
193
|
+
const _d3selection = require("d3-selection");
|
|
194
|
+
const _d3format = require("d3-format");
|
|
195
|
+
const _d3timeformat = require("d3-time-format");
|
|
196
|
+
const _d3time = require("d3-time");
|
|
197
|
+
const _d3shape = require("d3-shape");
|
|
198
|
+
const _reactsharedcontexts = require("@fluentui/react-shared-contexts");
|
|
199
|
+
var ChartTypes;
|
|
200
|
+
(function(ChartTypes) {
|
|
201
|
+
ChartTypes[ChartTypes["AreaChart"] = 0] = "AreaChart";
|
|
202
|
+
ChartTypes[ChartTypes["LineChart"] = 1] = "LineChart";
|
|
203
|
+
ChartTypes[ChartTypes["VerticalBarChart"] = 2] = "VerticalBarChart";
|
|
204
|
+
ChartTypes[ChartTypes["VerticalStackedBarChart"] = 3] = "VerticalStackedBarChart";
|
|
205
|
+
ChartTypes[ChartTypes["GroupedVerticalBarChart"] = 4] = "GroupedVerticalBarChart";
|
|
206
|
+
ChartTypes[ChartTypes["HeatMapChart"] = 5] = "HeatMapChart";
|
|
207
|
+
ChartTypes[ChartTypes["HorizontalBarChartWithAxis"] = 6] = "HorizontalBarChartWithAxis";
|
|
208
|
+
ChartTypes[ChartTypes["ScatterChart"] = 7] = "ScatterChart";
|
|
209
|
+
})(ChartTypes || (ChartTypes = {}));
|
|
210
|
+
var XAxisTypes;
|
|
211
|
+
(function(XAxisTypes) {
|
|
212
|
+
XAxisTypes[XAxisTypes["NumericAxis"] = 0] = "NumericAxis";
|
|
213
|
+
XAxisTypes[XAxisTypes["DateAxis"] = 1] = "DateAxis";
|
|
214
|
+
XAxisTypes[XAxisTypes["StringAxis"] = 2] = "StringAxis";
|
|
215
|
+
})(XAxisTypes || (XAxisTypes = {}));
|
|
216
|
+
var YAxisType;
|
|
217
|
+
(function(YAxisType) {
|
|
218
|
+
YAxisType[YAxisType["NumericAxis"] = 0] = "NumericAxis";
|
|
219
|
+
YAxisType[YAxisType["DateAxis"] = 1] = "DateAxis";
|
|
220
|
+
YAxisType[YAxisType["StringAxis"] = 2] = "StringAxis";
|
|
221
|
+
})(YAxisType || (YAxisType = {}));
|
|
222
|
+
function createNumericXAxis(xAxisParams, tickParams, chartType, culture) {
|
|
223
|
+
const { domainNRangeValues, showRoundOffXTickValues = false, xAxistickSize = 6, tickPadding = 10, xAxisCount, xAxisElement, hideTickOverlap } = xAxisParams;
|
|
224
|
+
const xAxisScale = (0, _d3scale.scaleLinear)().domain([
|
|
225
|
+
domainNRangeValues.dStartValue,
|
|
226
|
+
domainNRangeValues.dEndValue
|
|
227
|
+
]).range([
|
|
228
|
+
domainNRangeValues.rStartValue,
|
|
229
|
+
domainNRangeValues.rEndValue
|
|
230
|
+
]);
|
|
231
|
+
showRoundOffXTickValues && xAxisScale.nice();
|
|
232
|
+
let tickCount = xAxisCount !== null && xAxisCount !== void 0 ? xAxisCount : 6;
|
|
233
|
+
const tickFormat = (domainValue, _index)=>{
|
|
234
|
+
if (tickParams.tickFormat) {
|
|
235
|
+
return (0, _d3format.format)(tickParams.tickFormat)(domainValue);
|
|
236
|
+
}
|
|
237
|
+
const xAxisValue = typeof domainValue === 'number' ? domainValue : domainValue.valueOf();
|
|
238
|
+
return convertToLocaleString(xAxisValue, culture);
|
|
239
|
+
};
|
|
240
|
+
if (hideTickOverlap && typeof xAxisCount === 'undefined') {
|
|
241
|
+
const longestLabelWidth = calculateLongestLabelWidth(xAxisScale.ticks().map(tickFormat), '.fui-cart__xAxis text') + 20;
|
|
242
|
+
const [start, end] = xAxisScale.range();
|
|
243
|
+
tickCount = Math.max(1, Math.floor(Math.abs(end - start) / longestLabelWidth));
|
|
244
|
+
}
|
|
245
|
+
const xAxis = (0, _d3axis.axisBottom)(xAxisScale).tickSize(xAxistickSize).tickPadding(tickPadding).ticks(tickCount).tickFormat(tickFormat);
|
|
246
|
+
if (chartType === 6) {
|
|
247
|
+
xAxis.tickSizeInner(-(xAxisParams.containerHeight - xAxisParams.margins.top));
|
|
248
|
+
}
|
|
249
|
+
if (tickParams.tickValues) {
|
|
250
|
+
xAxis.tickValues(tickParams.tickValues);
|
|
251
|
+
}
|
|
252
|
+
if (xAxisElement) {
|
|
253
|
+
(0, _d3selection.select)(xAxisElement).call(xAxis).selectAll('text').attr('aria-hidden', 'true');
|
|
254
|
+
}
|
|
255
|
+
var _tickParams_tickValues;
|
|
256
|
+
const tickValues = ((_tickParams_tickValues = tickParams.tickValues) !== null && _tickParams_tickValues !== void 0 ? _tickParams_tickValues : xAxisScale.ticks(tickCount)).map(xAxis.tickFormat());
|
|
257
|
+
return {
|
|
258
|
+
xScale: xAxisScale,
|
|
259
|
+
tickValues
|
|
260
|
+
};
|
|
261
|
+
}
|
|
262
|
+
function multiFormat(date, locale, useUTC) {
|
|
263
|
+
const timeFormat = locale ? useUTC ? locale.utcFormat : locale.format : useUTC ? _d3timeformat.utcFormat : _d3timeformat.timeFormat;
|
|
264
|
+
const formatMillisecond = timeFormat('.%L');
|
|
265
|
+
const formatSecond = timeFormat(':%S');
|
|
266
|
+
const formatMinute = timeFormat('%I:%M');
|
|
267
|
+
const formatHour = timeFormat('%I %p');
|
|
268
|
+
const formatDay = timeFormat('%a %d');
|
|
269
|
+
const formatWeek = timeFormat('%b %d');
|
|
270
|
+
const formatMonth = timeFormat('%B');
|
|
271
|
+
const formatYear = timeFormat('%Y');
|
|
272
|
+
const timeSecond = useUTC ? _d3time.utcSecond : _d3time.timeSecond;
|
|
273
|
+
const timeMinute = useUTC ? _d3time.utcMinute : _d3time.timeMinute;
|
|
274
|
+
const timeHour = useUTC ? _d3time.utcHour : _d3time.timeHour;
|
|
275
|
+
const timeDay = useUTC ? _d3time.utcDay : _d3time.timeDay;
|
|
276
|
+
const timeMonth = useUTC ? _d3time.utcMonth : _d3time.timeMonth;
|
|
277
|
+
const timeWeek = useUTC ? _d3time.utcWeek : _d3time.timeWeek;
|
|
278
|
+
const timeYear = useUTC ? _d3time.utcYear : _d3time.timeYear;
|
|
279
|
+
return (timeSecond(date) < date ? formatMillisecond : timeMinute(date) < date ? formatSecond : timeHour(date) < date ? formatMinute : timeDay(date) < date ? formatHour : timeMonth(date) < date ? timeWeek(date) < date ? formatDay : formatWeek : timeYear(date) < date ? formatMonth : formatYear)(date);
|
|
280
|
+
}
|
|
281
|
+
function createDateXAxis(xAxisParams, tickParams, culture, options, timeFormatLocale, customDateTimeFormatter, useUTC) {
|
|
282
|
+
const { domainNRangeValues, xAxisElement, tickPadding = 6, xAxistickSize = 6, xAxisCount, hideTickOverlap } = xAxisParams;
|
|
283
|
+
const xAxisScale = useUTC ? (0, _d3scale.scaleUtc)() : (0, _d3scale.scaleTime)();
|
|
284
|
+
xAxisScale.domain([
|
|
285
|
+
domainNRangeValues.dStartValue,
|
|
286
|
+
domainNRangeValues.dEndValue
|
|
287
|
+
]).range([
|
|
288
|
+
domainNRangeValues.rStartValue,
|
|
289
|
+
domainNRangeValues.rEndValue
|
|
290
|
+
]);
|
|
291
|
+
let tickCount = xAxisCount !== null && xAxisCount !== void 0 ? xAxisCount : 6;
|
|
292
|
+
const tickFormat = (domainValue, _index)=>{
|
|
293
|
+
if (customDateTimeFormatter) {
|
|
294
|
+
return customDateTimeFormatter(domainValue);
|
|
295
|
+
}
|
|
296
|
+
if (culture && options) {
|
|
297
|
+
return domainValue.toLocaleString(culture, options);
|
|
298
|
+
}
|
|
299
|
+
if (timeFormatLocale) {
|
|
300
|
+
const locale = (0, _d3timeformat.timeFormatLocale)(timeFormatLocale);
|
|
301
|
+
return multiFormat(domainValue, locale, useUTC);
|
|
302
|
+
}
|
|
303
|
+
if (culture === undefined && tickParams.tickFormat) {
|
|
304
|
+
if (useUTC) {
|
|
305
|
+
return (0, _d3timeformat.utcFormat)(tickParams.tickFormat)(domainValue);
|
|
306
|
+
} else {
|
|
307
|
+
return (0, _d3timeformat.timeFormat)(tickParams.tickFormat)(domainValue);
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
return multiFormat(domainValue, undefined, useUTC);
|
|
311
|
+
};
|
|
312
|
+
if (hideTickOverlap && typeof xAxisCount === 'undefined') {
|
|
313
|
+
const longestLabelWidth = calculateLongestLabelWidth(xAxisScale.ticks().map(tickFormat), '.fui-cart__xAxis text') + 40;
|
|
314
|
+
const [start, end] = xAxisScale.range();
|
|
315
|
+
tickCount = Math.max(1, Math.floor(Math.abs(end - start) / longestLabelWidth));
|
|
316
|
+
}
|
|
317
|
+
const xAxis = (0, _d3axis.axisBottom)(xAxisScale).tickSize(xAxistickSize).tickPadding(tickPadding).ticks(tickCount).tickFormat(tickFormat);
|
|
318
|
+
tickParams.tickValues ? xAxis.tickValues(tickParams.tickValues) : '';
|
|
319
|
+
if (xAxisElement) {
|
|
320
|
+
(0, _d3selection.select)(xAxisElement).call(xAxis).selectAll('text').attr('aria-hidden', 'true');
|
|
321
|
+
}
|
|
322
|
+
var _tickParams_tickValues;
|
|
323
|
+
const tickValues = ((_tickParams_tickValues = tickParams.tickValues) !== null && _tickParams_tickValues !== void 0 ? _tickParams_tickValues : xAxisScale.ticks(tickCount)).map(xAxis.tickFormat());
|
|
324
|
+
return {
|
|
325
|
+
xScale: xAxisScale,
|
|
326
|
+
tickValues
|
|
327
|
+
};
|
|
328
|
+
}
|
|
329
|
+
function createStringXAxis(xAxisParams, tickParams, dataset, culture) {
|
|
330
|
+
const { domainNRangeValues, xAxistickSize = 6, tickPadding = 10, xAxisPadding = 0.1, xAxisInnerPadding, xAxisOuterPadding, containerWidth, hideTickOverlap } = xAxisParams;
|
|
331
|
+
const xAxisScale = (0, _d3scale.scaleBand)().domain(dataset).range([
|
|
332
|
+
domainNRangeValues.rStartValue,
|
|
333
|
+
domainNRangeValues.rEndValue
|
|
334
|
+
]).paddingInner(typeof xAxisInnerPadding !== 'undefined' ? xAxisInnerPadding : xAxisPadding).paddingOuter(typeof xAxisOuterPadding !== 'undefined' ? xAxisOuterPadding : xAxisPadding);
|
|
335
|
+
var _tickParams_tickValues;
|
|
336
|
+
let tickValues = (_tickParams_tickValues = tickParams.tickValues) !== null && _tickParams_tickValues !== void 0 ? _tickParams_tickValues : dataset;
|
|
337
|
+
const tickFormat = (domainValue, _index)=>{
|
|
338
|
+
return convertToLocaleString(domainValue, culture);
|
|
339
|
+
};
|
|
340
|
+
if (hideTickOverlap) {
|
|
341
|
+
let nonOverlappingTickValues = [];
|
|
342
|
+
const tickSizes = tickValues.map((value, index)=>calculateLongestLabelWidth([
|
|
343
|
+
tickFormat(value, index)
|
|
344
|
+
], '.fui-cart__xAxis text'));
|
|
345
|
+
// for LTR
|
|
346
|
+
let start = 0;
|
|
347
|
+
let end = containerWidth;
|
|
348
|
+
let sign = 1;
|
|
349
|
+
const range = xAxisScale.range();
|
|
350
|
+
if (range[1] - range[0] < 0) {
|
|
351
|
+
// for RTL
|
|
352
|
+
start = containerWidth;
|
|
353
|
+
end = 0;
|
|
354
|
+
sign = -1;
|
|
355
|
+
}
|
|
356
|
+
for(let i = tickValues.length - 1; i >= 0; i--){
|
|
357
|
+
const tickPosition = xAxisScale(tickValues[i]);
|
|
358
|
+
if (sign * (tickPosition - sign * tickSizes[i] / 2 - start) >= 0 && sign * (tickPosition + sign * tickSizes[i] / 2 - end) <= 0) {
|
|
359
|
+
nonOverlappingTickValues.push(tickValues[i]);
|
|
360
|
+
end = tickPosition - sign * (tickSizes[i] / 2 + 10);
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
nonOverlappingTickValues = nonOverlappingTickValues.reverse();
|
|
364
|
+
tickValues = nonOverlappingTickValues;
|
|
365
|
+
}
|
|
366
|
+
const xAxis = (0, _d3axis.axisBottom)(xAxisScale).tickSize(xAxistickSize).tickPadding(tickPadding).tickValues(tickValues).tickFormat(tickFormat);
|
|
367
|
+
if (xAxisParams.xAxisElement) {
|
|
368
|
+
(0, _d3selection.select)(xAxisParams.xAxisElement).call(xAxis).selectAll('text').attr('aria-hidden', 'true');
|
|
369
|
+
}
|
|
370
|
+
return {
|
|
371
|
+
xScale: xAxisScale,
|
|
372
|
+
tickValues: tickValues.map(xAxis.tickFormat())
|
|
373
|
+
};
|
|
374
|
+
}
|
|
375
|
+
function useRtl() {
|
|
376
|
+
const { dir } = (0, _reactsharedcontexts.useFluent_unstable)(); // "dir" returns "ltr" or "rtl"
|
|
377
|
+
return dir === 'rtl';
|
|
378
|
+
}
|
|
379
|
+
function isPowerOf10(num) {
|
|
380
|
+
const roundedfinalYMax = handleFloatingPointPrecisionError(num);
|
|
381
|
+
return Math.log10(roundedfinalYMax) % 1 === 0;
|
|
382
|
+
}
|
|
383
|
+
//for reference, go through this 'https://docs.python.org/release/2.5.1/tut/node16.html'
|
|
384
|
+
function handleFloatingPointPrecisionError(num) {
|
|
385
|
+
const rounded = Math.round(num);
|
|
386
|
+
return Math.abs(num - rounded) < 1e-6 ? rounded : num;
|
|
387
|
+
}
|
|
388
|
+
/**
|
|
389
|
+
* This method is used to calculate the rounded tick values for the y-axis
|
|
390
|
+
* @param {number} minVal
|
|
391
|
+
* @param {number} maxVal
|
|
392
|
+
* @param {number} splitInto
|
|
393
|
+
* @returns {number[]}
|
|
394
|
+
*/ function calculateRoundedTicks(minVal, maxVal, splitInto) {
|
|
395
|
+
const finalYmin = minVal >= 0 && minVal === maxVal ? 0 : minVal;
|
|
396
|
+
const finalYmax = minVal < 0 && minVal === maxVal ? 0 : maxVal;
|
|
397
|
+
const ticksInterval = (0, _d3array.nice)(finalYmin, finalYmax, splitInto);
|
|
398
|
+
const ticks = (0, _d3array.ticks)(ticksInterval[0], ticksInterval[ticksInterval.length - 1], splitInto);
|
|
399
|
+
if (ticks[ticks.length - 1] > finalYmax && isPowerOf10(finalYmax)) {
|
|
400
|
+
ticks.pop();
|
|
401
|
+
}
|
|
402
|
+
return ticks;
|
|
403
|
+
}
|
|
404
|
+
function prepareDatapoints(maxVal, minVal, splitInto, isIntegralDataset, roundedTicks) {
|
|
405
|
+
if (roundedTicks) {
|
|
406
|
+
return calculateRoundedTicks(minVal, maxVal, splitInto);
|
|
407
|
+
}
|
|
408
|
+
const val = isIntegralDataset ? Math.ceil((maxVal - minVal) / splitInto) : (maxVal - minVal) / splitInto >= 1 ? Math.ceil((maxVal - minVal) / splitInto) : (maxVal - minVal) / splitInto;
|
|
409
|
+
/*
|
|
410
|
+
For cases where we have negative and positive values
|
|
411
|
+
The dataPointsArray is filled from 0 to minVal by val difference
|
|
412
|
+
Then the array is reversed and values from 0(excluding 0) to maxVal are appended
|
|
413
|
+
This ensures presence of 0 to act as an anchor reference.
|
|
414
|
+
For simple cases where the scale may not encounter such a need for 0,
|
|
415
|
+
We simply fill from minVal to maxVal
|
|
416
|
+
*/ const dataPointsArray = [
|
|
417
|
+
minVal < 0 && maxVal >= 0 ? 0 : minVal
|
|
418
|
+
];
|
|
419
|
+
/*For the case of all positive or all negative, we need to add another value
|
|
420
|
+
in array for atleast one interval, but in case of mix of positive and negative,
|
|
421
|
+
there will always be one more entry that will be added by the logic we have*/ if (dataPointsArray[0] === minVal) {
|
|
422
|
+
dataPointsArray.push(minVal + val);
|
|
423
|
+
}
|
|
424
|
+
if (minVal < 0 && maxVal >= 0) {
|
|
425
|
+
while(dataPointsArray[dataPointsArray.length - 1] > minVal){
|
|
426
|
+
dataPointsArray.push(dataPointsArray[dataPointsArray.length - 1] - val);
|
|
427
|
+
}
|
|
428
|
+
dataPointsArray.reverse();
|
|
429
|
+
}
|
|
430
|
+
while(dataPointsArray[dataPointsArray.length - 1] < maxVal){
|
|
431
|
+
dataPointsArray.push(dataPointsArray[dataPointsArray.length - 1] + val);
|
|
432
|
+
}
|
|
433
|
+
return dataPointsArray;
|
|
434
|
+
}
|
|
435
|
+
function createYAxis(yAxisParams, isRtl, axisData, chartType, barWidth, isIntegralDataset, useSecondaryYScale = false, roundedTicks = false) {
|
|
436
|
+
switch(chartType){
|
|
437
|
+
case 6:
|
|
438
|
+
return createYAxisForHorizontalBarChartWithAxis(yAxisParams, isRtl, axisData, barWidth);
|
|
439
|
+
default:
|
|
440
|
+
return createYAxisForOtherCharts(yAxisParams, isRtl, axisData, isIntegralDataset, chartType, useSecondaryYScale, roundedTicks);
|
|
441
|
+
}
|
|
442
|
+
}
|
|
443
|
+
function createYAxisForHorizontalBarChartWithAxis(yAxisParams, isRtl, axisData, barWidth) {
|
|
444
|
+
const { yMinMaxValues = {
|
|
445
|
+
startValue: 0,
|
|
446
|
+
endValue: 0
|
|
447
|
+
}, yAxisElement = null, yMaxValue = 0, yMinValue = 0, containerHeight, margins, tickPadding = 12, maxOfYVal = 0, yAxisTickFormat, yAxisTickCount = 4 } = yAxisParams;
|
|
448
|
+
// maxOfYVal coming from only area chart and Grouped vertical bar chart(Calculation done at base file)
|
|
449
|
+
const tempVal = maxOfYVal || yMinMaxValues.endValue;
|
|
450
|
+
const finalYmax = tempVal > yMaxValue ? tempVal : yMaxValue;
|
|
451
|
+
const finalYmin = yMinMaxValues.startValue < yMinValue ? 0 : yMinValue;
|
|
452
|
+
const yAxisScale = (0, _d3scale.scaleLinear)().domain([
|
|
453
|
+
finalYmin,
|
|
454
|
+
finalYmax
|
|
455
|
+
]).range([
|
|
456
|
+
containerHeight - margins.bottom,
|
|
457
|
+
margins.top
|
|
458
|
+
]);
|
|
459
|
+
const axis = isRtl ? (0, _d3axis.axisRight)(yAxisScale) : (0, _d3axis.axisLeft)(yAxisScale);
|
|
460
|
+
const yAxis = axis.tickPadding(tickPadding).ticks(yAxisTickCount);
|
|
461
|
+
yAxisTickFormat ? yAxis.tickFormat(yAxisTickFormat) : yAxis.tickFormat((0, _d3format.format)('.2~s'));
|
|
462
|
+
yAxisElement ? (0, _d3selection.select)(yAxisElement).call(yAxis).selectAll('text').attr('aria-hidden', 'true') : '';
|
|
463
|
+
return yAxisScale;
|
|
464
|
+
}
|
|
465
|
+
function createYAxisForOtherCharts(yAxisParams, isRtl, axisData, isIntegralDataset, chartType, useSecondaryYScale = false, roundedTicks = false) {
|
|
466
|
+
const { yMinMaxValues = {
|
|
467
|
+
startValue: 0,
|
|
468
|
+
endValue: 0
|
|
469
|
+
}, yAxisElement = null, yMaxValue = 0, yMinValue = 0, containerHeight, containerWidth, margins, tickPadding = 12, maxOfYVal = 0, yAxisTickFormat, yAxisTickCount = 4, eventAnnotationProps, eventLabelHeight } = yAxisParams;
|
|
470
|
+
// maxOfYVal coming from only area chart and Grouped vertical bar chart(Calculation done at base file)
|
|
471
|
+
const tempVal = maxOfYVal || yMinMaxValues.endValue;
|
|
472
|
+
const finalYmax = tempVal > yMaxValue ? tempVal : yMaxValue;
|
|
473
|
+
const finalYmin = Math.min(yMinMaxValues.startValue, yMinValue || 0);
|
|
474
|
+
const domainValues = prepareDatapoints(finalYmax, finalYmin, yAxisTickCount, isIntegralDataset, roundedTicks);
|
|
475
|
+
let yMin = finalYmin;
|
|
476
|
+
let yMax = domainValues[domainValues.length - 1];
|
|
477
|
+
if (chartType === 7) {
|
|
478
|
+
const yPadding = (yMax - yMin) * 0.1;
|
|
479
|
+
yMin = yMin - yPadding;
|
|
480
|
+
yMax = yMax + yPadding;
|
|
481
|
+
}
|
|
482
|
+
const yAxisScale = (0, _d3scale.scaleLinear)().domain([
|
|
483
|
+
domainValues[0],
|
|
484
|
+
yMax
|
|
485
|
+
]).range([
|
|
486
|
+
containerHeight - margins.bottom,
|
|
487
|
+
margins.top + (eventAnnotationProps ? eventLabelHeight : 0)
|
|
488
|
+
]);
|
|
489
|
+
const axis = !isRtl && useSecondaryYScale || isRtl && !useSecondaryYScale ? (0, _d3axis.axisRight)(yAxisScale) : (0, _d3axis.axisLeft)(yAxisScale);
|
|
490
|
+
const yAxis = axis.tickPadding(tickPadding).tickValues(domainValues).tickSizeInner(-(containerWidth - margins.left - margins.right));
|
|
491
|
+
yAxisTickFormat ? yAxis.tickFormat(yAxisTickFormat) : yAxis.tickFormat((0, _d3format.format)('.2~s'));
|
|
492
|
+
yAxisElement ? (0, _d3selection.select)(yAxisElement).call(yAxis).selectAll('text').attr('aria-hidden', 'true') : '';
|
|
493
|
+
axisData.yAxisDomainValues = domainValues;
|
|
494
|
+
return yAxisScale;
|
|
495
|
+
}
|
|
496
|
+
const createStringYAxis = (yAxisParams, dataPoints, isRtl, chartType, barWidth, culture)=>{
|
|
497
|
+
switch(chartType){
|
|
498
|
+
case 6:
|
|
499
|
+
return createStringYAxisForHorizontalBarChartWithAxis(yAxisParams, dataPoints, isRtl, barWidth, culture);
|
|
500
|
+
default:
|
|
501
|
+
return createStringYAxisForOtherCharts(yAxisParams, dataPoints, isRtl);
|
|
502
|
+
}
|
|
503
|
+
};
|
|
504
|
+
const createStringYAxisForHorizontalBarChartWithAxis = (yAxisParams, dataPoints, isRtl, barWidth, culture)=>{
|
|
505
|
+
const { containerHeight, tickPadding = 12, margins, yAxisTickFormat, yAxisElement } = yAxisParams;
|
|
506
|
+
const yAxisScale = (0, _d3scale.scaleBand)().domain(dataPoints).range([
|
|
507
|
+
containerHeight - margins.bottom - barWidth / 2,
|
|
508
|
+
margins.top + barWidth / 2
|
|
509
|
+
]);
|
|
510
|
+
const axis = isRtl ? (0, _d3axis.axisRight)(yAxisScale) : (0, _d3axis.axisLeft)(yAxisScale);
|
|
511
|
+
const yAxis = axis.tickPadding(tickPadding).ticks(dataPoints);
|
|
512
|
+
if (yAxisTickFormat) {
|
|
513
|
+
yAxis.tickFormat(yAxisTickFormat);
|
|
514
|
+
}
|
|
515
|
+
yAxisElement ? (0, _d3selection.select)(yAxisElement).call(yAxis).selectAll('text') : '';
|
|
516
|
+
return yAxisScale;
|
|
517
|
+
};
|
|
518
|
+
const createStringYAxisForOtherCharts = (yAxisParams, dataPoints, isRtl)=>{
|
|
519
|
+
const { containerHeight, tickPadding = 12, margins, yAxisTickFormat, yAxisElement, yAxisPadding = 0 } = yAxisParams;
|
|
520
|
+
const yAxisScale = (0, _d3scale.scaleBand)().domain(dataPoints).range([
|
|
521
|
+
containerHeight - margins.bottom,
|
|
522
|
+
margins.top
|
|
523
|
+
]).padding(yAxisPadding);
|
|
524
|
+
const axis = isRtl ? (0, _d3axis.axisRight)(yAxisScale) : (0, _d3axis.axisLeft)(yAxisScale);
|
|
525
|
+
const yAxis = axis.tickPadding(tickPadding).tickValues(dataPoints).tickSize(0);
|
|
526
|
+
if (yAxisTickFormat) {
|
|
527
|
+
yAxis.tickFormat(yAxisTickFormat);
|
|
528
|
+
}
|
|
529
|
+
yAxisElement ? (0, _d3selection.select)(yAxisElement).call(yAxis).selectAll('text') : '';
|
|
530
|
+
return yAxisScale;
|
|
531
|
+
};
|
|
532
|
+
function calloutData(values) {
|
|
533
|
+
let combinedResult = [];
|
|
534
|
+
values.forEach((line)=>{
|
|
535
|
+
const elements = line.data.filter((point)=>!point.hideCallout).map((point)=>{
|
|
536
|
+
return {
|
|
537
|
+
...point,
|
|
538
|
+
legend: line.legend,
|
|
539
|
+
color: line.color,
|
|
540
|
+
index: line.index
|
|
541
|
+
};
|
|
542
|
+
});
|
|
543
|
+
combinedResult = combinedResult.concat(elements);
|
|
544
|
+
});
|
|
545
|
+
const xValToDataPoints = {};
|
|
546
|
+
combinedResult.forEach((ele)=>{
|
|
547
|
+
const xValue = ele.x instanceof Date ? ele.x.getTime() : ele.x;
|
|
548
|
+
if (xValue in xValToDataPoints) {
|
|
549
|
+
xValToDataPoints[xValue].push({
|
|
550
|
+
legend: ele.legend,
|
|
551
|
+
y: ele.y,
|
|
552
|
+
color: ele.color,
|
|
553
|
+
xAxisCalloutData: ele.xAxisCalloutData,
|
|
554
|
+
yAxisCalloutData: ele.yAxisCalloutData,
|
|
555
|
+
callOutAccessibilityData: ele.callOutAccessibilityData,
|
|
556
|
+
index: ele.index
|
|
557
|
+
});
|
|
558
|
+
} else {
|
|
559
|
+
xValToDataPoints[xValue] = [
|
|
560
|
+
{
|
|
561
|
+
legend: ele.legend,
|
|
562
|
+
y: ele.y,
|
|
563
|
+
color: ele.color,
|
|
564
|
+
xAxisCalloutData: ele.xAxisCalloutData,
|
|
565
|
+
yAxisCalloutData: ele.yAxisCalloutData,
|
|
566
|
+
callOutAccessibilityData: ele.callOutAccessibilityData,
|
|
567
|
+
index: ele.index
|
|
568
|
+
}
|
|
569
|
+
];
|
|
570
|
+
}
|
|
571
|
+
});
|
|
572
|
+
const result = Object.keys(xValToDataPoints).map((xValue)=>{
|
|
573
|
+
const originalXValue = isNaN(Number(xValue)) ? xValue : Number(xValue);
|
|
574
|
+
return {
|
|
575
|
+
x: originalXValue,
|
|
576
|
+
values: xValToDataPoints[xValue]
|
|
577
|
+
};
|
|
578
|
+
});
|
|
579
|
+
return result;
|
|
580
|
+
}
|
|
581
|
+
function getUnique(arr, comp) {
|
|
582
|
+
const unique = arr // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
583
|
+
.map((e)=>e[comp]) // store the keys of the unique objects
|
|
584
|
+
.map((e, i, final)=>final.indexOf(e) === i && i) // eliminate the dead keys & store unique objects
|
|
585
|
+
.filter((e)=>arr[e]).map((e)=>arr[e]);
|
|
586
|
+
return unique;
|
|
587
|
+
}
|
|
588
|
+
function silceOrAppendToArray(array, value) {
|
|
589
|
+
const pos = array.indexOf(value);
|
|
590
|
+
if (pos === -1) {
|
|
591
|
+
return [
|
|
592
|
+
...array,
|
|
593
|
+
value
|
|
594
|
+
];
|
|
595
|
+
} else {
|
|
596
|
+
return array.slice(0, pos).concat(array.slice(pos + 1));
|
|
597
|
+
}
|
|
598
|
+
}
|
|
599
|
+
function createWrapOfXLabels(wrapLabelProps) {
|
|
600
|
+
const { node, xAxis, noOfCharsToTruncate, showXAxisLablesTooltip } = wrapLabelProps;
|
|
601
|
+
if (node === null) {
|
|
602
|
+
return;
|
|
603
|
+
}
|
|
604
|
+
const axisNode = (0, _d3selection.select)(node).call(xAxis);
|
|
605
|
+
let removeVal = 0;
|
|
606
|
+
const width = 10;
|
|
607
|
+
const arr = [];
|
|
608
|
+
axisNode.selectAll('.tick text').each(function() {
|
|
609
|
+
const text = (0, _d3selection.select)(this);
|
|
610
|
+
const totalWord = text.text();
|
|
611
|
+
const truncatedWord = `${text.text().slice(0, noOfCharsToTruncate)}...`;
|
|
612
|
+
const totalWordLength = text.text().length;
|
|
613
|
+
const words = text.text().split(/\s+/).reverse();
|
|
614
|
+
arr.push(words.length);
|
|
615
|
+
let word = '';
|
|
616
|
+
let line = [];
|
|
617
|
+
let lineNumber = 0;
|
|
618
|
+
const lineHeight = 1.1; // ems
|
|
619
|
+
const y = text.attr('y');
|
|
620
|
+
const dy = parseFloat(text.attr('dy'));
|
|
621
|
+
let tspan = text.text(null).append('tspan').attr('x', 0).attr('y', y).attr('id', 'BaseSpan').attr('dy', dy + 'em').attr('data-', totalWord);
|
|
622
|
+
if (showXAxisLablesTooltip && totalWordLength > noOfCharsToTruncate) {
|
|
623
|
+
tspan = text.append('tspan').attr('id', 'showDots').attr('x', 0).attr('y', y).attr('dy', ++lineNumber * lineHeight + dy + 'em').text(truncatedWord);
|
|
624
|
+
} else if (showXAxisLablesTooltip && totalWordLength <= noOfCharsToTruncate) {
|
|
625
|
+
tspan = text.append('tspan').attr('id', 'LessLength').attr('x', 0).attr('y', y).attr('dy', ++lineNumber * lineHeight + dy + 'em').text(totalWord);
|
|
626
|
+
} else {
|
|
627
|
+
while(word = words.pop()){
|
|
628
|
+
line.push(word);
|
|
629
|
+
tspan.text(line.join(' '));
|
|
630
|
+
if (tspan.node().getComputedTextLength() > width && line.length > 1) {
|
|
631
|
+
line.pop();
|
|
632
|
+
tspan.text(line.join(' '));
|
|
633
|
+
line = [
|
|
634
|
+
word
|
|
635
|
+
];
|
|
636
|
+
tspan = text.append('tspan').attr('id', 'WordBreakId').attr('x', 0).attr('y', y).attr('dy', ++lineNumber * lineHeight + dy + 'em').text(word);
|
|
637
|
+
}
|
|
638
|
+
}
|
|
639
|
+
const maxDigit = Math.max(...arr);
|
|
640
|
+
let maxHeight = 12; // intial value to render corretly first time
|
|
641
|
+
axisNode.selectAll('text').each(()=>{
|
|
642
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
643
|
+
const outerHTMLElement = document.getElementById('WordBreakId');
|
|
644
|
+
const BoxCordinates = outerHTMLElement && outerHTMLElement.getBoundingClientRect();
|
|
645
|
+
const boxHeight = BoxCordinates && BoxCordinates.height;
|
|
646
|
+
if (boxHeight > maxHeight) {
|
|
647
|
+
maxHeight = boxHeight;
|
|
648
|
+
}
|
|
649
|
+
});
|
|
650
|
+
// If we take directly maxDigit * maxheight, then it will show more height between x axis tick values and bottom.
|
|
651
|
+
// To avoid this, reducing maxDigit value by removing some digit based on legth of word.
|
|
652
|
+
let removeDigit = 4;
|
|
653
|
+
if (maxDigit <= 2) {
|
|
654
|
+
removeDigit = 1;
|
|
655
|
+
} else if (maxDigit > 2 && maxDigit <= 6) {
|
|
656
|
+
removeDigit = 2;
|
|
657
|
+
} else if (maxDigit > 6 && maxDigit <= 9) {
|
|
658
|
+
removeDigit = 3;
|
|
659
|
+
}
|
|
660
|
+
removeVal = (maxDigit - removeDigit) * maxHeight;
|
|
661
|
+
}
|
|
662
|
+
});
|
|
663
|
+
return removeVal > 0 ? removeVal : 0;
|
|
664
|
+
}
|
|
665
|
+
function createYAxisLabels(node, yAxis, noOfCharsToTruncate, truncateLabel, xValue, isRtl) {
|
|
666
|
+
if (node === null) {
|
|
667
|
+
return;
|
|
668
|
+
}
|
|
669
|
+
let tickIndex = 0;
|
|
670
|
+
const axisNode = (0, _d3selection.select)(node).call(yAxis);
|
|
671
|
+
axisNode.selectAll('.tick text').each(function() {
|
|
672
|
+
const text = (0, _d3selection.select)(this);
|
|
673
|
+
const totalWord = text.text();
|
|
674
|
+
const truncatedWord = isRtl ? `...${text.text().slice(0, noOfCharsToTruncate)}` : `${text.text().slice(0, noOfCharsToTruncate)}...`;
|
|
675
|
+
const totalWordLength = text.text().length;
|
|
676
|
+
const padding = truncateLabel ? 1.5 : 1; // ems
|
|
677
|
+
const y = text.attr('y');
|
|
678
|
+
const x = text.attr('x');
|
|
679
|
+
const dy = parseFloat(text.attr('dy'));
|
|
680
|
+
const dx = 0;
|
|
681
|
+
const uid = tickIndex++;
|
|
682
|
+
text.text(null).append('tspan').attr('x', x).attr('y', y).attr('id', `BaseSpan-${uid}`).attr('dy', dy + 'em').attr('data-', totalWord);
|
|
683
|
+
if (truncateLabel && totalWordLength > noOfCharsToTruncate) {
|
|
684
|
+
text.append('tspan').attr('id', `showDots-${uid}`).attr('x', isRtl ? 0 : x).attr('y', y).attr('dy', dy).attr('dx', padding + dx + 'em').text(truncatedWord);
|
|
685
|
+
} else {
|
|
686
|
+
text.attr('text-align', 'start').append('tspan').attr('id', `LessLength-${uid}`).attr('x', isRtl ? 0 : x).attr('y', y).attr('dx', padding + dx + 'em').text(totalWord);
|
|
687
|
+
}
|
|
688
|
+
});
|
|
689
|
+
}
|
|
690
|
+
const wrapContent = (content, id, maxWidth)=>{
|
|
691
|
+
const textElement = (0, _d3selection.select)(`#${id}`);
|
|
692
|
+
textElement.text(content);
|
|
693
|
+
if (!textElement.node()) {
|
|
694
|
+
return false;
|
|
695
|
+
}
|
|
696
|
+
let isOverflowing = false;
|
|
697
|
+
let textLength = textElement.node().getComputedTextLength();
|
|
698
|
+
while(textLength > maxWidth && content.length > 0){
|
|
699
|
+
content = content.slice(0, -1);
|
|
700
|
+
textElement.text(content + '...');
|
|
701
|
+
isOverflowing = true;
|
|
702
|
+
textLength = textElement.node().getComputedTextLength();
|
|
703
|
+
}
|
|
704
|
+
return isOverflowing;
|
|
705
|
+
};
|
|
706
|
+
const calculateLongestLabelWidth = (labels, query = 'none')=>{
|
|
707
|
+
let maxLabelWidth = 0;
|
|
708
|
+
const canvas = document.createElement('canvas');
|
|
709
|
+
const ctx = canvas.getContext('2d');
|
|
710
|
+
if (ctx) {
|
|
711
|
+
const axisText = document.querySelector(query);
|
|
712
|
+
if (axisText) {
|
|
713
|
+
const styles = window.getComputedStyle(axisText, null);
|
|
714
|
+
const fontWeight = styles.getPropertyValue('font-weight');
|
|
715
|
+
const fontSize = styles.getPropertyValue('font-size');
|
|
716
|
+
const fontFamily = styles.getPropertyValue('font-family');
|
|
717
|
+
ctx.font = `${fontWeight} ${fontSize} ${fontFamily}`;
|
|
718
|
+
} else {
|
|
719
|
+
ctx.font = '600 10px "Segoe UI"';
|
|
720
|
+
}
|
|
721
|
+
labels.forEach((label)=>{
|
|
722
|
+
maxLabelWidth = Math.max(ctx.measureText(label.toString()).width, maxLabelWidth);
|
|
723
|
+
});
|
|
724
|
+
}
|
|
725
|
+
return maxLabelWidth;
|
|
726
|
+
};
|
|
727
|
+
function tooltipOfXAxislabels(xAxistooltipProps) {
|
|
728
|
+
const { tooltipCls, xAxis, id } = xAxistooltipProps;
|
|
729
|
+
if (xAxis === null) {
|
|
730
|
+
return null;
|
|
731
|
+
}
|
|
732
|
+
const div = (0, _d3selection.select)('body').append('div').attr('id', id).attr('class', tooltipCls).style('opacity', 0);
|
|
733
|
+
const aa = xAxis.selectAll('#BaseSpan')._groups[0];
|
|
734
|
+
const baseSpanLength = aa && Object.keys(aa).length;
|
|
735
|
+
const originalDataArray = [];
|
|
736
|
+
for(let i = 0; i < baseSpanLength; i++){
|
|
737
|
+
const originalData = aa[i].dataset && Object.values(aa[i].dataset)[0];
|
|
738
|
+
originalDataArray.push(originalData);
|
|
739
|
+
}
|
|
740
|
+
const tickObject = xAxis.selectAll('.tick')._groups[0];
|
|
741
|
+
const tickObjectLength = tickObject && Object.keys(tickObject).length;
|
|
742
|
+
for(let i = 0; i < tickObjectLength; i++){
|
|
743
|
+
const d1 = tickObject[i];
|
|
744
|
+
(0, _d3selection.select)(d1) // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
745
|
+
.on('mouseover', (event, d)=>{
|
|
746
|
+
div.style('opacity', 0.9);
|
|
747
|
+
div.html(originalDataArray[i]).style('left', event.pageX + 'px').style('top', event.pageY - 28 + 'px');
|
|
748
|
+
}).on('mouseout', (d)=>{
|
|
749
|
+
div.style('opacity', 0);
|
|
750
|
+
});
|
|
751
|
+
}
|
|
752
|
+
}
|
|
753
|
+
function getXAxisType(points) {
|
|
754
|
+
let isXAxisDateType = false;
|
|
755
|
+
if (points && points.length > 0) {
|
|
756
|
+
points.forEach((chartData)=>{
|
|
757
|
+
if (chartData.data.length > 0) {
|
|
758
|
+
isXAxisDateType = chartData.data[0].x instanceof Date;
|
|
759
|
+
return;
|
|
760
|
+
}
|
|
761
|
+
});
|
|
762
|
+
}
|
|
763
|
+
return isXAxisDateType;
|
|
764
|
+
}
|
|
765
|
+
function domainRangeOfNumericForAreaChart(points, margins, width, isRTL) {
|
|
766
|
+
const xMin = (0, _d3array.min)(points, (point)=>{
|
|
767
|
+
return (0, _d3array.min)(point.data, (item)=>item.x);
|
|
768
|
+
});
|
|
769
|
+
const xMax = (0, _d3array.max)(points, (point)=>{
|
|
770
|
+
return (0, _d3array.max)(point.data, (item)=>{
|
|
771
|
+
return item.x;
|
|
772
|
+
});
|
|
773
|
+
});
|
|
774
|
+
const rStartValue = margins.left;
|
|
775
|
+
const rEndValue = width - margins.right;
|
|
776
|
+
return isRTL ? {
|
|
777
|
+
dStartValue: xMax,
|
|
778
|
+
dEndValue: xMin,
|
|
779
|
+
rStartValue,
|
|
780
|
+
rEndValue
|
|
781
|
+
} : {
|
|
782
|
+
dStartValue: xMin,
|
|
783
|
+
dEndValue: xMax,
|
|
784
|
+
rStartValue,
|
|
785
|
+
rEndValue
|
|
786
|
+
};
|
|
787
|
+
}
|
|
788
|
+
function domainRangeOfNumericForScatterChart(points, margins, width, isRTL) {
|
|
789
|
+
let xMin = (0, _d3array.min)(points, (point)=>{
|
|
790
|
+
return (0, _d3array.min)(point.data, (item)=>item.x);
|
|
791
|
+
});
|
|
792
|
+
let xMax = (0, _d3array.max)(points, (point)=>{
|
|
793
|
+
return (0, _d3array.max)(point.data, (item)=>{
|
|
794
|
+
return item.x;
|
|
795
|
+
});
|
|
796
|
+
});
|
|
797
|
+
const xPadding = (xMax - xMin) * 0.1;
|
|
798
|
+
xMin = xMin - xPadding;
|
|
799
|
+
xMax = xMax + xPadding;
|
|
800
|
+
const rStartValue = margins.left;
|
|
801
|
+
const rEndValue = width - margins.right;
|
|
802
|
+
return isRTL ? {
|
|
803
|
+
dStartValue: xMax,
|
|
804
|
+
dEndValue: xMin,
|
|
805
|
+
rStartValue,
|
|
806
|
+
rEndValue
|
|
807
|
+
} : {
|
|
808
|
+
dStartValue: xMin,
|
|
809
|
+
dEndValue: xMax,
|
|
810
|
+
rStartValue,
|
|
811
|
+
rEndValue
|
|
812
|
+
};
|
|
813
|
+
}
|
|
814
|
+
function domainRangeOfNumericForHorizontalBarChartWithAxis(points, margins, containerWidth, isRTL, shiftX) {
|
|
815
|
+
const xMax = (0, _d3array.max)(points, (point)=>point.x);
|
|
816
|
+
const rMin = isRTL ? margins.left : margins.left + shiftX;
|
|
817
|
+
const rMax = isRTL ? containerWidth - margins.right - shiftX : containerWidth - margins.right;
|
|
818
|
+
return isRTL ? {
|
|
819
|
+
dStartValue: xMax,
|
|
820
|
+
dEndValue: 0,
|
|
821
|
+
rStartValue: rMin,
|
|
822
|
+
rEndValue: rMax
|
|
823
|
+
} : {
|
|
824
|
+
dStartValue: 0,
|
|
825
|
+
dEndValue: xMax,
|
|
826
|
+
rStartValue: rMin,
|
|
827
|
+
rEndValue: rMax
|
|
828
|
+
};
|
|
829
|
+
}
|
|
830
|
+
function domainRangeOfXStringAxis(margins, width, isRTL) {
|
|
831
|
+
const rMin = margins.left;
|
|
832
|
+
const rMax = width - margins.right;
|
|
833
|
+
return isRTL ? {
|
|
834
|
+
dStartValue: 0,
|
|
835
|
+
dEndValue: 0,
|
|
836
|
+
rStartValue: rMax,
|
|
837
|
+
rEndValue: rMin
|
|
838
|
+
} : {
|
|
839
|
+
dStartValue: 0,
|
|
840
|
+
dEndValue: 0,
|
|
841
|
+
rStartValue: rMin,
|
|
842
|
+
rEndValue: rMax
|
|
843
|
+
};
|
|
844
|
+
}
|
|
845
|
+
function domainRangeOfVSBCNumeric(points, margins, width, isRTL, barWidth) {
|
|
846
|
+
const xMin = (0, _d3array.min)(points, (point)=>point.x);
|
|
847
|
+
const xMax = (0, _d3array.max)(points, (point)=>point.x);
|
|
848
|
+
const rMax = margins.left;
|
|
849
|
+
const rMin = width - margins.right;
|
|
850
|
+
return isRTL ? {
|
|
851
|
+
dStartValue: xMax,
|
|
852
|
+
dEndValue: xMin,
|
|
853
|
+
rStartValue: rMax,
|
|
854
|
+
rEndValue: rMin
|
|
855
|
+
} : {
|
|
856
|
+
dStartValue: xMin,
|
|
857
|
+
dEndValue: xMax,
|
|
858
|
+
rStartValue: rMax,
|
|
859
|
+
rEndValue: rMin
|
|
860
|
+
};
|
|
861
|
+
}
|
|
862
|
+
function domainRangeOfDateForAreaLineVerticalBarChart(points, margins, width, isRTL, tickValues = [], chartType, barWidth) {
|
|
863
|
+
let sDate;
|
|
864
|
+
let lDate;
|
|
865
|
+
if (chartType === 0 || chartType === 1) {
|
|
866
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
867
|
+
sDate = (0, _d3array.min)(points, (point)=>{
|
|
868
|
+
return (0, _d3array.min)(point.data, (item)=>{
|
|
869
|
+
return item.x;
|
|
870
|
+
});
|
|
871
|
+
});
|
|
872
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
873
|
+
lDate = (0, _d3array.max)(points, (point)=>{
|
|
874
|
+
return (0, _d3array.max)(point.data, (item)=>{
|
|
875
|
+
return item.x;
|
|
876
|
+
});
|
|
877
|
+
});
|
|
878
|
+
// Need to draw graph with given small and large date
|
|
879
|
+
// (Which Involves customization of date axis tick values)
|
|
880
|
+
// That may be Either from given graph data or from prop 'tickValues' date values.
|
|
881
|
+
// So, Finding smallest and largest dates
|
|
882
|
+
sDate = (0, _d3array.min)([
|
|
883
|
+
...tickValues,
|
|
884
|
+
sDate
|
|
885
|
+
]);
|
|
886
|
+
lDate = (0, _d3array.max)([
|
|
887
|
+
...tickValues,
|
|
888
|
+
lDate
|
|
889
|
+
]);
|
|
890
|
+
} else {
|
|
891
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
892
|
+
sDate = (0, _d3array.min)(points, (point)=>point.x);
|
|
893
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
894
|
+
lDate = (0, _d3array.max)(points, (point)=>point.x);
|
|
895
|
+
}
|
|
896
|
+
const rStartValue = margins.left;
|
|
897
|
+
const rEndValue = width - margins.right;
|
|
898
|
+
return isRTL ? {
|
|
899
|
+
dStartValue: lDate,
|
|
900
|
+
dEndValue: sDate,
|
|
901
|
+
rStartValue,
|
|
902
|
+
rEndValue
|
|
903
|
+
} : {
|
|
904
|
+
dStartValue: sDate,
|
|
905
|
+
dEndValue: lDate,
|
|
906
|
+
rStartValue,
|
|
907
|
+
rEndValue
|
|
908
|
+
};
|
|
909
|
+
}
|
|
910
|
+
function domainRangeOfDateForScatterChart(points, margins, width, isRTL, tickValues = []) {
|
|
911
|
+
let sDate;
|
|
912
|
+
let lDate;
|
|
913
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
914
|
+
sDate = (0, _d3array.min)(points, (point)=>{
|
|
915
|
+
return (0, _d3array.min)(point.data, (item)=>{
|
|
916
|
+
return item.x;
|
|
917
|
+
});
|
|
918
|
+
});
|
|
919
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
920
|
+
lDate = (0, _d3array.max)(points, (point)=>{
|
|
921
|
+
return (0, _d3array.max)(point.data, (item)=>{
|
|
922
|
+
return item.x;
|
|
923
|
+
});
|
|
924
|
+
});
|
|
925
|
+
const xPadding = (lDate.getTime() - sDate.getTime()) * 0.1;
|
|
926
|
+
sDate = new Date(sDate.getTime() - xPadding);
|
|
927
|
+
lDate = new Date(lDate.getTime() + xPadding);
|
|
928
|
+
// Need to draw graph with given small and large date
|
|
929
|
+
// (Which Involves customization of date axis tick values)
|
|
930
|
+
// That may be Either from given graph data or from prop 'tickValues' date values.
|
|
931
|
+
// So, Finding smallest and largest dates
|
|
932
|
+
sDate = (0, _d3array.min)([
|
|
933
|
+
...tickValues,
|
|
934
|
+
sDate
|
|
935
|
+
]);
|
|
936
|
+
lDate = (0, _d3array.max)([
|
|
937
|
+
...tickValues,
|
|
938
|
+
lDate
|
|
939
|
+
]);
|
|
940
|
+
const rStartValue = margins.left;
|
|
941
|
+
const rEndValue = width - margins.right;
|
|
942
|
+
return isRTL ? {
|
|
943
|
+
dStartValue: lDate,
|
|
944
|
+
dEndValue: sDate,
|
|
945
|
+
rStartValue,
|
|
946
|
+
rEndValue
|
|
947
|
+
} : {
|
|
948
|
+
dStartValue: sDate,
|
|
949
|
+
dEndValue: lDate,
|
|
950
|
+
rStartValue,
|
|
951
|
+
rEndValue
|
|
952
|
+
};
|
|
953
|
+
}
|
|
954
|
+
function domainRageOfVerticalNumeric(points, margins, containerWidth, isRTL, barWidth) {
|
|
955
|
+
const xMax = (0, _d3array.max)(points, (point)=>point.x);
|
|
956
|
+
const xMin = (0, _d3array.min)(points, (point)=>point.x);
|
|
957
|
+
const rMin = margins.left;
|
|
958
|
+
const rMax = containerWidth - margins.right;
|
|
959
|
+
return isRTL ? {
|
|
960
|
+
dStartValue: xMax,
|
|
961
|
+
dEndValue: xMin,
|
|
962
|
+
rStartValue: rMin,
|
|
963
|
+
rEndValue: rMax
|
|
964
|
+
} : {
|
|
965
|
+
dStartValue: xMin,
|
|
966
|
+
dEndValue: xMax,
|
|
967
|
+
rStartValue: rMin,
|
|
968
|
+
rEndValue: rMax
|
|
969
|
+
};
|
|
970
|
+
}
|
|
971
|
+
function getDomainNRangeValues(points, margins, width, chartType, isRTL, xAxisType, barWidth, tickValues, shiftX) {
|
|
972
|
+
let domainNRangeValue;
|
|
973
|
+
if (xAxisType === 0) {
|
|
974
|
+
switch(chartType){
|
|
975
|
+
case 0:
|
|
976
|
+
case 1:
|
|
977
|
+
domainNRangeValue = domainRangeOfNumericForAreaChart(points, margins, width, isRTL);
|
|
978
|
+
break;
|
|
979
|
+
case 3:
|
|
980
|
+
domainNRangeValue = domainRangeOfVSBCNumeric(points, margins, width, isRTL, barWidth);
|
|
981
|
+
break;
|
|
982
|
+
case 2:
|
|
983
|
+
domainNRangeValue = domainRageOfVerticalNumeric(points, margins, width, isRTL, barWidth);
|
|
984
|
+
break;
|
|
985
|
+
case 6:
|
|
986
|
+
domainNRangeValue = domainRangeOfNumericForHorizontalBarChartWithAxis(points, margins, width, isRTL, shiftX);
|
|
987
|
+
break;
|
|
988
|
+
case 7:
|
|
989
|
+
domainNRangeValue = domainRangeOfNumericForScatterChart(points, margins, width, isRTL);
|
|
990
|
+
break;
|
|
991
|
+
default:
|
|
992
|
+
domainNRangeValue = {
|
|
993
|
+
dStartValue: 0,
|
|
994
|
+
dEndValue: 0,
|
|
995
|
+
rStartValue: 0,
|
|
996
|
+
rEndValue: 0
|
|
997
|
+
};
|
|
998
|
+
}
|
|
999
|
+
} else if (xAxisType === 1) {
|
|
1000
|
+
switch(chartType){
|
|
1001
|
+
case 0:
|
|
1002
|
+
case 1:
|
|
1003
|
+
case 2:
|
|
1004
|
+
case 3:
|
|
1005
|
+
domainNRangeValue = domainRangeOfDateForAreaLineVerticalBarChart(points, margins, width, isRTL, tickValues, chartType, barWidth);
|
|
1006
|
+
break;
|
|
1007
|
+
case 7:
|
|
1008
|
+
domainNRangeValue = domainRangeOfDateForScatterChart(points, margins, width, isRTL, tickValues);
|
|
1009
|
+
break;
|
|
1010
|
+
default:
|
|
1011
|
+
domainNRangeValue = {
|
|
1012
|
+
dStartValue: 0,
|
|
1013
|
+
dEndValue: 0,
|
|
1014
|
+
rStartValue: 0,
|
|
1015
|
+
rEndValue: 0
|
|
1016
|
+
};
|
|
1017
|
+
}
|
|
1018
|
+
} else {
|
|
1019
|
+
// String Axis type
|
|
1020
|
+
switch(chartType){
|
|
1021
|
+
case 3:
|
|
1022
|
+
case 4:
|
|
1023
|
+
case 2:
|
|
1024
|
+
case 5:
|
|
1025
|
+
case 7:
|
|
1026
|
+
domainNRangeValue = domainRangeOfXStringAxis(margins, width, isRTL);
|
|
1027
|
+
break;
|
|
1028
|
+
default:
|
|
1029
|
+
domainNRangeValue = {
|
|
1030
|
+
dStartValue: 0,
|
|
1031
|
+
dEndValue: 0,
|
|
1032
|
+
rStartValue: 0,
|
|
1033
|
+
rEndValue: 0
|
|
1034
|
+
};
|
|
1035
|
+
}
|
|
1036
|
+
}
|
|
1037
|
+
return domainNRangeValue;
|
|
1038
|
+
}
|
|
1039
|
+
function findNumericMinMaxOfY(points) {
|
|
1040
|
+
const yMax = (0, _d3array.max)(points, (point)=>{
|
|
1041
|
+
return (0, _d3array.max)(point.data, (item)=>item.y);
|
|
1042
|
+
});
|
|
1043
|
+
const yMin = (0, _d3array.min)(points, (point)=>{
|
|
1044
|
+
return (0, _d3array.min)(point.data, (item)=>item.y);
|
|
1045
|
+
});
|
|
1046
|
+
return {
|
|
1047
|
+
startValue: yMin,
|
|
1048
|
+
endValue: yMax
|
|
1049
|
+
};
|
|
1050
|
+
}
|
|
1051
|
+
function findVSBCNumericMinMaxOfY(dataset) {
|
|
1052
|
+
const yMax = (0, _d3array.max)(dataset, (point)=>point.y);
|
|
1053
|
+
const yMin = (0, _d3array.min)(dataset, (point)=>point.y);
|
|
1054
|
+
return {
|
|
1055
|
+
startValue: yMin,
|
|
1056
|
+
endValue: yMax
|
|
1057
|
+
};
|
|
1058
|
+
}
|
|
1059
|
+
function findVerticalNumericMinMaxOfY(points) {
|
|
1060
|
+
const yMax = (0, _d3array.max)(points, (point)=>{
|
|
1061
|
+
if (point.lineData !== undefined) {
|
|
1062
|
+
if (point.y > point.lineData.y) {
|
|
1063
|
+
return point.y;
|
|
1064
|
+
} else {
|
|
1065
|
+
return point.lineData.y;
|
|
1066
|
+
}
|
|
1067
|
+
} else {
|
|
1068
|
+
return point.y;
|
|
1069
|
+
}
|
|
1070
|
+
});
|
|
1071
|
+
const yMin = (0, _d3array.min)(points, (point)=>{
|
|
1072
|
+
if (point.lineData !== undefined) {
|
|
1073
|
+
if (point.y < point.lineData.y) {
|
|
1074
|
+
return point.y;
|
|
1075
|
+
} else {
|
|
1076
|
+
return point.lineData.y;
|
|
1077
|
+
}
|
|
1078
|
+
} else {
|
|
1079
|
+
return point.y;
|
|
1080
|
+
}
|
|
1081
|
+
});
|
|
1082
|
+
return {
|
|
1083
|
+
startValue: yMin,
|
|
1084
|
+
endValue: yMax
|
|
1085
|
+
};
|
|
1086
|
+
}
|
|
1087
|
+
function findHBCWANumericMinMaxOfY(points, yAxisType) {
|
|
1088
|
+
if (yAxisType !== undefined && yAxisType === 0) {
|
|
1089
|
+
const yMax = (0, _d3array.max)(points, (point)=>point.y);
|
|
1090
|
+
const yMin = (0, _d3array.min)(points, (point)=>point.y);
|
|
1091
|
+
return {
|
|
1092
|
+
startValue: yMin,
|
|
1093
|
+
endValue: yMax
|
|
1094
|
+
};
|
|
1095
|
+
}
|
|
1096
|
+
return {
|
|
1097
|
+
startValue: 0,
|
|
1098
|
+
endValue: 0
|
|
1099
|
+
};
|
|
1100
|
+
}
|
|
1101
|
+
function getMinMaxOfYAxis(points, chartType, yAxisType = 0) {
|
|
1102
|
+
let minMaxValues;
|
|
1103
|
+
switch(chartType){
|
|
1104
|
+
case 0:
|
|
1105
|
+
case 1:
|
|
1106
|
+
case 7:
|
|
1107
|
+
minMaxValues = findNumericMinMaxOfY(points);
|
|
1108
|
+
break;
|
|
1109
|
+
case 3:
|
|
1110
|
+
minMaxValues = findVSBCNumericMinMaxOfY(points);
|
|
1111
|
+
break;
|
|
1112
|
+
case 2:
|
|
1113
|
+
minMaxValues = findVerticalNumericMinMaxOfY(points);
|
|
1114
|
+
break;
|
|
1115
|
+
case 6:
|
|
1116
|
+
minMaxValues = findHBCWANumericMinMaxOfY(points, yAxisType);
|
|
1117
|
+
break;
|
|
1118
|
+
default:
|
|
1119
|
+
minMaxValues = {
|
|
1120
|
+
startValue: 0,
|
|
1121
|
+
endValue: 0
|
|
1122
|
+
};
|
|
1123
|
+
}
|
|
1124
|
+
return minMaxValues;
|
|
1125
|
+
}
|
|
1126
|
+
const getTypeOfAxis = (p, isXAxis)=>{
|
|
1127
|
+
if (isXAxis) {
|
|
1128
|
+
switch(typeof p){
|
|
1129
|
+
case 'string':
|
|
1130
|
+
return 2;
|
|
1131
|
+
case 'number':
|
|
1132
|
+
return 0;
|
|
1133
|
+
default:
|
|
1134
|
+
return 1;
|
|
1135
|
+
}
|
|
1136
|
+
} else {
|
|
1137
|
+
switch(typeof p){
|
|
1138
|
+
case 'string':
|
|
1139
|
+
return 2;
|
|
1140
|
+
case 'number':
|
|
1141
|
+
return 0;
|
|
1142
|
+
default:
|
|
1143
|
+
return 1;
|
|
1144
|
+
}
|
|
1145
|
+
}
|
|
1146
|
+
};
|
|
1147
|
+
var Points;
|
|
1148
|
+
(function(Points) {
|
|
1149
|
+
Points[Points["circle"] = 0] = "circle";
|
|
1150
|
+
Points[Points["square"] = 1] = "square";
|
|
1151
|
+
Points[Points["triangle"] = 2] = "triangle";
|
|
1152
|
+
Points[Points["diamond"] = 3] = "diamond";
|
|
1153
|
+
Points[Points["pyramid"] = 4] = "pyramid";
|
|
1154
|
+
Points[Points["hexagon"] = 5] = "hexagon";
|
|
1155
|
+
Points[Points["pentagon"] = 6] = "pentagon";
|
|
1156
|
+
Points[Points["octagon"] = 7] = "octagon";
|
|
1157
|
+
})(Points || (Points = {}));
|
|
1158
|
+
var CustomPoints;
|
|
1159
|
+
(function(CustomPoints) {
|
|
1160
|
+
CustomPoints[CustomPoints["dottedLine"] = 0] = "dottedLine";
|
|
1161
|
+
})(CustomPoints || (CustomPoints = {}));
|
|
1162
|
+
const pointTypes = {
|
|
1163
|
+
[0]: {
|
|
1164
|
+
widthRatio: 1
|
|
1165
|
+
},
|
|
1166
|
+
[1]: {
|
|
1167
|
+
widthRatio: 1
|
|
1168
|
+
},
|
|
1169
|
+
[2]: {
|
|
1170
|
+
widthRatio: 1
|
|
1171
|
+
},
|
|
1172
|
+
[3]: {
|
|
1173
|
+
widthRatio: 1
|
|
1174
|
+
},
|
|
1175
|
+
[4]: {
|
|
1176
|
+
widthRatio: 1
|
|
1177
|
+
},
|
|
1178
|
+
[5]: {
|
|
1179
|
+
widthRatio: 2
|
|
1180
|
+
},
|
|
1181
|
+
[6]: {
|
|
1182
|
+
widthRatio: 1.168
|
|
1183
|
+
},
|
|
1184
|
+
[7]: {
|
|
1185
|
+
widthRatio: 2.414
|
|
1186
|
+
}
|
|
1187
|
+
};
|
|
1188
|
+
const getAccessibleDataObject = (accessibleData, role = 'text', isDataFocusable = true)=>{
|
|
1189
|
+
accessibleData = accessibleData !== null && accessibleData !== void 0 ? accessibleData : {};
|
|
1190
|
+
return {
|
|
1191
|
+
role,
|
|
1192
|
+
'data-is-focusable': isDataFocusable,
|
|
1193
|
+
'aria-label': accessibleData.ariaLabel,
|
|
1194
|
+
'aria-labelledby': accessibleData.ariaLabelledBy,
|
|
1195
|
+
'aria-describedby': accessibleData.ariaDescribedBy
|
|
1196
|
+
};
|
|
1197
|
+
};
|
|
1198
|
+
const convertToLocaleString = (data, culture)=>{
|
|
1199
|
+
if (data === undefined || data === null || Number.isNaN(data)) {
|
|
1200
|
+
return data;
|
|
1201
|
+
}
|
|
1202
|
+
culture = culture || undefined;
|
|
1203
|
+
if (typeof data === 'number') {
|
|
1204
|
+
return data.toLocaleString(culture);
|
|
1205
|
+
} else if (typeof data === 'string' && !isNaN(Number(data))) {
|
|
1206
|
+
const num = Number(data);
|
|
1207
|
+
return num.toLocaleString(culture);
|
|
1208
|
+
} else if (data instanceof Date) {
|
|
1209
|
+
return data.toLocaleDateString(culture);
|
|
1210
|
+
}
|
|
1211
|
+
return data;
|
|
1212
|
+
};
|
|
1213
|
+
function rotateXAxisLabels(rotateLabelProps) {
|
|
1214
|
+
const { node, xAxis } = rotateLabelProps;
|
|
1215
|
+
if (node === null || xAxis === null) {
|
|
1216
|
+
return;
|
|
1217
|
+
}
|
|
1218
|
+
let maxHeight = 0;
|
|
1219
|
+
const xAxisTranslations = [];
|
|
1220
|
+
(0, _d3selection.select)(node).call(xAxis).selectAll('.tick').each(function() {
|
|
1221
|
+
const translateValue = this.getAttribute('transform');
|
|
1222
|
+
if ((translateValue === null || translateValue === void 0 ? void 0 : translateValue.indexOf('rotate')) === -1) {
|
|
1223
|
+
const translatePair = translateValue.substring(translateValue.indexOf('(') + 1, translateValue.indexOf(')')).split(',');
|
|
1224
|
+
if (translatePair.length === 2) {
|
|
1225
|
+
xAxisTranslations.push(translatePair[0]);
|
|
1226
|
+
this.setAttribute('transform', `translate(${translatePair[0]},0)rotate(-45)`);
|
|
1227
|
+
}
|
|
1228
|
+
}
|
|
1229
|
+
const BoxCordinates = this.getBoundingClientRect();
|
|
1230
|
+
const boxHeight = BoxCordinates && BoxCordinates.height;
|
|
1231
|
+
if (boxHeight > maxHeight) {
|
|
1232
|
+
maxHeight = boxHeight;
|
|
1233
|
+
}
|
|
1234
|
+
});
|
|
1235
|
+
let idx = 0;
|
|
1236
|
+
(0, _d3selection.select)(node).call(xAxis).selectAll('.tick').each(function() {
|
|
1237
|
+
if (xAxisTranslations.length > idx) {
|
|
1238
|
+
this.setAttribute('transform', `translate(${xAxisTranslations[idx]},${maxHeight / 2})rotate(-45)`); // Translate y by max height/2
|
|
1239
|
+
idx += 1;
|
|
1240
|
+
}
|
|
1241
|
+
});
|
|
1242
|
+
return Math.floor(maxHeight / 1.414); // Compute maxHeight/tanInverse(45) to get the vertical height of labels.
|
|
1243
|
+
}
|
|
1244
|
+
function wrapTextInsideDonut(selectorClass, maxWidth) {
|
|
1245
|
+
let idx = 0;
|
|
1246
|
+
(0, _d3selection.selectAll)(`.${selectorClass}`).each(function() {
|
|
1247
|
+
const text = (0, _d3selection.select)(this);
|
|
1248
|
+
const words = text.text().split(/\s+/).reverse();
|
|
1249
|
+
let word = '';
|
|
1250
|
+
let line = [];
|
|
1251
|
+
let lineNumber = 0;
|
|
1252
|
+
const lineHeight = 1.1; // ems
|
|
1253
|
+
const y = text.attr('y');
|
|
1254
|
+
let tspan = text.text(null).append('tspan').attr('id', `WordBreakId-${idx}-${lineNumber}`).attr('x', 0).attr('y', y).attr('dy', lineNumber++ * lineHeight + 'em');
|
|
1255
|
+
while(word = words.pop()){
|
|
1256
|
+
line.push(word);
|
|
1257
|
+
tspan.text(line.join(' ') + ' ');
|
|
1258
|
+
if (tspan.node().getComputedTextLength() > maxWidth && line.length > 1) {
|
|
1259
|
+
line.pop();
|
|
1260
|
+
tspan.text(line.join(' ') + ' ');
|
|
1261
|
+
line = [
|
|
1262
|
+
word
|
|
1263
|
+
];
|
|
1264
|
+
tspan = text.append('tspan').attr('id', `WordBreakId-${idx}-${lineNumber}`).attr('x', 0).attr('y', y).attr('dy', lineNumber++ * lineHeight + 'em').text(word);
|
|
1265
|
+
}
|
|
1266
|
+
}
|
|
1267
|
+
idx += 1;
|
|
1268
|
+
});
|
|
1269
|
+
}
|
|
1270
|
+
function formatValueWithSIPrefix(value) {
|
|
1271
|
+
let specifier;
|
|
1272
|
+
if (value < 1000) {
|
|
1273
|
+
specifier = '.2~'; // upto 2 decimal places without insignificant trailing zeros
|
|
1274
|
+
} else {
|
|
1275
|
+
specifier = '.1'; // upto 1 decimal place
|
|
1276
|
+
}
|
|
1277
|
+
return (0, _d3format.formatPrefix)(specifier, value)(value);
|
|
1278
|
+
}
|
|
1279
|
+
const DEFAULT_BAR_WIDTH = 16;
|
|
1280
|
+
const MIN_BAR_WIDTH = 1;
|
|
1281
|
+
const getBarWidth = (barWidthProp, maxBarWidthProp, adjustedValue = DEFAULT_BAR_WIDTH)=>{
|
|
1282
|
+
let barWidth;
|
|
1283
|
+
if (typeof barWidthProp === 'number') {
|
|
1284
|
+
barWidth = barWidthProp;
|
|
1285
|
+
} else if (barWidthProp === 'default' || typeof barWidthProp === 'undefined') {
|
|
1286
|
+
barWidth = Math.min(adjustedValue, DEFAULT_BAR_WIDTH);
|
|
1287
|
+
} else {
|
|
1288
|
+
barWidth = adjustedValue;
|
|
1289
|
+
}
|
|
1290
|
+
if (typeof maxBarWidthProp === 'number') {
|
|
1291
|
+
barWidth = Math.min(barWidth, maxBarWidthProp);
|
|
1292
|
+
}
|
|
1293
|
+
barWidth = Math.max(barWidth, MIN_BAR_WIDTH);
|
|
1294
|
+
return barWidth;
|
|
1295
|
+
};
|
|
1296
|
+
const getScalePadding = (prop, shorthandProp, defaultValue = 0)=>{
|
|
1297
|
+
let padding = typeof prop === 'number' ? prop : typeof shorthandProp === 'number' ? shorthandProp : defaultValue;
|
|
1298
|
+
padding = Math.max(0, Math.min(padding, 1));
|
|
1299
|
+
return padding;
|
|
1300
|
+
};
|
|
1301
|
+
const isScalePaddingDefined = (prop, shorthandProp)=>{
|
|
1302
|
+
return typeof prop === 'number' || typeof shorthandProp === 'number';
|
|
1303
|
+
};
|
|
1304
|
+
function findIndex(array, cb, fromIndex = 0) {
|
|
1305
|
+
let index = -1;
|
|
1306
|
+
for(let i = fromIndex; array && i < array.length; i++){
|
|
1307
|
+
if (cb(array[i], i)) {
|
|
1308
|
+
index = i;
|
|
1309
|
+
break;
|
|
1310
|
+
}
|
|
1311
|
+
}
|
|
1312
|
+
return index;
|
|
1313
|
+
}
|
|
1314
|
+
function find(array, cb) {
|
|
1315
|
+
let index = findIndex(array, cb);
|
|
1316
|
+
if (index < 0) {
|
|
1317
|
+
return undefined;
|
|
1318
|
+
}
|
|
1319
|
+
return array[index];
|
|
1320
|
+
}
|
|
1321
|
+
const HighContrastSelector = '@media screen and (-ms-high-contrast: active), screen and (forced-colors: active)';
|
|
1322
|
+
const HighContrastSelectorWhite = '@media screen and (-ms-high-contrast: black-on-white), screen and (forced-colors: active) and (prefers-color-scheme: light)';
|
|
1323
|
+
const HighContrastSelectorBlack = '@media screen and (-ms-high-contrast: white-on-black), screen and (forced-colors: active) and (prefers-color-scheme: dark)';
|
|
1324
|
+
const formatDate = (date, useUTC)=>{
|
|
1325
|
+
const timeFormat = useUTC ? _d3timeformat.utcFormat : _d3timeformat.timeFormat;
|
|
1326
|
+
return timeFormat('%-e %b %Y, %H:%M')(date) + (useUTC ? ' GMT' : '');
|
|
1327
|
+
};
|
|
1328
|
+
function areArraysEqual(arr1, arr2) {
|
|
1329
|
+
if (arr1 === arr2 || !arr1 && !arr2) {
|
|
1330
|
+
return true;
|
|
1331
|
+
}
|
|
1332
|
+
if (!arr1 || !arr2 || arr1.length !== arr2.length) {
|
|
1333
|
+
return false;
|
|
1334
|
+
}
|
|
1335
|
+
for(let i = 0; i < arr1.length; i++){
|
|
1336
|
+
if (arr1[i] !== arr2[i]) {
|
|
1337
|
+
return false;
|
|
1338
|
+
}
|
|
1339
|
+
}
|
|
1340
|
+
return true;
|
|
1341
|
+
}
|
|
1342
|
+
const cssVarRegExp = /var\((--[a-zA-Z0-9\-]+)\)/g;
|
|
1343
|
+
function resolveCSSVariables(chartContainer, styleRules) {
|
|
1344
|
+
const containerStyles = getComputedStyle(chartContainer);
|
|
1345
|
+
return styleRules.replace(cssVarRegExp, (match, group1)=>{
|
|
1346
|
+
return containerStyles.getPropertyValue(group1);
|
|
1347
|
+
});
|
|
1348
|
+
}
|
|
1349
|
+
function getSecureProps(props = {}) {
|
|
1350
|
+
const { dangerouslySetInnerHTML, ...result } = props;
|
|
1351
|
+
return result;
|
|
1352
|
+
}
|
|
1353
|
+
function getCurveFactory(curve, defaultFactory = _d3shape.curveLinear) {
|
|
1354
|
+
if (typeof curve === 'function') {
|
|
1355
|
+
return curve;
|
|
1356
|
+
}
|
|
1357
|
+
switch(curve){
|
|
1358
|
+
case 'linear':
|
|
1359
|
+
return _d3shape.curveLinear;
|
|
1360
|
+
case 'natural':
|
|
1361
|
+
return _d3shape.curveNatural;
|
|
1362
|
+
case 'step':
|
|
1363
|
+
return _d3shape.curveStep;
|
|
1364
|
+
case 'stepAfter':
|
|
1365
|
+
return _d3shape.curveStepAfter;
|
|
1366
|
+
case 'stepBefore':
|
|
1367
|
+
return _d3shape.curveStepBefore;
|
|
1368
|
+
default:
|
|
1369
|
+
return defaultFactory;
|
|
1370
|
+
}
|
|
1371
|
+
}
|