@fluentui/react-charts 9.3.21 → 9.74.3-experimental.esm.20260709-49ee7a20cf.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +20 -2
- package/package.json +15 -17
- package/dist/index.d.ts +0 -5724
- package/lib/AnnotationOnlyChart.js +0 -1
- package/lib/AnnotationOnlyChart.js.map +0 -1
- package/lib/AreaChart.js +0 -1
- package/lib/AreaChart.js.map +0 -1
- package/lib/CartesianChart.js +0 -1
- package/lib/CartesianChart.js.map +0 -1
- package/lib/ChartTable.js +0 -1
- package/lib/ChartTable.js.map +0 -1
- package/lib/DeclarativeChart.js +0 -1
- package/lib/DeclarativeChart.js.map +0 -1
- package/lib/DonutChart.js +0 -1
- package/lib/DonutChart.js.map +0 -1
- package/lib/FunnelChart.js +0 -1
- package/lib/FunnelChart.js.map +0 -1
- package/lib/GanttChart.js +0 -1
- package/lib/GanttChart.js.map +0 -1
- package/lib/GaugeChart.js +0 -1
- package/lib/GaugeChart.js.map +0 -1
- package/lib/GroupedVerticalBarChart.js +0 -1
- package/lib/GroupedVerticalBarChart.js.map +0 -1
- package/lib/HeatMapChart.js +0 -1
- package/lib/HeatMapChart.js.map +0 -1
- package/lib/HorizontalBarChart.js +0 -1
- package/lib/HorizontalBarChart.js.map +0 -1
- package/lib/HorizontalBarChartWithAxis.js +0 -1
- package/lib/HorizontalBarChartWithAxis.js.map +0 -1
- package/lib/Legends.js +0 -1
- package/lib/Legends.js.map +0 -1
- package/lib/LineChart.js +0 -1
- package/lib/LineChart.js.map +0 -1
- package/lib/PolarChart.js +0 -1
- package/lib/PolarChart.js.map +0 -1
- package/lib/Popover.js +0 -1
- package/lib/Popover.js.map +0 -1
- package/lib/ResponsiveContainer.js +0 -1
- package/lib/ResponsiveContainer.js.map +0 -1
- package/lib/SankeyChart.js +0 -1
- package/lib/SankeyChart.js.map +0 -1
- package/lib/ScatterChart.js +0 -1
- package/lib/ScatterChart.js.map +0 -1
- package/lib/Sparkline.js +0 -1
- package/lib/Sparkline.js.map +0 -1
- package/lib/VegaDeclarativeChart.js +0 -1
- package/lib/VegaDeclarativeChart.js.map +0 -1
- package/lib/VerticalBarChart.js +0 -1
- package/lib/VerticalBarChart.js.map +0 -1
- package/lib/VerticalStackedBarChart.js +0 -1
- package/lib/VerticalStackedBarChart.js.map +0 -1
- package/lib/components/AnnotationOnlyChart/AnnotationOnlyChart.js +0 -196
- package/lib/components/AnnotationOnlyChart/AnnotationOnlyChart.js.map +0 -1
- package/lib/components/AnnotationOnlyChart/AnnotationOnlyChart.types.js +0 -3
- package/lib/components/AnnotationOnlyChart/AnnotationOnlyChart.types.js.map +0 -1
- package/lib/components/AnnotationOnlyChart/index.js +0 -2
- package/lib/components/AnnotationOnlyChart/index.js.map +0 -1
- package/lib/components/AnnotationOnlyChart/useAnnotationOnlyChartStyles.styles.js +0 -33
- package/lib/components/AnnotationOnlyChart/useAnnotationOnlyChartStyles.styles.js.map +0 -1
- package/lib/components/AnnotationOnlyChart/useAnnotationOnlyChartStyles.styles.raw.js +0 -24
- package/lib/components/AnnotationOnlyChart/useAnnotationOnlyChartStyles.styles.raw.js.map +0 -1
- package/lib/components/AreaChart/AreaChart.js +0 -932
- package/lib/components/AreaChart/AreaChart.js.map +0 -1
- package/lib/components/AreaChart/AreaChart.types.js +0 -4
- package/lib/components/AreaChart/AreaChart.types.js.map +0 -1
- package/lib/components/AreaChart/index.js +0 -3
- package/lib/components/AreaChart/index.js.map +0 -1
- package/lib/components/AreaChart/useAreaChartStyles.styles.js +0 -63
- package/lib/components/AreaChart/useAreaChartStyles.styles.js.map +0 -1
- package/lib/components/AreaChart/useAreaChartStyles.styles.raw.js +0 -33
- package/lib/components/AreaChart/useAreaChartStyles.styles.raw.js.map +0 -1
- package/lib/components/ChartTable/ChartTable.js +0 -160
- package/lib/components/ChartTable/ChartTable.js.map +0 -1
- package/lib/components/ChartTable/ChartTable.types.js +0 -4
- package/lib/components/ChartTable/ChartTable.types.js.map +0 -1
- package/lib/components/ChartTable/index.js +0 -3
- package/lib/components/ChartTable/index.js.map +0 -1
- package/lib/components/ChartTable/useChartTableStyles.styles.js +0 -136
- package/lib/components/ChartTable/useChartTableStyles.styles.js.map +0 -1
- package/lib/components/ChartTable/useChartTableStyles.styles.raw.js +0 -68
- package/lib/components/ChartTable/useChartTableStyles.styles.raw.js.map +0 -1
- package/lib/components/CommonComponents/Annotations/ChartAnnotationLayer.js +0 -659
- package/lib/components/CommonComponents/Annotations/ChartAnnotationLayer.js.map +0 -1
- package/lib/components/CommonComponents/Annotations/ChartAnnotationLayer.types.js +0 -1
- package/lib/components/CommonComponents/Annotations/ChartAnnotationLayer.types.js.map +0 -1
- package/lib/components/CommonComponents/Annotations/index.js +0 -2
- package/lib/components/CommonComponents/Annotations/index.js.map +0 -1
- package/lib/components/CommonComponents/Annotations/useChartAnnotationLayer.styles.js +0 -223
- package/lib/components/CommonComponents/Annotations/useChartAnnotationLayer.styles.js.map +0 -1
- package/lib/components/CommonComponents/Annotations/useChartAnnotationLayer.styles.raw.js +0 -139
- package/lib/components/CommonComponents/Annotations/useChartAnnotationLayer.styles.raw.js.map +0 -1
- package/lib/components/CommonComponents/CartesianChart.js +0 -665
- package/lib/components/CommonComponents/CartesianChart.js.map +0 -1
- package/lib/components/CommonComponents/CartesianChart.types.js +0 -2
- package/lib/components/CommonComponents/CartesianChart.types.js.map +0 -1
- package/lib/components/CommonComponents/ChartPopover.js +0 -197
- package/lib/components/CommonComponents/ChartPopover.js.map +0 -1
- package/lib/components/CommonComponents/ChartPopover.types.js +0 -1
- package/lib/components/CommonComponents/ChartPopover.types.js.map +0 -1
- package/lib/components/CommonComponents/index.js +0 -6
- package/lib/components/CommonComponents/index.js.map +0 -1
- package/lib/components/CommonComponents/useCartesianChartStyles.styles.js +0 -189
- package/lib/components/CommonComponents/useCartesianChartStyles.styles.js.map +0 -1
- package/lib/components/CommonComponents/useCartesianChartStyles.styles.raw.js +0 -131
- package/lib/components/CommonComponents/useCartesianChartStyles.styles.raw.js.map +0 -1
- package/lib/components/CommonComponents/useChartPopoverStyles.styles.js +0 -171
- package/lib/components/CommonComponents/useChartPopoverStyles.styles.js.map +0 -1
- package/lib/components/CommonComponents/useChartPopoverStyles.styles.raw.js +0 -127
- package/lib/components/CommonComponents/useChartPopoverStyles.styles.raw.js.map +0 -1
- package/lib/components/DeclarativeChart/DeclarativeChart.js +0 -397
- package/lib/components/DeclarativeChart/DeclarativeChart.js.map +0 -1
- package/lib/components/DeclarativeChart/PlotlyColorAdapter.js +0 -163
- package/lib/components/DeclarativeChart/PlotlyColorAdapter.js.map +0 -1
- package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js +0 -3490
- package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js.map +0 -1
- package/lib/components/DeclarativeChart/index.js +0 -1
- package/lib/components/DeclarativeChart/index.js.map +0 -1
- package/lib/components/DonutChart/Arc/Arc.js +0 -118
- package/lib/components/DonutChart/Arc/Arc.js.map +0 -1
- package/lib/components/DonutChart/Arc/Arc.types.js +0 -1
- package/lib/components/DonutChart/Arc/Arc.types.js.map +0 -1
- package/lib/components/DonutChart/Arc/index.js +0 -2
- package/lib/components/DonutChart/Arc/index.js.map +0 -1
- package/lib/components/DonutChart/Arc/useArcStyles.styles.js +0 -80
- package/lib/components/DonutChart/Arc/useArcStyles.styles.js.map +0 -1
- package/lib/components/DonutChart/Arc/useArcStyles.styles.raw.js +0 -49
- package/lib/components/DonutChart/Arc/useArcStyles.styles.raw.js.map +0 -1
- package/lib/components/DonutChart/DonutChart.js +0 -349
- package/lib/components/DonutChart/DonutChart.js.map +0 -1
- package/lib/components/DonutChart/DonutChart.types.js +0 -4
- package/lib/components/DonutChart/DonutChart.types.js.map +0 -1
- package/lib/components/DonutChart/Pie/Pie.js +0 -72
- package/lib/components/DonutChart/Pie/Pie.js.map +0 -1
- package/lib/components/DonutChart/Pie/Pie.types.js +0 -1
- package/lib/components/DonutChart/Pie/Pie.types.js.map +0 -1
- package/lib/components/DonutChart/Pie/index.js +0 -2
- package/lib/components/DonutChart/Pie/index.js.map +0 -1
- package/lib/components/DonutChart/Pie/usePieStyles.styles.js +0 -41
- package/lib/components/DonutChart/Pie/usePieStyles.styles.js.map +0 -1
- package/lib/components/DonutChart/Pie/usePieStyles.styles.raw.js +0 -30
- package/lib/components/DonutChart/Pie/usePieStyles.styles.raw.js.map +0 -1
- package/lib/components/DonutChart/index.js +0 -3
- package/lib/components/DonutChart/index.js.map +0 -1
- package/lib/components/DonutChart/useDonutChartStyles.styles.js +0 -98
- package/lib/components/DonutChart/useDonutChartStyles.styles.js.map +0 -1
- package/lib/components/DonutChart/useDonutChartStyles.styles.raw.js +0 -62
- package/lib/components/DonutChart/useDonutChartStyles.styles.raw.js.map +0 -1
- package/lib/components/FunnelChart/FunnelChart.js +0 -401
- package/lib/components/FunnelChart/FunnelChart.js.map +0 -1
- package/lib/components/FunnelChart/FunnelChart.types.js +0 -4
- package/lib/components/FunnelChart/FunnelChart.types.js.map +0 -1
- package/lib/components/FunnelChart/funnelGeometry.js +0 -219
- package/lib/components/FunnelChart/funnelGeometry.js.map +0 -1
- package/lib/components/FunnelChart/index.js +0 -2
- package/lib/components/FunnelChart/index.js.map +0 -1
- package/lib/components/FunnelChart/useFunnelChartStyles.styles.js +0 -83
- package/lib/components/FunnelChart/useFunnelChartStyles.styles.js.map +0 -1
- package/lib/components/FunnelChart/useFunnelChartStyles.styles.raw.js +0 -65
- package/lib/components/FunnelChart/useFunnelChartStyles.styles.raw.js.map +0 -1
- package/lib/components/GanttChart/GanttChart.js +0 -535
- package/lib/components/GanttChart/GanttChart.js.map +0 -1
- package/lib/components/GanttChart/GanttChart.types.js +0 -4
- package/lib/components/GanttChart/GanttChart.types.js.map +0 -1
- package/lib/components/GanttChart/index.js +0 -2
- package/lib/components/GanttChart/index.js.map +0 -1
- package/lib/components/GanttChart/useGanttChartStyles.styles.js +0 -27
- package/lib/components/GanttChart/useGanttChartStyles.styles.js.map +0 -1
- package/lib/components/GanttChart/useGanttChartStyles.styles.raw.js +0 -26
- package/lib/components/GanttChart/useGanttChartStyles.styles.raw.js.map +0 -1
- package/lib/components/GaugeChart/GaugeChart.js +0 -568
- package/lib/components/GaugeChart/GaugeChart.js.map +0 -1
- package/lib/components/GaugeChart/GaugeChart.types.js +0 -4
- package/lib/components/GaugeChart/GaugeChart.types.js.map +0 -1
- package/lib/components/GaugeChart/index.js +0 -3
- package/lib/components/GaugeChart/index.js.map +0 -1
- package/lib/components/GaugeChart/useGaugeChartStyles.styles.js +0 -197
- package/lib/components/GaugeChart/useGaugeChartStyles.styles.js.map +0 -1
- package/lib/components/GaugeChart/useGaugeChartStyles.styles.raw.js +0 -149
- package/lib/components/GaugeChart/useGaugeChartStyles.styles.raw.js.map +0 -1
- package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js +0 -813
- package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js.map +0 -1
- package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.types.js +0 -4
- package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.types.js.map +0 -1
- package/lib/components/GroupedVerticalBarChart/index.js +0 -3
- package/lib/components/GroupedVerticalBarChart/index.js.map +0 -1
- package/lib/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.js +0 -77
- package/lib/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.js.map +0 -1
- package/lib/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.raw.js +0 -40
- package/lib/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.raw.js.map +0 -1
- package/lib/components/HeatMapChart/HeatMapChart.js +0 -677
- package/lib/components/HeatMapChart/HeatMapChart.js.map +0 -1
- package/lib/components/HeatMapChart/HeatMapChart.types.js +0 -4
- package/lib/components/HeatMapChart/HeatMapChart.types.js.map +0 -1
- package/lib/components/HeatMapChart/index.js +0 -3
- package/lib/components/HeatMapChart/index.js.map +0 -1
- package/lib/components/HeatMapChart/useHeatMapChartStyles.styles.js +0 -48
- package/lib/components/HeatMapChart/useHeatMapChartStyles.styles.js.map +0 -1
- package/lib/components/HeatMapChart/useHeatMapChartStyles.styles.raw.js +0 -42
- package/lib/components/HeatMapChart/useHeatMapChartStyles.styles.raw.js.map +0 -1
- package/lib/components/HorizontalBarChart/HorizontalBarChart.js +0 -411
- package/lib/components/HorizontalBarChart/HorizontalBarChart.js.map +0 -1
- package/lib/components/HorizontalBarChart/HorizontalBarChart.types.js +0 -7
- package/lib/components/HorizontalBarChart/HorizontalBarChart.types.js.map +0 -1
- package/lib/components/HorizontalBarChart/index.js +0 -3
- package/lib/components/HorizontalBarChart/index.js.map +0 -1
- package/lib/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.js +0 -175
- package/lib/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.js.map +0 -1
- package/lib/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.raw.js +0 -125
- package/lib/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.raw.js.map +0 -1
- package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js +0 -720
- package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js.map +0 -1
- package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.types.js +0 -4
- package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.types.js.map +0 -1
- package/lib/components/HorizontalBarChartWithAxis/index.js +0 -3
- package/lib/components/HorizontalBarChartWithAxis/index.js.map +0 -1
- package/lib/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.js +0 -62
- package/lib/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.js.map +0 -1
- package/lib/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.raw.js +0 -54
- package/lib/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.raw.js.map +0 -1
- package/lib/components/Legends/Legends.js +0 -323
- package/lib/components/Legends/Legends.js.map +0 -1
- package/lib/components/Legends/Legends.types.js +0 -3
- package/lib/components/Legends/Legends.types.js.map +0 -1
- package/lib/components/Legends/OverflowMenu.js +0 -33
- package/lib/components/Legends/OverflowMenu.js.map +0 -1
- package/lib/components/Legends/index.js +0 -3
- package/lib/components/Legends/index.js.map +0 -1
- package/lib/components/Legends/shape.js +0 -36
- package/lib/components/Legends/shape.js.map +0 -1
- package/lib/components/Legends/useLegendsStyles.styles.js +0 -262
- package/lib/components/Legends/useLegendsStyles.styles.js.map +0 -1
- package/lib/components/Legends/useLegendsStyles.styles.raw.js +0 -142
- package/lib/components/Legends/useLegendsStyles.styles.raw.js.map +0 -1
- package/lib/components/LineChart/LineChart.js +0 -1332
- package/lib/components/LineChart/LineChart.js.map +0 -1
- package/lib/components/LineChart/LineChart.types.js +0 -3
- package/lib/components/LineChart/LineChart.types.js.map +0 -1
- package/lib/components/LineChart/eventAnnotation/EventAnnotation.js +0 -118
- package/lib/components/LineChart/eventAnnotation/EventAnnotation.js.map +0 -1
- package/lib/components/LineChart/eventAnnotation/LabelLink.js +0 -59
- package/lib/components/LineChart/eventAnnotation/LabelLink.js.map +0 -1
- package/lib/components/LineChart/eventAnnotation/Textbox.js +0 -42
- package/lib/components/LineChart/eventAnnotation/Textbox.js.map +0 -1
- package/lib/components/LineChart/index.js +0 -4
- package/lib/components/LineChart/index.js.map +0 -1
- package/lib/components/LineChart/useLineChartStyles.styles.js +0 -93
- package/lib/components/LineChart/useLineChartStyles.styles.js.map +0 -1
- package/lib/components/LineChart/useLineChartStyles.styles.raw.js +0 -50
- package/lib/components/LineChart/useLineChartStyles.styles.raw.js.map +0 -1
- package/lib/components/PolarChart/PolarChart.js +0 -577
- package/lib/components/PolarChart/PolarChart.js.map +0 -1
- package/lib/components/PolarChart/PolarChart.types.js +0 -4
- package/lib/components/PolarChart/PolarChart.types.js.map +0 -1
- package/lib/components/PolarChart/PolarChart.utils.js +0 -174
- package/lib/components/PolarChart/PolarChart.utils.js.map +0 -1
- package/lib/components/PolarChart/index.js +0 -2
- package/lib/components/PolarChart/index.js.map +0 -1
- package/lib/components/PolarChart/usePolarChartStyles.styles.js +0 -72
- package/lib/components/PolarChart/usePolarChartStyles.styles.js.map +0 -1
- package/lib/components/PolarChart/usePolarChartStyles.styles.raw.js +0 -61
- package/lib/components/PolarChart/usePolarChartStyles.styles.raw.js.map +0 -1
- package/lib/components/ResponsiveContainer/ResponsiveContainer.js +0 -99
- package/lib/components/ResponsiveContainer/ResponsiveContainer.js.map +0 -1
- package/lib/components/ResponsiveContainer/ResponsiveContainer.types.js +0 -4
- package/lib/components/ResponsiveContainer/ResponsiveContainer.types.js.map +0 -1
- package/lib/components/ResponsiveContainer/index.js +0 -3
- package/lib/components/ResponsiveContainer/index.js.map +0 -1
- package/lib/components/ResponsiveContainer/useResponsiveChildStyles.styles.js +0 -30
- package/lib/components/ResponsiveContainer/useResponsiveChildStyles.styles.js.map +0 -1
- package/lib/components/ResponsiveContainer/useResponsiveChildStyles.styles.raw.js +0 -29
- package/lib/components/ResponsiveContainer/useResponsiveChildStyles.styles.raw.js.map +0 -1
- package/lib/components/ResponsiveContainer/withResponsiveContainer.js +0 -20
- package/lib/components/ResponsiveContainer/withResponsiveContainer.js.map +0 -1
- package/lib/components/SankeyChart/SankeyChart.js +0 -1026
- package/lib/components/SankeyChart/SankeyChart.js.map +0 -1
- package/lib/components/SankeyChart/SankeyChart.types.js +0 -3
- package/lib/components/SankeyChart/SankeyChart.types.js.map +0 -1
- package/lib/components/SankeyChart/index.js +0 -3
- package/lib/components/SankeyChart/index.js.map +0 -1
- package/lib/components/SankeyChart/useSankeyChartStyles.styles.js +0 -123
- package/lib/components/SankeyChart/useSankeyChartStyles.styles.js.map +0 -1
- package/lib/components/SankeyChart/useSankeyChartStyles.styles.raw.js +0 -79
- package/lib/components/SankeyChart/useSankeyChartStyles.styles.raw.js.map +0 -1
- package/lib/components/ScatterChart/ScatterChart.js +0 -544
- package/lib/components/ScatterChart/ScatterChart.js.map +0 -1
- package/lib/components/ScatterChart/ScatterChart.types.js +0 -4
- package/lib/components/ScatterChart/ScatterChart.types.js.map +0 -1
- package/lib/components/ScatterChart/index.js +0 -3
- package/lib/components/ScatterChart/index.js.map +0 -1
- package/lib/components/ScatterChart/useScatterChartStyles.styles.js +0 -84
- package/lib/components/ScatterChart/useScatterChartStyles.styles.js.map +0 -1
- package/lib/components/ScatterChart/useScatterChartStyles.styles.raw.js +0 -41
- package/lib/components/ScatterChart/useScatterChartStyles.styles.raw.js.map +0 -1
- package/lib/components/Sparkline/Sparkline.js +0 -123
- package/lib/components/Sparkline/Sparkline.js.map +0 -1
- package/lib/components/Sparkline/Sparkline.types.js +0 -4
- package/lib/components/Sparkline/Sparkline.types.js.map +0 -1
- package/lib/components/Sparkline/index.js +0 -3
- package/lib/components/Sparkline/index.js.map +0 -1
- package/lib/components/Sparkline/useSparklineStyles.styles.js +0 -40
- package/lib/components/Sparkline/useSparklineStyles.styles.js.map +0 -1
- package/lib/components/Sparkline/useSparklineStyles.styles.raw.js +0 -31
- package/lib/components/Sparkline/useSparklineStyles.styles.raw.js.map +0 -1
- package/lib/components/VegaDeclarativeChart/VegaDeclarativeChart.js +0 -405
- package/lib/components/VegaDeclarativeChart/VegaDeclarativeChart.js.map +0 -1
- package/lib/components/VegaDeclarativeChart/VegaDeclarativeChartHooks.js +0 -20
- package/lib/components/VegaDeclarativeChart/VegaDeclarativeChartHooks.js.map +0 -1
- package/lib/components/VegaDeclarativeChart/VegaLiteColorAdapter.js +0 -415
- package/lib/components/VegaDeclarativeChart/VegaLiteColorAdapter.js.map +0 -1
- package/lib/components/VegaDeclarativeChart/VegaLiteExpressionEvaluator.js +0 -537
- package/lib/components/VegaDeclarativeChart/VegaLiteExpressionEvaluator.js.map +0 -1
- package/lib/components/VegaDeclarativeChart/VegaLiteSchemaAdapter.js +0 -3279
- package/lib/components/VegaDeclarativeChart/VegaLiteSchemaAdapter.js.map +0 -1
- package/lib/components/VegaDeclarativeChart/VegaLiteTypes.js +0 -28
- package/lib/components/VegaDeclarativeChart/VegaLiteTypes.js.map +0 -1
- package/lib/components/VegaDeclarativeChart/index.js +0 -1
- package/lib/components/VegaDeclarativeChart/index.js.map +0 -1
- package/lib/components/VerticalBarChart/VerticalBarChart.js +0 -930
- package/lib/components/VerticalBarChart/VerticalBarChart.js.map +0 -1
- package/lib/components/VerticalBarChart/VerticalBarChart.types.js +0 -4
- package/lib/components/VerticalBarChart/VerticalBarChart.types.js.map +0 -1
- package/lib/components/VerticalBarChart/index.js +0 -3
- package/lib/components/VerticalBarChart/index.js.map +0 -1
- package/lib/components/VerticalBarChart/useVerticalBarChartStyles.styles.js +0 -86
- package/lib/components/VerticalBarChart/useVerticalBarChartStyles.styles.js.map +0 -1
- package/lib/components/VerticalBarChart/useVerticalBarChartStyles.styles.raw.js +0 -48
- package/lib/components/VerticalBarChart/useVerticalBarChartStyles.styles.raw.js.map +0 -1
- package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.js +0 -1077
- package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.js.map +0 -1
- package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.types.js +0 -4
- package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.types.js.map +0 -1
- package/lib/components/VerticalStackedBarChart/index.js +0 -3
- package/lib/components/VerticalStackedBarChart/index.js.map +0 -1
- package/lib/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.js +0 -74
- package/lib/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.js.map +0 -1
- package/lib/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.raw.js +0 -38
- package/lib/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.raw.js.map +0 -1
- package/lib/index.js +0 -26
- package/lib/index.js.map +0 -1
- package/lib/types/ChartAnnotation.js +0 -1
- package/lib/types/ChartAnnotation.js.map +0 -1
- package/lib/types/DataPoint.js +0 -3
- package/lib/types/DataPoint.js.map +0 -1
- package/lib/types/EventAnnotation.js +0 -1
- package/lib/types/EventAnnotation.js.map +0 -1
- package/lib/types/LegendDataItem.js +0 -1
- package/lib/types/LegendDataItem.js.map +0 -1
- package/lib/types/index.js +0 -3
- package/lib/types/index.js.map +0 -1
- package/lib/utilities/ChartTitle.js +0 -45
- package/lib/utilities/ChartTitle.js.map +0 -1
- package/lib/utilities/Common.styles.js +0 -117
- package/lib/utilities/Common.styles.js.map +0 -1
- package/lib/utilities/Common.styles.raw.js +0 -115
- package/lib/utilities/Common.styles.raw.js.map +0 -1
- package/lib/utilities/FocusableTooltipText.js +0 -65
- package/lib/utilities/FocusableTooltipText.js.map +0 -1
- package/lib/utilities/KeyCodes.js +0 -11
- package/lib/utilities/KeyCodes.js.map +0 -1
- package/lib/utilities/SVGTooltipText.js +0 -179
- package/lib/utilities/SVGTooltipText.js.map +0 -1
- package/lib/utilities/async-utils.js +0 -380
- package/lib/utilities/async-utils.js.map +0 -1
- package/lib/utilities/colors.js +0 -281
- package/lib/utilities/colors.js.map +0 -1
- package/lib/utilities/getWindow.js +0 -25
- package/lib/utilities/getWindow.js.map +0 -1
- package/lib/utilities/hooks.js +0 -34
- package/lib/utilities/hooks.js.map +0 -1
- package/lib/utilities/image-export-utils.js +0 -405
- package/lib/utilities/image-export-utils.js.map +0 -1
- package/lib/utilities/index.js +0 -5
- package/lib/utilities/index.js.map +0 -1
- package/lib/utilities/overflow-utils.js +0 -27
- package/lib/utilities/overflow-utils.js.map +0 -1
- package/lib/utilities/scatterpolar-utils.js +0 -52
- package/lib/utilities/scatterpolar-utils.js.map +0 -1
- package/lib/utilities/string.js +0 -32
- package/lib/utilities/string.js.map +0 -1
- package/lib/utilities/test-data.js +0 -565
- package/lib/utilities/test-data.js.map +0 -1
- package/lib/utilities/utilities.js +0 -1990
- package/lib/utilities/utilities.js.map +0 -1
- package/lib/utilities/vbc-utils.js +0 -51
- package/lib/utilities/vbc-utils.js.map +0 -1
- package/lib-commonjs/AnnotationOnlyChart.js +0 -6
- package/lib-commonjs/AnnotationOnlyChart.js.map +0 -1
- package/lib-commonjs/AreaChart.js +0 -6
- package/lib-commonjs/AreaChart.js.map +0 -1
- package/lib-commonjs/CartesianChart.js +0 -6
- package/lib-commonjs/CartesianChart.js.map +0 -1
- package/lib-commonjs/ChartTable.js +0 -6
- package/lib-commonjs/ChartTable.js.map +0 -1
- package/lib-commonjs/DeclarativeChart.js +0 -6
- package/lib-commonjs/DeclarativeChart.js.map +0 -1
- package/lib-commonjs/DonutChart.js +0 -6
- package/lib-commonjs/DonutChart.js.map +0 -1
- package/lib-commonjs/FunnelChart.js +0 -6
- package/lib-commonjs/FunnelChart.js.map +0 -1
- package/lib-commonjs/GanttChart.js +0 -6
- package/lib-commonjs/GanttChart.js.map +0 -1
- package/lib-commonjs/GaugeChart.js +0 -6
- package/lib-commonjs/GaugeChart.js.map +0 -1
- package/lib-commonjs/GroupedVerticalBarChart.js +0 -6
- package/lib-commonjs/GroupedVerticalBarChart.js.map +0 -1
- package/lib-commonjs/HeatMapChart.js +0 -6
- package/lib-commonjs/HeatMapChart.js.map +0 -1
- package/lib-commonjs/HorizontalBarChart.js +0 -6
- package/lib-commonjs/HorizontalBarChart.js.map +0 -1
- package/lib-commonjs/HorizontalBarChartWithAxis.js +0 -6
- package/lib-commonjs/HorizontalBarChartWithAxis.js.map +0 -1
- package/lib-commonjs/Legends.js +0 -6
- package/lib-commonjs/Legends.js.map +0 -1
- package/lib-commonjs/LineChart.js +0 -6
- package/lib-commonjs/LineChart.js.map +0 -1
- package/lib-commonjs/PolarChart.js +0 -6
- package/lib-commonjs/PolarChart.js.map +0 -1
- package/lib-commonjs/Popover.js +0 -6
- package/lib-commonjs/Popover.js.map +0 -1
- package/lib-commonjs/ResponsiveContainer.js +0 -6
- package/lib-commonjs/ResponsiveContainer.js.map +0 -1
- package/lib-commonjs/SankeyChart.js +0 -6
- package/lib-commonjs/SankeyChart.js.map +0 -1
- package/lib-commonjs/ScatterChart.js +0 -6
- package/lib-commonjs/ScatterChart.js.map +0 -1
- package/lib-commonjs/Sparkline.js +0 -6
- package/lib-commonjs/Sparkline.js.map +0 -1
- package/lib-commonjs/VegaDeclarativeChart.js +0 -6
- package/lib-commonjs/VegaDeclarativeChart.js.map +0 -1
- package/lib-commonjs/VerticalBarChart.js +0 -6
- package/lib-commonjs/VerticalBarChart.js.map +0 -1
- package/lib-commonjs/VerticalStackedBarChart.js +0 -6
- package/lib-commonjs/VerticalStackedBarChart.js.map +0 -1
- package/lib-commonjs/components/AnnotationOnlyChart/AnnotationOnlyChart.js +0 -207
- package/lib-commonjs/components/AnnotationOnlyChart/AnnotationOnlyChart.js.map +0 -1
- package/lib-commonjs/components/AnnotationOnlyChart/AnnotationOnlyChart.types.js +0 -6
- package/lib-commonjs/components/AnnotationOnlyChart/AnnotationOnlyChart.types.js.map +0 -1
- package/lib-commonjs/components/AnnotationOnlyChart/index.js +0 -7
- package/lib-commonjs/components/AnnotationOnlyChart/index.js.map +0 -1
- package/lib-commonjs/components/AnnotationOnlyChart/useAnnotationOnlyChartStyles.styles.js +0 -57
- package/lib-commonjs/components/AnnotationOnlyChart/useAnnotationOnlyChartStyles.styles.js.map +0 -1
- package/lib-commonjs/components/AnnotationOnlyChart/useAnnotationOnlyChartStyles.styles.raw.js +0 -34
- package/lib-commonjs/components/AnnotationOnlyChart/useAnnotationOnlyChartStyles.styles.raw.js.map +0 -1
- package/lib-commonjs/components/AreaChart/AreaChart.js +0 -938
- package/lib-commonjs/components/AreaChart/AreaChart.js.map +0 -1
- package/lib-commonjs/components/AreaChart/AreaChart.types.js +0 -7
- package/lib-commonjs/components/AreaChart/AreaChart.types.js.map +0 -1
- package/lib-commonjs/components/AreaChart/index.js +0 -8
- package/lib-commonjs/components/AreaChart/index.js.map +0 -1
- package/lib-commonjs/components/AreaChart/useAreaChartStyles.styles.js +0 -96
- package/lib-commonjs/components/AreaChart/useAreaChartStyles.styles.js.map +0 -1
- package/lib-commonjs/components/AreaChart/useAreaChartStyles.styles.raw.js +0 -49
- package/lib-commonjs/components/AreaChart/useAreaChartStyles.styles.raw.js.map +0 -1
- package/lib-commonjs/components/ChartTable/ChartTable.js +0 -171
- package/lib-commonjs/components/ChartTable/ChartTable.js.map +0 -1
- package/lib-commonjs/components/ChartTable/ChartTable.types.js +0 -7
- package/lib-commonjs/components/ChartTable/ChartTable.types.js.map +0 -1
- package/lib-commonjs/components/ChartTable/index.js +0 -8
- package/lib-commonjs/components/ChartTable/index.js.map +0 -1
- package/lib-commonjs/components/ChartTable/useChartTableStyles.styles.js +0 -200
- package/lib-commonjs/components/ChartTable/useChartTableStyles.styles.js.map +0 -1
- package/lib-commonjs/components/ChartTable/useChartTableStyles.styles.raw.js +0 -82
- package/lib-commonjs/components/ChartTable/useChartTableStyles.styles.raw.js.map +0 -1
- package/lib-commonjs/components/CommonComponents/Annotations/ChartAnnotationLayer.js +0 -670
- package/lib-commonjs/components/CommonComponents/Annotations/ChartAnnotationLayer.js.map +0 -1
- package/lib-commonjs/components/CommonComponents/Annotations/ChartAnnotationLayer.types.js +0 -4
- package/lib-commonjs/components/CommonComponents/Annotations/ChartAnnotationLayer.types.js.map +0 -1
- package/lib-commonjs/components/CommonComponents/Annotations/index.js +0 -7
- package/lib-commonjs/components/CommonComponents/Annotations/index.js.map +0 -1
- package/lib-commonjs/components/CommonComponents/Annotations/useChartAnnotationLayer.styles.js +0 -325
- package/lib-commonjs/components/CommonComponents/Annotations/useChartAnnotationLayer.styles.js.map +0 -1
- package/lib-commonjs/components/CommonComponents/Annotations/useChartAnnotationLayer.styles.raw.js +0 -174
- package/lib-commonjs/components/CommonComponents/Annotations/useChartAnnotationLayer.styles.raw.js.map +0 -1
- package/lib-commonjs/components/CommonComponents/CartesianChart.js +0 -673
- package/lib-commonjs/components/CommonComponents/CartesianChart.js.map +0 -1
- package/lib-commonjs/components/CommonComponents/CartesianChart.types.js +0 -5
- package/lib-commonjs/components/CommonComponents/CartesianChart.types.js.map +0 -1
- package/lib-commonjs/components/CommonComponents/ChartPopover.js +0 -207
- package/lib-commonjs/components/CommonComponents/ChartPopover.js.map +0 -1
- package/lib-commonjs/components/CommonComponents/ChartPopover.types.js +0 -4
- package/lib-commonjs/components/CommonComponents/ChartPopover.types.js.map +0 -1
- package/lib-commonjs/components/CommonComponents/index.js +0 -11
- package/lib-commonjs/components/CommonComponents/index.js.map +0 -1
- package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.js +0 -268
- package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.js.map +0 -1
- package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.raw.js +0 -144
- package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.raw.js.map +0 -1
- package/lib-commonjs/components/CommonComponents/useChartPopoverStyles.styles.js +0 -238
- package/lib-commonjs/components/CommonComponents/useChartPopoverStyles.styles.js.map +0 -1
- package/lib-commonjs/components/CommonComponents/useChartPopoverStyles.styles.raw.js +0 -141
- package/lib-commonjs/components/CommonComponents/useChartPopoverStyles.styles.raw.js.map +0 -1
- package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js +0 -400
- package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js.map +0 -1
- package/lib-commonjs/components/DeclarativeChart/PlotlyColorAdapter.js +0 -195
- package/lib-commonjs/components/DeclarativeChart/PlotlyColorAdapter.js.map +0 -1
- package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js +0 -3577
- package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js.map +0 -1
- package/lib-commonjs/components/DeclarativeChart/index.js +0 -6
- package/lib-commonjs/components/DeclarativeChart/index.js.map +0 -1
- package/lib-commonjs/components/DonutChart/Arc/Arc.js +0 -125
- package/lib-commonjs/components/DonutChart/Arc/Arc.js.map +0 -1
- package/lib-commonjs/components/DonutChart/Arc/Arc.types.js +0 -4
- package/lib-commonjs/components/DonutChart/Arc/Arc.types.js.map +0 -1
- package/lib-commonjs/components/DonutChart/Arc/index.js +0 -7
- package/lib-commonjs/components/DonutChart/Arc/index.js.map +0 -1
- package/lib-commonjs/components/DonutChart/Arc/useArcStyles.styles.js +0 -110
- package/lib-commonjs/components/DonutChart/Arc/useArcStyles.styles.js.map +0 -1
- package/lib-commonjs/components/DonutChart/Arc/useArcStyles.styles.raw.js +0 -63
- package/lib-commonjs/components/DonutChart/Arc/useArcStyles.styles.raw.js.map +0 -1
- package/lib-commonjs/components/DonutChart/DonutChart.js +0 -356
- package/lib-commonjs/components/DonutChart/DonutChart.js.map +0 -1
- package/lib-commonjs/components/DonutChart/DonutChart.types.js +0 -7
- package/lib-commonjs/components/DonutChart/DonutChart.types.js.map +0 -1
- package/lib-commonjs/components/DonutChart/Pie/Pie.js +0 -79
- package/lib-commonjs/components/DonutChart/Pie/Pie.js.map +0 -1
- package/lib-commonjs/components/DonutChart/Pie/Pie.types.js +0 -4
- package/lib-commonjs/components/DonutChart/Pie/Pie.types.js.map +0 -1
- package/lib-commonjs/components/DonutChart/Pie/index.js +0 -7
- package/lib-commonjs/components/DonutChart/Pie/index.js.map +0 -1
- package/lib-commonjs/components/DonutChart/Pie/usePieStyles.styles.js +0 -55
- package/lib-commonjs/components/DonutChart/Pie/usePieStyles.styles.js.map +0 -1
- package/lib-commonjs/components/DonutChart/Pie/usePieStyles.styles.raw.js +0 -44
- package/lib-commonjs/components/DonutChart/Pie/usePieStyles.styles.raw.js.map +0 -1
- package/lib-commonjs/components/DonutChart/index.js +0 -8
- package/lib-commonjs/components/DonutChart/index.js.map +0 -1
- package/lib-commonjs/components/DonutChart/useDonutChartStyles.styles.js +0 -145
- package/lib-commonjs/components/DonutChart/useDonutChartStyles.styles.js.map +0 -1
- package/lib-commonjs/components/DonutChart/useDonutChartStyles.styles.raw.js +0 -76
- package/lib-commonjs/components/DonutChart/useDonutChartStyles.styles.raw.js.map +0 -1
- package/lib-commonjs/components/FunnelChart/FunnelChart.js +0 -412
- package/lib-commonjs/components/FunnelChart/FunnelChart.js.map +0 -1
- package/lib-commonjs/components/FunnelChart/FunnelChart.types.js +0 -7
- package/lib-commonjs/components/FunnelChart/FunnelChart.types.js.map +0 -1
- package/lib-commonjs/components/FunnelChart/funnelGeometry.js +0 -246
- package/lib-commonjs/components/FunnelChart/funnelGeometry.js.map +0 -1
- package/lib-commonjs/components/FunnelChart/index.js +0 -7
- package/lib-commonjs/components/FunnelChart/index.js.map +0 -1
- package/lib-commonjs/components/FunnelChart/useFunnelChartStyles.styles.js +0 -118
- package/lib-commonjs/components/FunnelChart/useFunnelChartStyles.styles.js.map +0 -1
- package/lib-commonjs/components/FunnelChart/useFunnelChartStyles.styles.raw.js +0 -79
- package/lib-commonjs/components/FunnelChart/useFunnelChartStyles.styles.raw.js.map +0 -1
- package/lib-commonjs/components/GanttChart/GanttChart.js +0 -546
- package/lib-commonjs/components/GanttChart/GanttChart.js.map +0 -1
- package/lib-commonjs/components/GanttChart/GanttChart.types.js +0 -7
- package/lib-commonjs/components/GanttChart/GanttChart.types.js.map +0 -1
- package/lib-commonjs/components/GanttChart/index.js +0 -7
- package/lib-commonjs/components/GanttChart/index.js.map +0 -1
- package/lib-commonjs/components/GanttChart/useGanttChartStyles.styles.js +0 -42
- package/lib-commonjs/components/GanttChart/useGanttChartStyles.styles.js.map +0 -1
- package/lib-commonjs/components/GanttChart/useGanttChartStyles.styles.raw.js +0 -42
- package/lib-commonjs/components/GanttChart/useGanttChartStyles.styles.raw.js.map +0 -1
- package/lib-commonjs/components/GaugeChart/GaugeChart.js +0 -597
- package/lib-commonjs/components/GaugeChart/GaugeChart.js.map +0 -1
- package/lib-commonjs/components/GaugeChart/GaugeChart.types.js +0 -7
- package/lib-commonjs/components/GaugeChart/GaugeChart.types.js.map +0 -1
- package/lib-commonjs/components/GaugeChart/index.js +0 -8
- package/lib-commonjs/components/GaugeChart/index.js.map +0 -1
- package/lib-commonjs/components/GaugeChart/useGaugeChartStyles.styles.js +0 -281
- package/lib-commonjs/components/GaugeChart/useGaugeChartStyles.styles.js.map +0 -1
- package/lib-commonjs/components/GaugeChart/useGaugeChartStyles.styles.raw.js +0 -167
- package/lib-commonjs/components/GaugeChart/useGaugeChartStyles.styles.raw.js.map +0 -1
- package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js +0 -818
- package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js.map +0 -1
- package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.types.js +0 -7
- package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.types.js.map +0 -1
- package/lib-commonjs/components/GroupedVerticalBarChart/index.js +0 -8
- package/lib-commonjs/components/GroupedVerticalBarChart/index.js.map +0 -1
- package/lib-commonjs/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.js +0 -116
- package/lib-commonjs/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.js.map +0 -1
- package/lib-commonjs/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.raw.js +0 -56
- package/lib-commonjs/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.raw.js.map +0 -1
- package/lib-commonjs/components/HeatMapChart/HeatMapChart.js +0 -688
- package/lib-commonjs/components/HeatMapChart/HeatMapChart.js.map +0 -1
- package/lib-commonjs/components/HeatMapChart/HeatMapChart.types.js +0 -7
- package/lib-commonjs/components/HeatMapChart/HeatMapChart.types.js.map +0 -1
- package/lib-commonjs/components/HeatMapChart/index.js +0 -8
- package/lib-commonjs/components/HeatMapChart/index.js.map +0 -1
- package/lib-commonjs/components/HeatMapChart/useHeatMapChartStyles.styles.js +0 -71
- package/lib-commonjs/components/HeatMapChart/useHeatMapChartStyles.styles.js.map +0 -1
- package/lib-commonjs/components/HeatMapChart/useHeatMapChartStyles.styles.raw.js +0 -60
- package/lib-commonjs/components/HeatMapChart/useHeatMapChartStyles.styles.raw.js.map +0 -1
- package/lib-commonjs/components/HorizontalBarChart/HorizontalBarChart.js +0 -417
- package/lib-commonjs/components/HorizontalBarChart/HorizontalBarChart.js.map +0 -1
- package/lib-commonjs/components/HorizontalBarChart/HorizontalBarChart.types.js +0 -17
- package/lib-commonjs/components/HorizontalBarChart/HorizontalBarChart.types.js.map +0 -1
- package/lib-commonjs/components/HorizontalBarChart/index.js +0 -8
- package/lib-commonjs/components/HorizontalBarChart/index.js.map +0 -1
- package/lib-commonjs/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.js +0 -264
- package/lib-commonjs/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.js.map +0 -1
- package/lib-commonjs/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.raw.js +0 -139
- package/lib-commonjs/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.raw.js.map +0 -1
- package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js +0 -726
- package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js.map +0 -1
- package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.types.js +0 -7
- package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.types.js.map +0 -1
- package/lib-commonjs/components/HorizontalBarChartWithAxis/index.js +0 -8
- package/lib-commonjs/components/HorizontalBarChartWithAxis/index.js.map +0 -1
- package/lib-commonjs/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.js +0 -86
- package/lib-commonjs/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.js.map +0 -1
- package/lib-commonjs/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.raw.js +0 -70
- package/lib-commonjs/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.raw.js.map +0 -1
- package/lib-commonjs/components/Legends/Legends.js +0 -333
- package/lib-commonjs/components/Legends/Legends.js.map +0 -1
- package/lib-commonjs/components/Legends/Legends.types.js +0 -6
- package/lib-commonjs/components/Legends/Legends.types.js.map +0 -1
- package/lib-commonjs/components/Legends/OverflowMenu.js +0 -44
- package/lib-commonjs/components/Legends/OverflowMenu.js.map +0 -1
- package/lib-commonjs/components/Legends/index.js +0 -8
- package/lib-commonjs/components/Legends/index.js.map +0 -1
- package/lib-commonjs/components/Legends/shape.js +0 -47
- package/lib-commonjs/components/Legends/shape.js.map +0 -1
- package/lib-commonjs/components/Legends/useLegendsStyles.styles.js +0 -456
- package/lib-commonjs/components/Legends/useLegendsStyles.styles.js.map +0 -1
- package/lib-commonjs/components/Legends/useLegendsStyles.styles.raw.js +0 -178
- package/lib-commonjs/components/Legends/useLegendsStyles.styles.raw.js.map +0 -1
- package/lib-commonjs/components/LineChart/LineChart.js +0 -1337
- package/lib-commonjs/components/LineChart/LineChart.js.map +0 -1
- package/lib-commonjs/components/LineChart/LineChart.types.js +0 -6
- package/lib-commonjs/components/LineChart/LineChart.types.js.map +0 -1
- package/lib-commonjs/components/LineChart/eventAnnotation/EventAnnotation.js +0 -129
- package/lib-commonjs/components/LineChart/eventAnnotation/EventAnnotation.js.map +0 -1
- package/lib-commonjs/components/LineChart/eventAnnotation/LabelLink.js +0 -70
- package/lib-commonjs/components/LineChart/eventAnnotation/LabelLink.js.map +0 -1
- package/lib-commonjs/components/LineChart/eventAnnotation/Textbox.js +0 -53
- package/lib-commonjs/components/LineChart/eventAnnotation/Textbox.js.map +0 -1
- package/lib-commonjs/components/LineChart/index.js +0 -9
- package/lib-commonjs/components/LineChart/index.js.map +0 -1
- package/lib-commonjs/components/LineChart/useLineChartStyles.styles.js +0 -132
- package/lib-commonjs/components/LineChart/useLineChartStyles.styles.js.map +0 -1
- package/lib-commonjs/components/LineChart/useLineChartStyles.styles.raw.js +0 -63
- package/lib-commonjs/components/LineChart/useLineChartStyles.styles.raw.js.map +0 -1
- package/lib-commonjs/components/PolarChart/PolarChart.js +0 -587
- package/lib-commonjs/components/PolarChart/PolarChart.js.map +0 -1
- package/lib-commonjs/components/PolarChart/PolarChart.types.js +0 -7
- package/lib-commonjs/components/PolarChart/PolarChart.types.js.map +0 -1
- package/lib-commonjs/components/PolarChart/PolarChart.utils.js +0 -204
- package/lib-commonjs/components/PolarChart/PolarChart.utils.js.map +0 -1
- package/lib-commonjs/components/PolarChart/index.js +0 -7
- package/lib-commonjs/components/PolarChart/index.js.map +0 -1
- package/lib-commonjs/components/PolarChart/usePolarChartStyles.styles.js +0 -107
- package/lib-commonjs/components/PolarChart/usePolarChartStyles.styles.js.map +0 -1
- package/lib-commonjs/components/PolarChart/usePolarChartStyles.styles.raw.js +0 -75
- package/lib-commonjs/components/PolarChart/usePolarChartStyles.styles.raw.js.map +0 -1
- package/lib-commonjs/components/ResponsiveContainer/ResponsiveContainer.js +0 -107
- package/lib-commonjs/components/ResponsiveContainer/ResponsiveContainer.js.map +0 -1
- package/lib-commonjs/components/ResponsiveContainer/ResponsiveContainer.types.js +0 -7
- package/lib-commonjs/components/ResponsiveContainer/ResponsiveContainer.types.js.map +0 -1
- package/lib-commonjs/components/ResponsiveContainer/index.js +0 -8
- package/lib-commonjs/components/ResponsiveContainer/index.js.map +0 -1
- package/lib-commonjs/components/ResponsiveContainer/useResponsiveChildStyles.styles.js +0 -50
- package/lib-commonjs/components/ResponsiveContainer/useResponsiveChildStyles.styles.js.map +0 -1
- package/lib-commonjs/components/ResponsiveContainer/useResponsiveChildStyles.styles.raw.js +0 -47
- package/lib-commonjs/components/ResponsiveContainer/useResponsiveChildStyles.styles.raw.js.map +0 -1
- package/lib-commonjs/components/ResponsiveContainer/withResponsiveContainer.js +0 -28
- package/lib-commonjs/components/ResponsiveContainer/withResponsiveContainer.js.map +0 -1
- package/lib-commonjs/components/SankeyChart/SankeyChart.js +0 -1042
- package/lib-commonjs/components/SankeyChart/SankeyChart.js.map +0 -1
- package/lib-commonjs/components/SankeyChart/SankeyChart.types.js +0 -6
- package/lib-commonjs/components/SankeyChart/SankeyChart.types.js.map +0 -1
- package/lib-commonjs/components/SankeyChart/index.js +0 -8
- package/lib-commonjs/components/SankeyChart/index.js.map +0 -1
- package/lib-commonjs/components/SankeyChart/useSankeyChartStyles.styles.js +0 -202
- package/lib-commonjs/components/SankeyChart/useSankeyChartStyles.styles.js.map +0 -1
- package/lib-commonjs/components/SankeyChart/useSankeyChartStyles.styles.raw.js +0 -97
- package/lib-commonjs/components/SankeyChart/useSankeyChartStyles.styles.raw.js.map +0 -1
- package/lib-commonjs/components/ScatterChart/ScatterChart.js +0 -550
- package/lib-commonjs/components/ScatterChart/ScatterChart.js.map +0 -1
- package/lib-commonjs/components/ScatterChart/ScatterChart.types.js +0 -7
- package/lib-commonjs/components/ScatterChart/ScatterChart.types.js.map +0 -1
- package/lib-commonjs/components/ScatterChart/index.js +0 -8
- package/lib-commonjs/components/ScatterChart/index.js.map +0 -1
- package/lib-commonjs/components/ScatterChart/useScatterChartStyles.styles.js +0 -120
- package/lib-commonjs/components/ScatterChart/useScatterChartStyles.styles.js.map +0 -1
- package/lib-commonjs/components/ScatterChart/useScatterChartStyles.styles.raw.js +0 -55
- package/lib-commonjs/components/ScatterChart/useScatterChartStyles.styles.raw.js.map +0 -1
- package/lib-commonjs/components/Sparkline/Sparkline.js +0 -129
- package/lib-commonjs/components/Sparkline/Sparkline.js.map +0 -1
- package/lib-commonjs/components/Sparkline/Sparkline.types.js +0 -7
- package/lib-commonjs/components/Sparkline/Sparkline.types.js.map +0 -1
- package/lib-commonjs/components/Sparkline/index.js +0 -8
- package/lib-commonjs/components/Sparkline/index.js.map +0 -1
- package/lib-commonjs/components/Sparkline/useSparklineStyles.styles.js +0 -57
- package/lib-commonjs/components/Sparkline/useSparklineStyles.styles.js.map +0 -1
- package/lib-commonjs/components/Sparkline/useSparklineStyles.styles.raw.js +0 -45
- package/lib-commonjs/components/Sparkline/useSparklineStyles.styles.raw.js.map +0 -1
- package/lib-commonjs/components/VegaDeclarativeChart/VegaDeclarativeChart.js +0 -274
- package/lib-commonjs/components/VegaDeclarativeChart/VegaDeclarativeChart.js.map +0 -1
- package/lib-commonjs/components/VegaDeclarativeChart/VegaDeclarativeChartHooks.js +0 -35
- package/lib-commonjs/components/VegaDeclarativeChart/VegaDeclarativeChartHooks.js.map +0 -1
- package/lib-commonjs/components/VegaDeclarativeChart/VegaLiteColorAdapter.js +0 -412
- package/lib-commonjs/components/VegaDeclarativeChart/VegaLiteColorAdapter.js.map +0 -1
- package/lib-commonjs/components/VegaDeclarativeChart/VegaLiteExpressionEvaluator.js +0 -533
- package/lib-commonjs/components/VegaDeclarativeChart/VegaLiteExpressionEvaluator.js.map +0 -1
- package/lib-commonjs/components/VegaDeclarativeChart/VegaLiteSchemaAdapter.js +0 -3214
- package/lib-commonjs/components/VegaDeclarativeChart/VegaLiteSchemaAdapter.js.map +0 -1
- package/lib-commonjs/components/VegaDeclarativeChart/VegaLiteTypes.js +0 -31
- package/lib-commonjs/components/VegaDeclarativeChart/VegaLiteTypes.js.map +0 -1
- package/lib-commonjs/components/VegaDeclarativeChart/index.js +0 -6
- package/lib-commonjs/components/VegaDeclarativeChart/index.js.map +0 -1
- package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.js +0 -932
- package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.js.map +0 -1
- package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.types.js +0 -7
- package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.types.js.map +0 -1
- package/lib-commonjs/components/VerticalBarChart/index.js +0 -8
- package/lib-commonjs/components/VerticalBarChart/index.js.map +0 -1
- package/lib-commonjs/components/VerticalBarChart/useVerticalBarChartStyles.styles.js +0 -128
- package/lib-commonjs/components/VerticalBarChart/useVerticalBarChartStyles.styles.js.map +0 -1
- package/lib-commonjs/components/VerticalBarChart/useVerticalBarChartStyles.styles.raw.js +0 -64
- package/lib-commonjs/components/VerticalBarChart/useVerticalBarChartStyles.styles.raw.js.map +0 -1
- package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.js +0 -1088
- package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.js.map +0 -1
- package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.types.js +0 -7
- package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.types.js.map +0 -1
- package/lib-commonjs/components/VerticalStackedBarChart/index.js +0 -8
- package/lib-commonjs/components/VerticalStackedBarChart/index.js.map +0 -1
- package/lib-commonjs/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.js +0 -116
- package/lib-commonjs/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.js.map +0 -1
- package/lib-commonjs/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.raw.js +0 -56
- package/lib-commonjs/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.raw.js.map +0 -1
- package/lib-commonjs/index.js +0 -31
- package/lib-commonjs/index.js.map +0 -1
- package/lib-commonjs/types/ChartAnnotation.js +0 -4
- package/lib-commonjs/types/ChartAnnotation.js.map +0 -1
- package/lib-commonjs/types/DataPoint.js +0 -6
- package/lib-commonjs/types/DataPoint.js.map +0 -1
- package/lib-commonjs/types/EventAnnotation.js +0 -4
- package/lib-commonjs/types/EventAnnotation.js.map +0 -1
- package/lib-commonjs/types/LegendDataItem.js +0 -4
- package/lib-commonjs/types/LegendDataItem.js.map +0 -1
- package/lib-commonjs/types/index.js +0 -8
- package/lib-commonjs/types/index.js.map +0 -1
- package/lib-commonjs/utilities/ChartTitle.js +0 -53
- package/lib-commonjs/utilities/ChartTitle.js.map +0 -1
- package/lib-commonjs/utilities/Common.styles.js +0 -138
- package/lib-commonjs/utilities/Common.styles.js.map +0 -1
- package/lib-commonjs/utilities/Common.styles.raw.js +0 -138
- package/lib-commonjs/utilities/Common.styles.raw.js.map +0 -1
- package/lib-commonjs/utilities/FocusableTooltipText.js +0 -75
- package/lib-commonjs/utilities/FocusableTooltipText.js.map +0 -1
- package/lib-commonjs/utilities/KeyCodes.js +0 -21
- package/lib-commonjs/utilities/KeyCodes.js.map +0 -1
- package/lib-commonjs/utilities/SVGTooltipText.js +0 -189
- package/lib-commonjs/utilities/SVGTooltipText.js.map +0 -1
- package/lib-commonjs/utilities/async-utils.js +0 -382
- package/lib-commonjs/utilities/async-utils.js.map +0 -1
- package/lib-commonjs/utilities/colors.js +0 -311
- package/lib-commonjs/utilities/colors.js.map +0 -1
- package/lib-commonjs/utilities/getWindow.js +0 -28
- package/lib-commonjs/utilities/getWindow.js.map +0 -1
- package/lib-commonjs/utilities/hooks.js +0 -45
- package/lib-commonjs/utilities/hooks.js.map +0 -1
- package/lib-commonjs/utilities/image-export-utils.js +0 -423
- package/lib-commonjs/utilities/image-export-utils.js.map +0 -1
- package/lib-commonjs/utilities/index.js +0 -10
- package/lib-commonjs/utilities/index.js.map +0 -1
- package/lib-commonjs/utilities/overflow-utils.js +0 -36
- package/lib-commonjs/utilities/overflow-utils.js.map +0 -1
- package/lib-commonjs/utilities/scatterpolar-utils.js +0 -67
- package/lib-commonjs/utilities/scatterpolar-utils.js.map +0 -1
- package/lib-commonjs/utilities/string.js +0 -29
- package/lib-commonjs/utilities/string.js.map +0 -1
- package/lib-commonjs/utilities/test-data.js +0 -628
- package/lib-commonjs/utilities/test-data.js.map +0 -1
- package/lib-commonjs/utilities/utilities.js +0 -2016
- package/lib-commonjs/utilities/utilities.js.map +0 -1
- package/lib-commonjs/utilities/vbc-utils.js +0 -72
- package/lib-commonjs/utilities/vbc-utils.js.map +0 -1
|
@@ -1,2016 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
function _export(target, all) {
|
|
7
|
-
for(var name in all)Object.defineProperty(target, name, {
|
|
8
|
-
enumerable: true,
|
|
9
|
-
get: all[name]
|
|
10
|
-
});
|
|
11
|
-
}
|
|
12
|
-
_export(exports, {
|
|
13
|
-
CARTESIAN_XAXIS_CLASSNAME: function() {
|
|
14
|
-
return CARTESIAN_XAXIS_CLASSNAME;
|
|
15
|
-
},
|
|
16
|
-
ChartTypes: function() {
|
|
17
|
-
return ChartTypes;
|
|
18
|
-
},
|
|
19
|
-
CustomPoints: function() {
|
|
20
|
-
return CustomPoints;
|
|
21
|
-
},
|
|
22
|
-
DEFAULT_DATE_STRING: function() {
|
|
23
|
-
return DEFAULT_DATE_STRING;
|
|
24
|
-
},
|
|
25
|
-
DEFAULT_WRAP_WIDTH: function() {
|
|
26
|
-
return DEFAULT_WRAP_WIDTH;
|
|
27
|
-
},
|
|
28
|
-
HighContrastSelector: function() {
|
|
29
|
-
return HighContrastSelector;
|
|
30
|
-
},
|
|
31
|
-
HighContrastSelectorBlack: function() {
|
|
32
|
-
return HighContrastSelectorBlack;
|
|
33
|
-
},
|
|
34
|
-
HighContrastSelectorWhite: function() {
|
|
35
|
-
return HighContrastSelectorWhite;
|
|
36
|
-
},
|
|
37
|
-
MIN_DOMAIN_MARGIN: function() {
|
|
38
|
-
return MIN_DOMAIN_MARGIN;
|
|
39
|
-
},
|
|
40
|
-
MIN_DONUT_RADIUS: function() {
|
|
41
|
-
return MIN_DONUT_RADIUS;
|
|
42
|
-
},
|
|
43
|
-
Points: function() {
|
|
44
|
-
return Points;
|
|
45
|
-
},
|
|
46
|
-
XAxisTypes: function() {
|
|
47
|
-
return XAxisTypes;
|
|
48
|
-
},
|
|
49
|
-
YAxisType: function() {
|
|
50
|
-
return YAxisType;
|
|
51
|
-
},
|
|
52
|
-
areArraysEqual: function() {
|
|
53
|
-
return areArraysEqual;
|
|
54
|
-
},
|
|
55
|
-
autoLayoutXAxisLabels: function() {
|
|
56
|
-
return autoLayoutXAxisLabels;
|
|
57
|
-
},
|
|
58
|
-
calculateLongestLabelWidth: function() {
|
|
59
|
-
return calculateLongestLabelWidth;
|
|
60
|
-
},
|
|
61
|
-
calculateMarkerRadius: function() {
|
|
62
|
-
return calculateMarkerRadius;
|
|
63
|
-
},
|
|
64
|
-
calculatePrecision: function() {
|
|
65
|
-
return calculatePrecision;
|
|
66
|
-
},
|
|
67
|
-
calloutData: function() {
|
|
68
|
-
return calloutData;
|
|
69
|
-
},
|
|
70
|
-
computeLongestBars: function() {
|
|
71
|
-
return computeLongestBars;
|
|
72
|
-
},
|
|
73
|
-
copyStyle: function() {
|
|
74
|
-
return copyStyle;
|
|
75
|
-
},
|
|
76
|
-
createDateXAxis: function() {
|
|
77
|
-
return createDateXAxis;
|
|
78
|
-
},
|
|
79
|
-
createNumericXAxis: function() {
|
|
80
|
-
return createNumericXAxis;
|
|
81
|
-
},
|
|
82
|
-
createNumericYAxis: function() {
|
|
83
|
-
return createNumericYAxis;
|
|
84
|
-
},
|
|
85
|
-
createStringXAxis: function() {
|
|
86
|
-
return createStringXAxis;
|
|
87
|
-
},
|
|
88
|
-
createStringYAxis: function() {
|
|
89
|
-
return createStringYAxis;
|
|
90
|
-
},
|
|
91
|
-
createStringYAxisForHorizontalBarChartWithAxis: function() {
|
|
92
|
-
return createStringYAxisForHorizontalBarChartWithAxis;
|
|
93
|
-
},
|
|
94
|
-
createWrapOfXLabels: function() {
|
|
95
|
-
return createWrapOfXLabels;
|
|
96
|
-
},
|
|
97
|
-
createYAxisForHorizontalBarChartWithAxis: function() {
|
|
98
|
-
return createYAxisForHorizontalBarChartWithAxis;
|
|
99
|
-
},
|
|
100
|
-
createYAxisLabels: function() {
|
|
101
|
-
return createYAxisLabels;
|
|
102
|
-
},
|
|
103
|
-
defaultYAxisTickFormatter: function() {
|
|
104
|
-
return defaultYAxisTickFormatter;
|
|
105
|
-
},
|
|
106
|
-
domainRangeOfDateForAreaLineScatterVerticalBarCharts: function() {
|
|
107
|
-
return domainRangeOfDateForAreaLineScatterVerticalBarCharts;
|
|
108
|
-
},
|
|
109
|
-
domainRangeOfNumericForAreaLineScatterCharts: function() {
|
|
110
|
-
return domainRangeOfNumericForAreaLineScatterCharts;
|
|
111
|
-
},
|
|
112
|
-
domainRangeOfNumericForHorizontalBarChartWithAxis: function() {
|
|
113
|
-
return domainRangeOfNumericForHorizontalBarChartWithAxis;
|
|
114
|
-
},
|
|
115
|
-
domainRangeOfVSBCNumeric: function() {
|
|
116
|
-
return domainRangeOfVSBCNumeric;
|
|
117
|
-
},
|
|
118
|
-
domainRangeOfVerticalNumeric: function() {
|
|
119
|
-
return domainRangeOfVerticalNumeric;
|
|
120
|
-
},
|
|
121
|
-
domainRangeOfXStringAxis: function() {
|
|
122
|
-
return domainRangeOfXStringAxis;
|
|
123
|
-
},
|
|
124
|
-
find: function() {
|
|
125
|
-
return find;
|
|
126
|
-
},
|
|
127
|
-
findCalloutPoints: function() {
|
|
128
|
-
return findCalloutPoints;
|
|
129
|
-
},
|
|
130
|
-
findHBCWANumericMinMaxOfY: function() {
|
|
131
|
-
return findHBCWANumericMinMaxOfY;
|
|
132
|
-
},
|
|
133
|
-
findIndex: function() {
|
|
134
|
-
return findIndex;
|
|
135
|
-
},
|
|
136
|
-
findNumericMinMaxOfY: function() {
|
|
137
|
-
return findNumericMinMaxOfY;
|
|
138
|
-
},
|
|
139
|
-
findVSBCNumericMinMaxOfY: function() {
|
|
140
|
-
return findVSBCNumericMinMaxOfY;
|
|
141
|
-
},
|
|
142
|
-
findVerticalNumericMinMaxOfY: function() {
|
|
143
|
-
return findVerticalNumericMinMaxOfY;
|
|
144
|
-
},
|
|
145
|
-
formatDate: function() {
|
|
146
|
-
return formatDate;
|
|
147
|
-
},
|
|
148
|
-
formatScientificLimitWidth: function() {
|
|
149
|
-
return formatScientificLimitWidth;
|
|
150
|
-
},
|
|
151
|
-
generateDateTicks: function() {
|
|
152
|
-
return generateDateTicks;
|
|
153
|
-
},
|
|
154
|
-
generateLinearTicks: function() {
|
|
155
|
-
return generateLinearTicks;
|
|
156
|
-
},
|
|
157
|
-
generateMonthlyTicks: function() {
|
|
158
|
-
return generateMonthlyTicks;
|
|
159
|
-
},
|
|
160
|
-
generateNumericTicks: function() {
|
|
161
|
-
return generateNumericTicks;
|
|
162
|
-
},
|
|
163
|
-
getAccessibleDataObject: function() {
|
|
164
|
-
return getAccessibleDataObject;
|
|
165
|
-
},
|
|
166
|
-
getBarWidth: function() {
|
|
167
|
-
return getBarWidth;
|
|
168
|
-
},
|
|
169
|
-
getCurveFactory: function() {
|
|
170
|
-
return getCurveFactory;
|
|
171
|
-
},
|
|
172
|
-
getDateFormatLevel: function() {
|
|
173
|
-
return getDateFormatLevel;
|
|
174
|
-
},
|
|
175
|
-
getDomainPaddingForMarkers: function() {
|
|
176
|
-
return getDomainPaddingForMarkers;
|
|
177
|
-
},
|
|
178
|
-
getRangeForScatterMarkerSize: function() {
|
|
179
|
-
return getRangeForScatterMarkerSize;
|
|
180
|
-
},
|
|
181
|
-
getScalePadding: function() {
|
|
182
|
-
return getScalePadding;
|
|
183
|
-
},
|
|
184
|
-
getScatterXDomainExtent: function() {
|
|
185
|
-
return getScatterXDomainExtent;
|
|
186
|
-
},
|
|
187
|
-
getSecureProps: function() {
|
|
188
|
-
return getSecureProps;
|
|
189
|
-
},
|
|
190
|
-
getTextSize: function() {
|
|
191
|
-
return getTextSize;
|
|
192
|
-
},
|
|
193
|
-
getTypeOfAxis: function() {
|
|
194
|
-
return getTypeOfAxis;
|
|
195
|
-
},
|
|
196
|
-
getUnique: function() {
|
|
197
|
-
return getUnique;
|
|
198
|
-
},
|
|
199
|
-
getXAxisType: function() {
|
|
200
|
-
return getXAxisType;
|
|
201
|
-
},
|
|
202
|
-
groupChartDataByYValue: function() {
|
|
203
|
-
return groupChartDataByYValue;
|
|
204
|
-
},
|
|
205
|
-
isPlottable: function() {
|
|
206
|
-
return isPlottable;
|
|
207
|
-
},
|
|
208
|
-
isScalePaddingDefined: function() {
|
|
209
|
-
return isScalePaddingDefined;
|
|
210
|
-
},
|
|
211
|
-
isScatterPolarSeries: function() {
|
|
212
|
-
return isScatterPolarSeries;
|
|
213
|
-
},
|
|
214
|
-
isTextMode: function() {
|
|
215
|
-
return isTextMode;
|
|
216
|
-
},
|
|
217
|
-
isValidDomainValue: function() {
|
|
218
|
-
return isValidDomainValue;
|
|
219
|
-
},
|
|
220
|
-
measureTextWithDOM: function() {
|
|
221
|
-
return measureTextWithDOM;
|
|
222
|
-
},
|
|
223
|
-
pointTypes: function() {
|
|
224
|
-
return pointTypes;
|
|
225
|
-
},
|
|
226
|
-
precisionRound: function() {
|
|
227
|
-
return precisionRound;
|
|
228
|
-
},
|
|
229
|
-
prepareDatapoints: function() {
|
|
230
|
-
return prepareDatapoints;
|
|
231
|
-
},
|
|
232
|
-
resolveCSSVariables: function() {
|
|
233
|
-
return resolveCSSVariables;
|
|
234
|
-
},
|
|
235
|
-
rotateXAxisLabels: function() {
|
|
236
|
-
return rotateXAxisLabels;
|
|
237
|
-
},
|
|
238
|
-
silceOrAppendToArray: function() {
|
|
239
|
-
return silceOrAppendToArray;
|
|
240
|
-
},
|
|
241
|
-
sortAxisCategories: function() {
|
|
242
|
-
return sortAxisCategories;
|
|
243
|
-
},
|
|
244
|
-
tooltipOfAxislabels: function() {
|
|
245
|
-
return tooltipOfAxislabels;
|
|
246
|
-
},
|
|
247
|
-
truncateString: function() {
|
|
248
|
-
return truncateString;
|
|
249
|
-
},
|
|
250
|
-
useRtl: function() {
|
|
251
|
-
return useRtl;
|
|
252
|
-
},
|
|
253
|
-
wrapContent: function() {
|
|
254
|
-
return wrapContent;
|
|
255
|
-
},
|
|
256
|
-
wrapTextInsideDonut: function() {
|
|
257
|
-
return wrapTextInsideDonut;
|
|
258
|
-
}
|
|
259
|
-
});
|
|
260
|
-
const _d3axis = require("d3-axis");
|
|
261
|
-
const _d3array = require("d3-array");
|
|
262
|
-
const _d3scale = require("d3-scale");
|
|
263
|
-
const _d3selection = require("d3-selection");
|
|
264
|
-
const _d3format = require("d3-format");
|
|
265
|
-
const _d3timeformat = require("d3-time-format");
|
|
266
|
-
const _d3time = require("d3-time");
|
|
267
|
-
const _d3shape = require("d3-shape");
|
|
268
|
-
const _reactsharedcontexts = require("@fluentui/react-shared-contexts");
|
|
269
|
-
const _chartutilities = require("@fluentui/chart-utilities");
|
|
270
|
-
const MIN_DOMAIN_MARGIN = 8;
|
|
271
|
-
const MIN_DONUT_RADIUS = 1;
|
|
272
|
-
const DEFAULT_DATE_STRING = '2000-01-01';
|
|
273
|
-
const CARTESIAN_XAXIS_CLASSNAME = 'fui-cart__xAxis';
|
|
274
|
-
const CARTESIAN_XAXIS_TEXT_SELECTOR = `.${CARTESIAN_XAXIS_CLASSNAME} text`;
|
|
275
|
-
var ChartTypes = /*#__PURE__*/ function(ChartTypes) {
|
|
276
|
-
ChartTypes[ChartTypes["AreaChart"] = 0] = "AreaChart";
|
|
277
|
-
ChartTypes[ChartTypes["LineChart"] = 1] = "LineChart";
|
|
278
|
-
ChartTypes[ChartTypes["VerticalBarChart"] = 2] = "VerticalBarChart";
|
|
279
|
-
ChartTypes[ChartTypes["VerticalStackedBarChart"] = 3] = "VerticalStackedBarChart";
|
|
280
|
-
ChartTypes[ChartTypes["GroupedVerticalBarChart"] = 4] = "GroupedVerticalBarChart";
|
|
281
|
-
ChartTypes[ChartTypes["HeatMapChart"] = 5] = "HeatMapChart";
|
|
282
|
-
ChartTypes[ChartTypes["HorizontalBarChartWithAxis"] = 6] = "HorizontalBarChartWithAxis";
|
|
283
|
-
ChartTypes[ChartTypes["ScatterChart"] = 7] = "ScatterChart";
|
|
284
|
-
ChartTypes[ChartTypes["GanttChart"] = 8] = "GanttChart";
|
|
285
|
-
return ChartTypes;
|
|
286
|
-
}({});
|
|
287
|
-
var XAxisTypes = /*#__PURE__*/ function(XAxisTypes) {
|
|
288
|
-
XAxisTypes[XAxisTypes["NumericAxis"] = 0] = "NumericAxis";
|
|
289
|
-
XAxisTypes[XAxisTypes["DateAxis"] = 1] = "DateAxis";
|
|
290
|
-
XAxisTypes[XAxisTypes["StringAxis"] = 2] = "StringAxis";
|
|
291
|
-
return XAxisTypes;
|
|
292
|
-
}({});
|
|
293
|
-
var YAxisType = /*#__PURE__*/ function(YAxisType) {
|
|
294
|
-
YAxisType[YAxisType["NumericAxis"] = 0] = "NumericAxis";
|
|
295
|
-
YAxisType[YAxisType["DateAxis"] = 1] = "DateAxis";
|
|
296
|
-
YAxisType[YAxisType["StringAxis"] = 2] = "StringAxis";
|
|
297
|
-
return YAxisType;
|
|
298
|
-
}({});
|
|
299
|
-
function yAxisTickFormatterInternal(value, limitWidth = false) {
|
|
300
|
-
// Use SI format prefix with 2 decimal places without insignificant trailing zeros
|
|
301
|
-
let formatter = (0, _d3format.formatPrefix)('.2~', value);
|
|
302
|
-
if (Math.abs(value) < 1) {
|
|
303
|
-
// Don't use SI notation for small numbers as it is less readable
|
|
304
|
-
formatter = (0, _d3format.format)('.2~g');
|
|
305
|
-
} else if (limitWidth && Math.abs(value) >= 1000) {
|
|
306
|
-
// If width is limited, use SI format prefix with 1 point precision
|
|
307
|
-
formatter = (0, _d3format.formatPrefix)('.1~', value);
|
|
308
|
-
}
|
|
309
|
-
const formattedValue = formatter(value);
|
|
310
|
-
// Replace 'G' with 'B' if the value is greater than 10^9 as it is a more common convention
|
|
311
|
-
if (Math.abs(value) >= 1e9) {
|
|
312
|
-
return formattedValue.replace('G', 'B');
|
|
313
|
-
}
|
|
314
|
-
return formattedValue;
|
|
315
|
-
}
|
|
316
|
-
function defaultYAxisTickFormatter(value) {
|
|
317
|
-
return yAxisTickFormatterInternal(value);
|
|
318
|
-
}
|
|
319
|
-
function createNumericXAxis(xAxisParams, tickParams, chartType, culture, scaleType, _useRtl) {
|
|
320
|
-
const { domainNRangeValues, showRoundOffXTickValues = false, xAxistickSize = 6, tickPadding = 10, xAxisCount, xAxisElement, hideTickOverlap, calcMaxLabelWidth, tickStep, tick0, tickText } = xAxisParams;
|
|
321
|
-
const dStartValue = domainNRangeValues.dStartValue;
|
|
322
|
-
const dEndValue = domainNRangeValues.dEndValue;
|
|
323
|
-
const finalXmin = xAxisParams.xMinValue !== undefined ? Math.min(dStartValue, xAxisParams.xMinValue) : dStartValue;
|
|
324
|
-
const finalXmax = xAxisParams.xMaxValue !== undefined ? Math.max(dEndValue, xAxisParams.xMaxValue) : dEndValue;
|
|
325
|
-
const xAxisScale = createNumericScale(scaleType).domain([
|
|
326
|
-
finalXmin,
|
|
327
|
-
finalXmax
|
|
328
|
-
]).range([
|
|
329
|
-
domainNRangeValues.rStartValue,
|
|
330
|
-
domainNRangeValues.rEndValue
|
|
331
|
-
]);
|
|
332
|
-
showRoundOffXTickValues && xAxisScale.nice();
|
|
333
|
-
let tickCount = xAxisCount !== null && xAxisCount !== void 0 ? xAxisCount : 6;
|
|
334
|
-
const tickFormat = (domainValue, _index, defaultFormat)=>{
|
|
335
|
-
if (tickParams.tickValues && tickText && typeof tickText[_index] !== 'undefined') {
|
|
336
|
-
return tickText[_index];
|
|
337
|
-
}
|
|
338
|
-
if (tickParams.tickFormat) {
|
|
339
|
-
return (0, _d3format.format)(tickParams.tickFormat)(domainValue);
|
|
340
|
-
}
|
|
341
|
-
const xAxisValue = typeof domainValue === 'number' ? domainValue : domainValue.valueOf();
|
|
342
|
-
return (defaultFormat === null || defaultFormat === void 0 ? void 0 : defaultFormat(xAxisValue)) === '' ? '' : (0, _chartutilities.formatToLocaleString)(xAxisValue, culture);
|
|
343
|
-
};
|
|
344
|
-
if (hideTickOverlap) {
|
|
345
|
-
const longestLabelWidth = calcMaxLabelWidth(xAxisScale.ticks().map((v, i)=>tickFormat(v, i))) + 20;
|
|
346
|
-
const [start, end] = xAxisScale.range();
|
|
347
|
-
tickCount = Math.min(Math.max(1, Math.floor(Math.abs(end - start) / longestLabelWidth)), 10);
|
|
348
|
-
}
|
|
349
|
-
const xAxis = (0, _d3axis.axisBottom)(xAxisScale).tickSize(xAxistickSize).tickPadding(tickPadding).ticks(tickCount).tickFormat((v, i)=>tickFormat(v, i, xAxisScale.tickFormat(tickCount)));
|
|
350
|
-
if ([
|
|
351
|
-
6,
|
|
352
|
-
8
|
|
353
|
-
].includes(chartType)) {
|
|
354
|
-
xAxis.tickSizeInner(-(xAxisParams.containerHeight - xAxisParams.margins.top));
|
|
355
|
-
}
|
|
356
|
-
let customTickValues;
|
|
357
|
-
if (tickParams.tickValues) {
|
|
358
|
-
customTickValues = tickParams.tickValues;
|
|
359
|
-
} else if (tickStep) {
|
|
360
|
-
customTickValues = generateNumericTicks(scaleType, tickStep, tick0, xAxisScale.domain());
|
|
361
|
-
}
|
|
362
|
-
if (customTickValues) {
|
|
363
|
-
xAxis.tickValues(customTickValues);
|
|
364
|
-
}
|
|
365
|
-
if (xAxisElement) {
|
|
366
|
-
(0, _d3selection.select)(xAxisElement).call(xAxis).selectAll('text').attr('aria-hidden', 'true').style('direction', 'ltr').style('unicode-bidi', 'isolate');
|
|
367
|
-
}
|
|
368
|
-
const tickValues = customTickValues !== null && customTickValues !== void 0 ? customTickValues : xAxisScale.ticks(tickCount);
|
|
369
|
-
const tickLabels = tickValues.map(xAxis.tickFormat());
|
|
370
|
-
return {
|
|
371
|
-
xScale: xAxisScale,
|
|
372
|
-
tickValues,
|
|
373
|
-
tickLabels
|
|
374
|
-
};
|
|
375
|
-
}
|
|
376
|
-
/**
|
|
377
|
-
* This function returns a multilevel formatter for a given date range.
|
|
378
|
-
* It determines the appropriate date format to accommodate each tick value.
|
|
379
|
-
* The goal is to represent the date label in the smallest possible format without loss of information.
|
|
380
|
-
* The challenge here is to adhere to locale specific formats while ensuring the complete label is shown.
|
|
381
|
-
* There is an exhaustive map of all possible date/time units and their respective formats.
|
|
382
|
-
* Based on the range of formatting granularity levels, a format spanning the range is returned.
|
|
383
|
-
* @param startLevel - The starting level of the date format.
|
|
384
|
-
* @param endLevel - The ending level of the date format.
|
|
385
|
-
* @param locale - The locale object for formatting.
|
|
386
|
-
* @param useUTC
|
|
387
|
-
* @returns
|
|
388
|
-
*/ function getMultiLevelD3DateFormatter(startLevel, endLevel, locale, useUTC) {
|
|
389
|
-
const timeFormat = locale ? useUTC ? locale.utcFormat : locale.format : useUTC ? _d3timeformat.utcFormat : _d3timeformat.timeFormat;
|
|
390
|
-
// Refer to https://d3js.org/d3-time-format#locale_format to see explanation about each format specifier
|
|
391
|
-
const DEFAULT = '%c';
|
|
392
|
-
const MS = '.%L';
|
|
393
|
-
const MS_S = ':%S.%L';
|
|
394
|
-
const MS_S_MIN = '%M:%S.%L';
|
|
395
|
-
const MS_S_MIN_H = '%-I:%M:%S.%L %p';
|
|
396
|
-
const MS_S_MIN_H_D = '%a %d, %X';
|
|
397
|
-
const MS_S_MIN_H_D_W = '%b %d, %X';
|
|
398
|
-
const MS_S_MIN_H_D_W_M = MS_S_MIN_H_D_W;
|
|
399
|
-
const MS_S_MIN_H_D_W_M_Y = DEFAULT;
|
|
400
|
-
const S = ':%S';
|
|
401
|
-
const S_MIN = '%-I:%M:%S';
|
|
402
|
-
const S_MIN_H = '%X';
|
|
403
|
-
const S_MIN_H_D = MS_S_MIN_H_D;
|
|
404
|
-
const S_MIN_H_D_W = MS_S_MIN_H_D_W;
|
|
405
|
-
const S_MIN_H_D_W_M = MS_S_MIN_H_D_W_M;
|
|
406
|
-
const S_MIN_H_D_W_M_Y = DEFAULT;
|
|
407
|
-
const MIN = '%-I:%M %p';
|
|
408
|
-
const MIN_H = MIN;
|
|
409
|
-
const MIN_H_D = '%a %d, %-I:%M %p';
|
|
410
|
-
const MIN_H_D_W = '%b %d, %-I:%M %p';
|
|
411
|
-
const MIN_H_D_W_M = MIN_H_D_W;
|
|
412
|
-
const MIN_H_D_W_M_Y = '%x, %-I:%M %p';
|
|
413
|
-
const H = '%-I %p';
|
|
414
|
-
const H_D = '%a %d, %-I %p';
|
|
415
|
-
const H_D_W = '%b %d, %-I %p';
|
|
416
|
-
const H_D_W_M = H_D_W;
|
|
417
|
-
const H_D_W_M_Y = '%x, %-I %p';
|
|
418
|
-
const D = '%a %d';
|
|
419
|
-
const D_W = '%b %d';
|
|
420
|
-
const D_W_M = D_W;
|
|
421
|
-
const D_W_M_Y = '%x';
|
|
422
|
-
const W = D_W;
|
|
423
|
-
const W_M = W;
|
|
424
|
-
const W_M_Y = D_W_M_Y;
|
|
425
|
-
const M = '%B';
|
|
426
|
-
const M_Y = '%b %Y';
|
|
427
|
-
const Y = '%Y';
|
|
428
|
-
const MULTI_LEVEL_DATE_TIME_FORMATS = [
|
|
429
|
-
// ms, s, min, h, d, w, m, y
|
|
430
|
-
[
|
|
431
|
-
MS,
|
|
432
|
-
MS_S,
|
|
433
|
-
MS_S_MIN,
|
|
434
|
-
MS_S_MIN_H,
|
|
435
|
-
MS_S_MIN_H_D,
|
|
436
|
-
MS_S_MIN_H_D_W,
|
|
437
|
-
MS_S_MIN_H_D_W_M,
|
|
438
|
-
MS_S_MIN_H_D_W_M_Y
|
|
439
|
-
],
|
|
440
|
-
[
|
|
441
|
-
DEFAULT,
|
|
442
|
-
S,
|
|
443
|
-
S_MIN,
|
|
444
|
-
S_MIN_H,
|
|
445
|
-
S_MIN_H_D,
|
|
446
|
-
S_MIN_H_D_W,
|
|
447
|
-
S_MIN_H_D_W_M,
|
|
448
|
-
S_MIN_H_D_W_M_Y
|
|
449
|
-
],
|
|
450
|
-
[
|
|
451
|
-
DEFAULT,
|
|
452
|
-
DEFAULT,
|
|
453
|
-
MIN,
|
|
454
|
-
MIN_H,
|
|
455
|
-
MIN_H_D,
|
|
456
|
-
MIN_H_D_W,
|
|
457
|
-
MIN_H_D_W_M,
|
|
458
|
-
MIN_H_D_W_M_Y
|
|
459
|
-
],
|
|
460
|
-
[
|
|
461
|
-
DEFAULT,
|
|
462
|
-
DEFAULT,
|
|
463
|
-
DEFAULT,
|
|
464
|
-
H,
|
|
465
|
-
H_D,
|
|
466
|
-
H_D_W,
|
|
467
|
-
H_D_W_M,
|
|
468
|
-
H_D_W_M_Y
|
|
469
|
-
],
|
|
470
|
-
[
|
|
471
|
-
DEFAULT,
|
|
472
|
-
DEFAULT,
|
|
473
|
-
DEFAULT,
|
|
474
|
-
DEFAULT,
|
|
475
|
-
D,
|
|
476
|
-
D_W,
|
|
477
|
-
D_W_M,
|
|
478
|
-
D_W_M_Y
|
|
479
|
-
],
|
|
480
|
-
[
|
|
481
|
-
DEFAULT,
|
|
482
|
-
DEFAULT,
|
|
483
|
-
DEFAULT,
|
|
484
|
-
DEFAULT,
|
|
485
|
-
DEFAULT,
|
|
486
|
-
W,
|
|
487
|
-
W_M,
|
|
488
|
-
W_M_Y
|
|
489
|
-
],
|
|
490
|
-
[
|
|
491
|
-
DEFAULT,
|
|
492
|
-
DEFAULT,
|
|
493
|
-
DEFAULT,
|
|
494
|
-
DEFAULT,
|
|
495
|
-
DEFAULT,
|
|
496
|
-
DEFAULT,
|
|
497
|
-
M,
|
|
498
|
-
M_Y
|
|
499
|
-
],
|
|
500
|
-
[
|
|
501
|
-
DEFAULT,
|
|
502
|
-
DEFAULT,
|
|
503
|
-
DEFAULT,
|
|
504
|
-
DEFAULT,
|
|
505
|
-
DEFAULT,
|
|
506
|
-
DEFAULT,
|
|
507
|
-
DEFAULT,
|
|
508
|
-
Y
|
|
509
|
-
]
|
|
510
|
-
];
|
|
511
|
-
const formatter = timeFormat(MULTI_LEVEL_DATE_TIME_FORMATS[startLevel][endLevel]);
|
|
512
|
-
return formatter;
|
|
513
|
-
}
|
|
514
|
-
function getDateFormatLevel(date, useUTC) {
|
|
515
|
-
const timeSecond = useUTC ? _d3time.utcSecond : _d3time.timeSecond;
|
|
516
|
-
const timeMinute = useUTC ? _d3time.utcMinute : _d3time.timeMinute;
|
|
517
|
-
const timeHour = useUTC ? _d3time.utcHour : _d3time.timeHour;
|
|
518
|
-
const timeDay = useUTC ? _d3time.utcDay : _d3time.timeDay;
|
|
519
|
-
const timeMonth = useUTC ? _d3time.utcMonth : _d3time.timeMonth;
|
|
520
|
-
const timeWeek = useUTC ? _d3time.utcWeek : _d3time.timeWeek;
|
|
521
|
-
const timeYear = useUTC ? _d3time.utcYear : _d3time.timeYear;
|
|
522
|
-
const formats = [
|
|
523
|
-
{
|
|
524
|
-
formatLevel: 0,
|
|
525
|
-
condition: (d)=>timeSecond(d) < d
|
|
526
|
-
},
|
|
527
|
-
{
|
|
528
|
-
formatLevel: 1,
|
|
529
|
-
condition: (d)=>timeMinute(d) < d
|
|
530
|
-
},
|
|
531
|
-
{
|
|
532
|
-
formatLevel: 2,
|
|
533
|
-
condition: (d)=>timeHour(d) < d
|
|
534
|
-
},
|
|
535
|
-
{
|
|
536
|
-
formatLevel: 3,
|
|
537
|
-
condition: (d)=>timeDay(d) < d
|
|
538
|
-
},
|
|
539
|
-
{
|
|
540
|
-
formatLevel: 4,
|
|
541
|
-
condition: (d)=>timeMonth(d) < d && timeWeek(d) < d
|
|
542
|
-
},
|
|
543
|
-
{
|
|
544
|
-
formatLevel: 5,
|
|
545
|
-
condition: (d)=>timeMonth(d) < d
|
|
546
|
-
},
|
|
547
|
-
{
|
|
548
|
-
formatLevel: 6,
|
|
549
|
-
condition: (d)=>timeYear(d) < d
|
|
550
|
-
},
|
|
551
|
-
{
|
|
552
|
-
formatLevel: 7,
|
|
553
|
-
condition: ()=>true
|
|
554
|
-
}
|
|
555
|
-
];
|
|
556
|
-
const matchedFormat = formats.find(({ condition })=>condition(date));
|
|
557
|
-
var _matchedFormat_formatLevel;
|
|
558
|
-
return (_matchedFormat_formatLevel = matchedFormat === null || matchedFormat === void 0 ? void 0 : matchedFormat.formatLevel) !== null && _matchedFormat_formatLevel !== void 0 ? _matchedFormat_formatLevel : 7;
|
|
559
|
-
}
|
|
560
|
-
function createDateXAxis(xAxisParams, tickParams, culture, options, timeFormatLocale, customDateTimeFormatter, useUTC, chartType) {
|
|
561
|
-
const { domainNRangeValues, xAxisElement, tickPadding = 6, xAxistickSize = 6, xAxisCount, hideTickOverlap, calcMaxLabelWidth, tickStep, tick0, tickText } = xAxisParams;
|
|
562
|
-
const isUtcSet = useUTC === true || useUTC === 'utc';
|
|
563
|
-
const xAxisScale = isUtcSet ? (0, _d3scale.scaleUtc)() : (0, _d3scale.scaleTime)();
|
|
564
|
-
xAxisScale.domain([
|
|
565
|
-
domainNRangeValues.dStartValue,
|
|
566
|
-
domainNRangeValues.dEndValue
|
|
567
|
-
]).range([
|
|
568
|
-
domainNRangeValues.rStartValue,
|
|
569
|
-
domainNRangeValues.rEndValue
|
|
570
|
-
]).nice();
|
|
571
|
-
let tickCount = xAxisCount !== null && xAxisCount !== void 0 ? xAxisCount : 6;
|
|
572
|
-
let lowestFormatLevel = 100;
|
|
573
|
-
let highestFormatLevel = -1;
|
|
574
|
-
const locale = timeFormatLocale ? (0, _d3timeformat.timeFormatLocale)(timeFormatLocale) : undefined;
|
|
575
|
-
xAxisScale.ticks().forEach((domainValue)=>{
|
|
576
|
-
const formatLevel = getDateFormatLevel(domainValue, isUtcSet);
|
|
577
|
-
if (formatLevel > highestFormatLevel) {
|
|
578
|
-
highestFormatLevel = formatLevel;
|
|
579
|
-
}
|
|
580
|
-
if (formatLevel < lowestFormatLevel) {
|
|
581
|
-
lowestFormatLevel = formatLevel;
|
|
582
|
-
}
|
|
583
|
-
});
|
|
584
|
-
const formatOptions = options !== null && options !== void 0 ? options : (0, _chartutilities.getMultiLevelDateTimeFormatOptions)(lowestFormatLevel, highestFormatLevel);
|
|
585
|
-
const formatFn = getMultiLevelD3DateFormatter(lowestFormatLevel, highestFormatLevel, locale, isUtcSet);
|
|
586
|
-
const tickFormat = (domainValue, _index)=>{
|
|
587
|
-
if (tickParams.tickValues && tickText && typeof tickText[_index] !== 'undefined') {
|
|
588
|
-
return tickText[_index];
|
|
589
|
-
}
|
|
590
|
-
if (customDateTimeFormatter) {
|
|
591
|
-
return customDateTimeFormatter(domainValue);
|
|
592
|
-
}
|
|
593
|
-
if (timeFormatLocale) {
|
|
594
|
-
return formatFn(domainValue);
|
|
595
|
-
}
|
|
596
|
-
if (culture === undefined && tickParams.tickFormat) {
|
|
597
|
-
if (useUTC) {
|
|
598
|
-
return (0, _d3timeformat.utcFormat)(tickParams.tickFormat)(domainValue);
|
|
599
|
-
} else {
|
|
600
|
-
return (0, _d3timeformat.timeFormat)(tickParams.tickFormat)(domainValue);
|
|
601
|
-
}
|
|
602
|
-
}
|
|
603
|
-
return (0, _chartutilities.formatDateToLocaleString)(domainValue, culture, useUTC ? true : false, false, formatOptions);
|
|
604
|
-
};
|
|
605
|
-
if (hideTickOverlap) {
|
|
606
|
-
const longestLabelWidth = calcMaxLabelWidth(xAxisScale.ticks().map(tickFormat)) + 40;
|
|
607
|
-
const [start, end] = xAxisScale.range();
|
|
608
|
-
tickCount = Math.min(Math.max(1, Math.floor(Math.abs(end - start) / longestLabelWidth)), 10);
|
|
609
|
-
}
|
|
610
|
-
const xAxis = (0, _d3axis.axisBottom)(xAxisScale).tickSize(xAxistickSize).tickPadding(tickPadding).ticks(tickCount).tickFormat(tickFormat);
|
|
611
|
-
if ([
|
|
612
|
-
8
|
|
613
|
-
].includes(chartType)) {
|
|
614
|
-
xAxis.tickSizeInner(-(xAxisParams.containerHeight - xAxisParams.margins.top));
|
|
615
|
-
}
|
|
616
|
-
let customTickValues;
|
|
617
|
-
if (tickParams.tickValues) {
|
|
618
|
-
customTickValues = tickParams.tickValues;
|
|
619
|
-
} else if (tickStep) {
|
|
620
|
-
customTickValues = generateDateTicks(tickStep, tick0, xAxisScale.domain(), useUTC);
|
|
621
|
-
}
|
|
622
|
-
if (customTickValues) {
|
|
623
|
-
xAxis.tickValues(customTickValues);
|
|
624
|
-
}
|
|
625
|
-
if (xAxisElement) {
|
|
626
|
-
(0, _d3selection.select)(xAxisElement).call(xAxis).selectAll('text').attr('aria-hidden', 'true');
|
|
627
|
-
}
|
|
628
|
-
const tickValues = customTickValues !== null && customTickValues !== void 0 ? customTickValues : xAxisScale.ticks(tickCount);
|
|
629
|
-
const tickLabels = tickValues.map(xAxis.tickFormat());
|
|
630
|
-
return {
|
|
631
|
-
xScale: xAxisScale,
|
|
632
|
-
tickValues,
|
|
633
|
-
tickLabels
|
|
634
|
-
};
|
|
635
|
-
}
|
|
636
|
-
function createStringXAxis(xAxisParams, tickParams, dataset, culture, _useRtl) {
|
|
637
|
-
const { domainNRangeValues, xAxistickSize = 6, tickPadding = 10, xAxisPadding = 0.1, xAxisInnerPadding, xAxisOuterPadding, containerWidth, hideTickOverlap, calcMaxLabelWidth, tickText } = xAxisParams;
|
|
638
|
-
const xAxisScale = (0, _d3scale.scaleBand)().domain(dataset).range([
|
|
639
|
-
domainNRangeValues.rStartValue,
|
|
640
|
-
domainNRangeValues.rEndValue
|
|
641
|
-
]).paddingInner(typeof xAxisInnerPadding !== 'undefined' ? xAxisInnerPadding : xAxisPadding).paddingOuter(typeof xAxisOuterPadding !== 'undefined' ? xAxisOuterPadding : xAxisPadding);
|
|
642
|
-
var _tickParams_tickValues;
|
|
643
|
-
let tickValues = (_tickParams_tickValues = tickParams.tickValues) !== null && _tickParams_tickValues !== void 0 ? _tickParams_tickValues : dataset;
|
|
644
|
-
const tickFormat = (domainValue, _index)=>{
|
|
645
|
-
if (tickParams.tickValues && tickText && typeof tickText[_index] !== 'undefined') {
|
|
646
|
-
return tickText[_index];
|
|
647
|
-
}
|
|
648
|
-
return domainValue;
|
|
649
|
-
};
|
|
650
|
-
if (hideTickOverlap) {
|
|
651
|
-
let nonOverlappingTickValues = [];
|
|
652
|
-
const tickSizes = tickValues.map((value)=>calcMaxLabelWidth([
|
|
653
|
-
value
|
|
654
|
-
]));
|
|
655
|
-
// for LTR
|
|
656
|
-
let start = 0;
|
|
657
|
-
let end = containerWidth;
|
|
658
|
-
let sign = 1;
|
|
659
|
-
const range = xAxisScale.range();
|
|
660
|
-
if (range[1] - range[0] < 0) {
|
|
661
|
-
// for RTL
|
|
662
|
-
start = containerWidth;
|
|
663
|
-
end = 0;
|
|
664
|
-
sign = -1;
|
|
665
|
-
}
|
|
666
|
-
for(let i = tickValues.length - 1; i >= 0; i--){
|
|
667
|
-
const tickPosition = xAxisScale(tickValues[i]);
|
|
668
|
-
if (sign * (tickPosition - sign * tickSizes[i] / 2 - start) >= 0 && sign * (tickPosition + sign * tickSizes[i] / 2 - end) <= 0) {
|
|
669
|
-
nonOverlappingTickValues.push(tickValues[i]);
|
|
670
|
-
end = tickPosition - sign * (tickSizes[i] / 2 + 10);
|
|
671
|
-
}
|
|
672
|
-
}
|
|
673
|
-
nonOverlappingTickValues = nonOverlappingTickValues.reverse();
|
|
674
|
-
tickValues = nonOverlappingTickValues;
|
|
675
|
-
}
|
|
676
|
-
const xAxis = (0, _d3axis.axisBottom)(xAxisScale).tickSize(xAxistickSize).tickPadding(tickPadding).tickValues(tickValues).tickFormat(tickFormat);
|
|
677
|
-
if (xAxisParams.xAxisElement) {
|
|
678
|
-
(0, _d3selection.select)(xAxisParams.xAxisElement).call(xAxis).selectAll('text').attr('aria-hidden', 'true').style('direction', 'ltr').style('unicode-bidi', 'isolate');
|
|
679
|
-
}
|
|
680
|
-
return {
|
|
681
|
-
xScale: xAxisScale,
|
|
682
|
-
tickValues,
|
|
683
|
-
tickLabels: tickValues.map(xAxis.tickFormat())
|
|
684
|
-
};
|
|
685
|
-
}
|
|
686
|
-
function useRtl() {
|
|
687
|
-
const { dir } = (0, _reactsharedcontexts.useFluent_unstable)(); // "dir" returns "ltr" or "rtl"
|
|
688
|
-
return dir === 'rtl';
|
|
689
|
-
}
|
|
690
|
-
function isPowerOf10(num) {
|
|
691
|
-
const roundedfinalYMax = handleFloatingPointPrecisionError(num);
|
|
692
|
-
return Math.log10(roundedfinalYMax) % 1 === 0;
|
|
693
|
-
}
|
|
694
|
-
//for reference, go through this 'https://docs.python.org/release/2.5.1/tut/node16.html'
|
|
695
|
-
function handleFloatingPointPrecisionError(num) {
|
|
696
|
-
const rounded = Math.round(num);
|
|
697
|
-
return Math.abs(num - rounded) < 1e-6 ? rounded : num;
|
|
698
|
-
}
|
|
699
|
-
/**
|
|
700
|
-
* This method is used to calculate the rounded tick values for the y-axis
|
|
701
|
-
* @param {number} minVal
|
|
702
|
-
* @param {number} maxVal
|
|
703
|
-
* @param {number} splitInto
|
|
704
|
-
* @returns {number[]}
|
|
705
|
-
*/ function calculateRoundedTicks(minVal, maxVal, splitInto) {
|
|
706
|
-
const finalYmin = minVal >= 0 && minVal === maxVal ? 0 : minVal;
|
|
707
|
-
const finalYmax = minVal < 0 && minVal === maxVal ? 0 : maxVal;
|
|
708
|
-
const ticksInterval = (0, _d3array.nice)(finalYmin, finalYmax, splitInto);
|
|
709
|
-
const ticks = (0, _d3array.ticks)(ticksInterval[0], ticksInterval[ticksInterval.length - 1], splitInto);
|
|
710
|
-
if (ticks[ticks.length - 1] > finalYmax && isPowerOf10(finalYmax)) {
|
|
711
|
-
ticks.pop();
|
|
712
|
-
}
|
|
713
|
-
return ticks;
|
|
714
|
-
}
|
|
715
|
-
function prepareDatapoints(maxVal, minVal, splitInto, isIntegralDataset, roundedTicks) {
|
|
716
|
-
if (roundedTicks) {
|
|
717
|
-
return calculateRoundedTicks(minVal, maxVal, splitInto);
|
|
718
|
-
}
|
|
719
|
-
const val = isIntegralDataset ? Math.ceil((maxVal - minVal) / splitInto) : (maxVal - minVal) / splitInto >= 1 ? Math.ceil((maxVal - minVal) / splitInto) : (maxVal - minVal) / splitInto;
|
|
720
|
-
/*
|
|
721
|
-
For cases where we have negative and positive values
|
|
722
|
-
The dataPointsArray is filled from 0 to minVal by val difference
|
|
723
|
-
Then the array is reversed and values from 0(excluding 0) to maxVal are appended
|
|
724
|
-
This ensures presence of 0 to act as an anchor reference.
|
|
725
|
-
For simple cases where the scale may not encounter such a need for 0,
|
|
726
|
-
We simply fill from minVal to maxVal
|
|
727
|
-
*/ const dataPointsArray = [
|
|
728
|
-
minVal < 0 && maxVal >= 0 ? 0 : minVal
|
|
729
|
-
];
|
|
730
|
-
/*For the case of all positive or all negative, we need to add another value
|
|
731
|
-
in array for atleast one interval, but in case of mix of positive and negative,
|
|
732
|
-
there will always be one more entry that will be added by the logic we have*/ if (dataPointsArray[0] === minVal) {
|
|
733
|
-
dataPointsArray.push(minVal + val);
|
|
734
|
-
}
|
|
735
|
-
if (minVal < 0 && maxVal >= 0) {
|
|
736
|
-
while(dataPointsArray[dataPointsArray.length - 1] > minVal){
|
|
737
|
-
dataPointsArray.push(dataPointsArray[dataPointsArray.length - 1] - val);
|
|
738
|
-
}
|
|
739
|
-
dataPointsArray.reverse();
|
|
740
|
-
}
|
|
741
|
-
while(dataPointsArray[dataPointsArray.length - 1] < maxVal){
|
|
742
|
-
dataPointsArray.push(dataPointsArray[dataPointsArray.length - 1] + val);
|
|
743
|
-
}
|
|
744
|
-
return dataPointsArray;
|
|
745
|
-
}
|
|
746
|
-
function createYAxisForHorizontalBarChartWithAxis(yAxisParams, isRtl, axisData) {
|
|
747
|
-
const { yMinMaxValues = {
|
|
748
|
-
startValue: 0,
|
|
749
|
-
endValue: 0
|
|
750
|
-
}, yAxisElement = null, yMaxValue = 0, yMinValue = 0, containerHeight, margins, tickPadding = 12, maxOfYVal = 0, yAxisTickFormat, yAxisTickCount = 4, tickValues, tickStep, tick0, tickText } = yAxisParams;
|
|
751
|
-
// maxOfYVal coming from horizontal bar chart with axis (Calculation done at base file)
|
|
752
|
-
const tempVal = maxOfYVal || yMinMaxValues.endValue;
|
|
753
|
-
const finalYmax = tempVal > yMaxValue ? tempVal : yMaxValue;
|
|
754
|
-
const finalYmin = yMinMaxValues.startValue < yMinValue ? Math.min(0, yMinMaxValues.startValue) : yMinValue;
|
|
755
|
-
const yAxisScale = (0, _d3scale.scaleLinear)().domain([
|
|
756
|
-
finalYmin,
|
|
757
|
-
finalYmax
|
|
758
|
-
]).range([
|
|
759
|
-
containerHeight - margins.bottom,
|
|
760
|
-
margins.top
|
|
761
|
-
]);
|
|
762
|
-
const axis = isRtl ? (0, _d3axis.axisRight)(yAxisScale) : (0, _d3axis.axisLeft)(yAxisScale);
|
|
763
|
-
const yAxis = axis.tickPadding(tickPadding).ticks(yAxisTickCount);
|
|
764
|
-
const tickFormat = (domainValue, index)=>{
|
|
765
|
-
if (tickValues && tickText && typeof tickText[index] !== 'undefined') {
|
|
766
|
-
return tickText[index];
|
|
767
|
-
}
|
|
768
|
-
if (typeof yAxisTickFormat === 'function') {
|
|
769
|
-
return yAxisTickFormat(domainValue, index);
|
|
770
|
-
}
|
|
771
|
-
if (typeof yAxisTickFormat === 'string') {
|
|
772
|
-
return (0, _d3format.format)(yAxisTickFormat)(domainValue);
|
|
773
|
-
}
|
|
774
|
-
const value = typeof domainValue === 'number' ? domainValue : domainValue.valueOf();
|
|
775
|
-
return defaultYAxisTickFormatter(value);
|
|
776
|
-
};
|
|
777
|
-
yAxis.tickFormat(tickFormat);
|
|
778
|
-
let customTickValues;
|
|
779
|
-
if (tickValues) {
|
|
780
|
-
customTickValues = tickValues;
|
|
781
|
-
} else if (tickStep) {
|
|
782
|
-
customTickValues = generateNumericTicks(undefined, tickStep, tick0, yAxisScale.domain());
|
|
783
|
-
}
|
|
784
|
-
if (customTickValues) {
|
|
785
|
-
yAxis.tickValues(customTickValues);
|
|
786
|
-
}
|
|
787
|
-
yAxisElement ? (0, _d3selection.select)(yAxisElement).call(yAxis).selectAll('text').attr('aria-hidden', 'true') : '';
|
|
788
|
-
axisData.yAxisDomainValues = yAxisScale.domain();
|
|
789
|
-
var _yAxis_tickValues;
|
|
790
|
-
axisData.yAxisTickText = ((_yAxis_tickValues = yAxis.tickValues()) !== null && _yAxis_tickValues !== void 0 ? _yAxis_tickValues : yAxisScale.ticks(yAxisTickCount)).map(yAxis.tickFormat());
|
|
791
|
-
return yAxisScale;
|
|
792
|
-
}
|
|
793
|
-
function createNumericYAxis(yAxisParams, isRtl, axisData, isIntegralDataset, chartType, useSecondaryYScale = false, roundedTicks = false, scaleType, _useRtl) {
|
|
794
|
-
const { yMinMaxValues = {
|
|
795
|
-
startValue: 0,
|
|
796
|
-
endValue: 0
|
|
797
|
-
}, yAxisElement = null, yMaxValue = 0, yMinValue = 0, containerHeight, containerWidth, margins, tickPadding = 12, maxOfYVal = 0, yAxisTickFormat, yAxisTickCount = 4, eventAnnotationProps, eventLabelHeight, tickValues, tickStep, tick0, tickText } = yAxisParams;
|
|
798
|
-
// maxOfYVal coming from only area chart and Grouped vertical bar chart(Calculation done at base file)
|
|
799
|
-
const tempVal = maxOfYVal || yMinMaxValues.endValue || 0;
|
|
800
|
-
const finalYmax = tempVal > yMaxValue ? tempVal : yMaxValue;
|
|
801
|
-
const finalYmin = Math.min(yMinMaxValues.startValue || 0, yMinValue || 0);
|
|
802
|
-
const domainValues = prepareDatapoints(finalYmax, finalYmin, yAxisTickCount, isIntegralDataset, roundedTicks);
|
|
803
|
-
let yMin = finalYmin;
|
|
804
|
-
let yMax = domainValues[domainValues.length - 1];
|
|
805
|
-
if (chartType === 7) {
|
|
806
|
-
const yPadding = (yMax - yMin) * 0.1;
|
|
807
|
-
yMin = yMin - yPadding;
|
|
808
|
-
yMax = yMax + yPadding;
|
|
809
|
-
}
|
|
810
|
-
let scaleDomain = [
|
|
811
|
-
domainValues[0],
|
|
812
|
-
domainValues[domainValues.length - 1]
|
|
813
|
-
];
|
|
814
|
-
if (scaleType === 'log') {
|
|
815
|
-
let domainStart = yMinMaxValues.startValue;
|
|
816
|
-
let domainEnd = yMinMaxValues.endValue;
|
|
817
|
-
if (yMinValue > 0) {
|
|
818
|
-
domainStart = Math.min(domainStart, yMinValue);
|
|
819
|
-
}
|
|
820
|
-
if (yMaxValue > 0) {
|
|
821
|
-
domainEnd = Math.max(domainEnd, yMaxValue);
|
|
822
|
-
}
|
|
823
|
-
scaleDomain = [
|
|
824
|
-
domainStart,
|
|
825
|
-
domainEnd
|
|
826
|
-
];
|
|
827
|
-
}
|
|
828
|
-
const yAxisScale = createNumericScale(scaleType).domain(scaleDomain).range([
|
|
829
|
-
containerHeight - margins.bottom,
|
|
830
|
-
margins.top + (eventAnnotationProps ? eventLabelHeight : 0)
|
|
831
|
-
]);
|
|
832
|
-
const axis = !isRtl && useSecondaryYScale || isRtl && !useSecondaryYScale ? (0, _d3axis.axisRight)(yAxisScale) : (0, _d3axis.axisLeft)(yAxisScale);
|
|
833
|
-
const yAxis = axis.tickPadding(tickPadding).tickSizeInner(-(containerWidth - margins.left - margins.right));
|
|
834
|
-
let customTickValues;
|
|
835
|
-
if (tickValues) {
|
|
836
|
-
customTickValues = tickValues;
|
|
837
|
-
} else if (tickStep) {
|
|
838
|
-
customTickValues = generateNumericTicks(scaleType, tickStep, tick0, yAxisScale.domain());
|
|
839
|
-
}
|
|
840
|
-
if (customTickValues) {
|
|
841
|
-
yAxis.tickValues(customTickValues);
|
|
842
|
-
axisData.yAxisDomainValues = customTickValues;
|
|
843
|
-
} else if (scaleType !== 'log') {
|
|
844
|
-
yAxis.tickValues(domainValues);
|
|
845
|
-
}
|
|
846
|
-
const tickFormat = (domainValue, index, defaultFormat)=>{
|
|
847
|
-
if (tickValues && tickText && typeof tickText[index] !== 'undefined') {
|
|
848
|
-
return tickText[index];
|
|
849
|
-
}
|
|
850
|
-
if (typeof yAxisTickFormat === 'function') {
|
|
851
|
-
return yAxisTickFormat(domainValue, index);
|
|
852
|
-
}
|
|
853
|
-
if (typeof yAxisTickFormat === 'string') {
|
|
854
|
-
return (0, _d3format.format)(yAxisTickFormat)(domainValue);
|
|
855
|
-
}
|
|
856
|
-
const value = typeof domainValue === 'number' ? domainValue : domainValue.valueOf();
|
|
857
|
-
return (defaultFormat === null || defaultFormat === void 0 ? void 0 : defaultFormat(value)) === '' ? '' : defaultYAxisTickFormatter(value);
|
|
858
|
-
};
|
|
859
|
-
yAxis.tickFormat((v, i)=>tickFormat(v, i, yAxisScale.tickFormat(yAxisTickCount)));
|
|
860
|
-
yAxisElement ? (0, _d3selection.select)(yAxisElement).call(yAxis).selectAll('text').attr('aria-hidden', 'true').style('direction', 'ltr').style('unicode-bidi', 'isolate').style('text-anchor', !useSecondaryYScale && (_useRtl ? 'start' : 'end')) : '';
|
|
861
|
-
axisData.yAxisDomainValues = yAxisScale.domain();
|
|
862
|
-
var _yAxis_tickValues;
|
|
863
|
-
axisData.yAxisTickText = ((_yAxis_tickValues = yAxis.tickValues()) !== null && _yAxis_tickValues !== void 0 ? _yAxis_tickValues : yAxisScale.ticks(yAxisTickCount)).map(yAxis.tickFormat());
|
|
864
|
-
return yAxisScale;
|
|
865
|
-
}
|
|
866
|
-
const createStringYAxisForHorizontalBarChartWithAxis = (yAxisParams, dataPoints, isRtl, axisData, barWidth)=>{
|
|
867
|
-
const { containerHeight, tickPadding = 12, margins, yAxisTickFormat, yAxisElement, yAxisPadding, tickValues, tickText } = yAxisParams;
|
|
868
|
-
let yAxisPaddingValue = yAxisPadding !== null && yAxisPadding !== void 0 ? yAxisPadding : 0.5;
|
|
869
|
-
yAxisPaddingValue = yAxisPaddingValue === 1 ? 0.99 : yAxisPaddingValue;
|
|
870
|
-
const yAxisScale = (0, _d3scale.scaleBand)().domain(dataPoints).range([
|
|
871
|
-
containerHeight - margins.bottom,
|
|
872
|
-
margins.top
|
|
873
|
-
]).padding(yAxisPaddingValue);
|
|
874
|
-
const axis = isRtl ? (0, _d3axis.axisRight)(yAxisScale) : (0, _d3axis.axisLeft)(yAxisScale);
|
|
875
|
-
const customTickValues = tickValues !== null && tickValues !== void 0 ? tickValues : dataPoints;
|
|
876
|
-
const tickFormat = (domainValue, _index)=>{
|
|
877
|
-
if (tickValues && tickText && typeof tickText[_index] !== 'undefined') {
|
|
878
|
-
return tickText[_index];
|
|
879
|
-
}
|
|
880
|
-
if (typeof yAxisTickFormat === 'function') {
|
|
881
|
-
return yAxisTickFormat(domainValue, _index);
|
|
882
|
-
}
|
|
883
|
-
return domainValue;
|
|
884
|
-
};
|
|
885
|
-
const yAxis = axis.tickPadding(tickPadding).tickValues(customTickValues).tickFormat(tickFormat);
|
|
886
|
-
yAxisElement ? (0, _d3selection.select)(yAxisElement).call(yAxis).selectAll('text') : '';
|
|
887
|
-
axisData.yAxisTickText = yAxis.tickValues().map(yAxis.tickFormat());
|
|
888
|
-
return yAxisScale;
|
|
889
|
-
};
|
|
890
|
-
const createStringYAxis = (yAxisParams, dataPoints, isRtl, axisData, barWidth, chartType)=>{
|
|
891
|
-
const { containerHeight, tickPadding = 12, margins, yAxisTickFormat, yAxisElement, yAxisPadding = 0, containerWidth, tickValues, tickText } = yAxisParams;
|
|
892
|
-
const yAxisScale = (0, _d3scale.scaleBand)().domain(dataPoints).range([
|
|
893
|
-
containerHeight - margins.bottom,
|
|
894
|
-
margins.top
|
|
895
|
-
]).padding(yAxisPadding);
|
|
896
|
-
if (chartType === 3) {
|
|
897
|
-
yAxisScale.paddingInner(1).paddingOuter(0);
|
|
898
|
-
}
|
|
899
|
-
const axis = isRtl ? (0, _d3axis.axisRight)(yAxisScale) : (0, _d3axis.axisLeft)(yAxisScale);
|
|
900
|
-
const customTickValues = tickValues !== null && tickValues !== void 0 ? tickValues : dataPoints;
|
|
901
|
-
const tickFormat = (domainValue, _index)=>{
|
|
902
|
-
if (tickValues && tickText && typeof tickText[_index] !== 'undefined') {
|
|
903
|
-
return tickText[_index];
|
|
904
|
-
}
|
|
905
|
-
if (typeof yAxisTickFormat === 'function') {
|
|
906
|
-
return yAxisTickFormat(domainValue, _index);
|
|
907
|
-
}
|
|
908
|
-
return domainValue;
|
|
909
|
-
};
|
|
910
|
-
const yAxis = axis.tickPadding(tickPadding).tickValues(customTickValues).tickFormat(tickFormat).tickSize(0);
|
|
911
|
-
if (chartType === 3) {
|
|
912
|
-
axis.tickSizeInner(-(containerWidth - margins.left - margins.right));
|
|
913
|
-
}
|
|
914
|
-
yAxisElement ? (0, _d3selection.select)(yAxisElement).call(yAxis).selectAll('text') : '';
|
|
915
|
-
axisData.yAxisTickText = yAxis.tickValues().map(yAxis.tickFormat());
|
|
916
|
-
return yAxisScale;
|
|
917
|
-
};
|
|
918
|
-
function calloutData(values) {
|
|
919
|
-
let combinedResult = [];
|
|
920
|
-
values.forEach((line)=>{
|
|
921
|
-
const elements = line.data.filter((point)=>!point.hideCallout).map((point)=>{
|
|
922
|
-
return {
|
|
923
|
-
...point,
|
|
924
|
-
legend: line.legend,
|
|
925
|
-
color: line.color,
|
|
926
|
-
index: line.index
|
|
927
|
-
};
|
|
928
|
-
});
|
|
929
|
-
combinedResult = combinedResult.concat(elements);
|
|
930
|
-
});
|
|
931
|
-
const xValToDataPoints = {};
|
|
932
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
933
|
-
combinedResult.forEach((ele)=>{
|
|
934
|
-
const xValue = ele.x instanceof Date ? ele.x.getTime() : ele.x;
|
|
935
|
-
const newPoint = {
|
|
936
|
-
legend: ele.legend,
|
|
937
|
-
y: ele.y,
|
|
938
|
-
color: ele.color,
|
|
939
|
-
xAxisCalloutData: ele.xAxisCalloutData,
|
|
940
|
-
yAxisCalloutData: ele.yAxisCalloutData,
|
|
941
|
-
callOutAccessibilityData: ele.callOutAccessibilityData,
|
|
942
|
-
index: ele.index
|
|
943
|
-
};
|
|
944
|
-
if (xValue in xValToDataPoints) {
|
|
945
|
-
// Check if a point with the same legend and y-value already exists
|
|
946
|
-
const existingPoint = xValToDataPoints[xValue].find((p)=>p.legend === newPoint.legend && p.y === newPoint.y);
|
|
947
|
-
if (!existingPoint) {
|
|
948
|
-
xValToDataPoints[xValue].push(newPoint);
|
|
949
|
-
}
|
|
950
|
-
} else {
|
|
951
|
-
xValToDataPoints[xValue] = [
|
|
952
|
-
newPoint
|
|
953
|
-
];
|
|
954
|
-
}
|
|
955
|
-
});
|
|
956
|
-
return xValToDataPoints;
|
|
957
|
-
}
|
|
958
|
-
function getUnique(arr, comp) {
|
|
959
|
-
const unique = arr // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
960
|
-
.map((e)=>e[comp]) // store the keys of the unique objects
|
|
961
|
-
.map((e, i, final)=>final.indexOf(e) === i && i) // eliminate the dead keys & store unique objects
|
|
962
|
-
.filter((e)=>arr[e]).map((e)=>arr[e]);
|
|
963
|
-
return unique;
|
|
964
|
-
}
|
|
965
|
-
function silceOrAppendToArray(array, value) {
|
|
966
|
-
const pos = array.indexOf(value);
|
|
967
|
-
if (pos === -1) {
|
|
968
|
-
return [
|
|
969
|
-
...array,
|
|
970
|
-
value
|
|
971
|
-
];
|
|
972
|
-
} else {
|
|
973
|
-
return array.slice(0, pos).concat(array.slice(pos + 1));
|
|
974
|
-
}
|
|
975
|
-
}
|
|
976
|
-
const DEFAULT_WRAP_WIDTH = 10;
|
|
977
|
-
function createWrapOfXLabels(wrapLabelProps) {
|
|
978
|
-
const { node, xAxis, noOfCharsToTruncate, showXAxisLablesTooltip, width = DEFAULT_WRAP_WIDTH, container } = wrapLabelProps;
|
|
979
|
-
if (node === null) {
|
|
980
|
-
return;
|
|
981
|
-
}
|
|
982
|
-
const axisNode = (0, _d3selection.select)(node).call(xAxis);
|
|
983
|
-
let removeVal = 0;
|
|
984
|
-
let maxLines = 1;
|
|
985
|
-
axisNode.selectAll('.tick text').each(function(_, tickIndex) {
|
|
986
|
-
const text = (0, _d3selection.select)(this);
|
|
987
|
-
const totalWord = text.text();
|
|
988
|
-
const truncatedWord = `${text.text().slice(0, noOfCharsToTruncate)}...`;
|
|
989
|
-
const totalWordLength = text.text().length;
|
|
990
|
-
const words = text.text().split(/\s+/).reverse();
|
|
991
|
-
let word = '';
|
|
992
|
-
let line = [];
|
|
993
|
-
let lineNumber = 0;
|
|
994
|
-
const lineHeight = 1.1; // ems
|
|
995
|
-
const y = text.attr('y');
|
|
996
|
-
const dy = parseFloat(text.attr('dy'));
|
|
997
|
-
let tspan = text.text(null).attr('data-full', totalWord).append('tspan').attr('x', 0).attr('y', y).attr('dy', dy + 'em');
|
|
998
|
-
if (showXAxisLablesTooltip) {
|
|
999
|
-
tspan.text(totalWordLength > noOfCharsToTruncate ? truncatedWord : totalWord);
|
|
1000
|
-
} else {
|
|
1001
|
-
const maxWidth = Array.isArray(width) ? width[tickIndex] : width;
|
|
1002
|
-
while(word = words.pop()){
|
|
1003
|
-
line.push(word);
|
|
1004
|
-
const label = line.join(' ');
|
|
1005
|
-
tspan.text(label);
|
|
1006
|
-
const labelWidth = getTextSize(label, CARTESIAN_XAXIS_TEXT_SELECTOR, container).width;
|
|
1007
|
-
if (labelWidth > maxWidth && line.length > 1) {
|
|
1008
|
-
line.pop();
|
|
1009
|
-
tspan.text(line.join(' '));
|
|
1010
|
-
line = [
|
|
1011
|
-
word
|
|
1012
|
-
];
|
|
1013
|
-
tspan = text.append('tspan').attr('x', 0).attr('y', y).attr('dy', ++lineNumber * lineHeight + dy + 'em').text(word);
|
|
1014
|
-
}
|
|
1015
|
-
}
|
|
1016
|
-
}
|
|
1017
|
-
maxLines = Math.max(maxLines, lineNumber + 1);
|
|
1018
|
-
});
|
|
1019
|
-
if (!showXAxisLablesTooltip) {
|
|
1020
|
-
var _querySelector;
|
|
1021
|
-
let maxHeight = 12; // intial value to render corretly first time
|
|
1022
|
-
var _querySelector_getBoundingClientRect_height;
|
|
1023
|
-
const boxHeight = (_querySelector_getBoundingClientRect_height = (_querySelector = (container !== null && container !== void 0 ? container : document).querySelector(`.${CARTESIAN_XAXIS_CLASSNAME} tspan`)) === null || _querySelector === void 0 ? void 0 : _querySelector.getBoundingClientRect().height) !== null && _querySelector_getBoundingClientRect_height !== void 0 ? _querySelector_getBoundingClientRect_height : 0;
|
|
1024
|
-
if (boxHeight > maxHeight) {
|
|
1025
|
-
maxHeight = boxHeight;
|
|
1026
|
-
}
|
|
1027
|
-
removeVal = (maxLines - 1) * maxHeight;
|
|
1028
|
-
}
|
|
1029
|
-
return removeVal > 0 ? removeVal : 0;
|
|
1030
|
-
}
|
|
1031
|
-
function createYAxisLabels(node, yAxis, noOfCharsToTruncate, truncateLabel, isRtl) {
|
|
1032
|
-
if (node === null) {
|
|
1033
|
-
return;
|
|
1034
|
-
}
|
|
1035
|
-
const axisNode = (0, _d3selection.select)(node).call(yAxis);
|
|
1036
|
-
axisNode.selectAll('.tick text').each(function() {
|
|
1037
|
-
const text = (0, _d3selection.select)(this);
|
|
1038
|
-
const totalWord = text.text();
|
|
1039
|
-
const truncatedWord = isRtl ? `...${text.text().slice(0, noOfCharsToTruncate)}` : `${text.text().slice(0, noOfCharsToTruncate)}...`;
|
|
1040
|
-
const totalWordLength = text.text().length;
|
|
1041
|
-
const y = text.attr('y');
|
|
1042
|
-
const x = text.attr('x');
|
|
1043
|
-
const dy = parseFloat(text.attr('dy'));
|
|
1044
|
-
const tspan = text.text(null).attr('data-full', totalWord).append('tspan').attr('x', x).attr('y', y).attr('dy', dy + 'em');
|
|
1045
|
-
if (truncateLabel) {
|
|
1046
|
-
tspan.text(totalWordLength > noOfCharsToTruncate ? truncatedWord : totalWord);
|
|
1047
|
-
}
|
|
1048
|
-
});
|
|
1049
|
-
}
|
|
1050
|
-
const wrapContent = (content, id, maxWidth)=>{
|
|
1051
|
-
const textElement = (0, _d3selection.select)(`#${id}`);
|
|
1052
|
-
textElement.text(content);
|
|
1053
|
-
if (!textElement.node()) {
|
|
1054
|
-
return false;
|
|
1055
|
-
}
|
|
1056
|
-
let isOverflowing = false;
|
|
1057
|
-
let textLength = textElement.node().getComputedTextLength();
|
|
1058
|
-
while(textLength > maxWidth && content.length > 0){
|
|
1059
|
-
content = content.slice(0, -1);
|
|
1060
|
-
textElement.text(content + '...');
|
|
1061
|
-
isOverflowing = true;
|
|
1062
|
-
textLength = textElement.node().getComputedTextLength();
|
|
1063
|
-
}
|
|
1064
|
-
return isOverflowing;
|
|
1065
|
-
};
|
|
1066
|
-
const calculateLongestLabelWidth = (labels, query = 'none')=>{
|
|
1067
|
-
let maxLabelWidth = 0;
|
|
1068
|
-
const canvas = document.createElement('canvas');
|
|
1069
|
-
const ctx = canvas.getContext('2d');
|
|
1070
|
-
if (ctx) {
|
|
1071
|
-
const axisText = document.querySelector(query);
|
|
1072
|
-
if (axisText) {
|
|
1073
|
-
const styles = window.getComputedStyle(axisText, null);
|
|
1074
|
-
const fontWeight = styles.getPropertyValue('font-weight');
|
|
1075
|
-
const fontSize = styles.getPropertyValue('font-size');
|
|
1076
|
-
const fontFamily = styles.getPropertyValue('font-family');
|
|
1077
|
-
ctx.font = `${fontWeight} ${fontSize} ${fontFamily}`;
|
|
1078
|
-
} else {
|
|
1079
|
-
ctx.font = '600 10px "Segoe UI"';
|
|
1080
|
-
}
|
|
1081
|
-
labels.forEach((label)=>{
|
|
1082
|
-
maxLabelWidth = Math.max(ctx.measureText(label.toString()).width, maxLabelWidth);
|
|
1083
|
-
});
|
|
1084
|
-
}
|
|
1085
|
-
return maxLabelWidth;
|
|
1086
|
-
};
|
|
1087
|
-
function tooltipOfAxislabels(axistooltipProps) {
|
|
1088
|
-
const { tooltipCls, axis, id, container } = axistooltipProps;
|
|
1089
|
-
if (axis === null) {
|
|
1090
|
-
return null;
|
|
1091
|
-
}
|
|
1092
|
-
const div = (container ? (0, _d3selection.select)(container) : (0, _d3selection.select)('body')).append('div').attr('id', id).attr('class', tooltipCls).style('opacity', 0);
|
|
1093
|
-
axis.selectAll('.tick text').each(function() {
|
|
1094
|
-
const tickSelection = (0, _d3selection.select)(this);
|
|
1095
|
-
const fullLabel = tickSelection.attr('data-full');
|
|
1096
|
-
if (tickSelection.text() === fullLabel) {
|
|
1097
|
-
return;
|
|
1098
|
-
}
|
|
1099
|
-
const tickEl = this;
|
|
1100
|
-
tickSelection // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1101
|
-
.on('mouseover', (event, d)=>{
|
|
1102
|
-
const containerBounds = container === null || container === void 0 ? void 0 : container.getBoundingClientRect();
|
|
1103
|
-
const tickBounds = tickEl.getBoundingClientRect();
|
|
1104
|
-
const tooltipBottom = containerBounds ? containerBounds.bottom - (tickBounds.top - 4) : tickBounds.top - 4;
|
|
1105
|
-
var _containerBounds_left;
|
|
1106
|
-
const tooltipLeft = (tickBounds.left + tickBounds.right) / 2 - ((_containerBounds_left = containerBounds === null || containerBounds === void 0 ? void 0 : containerBounds.left) !== null && _containerBounds_left !== void 0 ? _containerBounds_left : 0);
|
|
1107
|
-
div.text(fullLabel).style('bottom', `${tooltipBottom}px`).style('left', `${tooltipLeft}px`).style('transform', 'translateX(-50%)').style('opacity', 0.9);
|
|
1108
|
-
}).on('mouseout', (d)=>{
|
|
1109
|
-
div.style('opacity', 0);
|
|
1110
|
-
});
|
|
1111
|
-
});
|
|
1112
|
-
}
|
|
1113
|
-
function getXAxisType(points) {
|
|
1114
|
-
let isXAxisDateType = false;
|
|
1115
|
-
if (points && points.length > 0) {
|
|
1116
|
-
points.forEach((chartData)=>{
|
|
1117
|
-
if (chartData.data.length > 0) {
|
|
1118
|
-
isXAxisDateType = chartData.data[0].x instanceof Date;
|
|
1119
|
-
return;
|
|
1120
|
-
}
|
|
1121
|
-
});
|
|
1122
|
-
}
|
|
1123
|
-
return isXAxisDateType;
|
|
1124
|
-
}
|
|
1125
|
-
function domainRangeOfNumericForAreaLineScatterCharts(points, margins, width, isRTL, scaleType, hasMarkersMode, xMinVal, xMaxVal) {
|
|
1126
|
-
const isScatterPolar = isScatterPolarSeries(points);
|
|
1127
|
-
let [xMin, xMax] = getScatterXDomainExtent(points, scaleType);
|
|
1128
|
-
if (hasMarkersMode) {
|
|
1129
|
-
const xPadding = getDomainPaddingForMarkers(xMin, xMax, scaleType, xMinVal, xMaxVal);
|
|
1130
|
-
xMin = xMin - xPadding.start;
|
|
1131
|
-
xMax = xMax + xPadding.end;
|
|
1132
|
-
}
|
|
1133
|
-
const rStartValue = margins.left;
|
|
1134
|
-
const rEndValue = width - margins.right;
|
|
1135
|
-
return isRTL ? {
|
|
1136
|
-
dStartValue: isScatterPolar ? 1 : xMax,
|
|
1137
|
-
dEndValue: isScatterPolar ? -1 : xMin,
|
|
1138
|
-
rStartValue,
|
|
1139
|
-
rEndValue
|
|
1140
|
-
} : {
|
|
1141
|
-
dStartValue: isScatterPolar ? -1 : xMin,
|
|
1142
|
-
dEndValue: isScatterPolar ? 1 : xMax,
|
|
1143
|
-
rStartValue,
|
|
1144
|
-
rEndValue
|
|
1145
|
-
};
|
|
1146
|
-
}
|
|
1147
|
-
function groupChartDataByYValue(chartData) {
|
|
1148
|
-
const map = {};
|
|
1149
|
-
chartData.forEach((dataPoint)=>{
|
|
1150
|
-
const key = dataPoint.y;
|
|
1151
|
-
if (!map[key]) {
|
|
1152
|
-
map[key] = [];
|
|
1153
|
-
}
|
|
1154
|
-
map[key].push(dataPoint);
|
|
1155
|
-
});
|
|
1156
|
-
return Object.values(map);
|
|
1157
|
-
}
|
|
1158
|
-
function computeLongestBars(stackedChartData, X_ORIGIN) {
|
|
1159
|
-
let longestPositiveBar = 0;
|
|
1160
|
-
let longestNegativeBar = 0;
|
|
1161
|
-
stackedChartData.forEach((group)=>{
|
|
1162
|
-
const positiveBarTotal = group.reduce((acc, point)=>acc + (point.x > 0 ? point.x : 0), X_ORIGIN);
|
|
1163
|
-
const negativeBarTotal = group.reduce((acc, point)=>acc + (point.x < 0 ? point.x : 0), X_ORIGIN);
|
|
1164
|
-
longestPositiveBar = Math.max(longestPositiveBar, positiveBarTotal);
|
|
1165
|
-
longestNegativeBar = Math.min(longestNegativeBar, negativeBarTotal);
|
|
1166
|
-
});
|
|
1167
|
-
return {
|
|
1168
|
-
longestPositiveBar,
|
|
1169
|
-
longestNegativeBar
|
|
1170
|
-
};
|
|
1171
|
-
}
|
|
1172
|
-
function domainRangeOfNumericForHorizontalBarChartWithAxis(points, margins, containerWidth, isRTL, X_ORIGIN) {
|
|
1173
|
-
const longestBars = computeLongestBars(groupChartDataByYValue(points), X_ORIGIN);
|
|
1174
|
-
const xMax = longestBars.longestPositiveBar;
|
|
1175
|
-
const xMin = longestBars.longestNegativeBar;
|
|
1176
|
-
const rMin = margins.left;
|
|
1177
|
-
const rMax = containerWidth - margins.right;
|
|
1178
|
-
return isRTL ? {
|
|
1179
|
-
dStartValue: xMax,
|
|
1180
|
-
dEndValue: Math.min(xMin, X_ORIGIN),
|
|
1181
|
-
rStartValue: rMin,
|
|
1182
|
-
rEndValue: rMax
|
|
1183
|
-
} : {
|
|
1184
|
-
dStartValue: Math.min(xMin, X_ORIGIN),
|
|
1185
|
-
dEndValue: xMax,
|
|
1186
|
-
rStartValue: rMin,
|
|
1187
|
-
rEndValue: rMax
|
|
1188
|
-
};
|
|
1189
|
-
}
|
|
1190
|
-
function domainRangeOfXStringAxis(margins, width, isRTL) {
|
|
1191
|
-
const rMin = margins.left;
|
|
1192
|
-
const rMax = width - margins.right;
|
|
1193
|
-
return isRTL ? {
|
|
1194
|
-
dStartValue: 0,
|
|
1195
|
-
dEndValue: 0,
|
|
1196
|
-
rStartValue: rMax,
|
|
1197
|
-
rEndValue: rMin
|
|
1198
|
-
} : {
|
|
1199
|
-
dStartValue: 0,
|
|
1200
|
-
dEndValue: 0,
|
|
1201
|
-
rStartValue: rMin,
|
|
1202
|
-
rEndValue: rMax
|
|
1203
|
-
};
|
|
1204
|
-
}
|
|
1205
|
-
function domainRangeOfVSBCNumeric(points, margins, width, isRTL, barWidth) {
|
|
1206
|
-
const xMin = (0, _d3array.min)(points, (point)=>point.x);
|
|
1207
|
-
const xMax = (0, _d3array.max)(points, (point)=>point.x);
|
|
1208
|
-
const rMax = margins.left;
|
|
1209
|
-
const rMin = width - margins.right;
|
|
1210
|
-
return isRTL ? {
|
|
1211
|
-
dStartValue: xMax,
|
|
1212
|
-
dEndValue: xMin,
|
|
1213
|
-
rStartValue: rMax,
|
|
1214
|
-
rEndValue: rMin
|
|
1215
|
-
} : {
|
|
1216
|
-
dStartValue: xMin,
|
|
1217
|
-
dEndValue: xMax,
|
|
1218
|
-
rStartValue: rMax,
|
|
1219
|
-
rEndValue: rMin
|
|
1220
|
-
};
|
|
1221
|
-
}
|
|
1222
|
-
function domainRangeOfDateForAreaLineScatterVerticalBarCharts(points, margins, width, isRTL, tickValues = [], chartType, barWidth, hasMarkersMode) {
|
|
1223
|
-
let sDate;
|
|
1224
|
-
let lDate;
|
|
1225
|
-
if ([
|
|
1226
|
-
0,
|
|
1227
|
-
1,
|
|
1228
|
-
7
|
|
1229
|
-
].includes(chartType)) {
|
|
1230
|
-
[sDate, lDate] = getScatterXDomainExtent(points);
|
|
1231
|
-
// Need to draw graph with given small and large date
|
|
1232
|
-
// (Which Involves customization of date axis tick values)
|
|
1233
|
-
// That may be Either from given graph data or from prop 'tickValues' date values.
|
|
1234
|
-
// So, Finding smallest and largest dates
|
|
1235
|
-
sDate = (0, _d3array.min)([
|
|
1236
|
-
...tickValues,
|
|
1237
|
-
sDate
|
|
1238
|
-
]);
|
|
1239
|
-
lDate = (0, _d3array.max)([
|
|
1240
|
-
...tickValues,
|
|
1241
|
-
lDate
|
|
1242
|
-
]);
|
|
1243
|
-
if (hasMarkersMode || chartType === 7) {
|
|
1244
|
-
const xPadding = getDomainPaddingForMarkers(sDate.getTime(), lDate.getTime());
|
|
1245
|
-
sDate = new Date(sDate.getTime() - xPadding.start);
|
|
1246
|
-
lDate = new Date(lDate.getTime() + xPadding.end);
|
|
1247
|
-
}
|
|
1248
|
-
} else {
|
|
1249
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1250
|
-
sDate = (0, _d3array.min)(points, (point)=>point.x);
|
|
1251
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1252
|
-
lDate = (0, _d3array.max)(points, (point)=>point.x);
|
|
1253
|
-
}
|
|
1254
|
-
const rStartValue = margins.left;
|
|
1255
|
-
const rEndValue = width - margins.right;
|
|
1256
|
-
return isRTL ? {
|
|
1257
|
-
dStartValue: lDate,
|
|
1258
|
-
dEndValue: sDate,
|
|
1259
|
-
rStartValue,
|
|
1260
|
-
rEndValue
|
|
1261
|
-
} : {
|
|
1262
|
-
dStartValue: sDate,
|
|
1263
|
-
dEndValue: lDate,
|
|
1264
|
-
rStartValue,
|
|
1265
|
-
rEndValue
|
|
1266
|
-
};
|
|
1267
|
-
}
|
|
1268
|
-
function domainRangeOfVerticalNumeric(points, margins, containerWidth, isRTL, barWidth) {
|
|
1269
|
-
const xMax = (0, _d3array.max)(points, (point)=>point.x);
|
|
1270
|
-
const xMin = (0, _d3array.min)(points, (point)=>point.x);
|
|
1271
|
-
const rMin = margins.left;
|
|
1272
|
-
const rMax = containerWidth - margins.right;
|
|
1273
|
-
return isRTL ? {
|
|
1274
|
-
dStartValue: xMax,
|
|
1275
|
-
dEndValue: xMin,
|
|
1276
|
-
rStartValue: rMin,
|
|
1277
|
-
rEndValue: rMax
|
|
1278
|
-
} : {
|
|
1279
|
-
dStartValue: xMin,
|
|
1280
|
-
dEndValue: xMax,
|
|
1281
|
-
rStartValue: rMin,
|
|
1282
|
-
rEndValue: rMax
|
|
1283
|
-
};
|
|
1284
|
-
}
|
|
1285
|
-
function findNumericMinMaxOfY(points, yAxisType, useSecondaryYScale, scaleType) {
|
|
1286
|
-
const values = [];
|
|
1287
|
-
points.forEach((point)=>{
|
|
1288
|
-
if (!useSecondaryYScale === !point.useSecondaryYScale) {
|
|
1289
|
-
point.data.forEach((data)=>{
|
|
1290
|
-
if (isValidDomainValue(data.y, scaleType)) {
|
|
1291
|
-
values.push(data.y);
|
|
1292
|
-
}
|
|
1293
|
-
});
|
|
1294
|
-
}
|
|
1295
|
-
});
|
|
1296
|
-
return {
|
|
1297
|
-
startValue: (0, _d3array.min)(values),
|
|
1298
|
-
endValue: (0, _d3array.max)(values)
|
|
1299
|
-
};
|
|
1300
|
-
}
|
|
1301
|
-
function findVSBCNumericMinMaxOfY(dataset) {
|
|
1302
|
-
const yMax = (0, _d3array.max)(dataset, (point)=>point.y);
|
|
1303
|
-
const yMin = (0, _d3array.min)(dataset, (point)=>point.y);
|
|
1304
|
-
return {
|
|
1305
|
-
startValue: yMin,
|
|
1306
|
-
endValue: yMax
|
|
1307
|
-
};
|
|
1308
|
-
}
|
|
1309
|
-
function findVerticalNumericMinMaxOfY(points, yAxisType, useSecondaryYScale) {
|
|
1310
|
-
const values = [];
|
|
1311
|
-
points.forEach((point)=>{
|
|
1312
|
-
if (!useSecondaryYScale) {
|
|
1313
|
-
values.push(point.y);
|
|
1314
|
-
}
|
|
1315
|
-
if (typeof point.lineData !== 'undefined') {
|
|
1316
|
-
if (!useSecondaryYScale === !point.lineData.useSecondaryYScale) {
|
|
1317
|
-
values.push(point.lineData.y);
|
|
1318
|
-
}
|
|
1319
|
-
}
|
|
1320
|
-
});
|
|
1321
|
-
return {
|
|
1322
|
-
startValue: (0, _d3array.min)(values),
|
|
1323
|
-
endValue: (0, _d3array.max)(values)
|
|
1324
|
-
};
|
|
1325
|
-
}
|
|
1326
|
-
function findHBCWANumericMinMaxOfY(points, yAxisType) {
|
|
1327
|
-
if (yAxisType !== undefined && yAxisType === 0) {
|
|
1328
|
-
const yMax = (0, _d3array.max)(points, (point)=>point.y);
|
|
1329
|
-
const yMin = (0, _d3array.min)(points, (point)=>point.y);
|
|
1330
|
-
return {
|
|
1331
|
-
startValue: yMin,
|
|
1332
|
-
endValue: yMax
|
|
1333
|
-
};
|
|
1334
|
-
}
|
|
1335
|
-
return {
|
|
1336
|
-
startValue: 0,
|
|
1337
|
-
endValue: 0
|
|
1338
|
-
};
|
|
1339
|
-
}
|
|
1340
|
-
const getTypeOfAxis = (p, isXAxis)=>{
|
|
1341
|
-
if (isXAxis) {
|
|
1342
|
-
switch(typeof p){
|
|
1343
|
-
case 'string':
|
|
1344
|
-
return 2;
|
|
1345
|
-
case 'number':
|
|
1346
|
-
return 0;
|
|
1347
|
-
default:
|
|
1348
|
-
return 1;
|
|
1349
|
-
}
|
|
1350
|
-
} else {
|
|
1351
|
-
switch(typeof p){
|
|
1352
|
-
case 'string':
|
|
1353
|
-
return 2;
|
|
1354
|
-
case 'number':
|
|
1355
|
-
return 0;
|
|
1356
|
-
default:
|
|
1357
|
-
return 1;
|
|
1358
|
-
}
|
|
1359
|
-
}
|
|
1360
|
-
};
|
|
1361
|
-
var Points = /*#__PURE__*/ function(Points) {
|
|
1362
|
-
Points[Points["circle"] = 0] = "circle";
|
|
1363
|
-
Points[Points["square"] = 1] = "square";
|
|
1364
|
-
Points[Points["triangle"] = 2] = "triangle";
|
|
1365
|
-
Points[Points["diamond"] = 3] = "diamond";
|
|
1366
|
-
Points[Points["pyramid"] = 4] = "pyramid";
|
|
1367
|
-
Points[Points["hexagon"] = 5] = "hexagon";
|
|
1368
|
-
Points[Points["pentagon"] = 6] = "pentagon";
|
|
1369
|
-
Points[Points["octagon"] = 7] = "octagon";
|
|
1370
|
-
return Points;
|
|
1371
|
-
}({});
|
|
1372
|
-
var CustomPoints = /*#__PURE__*/ function(CustomPoints) {
|
|
1373
|
-
CustomPoints[CustomPoints["dottedLine"] = 0] = "dottedLine";
|
|
1374
|
-
return CustomPoints;
|
|
1375
|
-
}({});
|
|
1376
|
-
const pointTypes = {
|
|
1377
|
-
[0]: {
|
|
1378
|
-
widthRatio: 1
|
|
1379
|
-
},
|
|
1380
|
-
[1]: {
|
|
1381
|
-
widthRatio: 1
|
|
1382
|
-
},
|
|
1383
|
-
[2]: {
|
|
1384
|
-
widthRatio: 1
|
|
1385
|
-
},
|
|
1386
|
-
[3]: {
|
|
1387
|
-
widthRatio: 1
|
|
1388
|
-
},
|
|
1389
|
-
[4]: {
|
|
1390
|
-
widthRatio: 1
|
|
1391
|
-
},
|
|
1392
|
-
[5]: {
|
|
1393
|
-
widthRatio: 2
|
|
1394
|
-
},
|
|
1395
|
-
[6]: {
|
|
1396
|
-
widthRatio: 1.168
|
|
1397
|
-
},
|
|
1398
|
-
[7]: {
|
|
1399
|
-
widthRatio: 2.414
|
|
1400
|
-
}
|
|
1401
|
-
};
|
|
1402
|
-
const getAccessibleDataObject = (accessibleData, role = 'text', isDataFocusable = true)=>{
|
|
1403
|
-
accessibleData = accessibleData !== null && accessibleData !== void 0 ? accessibleData : {};
|
|
1404
|
-
return {
|
|
1405
|
-
role,
|
|
1406
|
-
'data-is-focusable': isDataFocusable,
|
|
1407
|
-
'aria-label': accessibleData.ariaLabel,
|
|
1408
|
-
'aria-labelledby': accessibleData.ariaLabelledBy,
|
|
1409
|
-
'aria-describedby': accessibleData.ariaDescribedBy
|
|
1410
|
-
};
|
|
1411
|
-
};
|
|
1412
|
-
function rotateXAxisLabels(rotateLabelProps) {
|
|
1413
|
-
const { node, xAxis } = rotateLabelProps;
|
|
1414
|
-
if (node === null || xAxis === null) {
|
|
1415
|
-
return;
|
|
1416
|
-
}
|
|
1417
|
-
let maxHeight = 0;
|
|
1418
|
-
const xAxisTranslations = [];
|
|
1419
|
-
(0, _d3selection.select)(node).call(xAxis).selectAll('.tick').each(function() {
|
|
1420
|
-
const translateValue = this.getAttribute('transform');
|
|
1421
|
-
if ((translateValue === null || translateValue === void 0 ? void 0 : translateValue.indexOf('rotate')) === -1) {
|
|
1422
|
-
const translatePair = translateValue.substring(translateValue.indexOf('(') + 1, translateValue.indexOf(')')).split(',');
|
|
1423
|
-
if (translatePair.length === 2) {
|
|
1424
|
-
xAxisTranslations.push(translatePair[0]);
|
|
1425
|
-
this.setAttribute('transform', `translate(${translatePair[0]},0)rotate(-45)`);
|
|
1426
|
-
}
|
|
1427
|
-
}
|
|
1428
|
-
const BoxCordinates = this.getBoundingClientRect();
|
|
1429
|
-
const boxHeight = BoxCordinates && BoxCordinates.height;
|
|
1430
|
-
if (boxHeight > maxHeight) {
|
|
1431
|
-
maxHeight = boxHeight;
|
|
1432
|
-
}
|
|
1433
|
-
});
|
|
1434
|
-
let idx = 0;
|
|
1435
|
-
(0, _d3selection.select)(node).call(xAxis).selectAll('.tick').each(function() {
|
|
1436
|
-
if (xAxisTranslations.length > idx) {
|
|
1437
|
-
this.setAttribute('transform', `translate(${xAxisTranslations[idx]},${maxHeight / 2})rotate(-45)`); // Translate y by max height/2
|
|
1438
|
-
idx += 1;
|
|
1439
|
-
}
|
|
1440
|
-
});
|
|
1441
|
-
return Math.floor(maxHeight / 1.414); // Compute maxHeight/tanInverse(45) to get the vertical height of labels.
|
|
1442
|
-
}
|
|
1443
|
-
function wrapTextInsideDonut(selectorClass, maxWidth) {
|
|
1444
|
-
let idx = 0;
|
|
1445
|
-
(0, _d3selection.selectAll)(`.${selectorClass}`).each(function() {
|
|
1446
|
-
const text = (0, _d3selection.select)(this);
|
|
1447
|
-
const words = text.text().split(/\s+/).reverse();
|
|
1448
|
-
let word = '';
|
|
1449
|
-
let line = [];
|
|
1450
|
-
let lineNumber = 0;
|
|
1451
|
-
const lineHeight = 1.1; // ems
|
|
1452
|
-
const y = text.attr('y');
|
|
1453
|
-
let tspan = text.text(null).append('tspan').attr('id', `WordBreakId-${idx}-${lineNumber}`).attr('x', 0).attr('y', y).attr('dy', lineNumber++ * lineHeight + 'em');
|
|
1454
|
-
while(word = words.pop()){
|
|
1455
|
-
line.push(word);
|
|
1456
|
-
tspan.text(line.join(' ') + ' ');
|
|
1457
|
-
if (tspan.node().getComputedTextLength() > maxWidth && line.length > 1) {
|
|
1458
|
-
line.pop();
|
|
1459
|
-
tspan.text(line.join(' ') + ' ');
|
|
1460
|
-
line = [
|
|
1461
|
-
word
|
|
1462
|
-
];
|
|
1463
|
-
tspan = text.append('tspan').attr('id', `WordBreakId-${idx}-${lineNumber}`).attr('x', 0).attr('y', y).attr('dy', lineNumber++ * lineHeight + 'em').text(word);
|
|
1464
|
-
}
|
|
1465
|
-
}
|
|
1466
|
-
idx += 1;
|
|
1467
|
-
});
|
|
1468
|
-
}
|
|
1469
|
-
function formatScientificLimitWidth(value) {
|
|
1470
|
-
return yAxisTickFormatterInternal(value, true);
|
|
1471
|
-
}
|
|
1472
|
-
const DEFAULT_BAR_WIDTH = 16;
|
|
1473
|
-
const MIN_BAR_WIDTH = 1;
|
|
1474
|
-
const getBarWidth = (barWidthProp, maxBarWidthProp, adjustedValue = DEFAULT_BAR_WIDTH, modeProp)=>{
|
|
1475
|
-
let barWidth;
|
|
1476
|
-
if (barWidthProp === 'auto' || modeProp === 'histogram') {
|
|
1477
|
-
barWidth = adjustedValue;
|
|
1478
|
-
} else if (typeof barWidthProp === 'number') {
|
|
1479
|
-
barWidth = barWidthProp;
|
|
1480
|
-
} else {
|
|
1481
|
-
barWidth = Math.min(adjustedValue, DEFAULT_BAR_WIDTH);
|
|
1482
|
-
}
|
|
1483
|
-
if (typeof maxBarWidthProp === 'number') {
|
|
1484
|
-
barWidth = Math.min(barWidth, maxBarWidthProp);
|
|
1485
|
-
}
|
|
1486
|
-
barWidth = Math.max(barWidth, MIN_BAR_WIDTH);
|
|
1487
|
-
return barWidth;
|
|
1488
|
-
};
|
|
1489
|
-
const getScalePadding = (prop, shorthandProp, defaultValue = 0)=>{
|
|
1490
|
-
let padding = typeof prop === 'number' ? prop : typeof shorthandProp === 'number' ? shorthandProp : defaultValue;
|
|
1491
|
-
padding = Math.max(0, Math.min(padding, 1));
|
|
1492
|
-
return padding;
|
|
1493
|
-
};
|
|
1494
|
-
const isScalePaddingDefined = (prop, shorthandProp)=>{
|
|
1495
|
-
return typeof prop === 'number' || typeof shorthandProp === 'number';
|
|
1496
|
-
};
|
|
1497
|
-
function findIndex(array, cb, fromIndex = 0) {
|
|
1498
|
-
let index = -1;
|
|
1499
|
-
for(let i = fromIndex; array && i < array.length; i++){
|
|
1500
|
-
if (cb(array[i], i)) {
|
|
1501
|
-
index = i;
|
|
1502
|
-
break;
|
|
1503
|
-
}
|
|
1504
|
-
}
|
|
1505
|
-
return index;
|
|
1506
|
-
}
|
|
1507
|
-
function find(array, cb) {
|
|
1508
|
-
const index = findIndex(array, cb);
|
|
1509
|
-
if (index < 0) {
|
|
1510
|
-
return undefined;
|
|
1511
|
-
}
|
|
1512
|
-
return array[index];
|
|
1513
|
-
}
|
|
1514
|
-
const HighContrastSelector = '@media screen and (-ms-high-contrast: active), screen and (forced-colors: active)';
|
|
1515
|
-
const HighContrastSelectorWhite = '@media screen and (-ms-high-contrast: black-on-white), screen and (forced-colors: active) and (prefers-color-scheme: light)';
|
|
1516
|
-
const HighContrastSelectorBlack = '@media screen and (-ms-high-contrast: white-on-black), screen and (forced-colors: active) and (prefers-color-scheme: dark)';
|
|
1517
|
-
const formatDate = (date, useUTC)=>{
|
|
1518
|
-
const timeFormat = useUTC ? _d3timeformat.utcFormat : _d3timeformat.timeFormat;
|
|
1519
|
-
return timeFormat('%-e %b %Y, %H:%M')(date) + (useUTC ? ' GMT' : '');
|
|
1520
|
-
};
|
|
1521
|
-
function areArraysEqual(arr1, arr2) {
|
|
1522
|
-
if (arr1 === arr2 || !arr1 && !arr2) {
|
|
1523
|
-
return true;
|
|
1524
|
-
}
|
|
1525
|
-
if (!arr1 || !arr2 || arr1.length !== arr2.length) {
|
|
1526
|
-
return false;
|
|
1527
|
-
}
|
|
1528
|
-
for(let i = 0; i < arr1.length; i++){
|
|
1529
|
-
if (arr1[i] !== arr2[i]) {
|
|
1530
|
-
return false;
|
|
1531
|
-
}
|
|
1532
|
-
}
|
|
1533
|
-
return true;
|
|
1534
|
-
}
|
|
1535
|
-
const cssVarRegExp = /var\((--[a-zA-Z0-9\-]+)\)/g;
|
|
1536
|
-
function resolveCSSVariables(container, styleRules) {
|
|
1537
|
-
const containerStyles = getComputedStyle(container);
|
|
1538
|
-
return styleRules.replace(cssVarRegExp, (match, group1)=>{
|
|
1539
|
-
return containerStyles.getPropertyValue(group1);
|
|
1540
|
-
});
|
|
1541
|
-
}
|
|
1542
|
-
function getSecureProps(props = {}) {
|
|
1543
|
-
const { dangerouslySetInnerHTML, ...result } = props;
|
|
1544
|
-
return result;
|
|
1545
|
-
}
|
|
1546
|
-
function getCurveFactory(curve, defaultFactory = _d3shape.curveLinear) {
|
|
1547
|
-
if (typeof curve === 'function') {
|
|
1548
|
-
return curve;
|
|
1549
|
-
}
|
|
1550
|
-
switch(curve){
|
|
1551
|
-
case 'linear':
|
|
1552
|
-
return _d3shape.curveLinear;
|
|
1553
|
-
case 'natural':
|
|
1554
|
-
return _d3shape.curveNatural;
|
|
1555
|
-
case 'step':
|
|
1556
|
-
return _d3shape.curveStep;
|
|
1557
|
-
case 'stepAfter':
|
|
1558
|
-
return _d3shape.curveStepAfter;
|
|
1559
|
-
case 'stepBefore':
|
|
1560
|
-
return _d3shape.curveStepBefore;
|
|
1561
|
-
default:
|
|
1562
|
-
return defaultFactory;
|
|
1563
|
-
}
|
|
1564
|
-
}
|
|
1565
|
-
const truncateString = (str, maxLength, ellipsis = '...')=>{
|
|
1566
|
-
if (str.length <= maxLength) {
|
|
1567
|
-
return str;
|
|
1568
|
-
}
|
|
1569
|
-
return str.slice(0, maxLength) + ellipsis;
|
|
1570
|
-
};
|
|
1571
|
-
const categoryOrderRegex = /(category|total|sum|min|max|mean|median) (ascending|descending)/;
|
|
1572
|
-
const sortAxisCategories = (categoryToValues, categoryOrder)=>{
|
|
1573
|
-
if (Array.isArray(categoryOrder)) {
|
|
1574
|
-
const result = [];
|
|
1575
|
-
const seen = new Set();
|
|
1576
|
-
// Add elements from categoryOrder array that are in categoryToValues, in the array's order
|
|
1577
|
-
categoryOrder.forEach((category)=>{
|
|
1578
|
-
if (categoryToValues[category] && !seen.has(category)) {
|
|
1579
|
-
result.push(category);
|
|
1580
|
-
seen.add(category);
|
|
1581
|
-
}
|
|
1582
|
-
});
|
|
1583
|
-
// Append any keys from categoryToValues not already in result
|
|
1584
|
-
Object.keys(categoryToValues).forEach((category)=>{
|
|
1585
|
-
if (!seen.has(category)) {
|
|
1586
|
-
result.push(category);
|
|
1587
|
-
}
|
|
1588
|
-
});
|
|
1589
|
-
return result;
|
|
1590
|
-
}
|
|
1591
|
-
const match = categoryOrder === null || categoryOrder === void 0 ? void 0 : categoryOrder.match(categoryOrderRegex);
|
|
1592
|
-
if (match) {
|
|
1593
|
-
const aggregator = match[1];
|
|
1594
|
-
const order = match[2];
|
|
1595
|
-
if (aggregator === 'category') {
|
|
1596
|
-
const result = Object.keys(categoryToValues).sort();
|
|
1597
|
-
return order === 'descending' ? result.reverse() : result;
|
|
1598
|
-
}
|
|
1599
|
-
const aggFn = {
|
|
1600
|
-
min: _d3array.min,
|
|
1601
|
-
max: _d3array.max,
|
|
1602
|
-
sum: _d3array.sum,
|
|
1603
|
-
total: _d3array.sum,
|
|
1604
|
-
mean: _d3array.mean,
|
|
1605
|
-
median: _d3array.median
|
|
1606
|
-
};
|
|
1607
|
-
const sortAscending = (a, b)=>{
|
|
1608
|
-
return a[1] - b[1];
|
|
1609
|
-
};
|
|
1610
|
-
const sortDescending = (a, b)=>{
|
|
1611
|
-
return b[1] - a[1];
|
|
1612
|
-
};
|
|
1613
|
-
const categoriesAggregatedValue = [];
|
|
1614
|
-
Object.keys(categoryToValues).forEach((category)=>{
|
|
1615
|
-
categoriesAggregatedValue.push([
|
|
1616
|
-
category,
|
|
1617
|
-
aggFn[aggregator](categoryToValues[category]) || 0
|
|
1618
|
-
]);
|
|
1619
|
-
});
|
|
1620
|
-
categoriesAggregatedValue.sort(order === 'descending' ? sortDescending : sortAscending);
|
|
1621
|
-
return categoriesAggregatedValue.map(([category])=>category);
|
|
1622
|
-
}
|
|
1623
|
-
return Object.keys(categoryToValues);
|
|
1624
|
-
};
|
|
1625
|
-
function copyStyle(properties, fromEl, toEl) {
|
|
1626
|
-
const styles = getComputedStyle(fromEl);
|
|
1627
|
-
if (Array.isArray(properties)) {
|
|
1628
|
-
properties.forEach((prop)=>{
|
|
1629
|
-
(0, _d3selection.select)(toEl).style(prop, styles.getPropertyValue(prop));
|
|
1630
|
-
});
|
|
1631
|
-
} else {
|
|
1632
|
-
Object.entries(properties).forEach(([fromProp, toProp])=>{
|
|
1633
|
-
(0, _d3selection.select)(toEl).style(toProp, styles.getPropertyValue(fromProp));
|
|
1634
|
-
});
|
|
1635
|
-
}
|
|
1636
|
-
}
|
|
1637
|
-
const MEASUREMENT_SPAN_STYLE = {
|
|
1638
|
-
position: 'absolute',
|
|
1639
|
-
visibility: 'hidden',
|
|
1640
|
-
top: '-20000px',
|
|
1641
|
-
left: 0,
|
|
1642
|
-
padding: 0,
|
|
1643
|
-
margin: 0,
|
|
1644
|
-
border: 'none',
|
|
1645
|
-
whiteSpace: 'pre'
|
|
1646
|
-
};
|
|
1647
|
-
const MEASUREMENT_SPAN_ID = 'fui_measurement_span';
|
|
1648
|
-
const TEXT_STYLE_PROPERTIES = [
|
|
1649
|
-
'font-size',
|
|
1650
|
-
'font-family',
|
|
1651
|
-
'font-weight',
|
|
1652
|
-
'font-style',
|
|
1653
|
-
'letter-spacing',
|
|
1654
|
-
'text-transform'
|
|
1655
|
-
];
|
|
1656
|
-
const measureTextWithDOM = (text, cssSelector, container)=>{
|
|
1657
|
-
let measurementSpan = document.getElementById(MEASUREMENT_SPAN_ID);
|
|
1658
|
-
if (!measurementSpan) {
|
|
1659
|
-
measurementSpan = document.createElement('span');
|
|
1660
|
-
measurementSpan.setAttribute('id', MEASUREMENT_SPAN_ID);
|
|
1661
|
-
measurementSpan.setAttribute('aria-hidden', 'true');
|
|
1662
|
-
(container !== null && container !== void 0 ? container : document.body).appendChild(measurementSpan);
|
|
1663
|
-
}
|
|
1664
|
-
Object.assign(measurementSpan.style, MEASUREMENT_SPAN_STYLE);
|
|
1665
|
-
const refEl = (container !== null && container !== void 0 ? container : document).querySelector(cssSelector);
|
|
1666
|
-
if (refEl) {
|
|
1667
|
-
copyStyle(TEXT_STYLE_PROPERTIES, refEl, measurementSpan);
|
|
1668
|
-
}
|
|
1669
|
-
measurementSpan.textContent = `${text}`;
|
|
1670
|
-
const rect = measurementSpan.getBoundingClientRect();
|
|
1671
|
-
return {
|
|
1672
|
-
node: measurementSpan,
|
|
1673
|
-
width: rect.width,
|
|
1674
|
-
height: rect.height
|
|
1675
|
-
};
|
|
1676
|
-
};
|
|
1677
|
-
const CACHE_SIZE = 2000;
|
|
1678
|
-
const textSizeCache = new Map();
|
|
1679
|
-
const getTextSize = (text, cssSelector, container)=>{
|
|
1680
|
-
const cacheKey = `${text}|${cssSelector}`;
|
|
1681
|
-
const cachedResult = textSizeCache.get(cacheKey);
|
|
1682
|
-
if (cachedResult) {
|
|
1683
|
-
return cachedResult;
|
|
1684
|
-
}
|
|
1685
|
-
const { width, height } = measureTextWithDOM(text, cssSelector, container);
|
|
1686
|
-
// TODO: Improve cache eviction strategy if needed (e.g., LRU)
|
|
1687
|
-
if (textSizeCache.size >= CACHE_SIZE) {
|
|
1688
|
-
const firstKey = textSizeCache.keys().next().value;
|
|
1689
|
-
if (!(0, _chartutilities.isInvalidValue)(firstKey)) {
|
|
1690
|
-
textSizeCache.delete(firstKey);
|
|
1691
|
-
}
|
|
1692
|
-
}
|
|
1693
|
-
textSizeCache.set(cacheKey, {
|
|
1694
|
-
width,
|
|
1695
|
-
height
|
|
1696
|
-
});
|
|
1697
|
-
return {
|
|
1698
|
-
width,
|
|
1699
|
-
height
|
|
1700
|
-
};
|
|
1701
|
-
};
|
|
1702
|
-
function isScatterPolarSeries(points) {
|
|
1703
|
-
return points.some((item)=>{
|
|
1704
|
-
var _item_lineOptions;
|
|
1705
|
-
return typeof ((_item_lineOptions = item.lineOptions) === null || _item_lineOptions === void 0 ? void 0 : _item_lineOptions.mode) === 'string' && item.lineOptions.mode === 'scatterpolar';
|
|
1706
|
-
});
|
|
1707
|
-
}
|
|
1708
|
-
function isTextMode(points) {
|
|
1709
|
-
return points.some((item)=>{
|
|
1710
|
-
var _item_lineOptions;
|
|
1711
|
-
return typeof ((_item_lineOptions = item.lineOptions) === null || _item_lineOptions === void 0 ? void 0 : _item_lineOptions.mode) === 'string' && item.lineOptions.mode === 'text';
|
|
1712
|
-
});
|
|
1713
|
-
}
|
|
1714
|
-
// TODO: Refactor to encapsulate the complete numeric scale creation logic here, including setting domain and range.
|
|
1715
|
-
const createNumericScale = (scaleType)=>{
|
|
1716
|
-
if (scaleType === 'log') {
|
|
1717
|
-
return (0, _d3scale.scaleLog)();
|
|
1718
|
-
} else {
|
|
1719
|
-
return (0, _d3scale.scaleLinear)();
|
|
1720
|
-
}
|
|
1721
|
-
};
|
|
1722
|
-
const getDomainPaddingForMarkers = (minVal, maxVal, scaleType, userMinVal, userMaxVal)=>{
|
|
1723
|
-
if (scaleType === 'log') {
|
|
1724
|
-
return {
|
|
1725
|
-
start: minVal * 0.5,
|
|
1726
|
-
end: maxVal
|
|
1727
|
-
};
|
|
1728
|
-
}
|
|
1729
|
-
/* if user explicitly sets userMinVal or userMaxVal, we will check that to avoid excessive padding on either side.
|
|
1730
|
-
If the difference between minVal and userMinVal is more than 10% of the data range, we set padding to 0 on that side.
|
|
1731
|
-
this is to avoid cases where userMinVal is significantly smaller than minVal or userMaxVal is significantly larger than
|
|
1732
|
-
maxVal, which would lead to excessive padding. In other cases, we apply the default 10% padding on both sides.
|
|
1733
|
-
*/ const rangePadding = (maxVal - minVal) * 0.1;
|
|
1734
|
-
// If explicit bounds are set and they're far from the data range, don't add extra padding
|
|
1735
|
-
const paddingAlreadySatisfiedAtMin = userMinVal !== undefined && rangePadding > Math.abs(minVal - Math.min(minVal, userMinVal));
|
|
1736
|
-
const paddingAlreadySatisfiedAtMax = userMaxVal !== undefined && rangePadding > Math.abs(maxVal - Math.max(maxVal, userMaxVal));
|
|
1737
|
-
const startPadding = paddingAlreadySatisfiedAtMin ? 0 : rangePadding;
|
|
1738
|
-
const endPadding = paddingAlreadySatisfiedAtMax ? 0 : rangePadding;
|
|
1739
|
-
return {
|
|
1740
|
-
start: startPadding,
|
|
1741
|
-
end: endPadding
|
|
1742
|
-
};
|
|
1743
|
-
};
|
|
1744
|
-
const isValidDomainValue = (value, scaleType)=>{
|
|
1745
|
-
return typeof value !== 'number' || scaleType !== 'log' || value > 0;
|
|
1746
|
-
};
|
|
1747
|
-
const isPlottable = (x, y)=>{
|
|
1748
|
-
return !(0, _chartutilities.isInvalidValue)(x) && !(0, _chartutilities.isInvalidValue)(y);
|
|
1749
|
-
};
|
|
1750
|
-
const getScatterXDomainExtent = (points, scaleType)=>{
|
|
1751
|
-
const isValidDataPointForScale = (item)=>isValidDomainValue(item.x, scaleType);
|
|
1752
|
-
const xMin = (0, _d3array.min)(points, (point)=>{
|
|
1753
|
-
return (0, _d3array.min)(point.data.filter(isValidDataPointForScale), (item)=>item.x);
|
|
1754
|
-
});
|
|
1755
|
-
const xMax = (0, _d3array.max)(points, (point)=>{
|
|
1756
|
-
return (0, _d3array.max)(point.data.filter(isValidDataPointForScale), (item)=>{
|
|
1757
|
-
return item.x;
|
|
1758
|
-
});
|
|
1759
|
-
});
|
|
1760
|
-
return [
|
|
1761
|
-
xMin,
|
|
1762
|
-
xMax
|
|
1763
|
-
];
|
|
1764
|
-
};
|
|
1765
|
-
const calculateMarkerRadius = ({ pointMarkerSize, minMarkerSize, maxMarkerSize, extraMaxPixels, isContinuousXY, isActive = false, defaultRadius = 3.5, activeRadius = 5.5, minRadius = 4 })=>{
|
|
1766
|
-
const minPixel = 4;
|
|
1767
|
-
const maxPixel = 16;
|
|
1768
|
-
// If no marker size is specified, use default or active radius
|
|
1769
|
-
if (!pointMarkerSize) {
|
|
1770
|
-
return isActive ? activeRadius : defaultRadius;
|
|
1771
|
-
}
|
|
1772
|
-
let radius;
|
|
1773
|
-
if (isContinuousXY && maxMarkerSize !== 0) {
|
|
1774
|
-
// For continuous axes: scale markers based on available space
|
|
1775
|
-
radius = maxMarkerSize < extraMaxPixels ? pointMarkerSize : pointMarkerSize / maxMarkerSize * extraMaxPixels;
|
|
1776
|
-
} else if (!isContinuousXY && maxMarkerSize !== minMarkerSize) {
|
|
1777
|
-
// For categorical axes: normalize to pixel range [minPixel, maxPixel]
|
|
1778
|
-
radius = minPixel + (pointMarkerSize - minMarkerSize) / (maxMarkerSize - minMarkerSize) * (maxPixel - minPixel);
|
|
1779
|
-
} else {
|
|
1780
|
-
// Fallback to default/active radius
|
|
1781
|
-
return isActive ? activeRadius : defaultRadius;
|
|
1782
|
-
}
|
|
1783
|
-
// Ensure minimum radius for visibility
|
|
1784
|
-
return Math.max(radius, minRadius);
|
|
1785
|
-
};
|
|
1786
|
-
const getRangeForScatterMarkerSize = ({ data, xScale, yScalePrimary, yScaleSecondary, useSecondaryYScale, xScaleType, yScaleType: primaryYScaleType, secondaryYScaleType })=>{
|
|
1787
|
-
// Note: This function is executed after the scale is created, so the actual padding can be
|
|
1788
|
-
// obtained by calculating the difference between the respective minimums or maximums of the
|
|
1789
|
-
// scale domain and the data. However, doing so often causes the marker size to scale up
|
|
1790
|
-
// unnecessarily when the scale uses a wider domain than required (due to the use of D3's nice
|
|
1791
|
-
// function or our own tick value calculations).
|
|
1792
|
-
// A better approach could be to treat the marker size as a fixed pixel value and adjust the
|
|
1793
|
-
// scale domain with sufficient padding to accommodate the maximum marker size—instead of doing
|
|
1794
|
-
// it the other way around (i.e., adjusting the scale domain first with padding and then scaling
|
|
1795
|
-
// the markers to fit inside the plot area).
|
|
1796
|
-
const [xMin, xMax] = getScatterXDomainExtent(data, xScaleType);
|
|
1797
|
-
const xPadding = getDomainPaddingForMarkers(+xMin, +xMax, xScaleType);
|
|
1798
|
-
const scaleXMin = xMin instanceof Date ? new Date(+xMin - xPadding.start) : xMin - xPadding.start;
|
|
1799
|
-
const scaleXMax = xMax instanceof Date ? new Date(+xMax + xPadding.end) : xMax + xPadding.end;
|
|
1800
|
-
const extraXPixels = Math.min(Math.abs(xScale(xMin) - xScale(scaleXMin)), Math.abs(xScale(scaleXMax) - xScale(xMax)));
|
|
1801
|
-
const yScaleType = useSecondaryYScale ? secondaryYScaleType : primaryYScaleType;
|
|
1802
|
-
const { startValue: yMin, endValue: yMax } = findNumericMinMaxOfY(data, undefined, useSecondaryYScale, yScaleType);
|
|
1803
|
-
const yPadding = getDomainPaddingForMarkers(yMin, yMax, yScaleType);
|
|
1804
|
-
const scaleYMin = yMin - yPadding.start;
|
|
1805
|
-
const scaleYMax = yMax + yPadding.end;
|
|
1806
|
-
const yScale = useSecondaryYScale ? yScaleSecondary : yScalePrimary;
|
|
1807
|
-
const extraYPixels = Math.min(Math.abs(yScale(scaleYMin) - yScale(yMin)), Math.abs(yScale(yMax) - yScale(scaleYMax)));
|
|
1808
|
-
return Math.min(extraXPixels, extraYPixels);
|
|
1809
|
-
};
|
|
1810
|
-
const generateLinearTicks = (tick0, tickStep, scaleDomain)=>{
|
|
1811
|
-
const domainMin = (0, _d3array.min)(scaleDomain);
|
|
1812
|
-
const domainMax = (0, _d3array.max)(scaleDomain);
|
|
1813
|
-
const precision = Math.max(calculatePrecision(tick0), calculatePrecision(tickStep));
|
|
1814
|
-
const start = Math.ceil(precisionRound((domainMin - tick0) / tickStep, precision));
|
|
1815
|
-
const end = Math.floor(precisionRound((domainMax - tick0) / tickStep, precision));
|
|
1816
|
-
const ticks = [];
|
|
1817
|
-
for(let i = start; i <= end; i++){
|
|
1818
|
-
ticks.push(precisionRound(tick0 + i * tickStep, precision));
|
|
1819
|
-
}
|
|
1820
|
-
return ticks;
|
|
1821
|
-
};
|
|
1822
|
-
const generateMonthlyTicks = (tick0, tickStepInMonths, scaleDomain, useUTC)=>{
|
|
1823
|
-
const domainMin = +(0, _d3array.min)(scaleDomain);
|
|
1824
|
-
const domainMax = +(0, _d3array.max)(scaleDomain);
|
|
1825
|
-
const getMonth = (d)=>useUTC ? d.getUTCMonth() : d.getMonth();
|
|
1826
|
-
const setMonth = (d, month)=>useUTC ? new Date(d.setUTCMonth(month)) : new Date(d.setMonth(month));
|
|
1827
|
-
// Find the earliest tick <= domainMin
|
|
1828
|
-
let start = 0;
|
|
1829
|
-
for(let firstTick = new Date(+tick0); +firstTick > domainMin;){
|
|
1830
|
-
firstTick = setMonth(firstTick, getMonth(firstTick) - tickStepInMonths);
|
|
1831
|
-
start -= tickStepInMonths;
|
|
1832
|
-
}
|
|
1833
|
-
const baseMonth = getMonth(tick0);
|
|
1834
|
-
const ticks = [];
|
|
1835
|
-
// Generate ticks forward until domainMax
|
|
1836
|
-
for(let i = start;; i += tickStepInMonths){
|
|
1837
|
-
let tickDate = setMonth(new Date(+tick0), baseMonth + i);
|
|
1838
|
-
// Handle month rollover (e.g., Jan 31 + 1 month → Mar 3 instead of Feb)
|
|
1839
|
-
if (getMonth(tickDate) !== ((baseMonth + i) % 12 + 12) % 12) {
|
|
1840
|
-
tickDate = useUTC ? new Date(tickDate.setUTCDate(0)) : new Date(tickDate.setDate(0));
|
|
1841
|
-
}
|
|
1842
|
-
if (+tickDate > domainMax) {
|
|
1843
|
-
break;
|
|
1844
|
-
}
|
|
1845
|
-
if (+tickDate >= domainMin) {
|
|
1846
|
-
ticks.push(tickDate);
|
|
1847
|
-
}
|
|
1848
|
-
}
|
|
1849
|
-
return ticks;
|
|
1850
|
-
};
|
|
1851
|
-
const generateNumericTicks = (scaleType, tickStep, tick0, scaleDomain)=>{
|
|
1852
|
-
const refTick = typeof tick0 === 'number' ? tick0 : 0;
|
|
1853
|
-
if (scaleType === 'log') {
|
|
1854
|
-
if (typeof tickStep === 'number' && tickStep > 0) {
|
|
1855
|
-
return generateLinearTicks(refTick, tickStep, scaleDomain.map((d)=>Math.log10(d))).map((t)=>10 ** t);
|
|
1856
|
-
}
|
|
1857
|
-
if (typeof tickStep === 'string') {
|
|
1858
|
-
const prefix = tickStep[0];
|
|
1859
|
-
const num = (0, _chartutilities.isNumber)(tickStep.slice(1)) ? Number(tickStep.slice(1)) : 0;
|
|
1860
|
-
if (prefix === 'L' && num > 0) {
|
|
1861
|
-
return generateLinearTicks(refTick, num, scaleDomain);
|
|
1862
|
-
}
|
|
1863
|
-
}
|
|
1864
|
-
return;
|
|
1865
|
-
}
|
|
1866
|
-
if (typeof tickStep === 'number' && tickStep > 0) {
|
|
1867
|
-
return generateLinearTicks(refTick, tickStep, scaleDomain);
|
|
1868
|
-
}
|
|
1869
|
-
};
|
|
1870
|
-
const generateDateTicks = (tickStep, tick0, scaleDomain, useUTC)=>{
|
|
1871
|
-
const refTick = tick0 instanceof Date ? tick0 : new Date(DEFAULT_DATE_STRING);
|
|
1872
|
-
if (typeof tickStep === 'number' && tickStep > 0) {
|
|
1873
|
-
return generateLinearTicks(+refTick, tickStep, scaleDomain.map((d)=>+d)).map((t)=>new Date(t));
|
|
1874
|
-
}
|
|
1875
|
-
if (typeof tickStep === 'string') {
|
|
1876
|
-
const prefix = tickStep[0];
|
|
1877
|
-
const num = (0, _chartutilities.isNumber)(tickStep.slice(1)) ? Number(tickStep.slice(1)) : 0;
|
|
1878
|
-
if (prefix === 'M' && num > 0 && num === Math.round(num)) {
|
|
1879
|
-
return generateMonthlyTicks(refTick, num, scaleDomain, useUTC);
|
|
1880
|
-
}
|
|
1881
|
-
}
|
|
1882
|
-
};
|
|
1883
|
-
function calculatePrecision(value) {
|
|
1884
|
-
/**
|
|
1885
|
-
* Group 1:
|
|
1886
|
-
* [1-9]([0]+$) matches trailing zeros
|
|
1887
|
-
* Group 2:
|
|
1888
|
-
* \.([0-9]*) matches all digits after a decimal point.
|
|
1889
|
-
*/ const groups = /[1-9]([0]+$)|\.([0-9]*)/.exec(String(value));
|
|
1890
|
-
if (!groups) {
|
|
1891
|
-
return 0;
|
|
1892
|
-
}
|
|
1893
|
-
if (groups[1]) {
|
|
1894
|
-
return -groups[1].length;
|
|
1895
|
-
}
|
|
1896
|
-
if (groups[2]) {
|
|
1897
|
-
return groups[2].length;
|
|
1898
|
-
}
|
|
1899
|
-
return 0;
|
|
1900
|
-
}
|
|
1901
|
-
function precisionRound(value, precision, base = 10) {
|
|
1902
|
-
const exp = base ** precision;
|
|
1903
|
-
return Math.round(value * exp) / exp;
|
|
1904
|
-
}
|
|
1905
|
-
const findCalloutPoints = (calloutPointsByX, x)=>{
|
|
1906
|
-
if (x === null) {
|
|
1907
|
-
return undefined;
|
|
1908
|
-
}
|
|
1909
|
-
const key = x instanceof Date ? x.getTime() : x;
|
|
1910
|
-
if (!calloutPointsByX[key]) {
|
|
1911
|
-
return undefined;
|
|
1912
|
-
}
|
|
1913
|
-
return {
|
|
1914
|
-
x,
|
|
1915
|
-
values: calloutPointsByX[key]
|
|
1916
|
-
};
|
|
1917
|
-
};
|
|
1918
|
-
const autoLayoutXAxisLabels = (tickValues, tickLabels, scale, axisNode, containerWidth, container)=>{
|
|
1919
|
-
let requiresWrap = false;
|
|
1920
|
-
let requiresTruncate = false;
|
|
1921
|
-
const maxWidths = [];
|
|
1922
|
-
const [rangeStart, rangeEnd] = scale.range();
|
|
1923
|
-
const isRTL = rangeEnd - rangeStart < 0;
|
|
1924
|
-
const start = isRTL ? containerWidth : 0;
|
|
1925
|
-
const end = isRTL ? 0 : containerWidth;
|
|
1926
|
-
const getTickPosition = (index)=>{
|
|
1927
|
-
var _scale;
|
|
1928
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1929
|
-
return ((_scale = scale(tickValues[index])) !== null && _scale !== void 0 ? _scale : 0) + ('bandwidth' in scale ? scale.bandwidth() / 2 : 0);
|
|
1930
|
-
};
|
|
1931
|
-
const getLabelWidth = (text)=>{
|
|
1932
|
-
return getTextSize(text, CARTESIAN_XAXIS_TEXT_SELECTOR, container).width;
|
|
1933
|
-
};
|
|
1934
|
-
for(let i = 0; i < tickValues.length; i++){
|
|
1935
|
-
const position = getTickPosition(i);
|
|
1936
|
-
const leftSpace = Math.abs(i > 0 ? (position - getTickPosition(i - 1)) / 2 : position - start);
|
|
1937
|
-
const rightSpace = Math.abs(i + 1 < tickValues.length ? (getTickPosition(i + 1) - position) / 2 : end - position);
|
|
1938
|
-
const maxAvailableWidth = Math.min(leftSpace, rightSpace) * 2 - 8; // 4px padding on both sides
|
|
1939
|
-
const label = tickLabels[i];
|
|
1940
|
-
const labelWidth = getLabelWidth(label);
|
|
1941
|
-
maxWidths.push(maxAvailableWidth);
|
|
1942
|
-
if (labelWidth > maxAvailableWidth) {
|
|
1943
|
-
const longestWordWidth = Math.max(...label.split(/\s+/).map((word)=>getLabelWidth(word)));
|
|
1944
|
-
if (longestWordWidth <= maxAvailableWidth) {
|
|
1945
|
-
requiresWrap = true;
|
|
1946
|
-
} else {
|
|
1947
|
-
requiresTruncate = true;
|
|
1948
|
-
}
|
|
1949
|
-
}
|
|
1950
|
-
}
|
|
1951
|
-
if (requiresTruncate) {
|
|
1952
|
-
return truncateAndStaggerXAxisLabels(tickValues, tickLabels, scale, axisNode, containerWidth, container);
|
|
1953
|
-
}
|
|
1954
|
-
if (requiresWrap) {
|
|
1955
|
-
var _createWrapOfXLabels;
|
|
1956
|
-
return (_createWrapOfXLabels = createWrapOfXLabels({
|
|
1957
|
-
node: axisNode,
|
|
1958
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1959
|
-
xAxis: scale,
|
|
1960
|
-
noOfCharsToTruncate: 100,
|
|
1961
|
-
showXAxisLablesTooltip: false,
|
|
1962
|
-
width: maxWidths,
|
|
1963
|
-
container
|
|
1964
|
-
})) !== null && _createWrapOfXLabels !== void 0 ? _createWrapOfXLabels : 0;
|
|
1965
|
-
}
|
|
1966
|
-
return 0;
|
|
1967
|
-
};
|
|
1968
|
-
const truncateAndStaggerXAxisLabels = (tickValues, tickLabels, scale, axisNode, containerWidth, container)=>{
|
|
1969
|
-
if (!axisNode) {
|
|
1970
|
-
return 0;
|
|
1971
|
-
}
|
|
1972
|
-
let maxHeight = 12;
|
|
1973
|
-
const [rangeStart, rangeEnd] = scale.range();
|
|
1974
|
-
const isRTL = rangeEnd - rangeStart < 0;
|
|
1975
|
-
const start = isRTL ? containerWidth : 0;
|
|
1976
|
-
const end = isRTL ? 0 : containerWidth;
|
|
1977
|
-
const getTickPosition = (index)=>{
|
|
1978
|
-
var _scale;
|
|
1979
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1980
|
-
return ((_scale = scale(tickValues[index])) !== null && _scale !== void 0 ? _scale : 0) + ('bandwidth' in scale ? scale.bandwidth() / 2 : 0);
|
|
1981
|
-
};
|
|
1982
|
-
const getLabelSize = (text)=>{
|
|
1983
|
-
return getTextSize(text, CARTESIAN_XAXIS_TEXT_SELECTOR, container);
|
|
1984
|
-
};
|
|
1985
|
-
(0, _d3selection.select)(axisNode).selectAll('.tick text').each(function(_, i) {
|
|
1986
|
-
const position = getTickPosition(i);
|
|
1987
|
-
const leftSpace = Math.abs(i > 0 ? position - getTickPosition(i - 1) : position - start);
|
|
1988
|
-
const rightSpace = Math.abs(i + 1 < tickValues.length ? getTickPosition(i + 1) - position : end - position);
|
|
1989
|
-
const maxAvailableWidth = Math.min(leftSpace, rightSpace) * 2 - 8; // 4px padding on both sides
|
|
1990
|
-
const label = tickLabels[i];
|
|
1991
|
-
const textNode = (0, _d3selection.select)(this).text(null).attr('data-full', label);
|
|
1992
|
-
const lineHeight = 1.1; // ems
|
|
1993
|
-
const y = textNode.attr('y');
|
|
1994
|
-
const dy = parseFloat(textNode.attr('dy'));
|
|
1995
|
-
textNode.append('tspan').attr('x', 0).attr('y', y).attr('dy', (i % 2 === 1 ? lineHeight : 0) + dy + 'em').text(truncateTextToFitWidth(label, maxAvailableWidth, (s)=>getLabelSize(s).width));
|
|
1996
|
-
maxHeight = Math.max(maxHeight, getLabelSize(label).height);
|
|
1997
|
-
});
|
|
1998
|
-
return tickValues.length > 1 ? maxHeight : 0;
|
|
1999
|
-
};
|
|
2000
|
-
const truncateTextToFitWidth = (text, maxWidth, measure)=>{
|
|
2001
|
-
if (measure(text) <= maxWidth) {
|
|
2002
|
-
return text;
|
|
2003
|
-
}
|
|
2004
|
-
let lo = 1;
|
|
2005
|
-
let hi = text.length;
|
|
2006
|
-
while(lo < hi){
|
|
2007
|
-
const mid = Math.floor((lo + hi + 1) / 2);
|
|
2008
|
-
const candidate = text.slice(0, mid) + '...';
|
|
2009
|
-
if (measure(candidate) <= maxWidth) {
|
|
2010
|
-
lo = mid;
|
|
2011
|
-
} else {
|
|
2012
|
-
hi = mid - 1;
|
|
2013
|
-
}
|
|
2014
|
-
}
|
|
2015
|
-
return text.slice(0, lo) + '...';
|
|
2016
|
-
};
|