@fluentui/react-charts 9.2.2 → 9.2.4
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 +74 -2
- package/dist/index.d.ts +187 -15
- package/lib/components/AreaChart/AreaChart.js +7 -4
- package/lib/components/AreaChart/AreaChart.js.map +1 -1
- package/lib/components/AreaChart/useAreaChartStyles.styles.js +4 -3
- package/lib/components/AreaChart/useAreaChartStyles.styles.js.map +1 -1
- package/lib/components/AreaChart/useAreaChartStyles.styles.raw.js +5 -16
- package/lib/components/AreaChart/useAreaChartStyles.styles.raw.js.map +1 -1
- package/lib/components/ChartTable/ChartTable.js +90 -6
- package/lib/components/ChartTable/ChartTable.js.map +1 -1
- package/lib/components/CommonComponents/CartesianChart.js +83 -38
- package/lib/components/CommonComponents/CartesianChart.js.map +1 -1
- package/lib/components/CommonComponents/CartesianChart.types.js.map +1 -1
- package/lib/components/CommonComponents/useCartesianChartStyles.styles.js +19 -3
- package/lib/components/CommonComponents/useCartesianChartStyles.styles.js.map +1 -1
- package/lib/components/CommonComponents/useCartesianChartStyles.styles.raw.js +8 -23
- package/lib/components/CommonComponents/useCartesianChartStyles.styles.raw.js.map +1 -1
- package/lib/components/DeclarativeChart/DeclarativeChart.js +214 -107
- package/lib/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
- package/lib/components/DeclarativeChart/PlotlyColorAdapter.js +25 -1
- package/lib/components/DeclarativeChart/PlotlyColorAdapter.js.map +1 -1
- package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js +1618 -259
- package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
- package/lib/components/DonutChart/Arc/useArcStyles.styles.js +8 -3
- package/lib/components/DonutChart/Arc/useArcStyles.styles.js.map +1 -1
- package/lib/components/DonutChart/Arc/useArcStyles.styles.raw.js +6 -2
- package/lib/components/DonutChart/Arc/useArcStyles.styles.raw.js.map +1 -1
- package/lib/components/DonutChart/DonutChart.js +8 -3
- package/lib/components/DonutChart/DonutChart.js.map +1 -1
- package/lib/components/DonutChart/DonutChart.types.js.map +1 -1
- package/lib/components/DonutChart/useDonutChartStyles.styles.js +21 -4
- package/lib/components/DonutChart/useDonutChartStyles.styles.js.map +1 -1
- package/lib/components/DonutChart/useDonutChartStyles.styles.raw.js +8 -4
- package/lib/components/DonutChart/useDonutChartStyles.styles.raw.js.map +1 -1
- package/lib/components/FunnelChart/FunnelChart.js +4 -2
- package/lib/components/FunnelChart/FunnelChart.js.map +1 -1
- package/lib/components/FunnelChart/funnelGeometry.js.map +1 -1
- package/lib/components/GanttChart/useGanttChartStyles.styles.js +2 -1
- package/lib/components/GanttChart/useGanttChartStyles.styles.js.map +1 -1
- package/lib/components/GanttChart/useGanttChartStyles.styles.raw.js +2 -1
- package/lib/components/GanttChart/useGanttChartStyles.styles.raw.js.map +1 -1
- package/lib/components/GaugeChart/GaugeChart.js +1 -2
- package/lib/components/GaugeChart/GaugeChart.js.map +1 -1
- package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js +31 -10
- package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js.map +1 -1
- package/lib/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.js +6 -18
- package/lib/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.js.map +1 -1
- package/lib/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.raw.js +6 -22
- package/lib/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.raw.js.map +1 -1
- package/lib/components/HeatMapChart/HeatMapChart.js +175 -114
- package/lib/components/HeatMapChart/HeatMapChart.js.map +1 -1
- package/lib/components/HeatMapChart/useHeatMapChartStyles.styles.js +2 -1
- package/lib/components/HeatMapChart/useHeatMapChartStyles.styles.js.map +1 -1
- package/lib/components/HeatMapChart/useHeatMapChartStyles.styles.raw.js +2 -1
- package/lib/components/HeatMapChart/useHeatMapChartStyles.styles.raw.js.map +1 -1
- package/lib/components/HorizontalBarChart/HorizontalBarChart.js +1 -1
- package/lib/components/HorizontalBarChart/HorizontalBarChart.js.map +1 -1
- package/lib/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.js +7 -3
- package/lib/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.js.map +1 -1
- package/lib/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.raw.js +5 -2
- package/lib/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.raw.js.map +1 -1
- package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js +26 -6
- package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js.map +1 -1
- package/lib/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.js +2 -1
- package/lib/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.js.map +1 -1
- package/lib/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.raw.js +2 -1
- package/lib/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.raw.js.map +1 -1
- package/lib/components/LineChart/LineChart.js +349 -176
- package/lib/components/LineChart/LineChart.js.map +1 -1
- package/lib/components/LineChart/LineChart.types.js.map +1 -1
- package/lib/components/LineChart/useLineChartStyles.styles.js +28 -8
- package/lib/components/LineChart/useLineChartStyles.styles.js.map +1 -1
- package/lib/components/LineChart/useLineChartStyles.styles.raw.js +9 -14
- package/lib/components/LineChart/useLineChartStyles.styles.raw.js.map +1 -1
- package/lib/components/ResponsiveContainer/withResponsiveContainer.js.map +1 -1
- package/lib/components/SankeyChart/SankeyChart.js.map +1 -1
- package/lib/components/SankeyChart/useSankeyChartStyles.styles.js +12 -25
- package/lib/components/SankeyChart/useSankeyChartStyles.styles.js.map +1 -1
- package/lib/components/SankeyChart/useSankeyChartStyles.styles.raw.js +2 -12
- package/lib/components/SankeyChart/useSankeyChartStyles.styles.raw.js.map +1 -1
- package/lib/components/ScatterChart/ScatterChart.js +139 -81
- package/lib/components/ScatterChart/ScatterChart.js.map +1 -1
- package/lib/components/ScatterChart/ScatterChart.types.js.map +1 -1
- package/lib/components/ScatterChart/useScatterChartStyles.styles.js +29 -8
- package/lib/components/ScatterChart/useScatterChartStyles.styles.js.map +1 -1
- package/lib/components/ScatterChart/useScatterChartStyles.styles.raw.js +10 -15
- package/lib/components/ScatterChart/useScatterChartStyles.styles.raw.js.map +1 -1
- package/lib/components/VerticalBarChart/VerticalBarChart.js +28 -5
- package/lib/components/VerticalBarChart/VerticalBarChart.js.map +1 -1
- package/lib/components/VerticalBarChart/useVerticalBarChartStyles.styles.js +10 -7
- package/lib/components/VerticalBarChart/useVerticalBarChartStyles.styles.js.map +1 -1
- package/lib/components/VerticalBarChart/useVerticalBarChartStyles.styles.raw.js +7 -20
- package/lib/components/VerticalBarChart/useVerticalBarChartStyles.styles.raw.js.map +1 -1
- package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.js +159 -47
- package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.js.map +1 -1
- package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.types.js.map +1 -1
- package/lib/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.js +9 -7
- package/lib/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.js.map +1 -1
- package/lib/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.raw.js +6 -20
- package/lib/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.raw.js.map +1 -1
- package/lib/types/DataPoint.js +3 -1
- package/lib/types/DataPoint.js.map +1 -1
- package/lib/utilities/Common.styles.js +47 -0
- package/lib/utilities/Common.styles.js.map +1 -0
- package/lib/utilities/Common.styles.raw.js +47 -0
- package/lib/utilities/Common.styles.raw.js.map +1 -0
- package/lib/utilities/SVGTooltipText.js.map +1 -1
- package/lib/utilities/image-export-utils.js.map +1 -1
- package/lib/utilities/index.js +1 -0
- package/lib/utilities/index.js.map +1 -1
- package/lib/utilities/scatterpolar-utils.js +52 -0
- package/lib/utilities/scatterpolar-utils.js.map +1 -0
- package/lib/utilities/utilities.js +324 -147
- package/lib/utilities/utilities.js.map +1 -1
- package/lib/utilities/vbc-utils.js.map +1 -1
- package/lib-commonjs/components/AreaChart/AreaChart.js +6 -3
- package/lib-commonjs/components/AreaChart/AreaChart.js.map +1 -1
- package/lib-commonjs/components/AreaChart/useAreaChartStyles.styles.js +2 -1
- package/lib-commonjs/components/AreaChart/useAreaChartStyles.styles.js.map +1 -1
- package/lib-commonjs/components/AreaChart/useAreaChartStyles.styles.raw.js +4 -15
- package/lib-commonjs/components/AreaChart/useAreaChartStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/components/ChartTable/ChartTable.js +90 -6
- package/lib-commonjs/components/ChartTable/ChartTable.js.map +1 -1
- package/lib-commonjs/components/CommonComponents/CartesianChart.js +83 -37
- package/lib-commonjs/components/CommonComponents/CartesianChart.js.map +1 -1
- package/lib-commonjs/components/CommonComponents/CartesianChart.types.js.map +1 -1
- package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.js +17 -2
- package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.js.map +1 -1
- package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.raw.js +6 -22
- package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js +212 -107
- package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
- package/lib-commonjs/components/DeclarativeChart/PlotlyColorAdapter.js +31 -1
- package/lib-commonjs/components/DeclarativeChart/PlotlyColorAdapter.js.map +1 -1
- package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js +1652 -260
- package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
- package/lib-commonjs/components/DonutChart/Arc/useArcStyles.styles.js +12 -3
- package/lib-commonjs/components/DonutChart/Arc/useArcStyles.styles.js.map +1 -1
- package/lib-commonjs/components/DonutChart/Arc/useArcStyles.styles.raw.js +6 -2
- package/lib-commonjs/components/DonutChart/Arc/useArcStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/components/DonutChart/DonutChart.js +7 -2
- package/lib-commonjs/components/DonutChart/DonutChart.js.map +1 -1
- package/lib-commonjs/components/DonutChart/DonutChart.types.js.map +1 -1
- package/lib-commonjs/components/DonutChart/useDonutChartStyles.styles.js +32 -4
- package/lib-commonjs/components/DonutChart/useDonutChartStyles.styles.js.map +1 -1
- package/lib-commonjs/components/DonutChart/useDonutChartStyles.styles.raw.js +8 -4
- package/lib-commonjs/components/DonutChart/useDonutChartStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/components/FunnelChart/FunnelChart.js +4 -2
- package/lib-commonjs/components/FunnelChart/FunnelChart.js.map +1 -1
- package/lib-commonjs/components/FunnelChart/funnelGeometry.js.map +1 -1
- package/lib-commonjs/components/GanttChart/useGanttChartStyles.styles.js +2 -1
- package/lib-commonjs/components/GanttChart/useGanttChartStyles.styles.js.map +1 -1
- package/lib-commonjs/components/GanttChart/useGanttChartStyles.styles.raw.js +2 -1
- package/lib-commonjs/components/GanttChart/useGanttChartStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/components/GaugeChart/GaugeChart.js +1 -2
- package/lib-commonjs/components/GaugeChart/GaugeChart.js.map +1 -1
- package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js +30 -9
- package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js.map +1 -1
- package/lib-commonjs/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.js +4 -20
- package/lib-commonjs/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.js.map +1 -1
- package/lib-commonjs/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.raw.js +5 -21
- package/lib-commonjs/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/components/HeatMapChart/HeatMapChart.js +174 -113
- package/lib-commonjs/components/HeatMapChart/HeatMapChart.js.map +1 -1
- package/lib-commonjs/components/HeatMapChart/useHeatMapChartStyles.styles.js +2 -1
- package/lib-commonjs/components/HeatMapChart/useHeatMapChartStyles.styles.js.map +1 -1
- package/lib-commonjs/components/HeatMapChart/useHeatMapChartStyles.styles.raw.js +2 -1
- package/lib-commonjs/components/HeatMapChart/useHeatMapChartStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/components/HorizontalBarChart/HorizontalBarChart.js +1 -1
- package/lib-commonjs/components/HorizontalBarChart/HorizontalBarChart.js.map +1 -1
- package/lib-commonjs/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.js +10 -3
- package/lib-commonjs/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.js.map +1 -1
- package/lib-commonjs/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.raw.js +5 -2
- package/lib-commonjs/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js +25 -5
- package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js.map +1 -1
- package/lib-commonjs/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.js +2 -1
- package/lib-commonjs/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.js.map +1 -1
- package/lib-commonjs/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.raw.js +2 -1
- package/lib-commonjs/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/components/LineChart/LineChart.js +347 -175
- package/lib-commonjs/components/LineChart/LineChart.js.map +1 -1
- package/lib-commonjs/components/LineChart/LineChart.types.js.map +1 -1
- package/lib-commonjs/components/LineChart/useLineChartStyles.styles.js +35 -5
- package/lib-commonjs/components/LineChart/useLineChartStyles.styles.js.map +1 -1
- package/lib-commonjs/components/LineChart/useLineChartStyles.styles.raw.js +7 -13
- package/lib-commonjs/components/LineChart/useLineChartStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/components/ResponsiveContainer/withResponsiveContainer.js.map +1 -1
- package/lib-commonjs/components/SankeyChart/SankeyChart.js.map +1 -1
- package/lib-commonjs/components/SankeyChart/useSankeyChartStyles.styles.js +23 -33
- package/lib-commonjs/components/SankeyChart/useSankeyChartStyles.styles.js.map +1 -1
- package/lib-commonjs/components/SankeyChart/useSankeyChartStyles.styles.raw.js +1 -12
- package/lib-commonjs/components/SankeyChart/useSankeyChartStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/components/ScatterChart/ScatterChart.js +137 -79
- package/lib-commonjs/components/ScatterChart/ScatterChart.js.map +1 -1
- package/lib-commonjs/components/ScatterChart/ScatterChart.types.js.map +1 -1
- package/lib-commonjs/components/ScatterChart/useScatterChartStyles.styles.js +39 -6
- package/lib-commonjs/components/ScatterChart/useScatterChartStyles.styles.js.map +1 -1
- package/lib-commonjs/components/ScatterChart/useScatterChartStyles.styles.raw.js +9 -14
- package/lib-commonjs/components/ScatterChart/useScatterChartStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.js +27 -4
- package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.js.map +1 -1
- package/lib-commonjs/components/VerticalBarChart/useVerticalBarChartStyles.styles.js +7 -4
- package/lib-commonjs/components/VerticalBarChart/useVerticalBarChartStyles.styles.js.map +1 -1
- package/lib-commonjs/components/VerticalBarChart/useVerticalBarChartStyles.styles.raw.js +5 -18
- package/lib-commonjs/components/VerticalBarChart/useVerticalBarChartStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.js +158 -46
- package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.js.map +1 -1
- package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.types.js.map +1 -1
- package/lib-commonjs/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.js +7 -4
- package/lib-commonjs/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.js.map +1 -1
- package/lib-commonjs/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.raw.js +5 -19
- package/lib-commonjs/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/types/DataPoint.js +3 -1
- package/lib-commonjs/types/DataPoint.js.map +1 -1
- package/lib-commonjs/utilities/Common.styles.js +71 -0
- package/lib-commonjs/utilities/Common.styles.js.map +1 -0
- package/lib-commonjs/utilities/Common.styles.raw.js +71 -0
- package/lib-commonjs/utilities/Common.styles.raw.js.map +1 -0
- package/lib-commonjs/utilities/SVGTooltipText.js.map +1 -1
- package/lib-commonjs/utilities/image-export-utils.js.map +1 -1
- package/lib-commonjs/utilities/index.js +1 -0
- package/lib-commonjs/utilities/index.js.map +1 -1
- package/lib-commonjs/utilities/scatterpolar-utils.js +67 -0
- package/lib-commonjs/utilities/scatterpolar-utils.js.map +1 -0
- package/lib-commonjs/utilities/utilities.js +337 -137
- package/lib-commonjs/utilities/utilities.js.map +1 -1
- package/lib-commonjs/utilities/vbc-utils.js.map +1 -1
- package/package.json +10 -10
|
@@ -15,6 +15,9 @@ _export(exports, {
|
|
|
15
15
|
CustomPoints: function() {
|
|
16
16
|
return CustomPoints;
|
|
17
17
|
},
|
|
18
|
+
DEFAULT_DATE_STRING: function() {
|
|
19
|
+
return DEFAULT_DATE_STRING;
|
|
20
|
+
},
|
|
18
21
|
DEFAULT_WRAP_WIDTH: function() {
|
|
19
22
|
return DEFAULT_WRAP_WIDTH;
|
|
20
23
|
},
|
|
@@ -30,6 +33,9 @@ _export(exports, {
|
|
|
30
33
|
MIN_DOMAIN_MARGIN: function() {
|
|
31
34
|
return MIN_DOMAIN_MARGIN;
|
|
32
35
|
},
|
|
36
|
+
MIN_DONUT_RADIUS: function() {
|
|
37
|
+
return MIN_DONUT_RADIUS;
|
|
38
|
+
},
|
|
33
39
|
Points: function() {
|
|
34
40
|
return Points;
|
|
35
41
|
},
|
|
@@ -45,6 +51,9 @@ _export(exports, {
|
|
|
45
51
|
calculateLongestLabelWidth: function() {
|
|
46
52
|
return calculateLongestLabelWidth;
|
|
47
53
|
},
|
|
54
|
+
calculatePrecision: function() {
|
|
55
|
+
return calculatePrecision;
|
|
56
|
+
},
|
|
48
57
|
calloutData: function() {
|
|
49
58
|
return calloutData;
|
|
50
59
|
},
|
|
@@ -87,21 +96,15 @@ _export(exports, {
|
|
|
87
96
|
defaultYAxisTickFormatter: function() {
|
|
88
97
|
return defaultYAxisTickFormatter;
|
|
89
98
|
},
|
|
90
|
-
|
|
91
|
-
return
|
|
99
|
+
domainRangeOfDateForAreaLineScatterVerticalBarCharts: function() {
|
|
100
|
+
return domainRangeOfDateForAreaLineScatterVerticalBarCharts;
|
|
92
101
|
},
|
|
93
|
-
|
|
94
|
-
return
|
|
95
|
-
},
|
|
96
|
-
domainRangeOfNumericForAreaChart: function() {
|
|
97
|
-
return domainRangeOfNumericForAreaChart;
|
|
102
|
+
domainRangeOfNumericForAreaLineScatterCharts: function() {
|
|
103
|
+
return domainRangeOfNumericForAreaLineScatterCharts;
|
|
98
104
|
},
|
|
99
105
|
domainRangeOfNumericForHorizontalBarChartWithAxis: function() {
|
|
100
106
|
return domainRangeOfNumericForHorizontalBarChartWithAxis;
|
|
101
107
|
},
|
|
102
|
-
domainRangeOfNumericForScatterChart: function() {
|
|
103
|
-
return domainRangeOfNumericForScatterChart;
|
|
104
|
-
},
|
|
105
108
|
domainRangeOfVSBCNumeric: function() {
|
|
106
109
|
return domainRangeOfVSBCNumeric;
|
|
107
110
|
},
|
|
@@ -135,6 +138,12 @@ _export(exports, {
|
|
|
135
138
|
formatScientificLimitWidth: function() {
|
|
136
139
|
return formatScientificLimitWidth;
|
|
137
140
|
},
|
|
141
|
+
generateLinearTicks: function() {
|
|
142
|
+
return generateLinearTicks;
|
|
143
|
+
},
|
|
144
|
+
generateMonthlyTicks: function() {
|
|
145
|
+
return generateMonthlyTicks;
|
|
146
|
+
},
|
|
138
147
|
getAccessibleDataObject: function() {
|
|
139
148
|
return getAccessibleDataObject;
|
|
140
149
|
},
|
|
@@ -147,9 +156,18 @@ _export(exports, {
|
|
|
147
156
|
getDateFormatLevel: function() {
|
|
148
157
|
return getDateFormatLevel;
|
|
149
158
|
},
|
|
159
|
+
getDomainPaddingForMarkers: function() {
|
|
160
|
+
return getDomainPaddingForMarkers;
|
|
161
|
+
},
|
|
162
|
+
getRangeForScatterMarkerSize: function() {
|
|
163
|
+
return getRangeForScatterMarkerSize;
|
|
164
|
+
},
|
|
150
165
|
getScalePadding: function() {
|
|
151
166
|
return getScalePadding;
|
|
152
167
|
},
|
|
168
|
+
getScatterXDomainExtent: function() {
|
|
169
|
+
return getScatterXDomainExtent;
|
|
170
|
+
},
|
|
153
171
|
getSecureProps: function() {
|
|
154
172
|
return getSecureProps;
|
|
155
173
|
},
|
|
@@ -165,12 +183,27 @@ _export(exports, {
|
|
|
165
183
|
groupChartDataByYValue: function() {
|
|
166
184
|
return groupChartDataByYValue;
|
|
167
185
|
},
|
|
186
|
+
isPlottable: function() {
|
|
187
|
+
return isPlottable;
|
|
188
|
+
},
|
|
168
189
|
isScalePaddingDefined: function() {
|
|
169
190
|
return isScalePaddingDefined;
|
|
170
191
|
},
|
|
192
|
+
isScatterPolarSeries: function() {
|
|
193
|
+
return isScatterPolarSeries;
|
|
194
|
+
},
|
|
195
|
+
isTextMode: function() {
|
|
196
|
+
return isTextMode;
|
|
197
|
+
},
|
|
198
|
+
isValidDomainValue: function() {
|
|
199
|
+
return isValidDomainValue;
|
|
200
|
+
},
|
|
171
201
|
pointTypes: function() {
|
|
172
202
|
return pointTypes;
|
|
173
203
|
},
|
|
204
|
+
precisionRound: function() {
|
|
205
|
+
return precisionRound;
|
|
206
|
+
},
|
|
174
207
|
prepareDatapoints: function() {
|
|
175
208
|
return prepareDatapoints;
|
|
176
209
|
},
|
|
@@ -213,6 +246,8 @@ const _d3shape = require("d3-shape");
|
|
|
213
246
|
const _reactsharedcontexts = require("@fluentui/react-shared-contexts");
|
|
214
247
|
const _chartutilities = require("@fluentui/chart-utilities");
|
|
215
248
|
const MIN_DOMAIN_MARGIN = 8;
|
|
249
|
+
const MIN_DONUT_RADIUS = 1;
|
|
250
|
+
const DEFAULT_DATE_STRING = '2000-01-01';
|
|
216
251
|
var ChartTypes = /*#__PURE__*/ function(ChartTypes) {
|
|
217
252
|
ChartTypes[ChartTypes["AreaChart"] = 0] = "AreaChart";
|
|
218
253
|
ChartTypes[ChartTypes["LineChart"] = 1] = "LineChart";
|
|
@@ -257,9 +292,9 @@ function yAxisTickFormatterInternal(value, limitWidth = false) {
|
|
|
257
292
|
function defaultYAxisTickFormatter(value) {
|
|
258
293
|
return yAxisTickFormatterInternal(value);
|
|
259
294
|
}
|
|
260
|
-
function createNumericXAxis(xAxisParams, tickParams, chartType, culture) {
|
|
261
|
-
const { domainNRangeValues, showRoundOffXTickValues = false, xAxistickSize = 6, tickPadding = 10, xAxisCount, xAxisElement, hideTickOverlap, calcMaxLabelWidth } = xAxisParams;
|
|
262
|
-
const xAxisScale = (
|
|
295
|
+
function createNumericXAxis(xAxisParams, tickParams, chartType, culture, scaleType) {
|
|
296
|
+
const { domainNRangeValues, showRoundOffXTickValues = false, xAxistickSize = 6, tickPadding = 10, xAxisCount, xAxisElement, hideTickOverlap, calcMaxLabelWidth, tickStep, tick0 } = xAxisParams;
|
|
297
|
+
const xAxisScale = createNumericScale(scaleType).domain([
|
|
263
298
|
domainNRangeValues.dStartValue,
|
|
264
299
|
domainNRangeValues.dEndValue
|
|
265
300
|
]).range([
|
|
@@ -268,33 +303,38 @@ function createNumericXAxis(xAxisParams, tickParams, chartType, culture) {
|
|
|
268
303
|
]);
|
|
269
304
|
showRoundOffXTickValues && xAxisScale.nice();
|
|
270
305
|
let tickCount = xAxisCount !== null && xAxisCount !== void 0 ? xAxisCount : 6;
|
|
271
|
-
const tickFormat = (domainValue, _index)=>{
|
|
306
|
+
const tickFormat = (domainValue, _index, defaultFormat)=>{
|
|
272
307
|
if (tickParams.tickFormat) {
|
|
273
308
|
return (0, _d3format.format)(tickParams.tickFormat)(domainValue);
|
|
274
309
|
}
|
|
275
310
|
const xAxisValue = typeof domainValue === 'number' ? domainValue : domainValue.valueOf();
|
|
276
|
-
return (0, _chartutilities.formatToLocaleString)(xAxisValue, culture);
|
|
311
|
+
return (defaultFormat === null || defaultFormat === void 0 ? void 0 : defaultFormat(xAxisValue)) === '' ? '' : (0, _chartutilities.formatToLocaleString)(xAxisValue, culture);
|
|
277
312
|
};
|
|
278
313
|
if (hideTickOverlap && typeof xAxisCount === 'undefined') {
|
|
279
|
-
const longestLabelWidth = calcMaxLabelWidth(xAxisScale.ticks().map(tickFormat)) + 20;
|
|
314
|
+
const longestLabelWidth = calcMaxLabelWidth(xAxisScale.ticks().map((v, i)=>tickFormat(v, i))) + 20;
|
|
280
315
|
const [start, end] = xAxisScale.range();
|
|
281
316
|
tickCount = Math.min(Math.max(1, Math.floor(Math.abs(end - start) / longestLabelWidth)), 10);
|
|
282
317
|
}
|
|
283
|
-
const xAxis = (0, _d3axis.axisBottom)(xAxisScale).tickSize(xAxistickSize).tickPadding(tickPadding).ticks(tickCount).tickFormat(tickFormat);
|
|
318
|
+
const xAxis = (0, _d3axis.axisBottom)(xAxisScale).tickSize(xAxistickSize).tickPadding(tickPadding).ticks(tickCount).tickFormat((v, i)=>tickFormat(v, i, xAxisScale.tickFormat(tickCount)));
|
|
284
319
|
if ([
|
|
285
320
|
6,
|
|
286
321
|
8
|
|
287
322
|
].includes(chartType)) {
|
|
288
323
|
xAxis.tickSizeInner(-(xAxisParams.containerHeight - xAxisParams.margins.top));
|
|
289
324
|
}
|
|
325
|
+
let customTickValues;
|
|
290
326
|
if (tickParams.tickValues) {
|
|
291
|
-
|
|
327
|
+
customTickValues = tickParams.tickValues;
|
|
328
|
+
} else if (tickStep) {
|
|
329
|
+
customTickValues = generateNumericTicks(scaleType, tickStep, tick0, xAxisScale.domain());
|
|
330
|
+
}
|
|
331
|
+
if (customTickValues) {
|
|
332
|
+
xAxis.tickValues(customTickValues);
|
|
292
333
|
}
|
|
293
334
|
if (xAxisElement) {
|
|
294
335
|
(0, _d3selection.select)(xAxisElement).call(xAxis).selectAll('text').attr('aria-hidden', 'true');
|
|
295
336
|
}
|
|
296
|
-
|
|
297
|
-
const tickValues = ((_tickParams_tickValues = tickParams.tickValues) !== null && _tickParams_tickValues !== void 0 ? _tickParams_tickValues : xAxisScale.ticks(tickCount)).map(xAxis.tickFormat());
|
|
337
|
+
const tickValues = (customTickValues !== null && customTickValues !== void 0 ? customTickValues : xAxisScale.ticks(tickCount)).map(xAxis.tickFormat());
|
|
298
338
|
return {
|
|
299
339
|
xScale: xAxisScale,
|
|
300
340
|
tickValues
|
|
@@ -485,7 +525,7 @@ function getDateFormatLevel(date, useUTC) {
|
|
|
485
525
|
return (_matchedFormat_formatLevel = matchedFormat === null || matchedFormat === void 0 ? void 0 : matchedFormat.formatLevel) !== null && _matchedFormat_formatLevel !== void 0 ? _matchedFormat_formatLevel : 7;
|
|
486
526
|
}
|
|
487
527
|
function createDateXAxis(xAxisParams, tickParams, culture, options, timeFormatLocale, customDateTimeFormatter, useUTC, chartType) {
|
|
488
|
-
const { domainNRangeValues, xAxisElement, tickPadding = 6, xAxistickSize = 6, xAxisCount, calcMaxLabelWidth } = xAxisParams;
|
|
528
|
+
const { domainNRangeValues, xAxisElement, tickPadding = 6, xAxistickSize = 6, xAxisCount, calcMaxLabelWidth, tickStep, tick0 } = xAxisParams;
|
|
489
529
|
const isUtcSet = useUTC === true || useUTC === 'utc';
|
|
490
530
|
const xAxisScale = isUtcSet ? (0, _d3scale.scaleUtc)() : (0, _d3scale.scaleTime)();
|
|
491
531
|
xAxisScale.domain([
|
|
@@ -536,12 +576,19 @@ function createDateXAxis(xAxisParams, tickParams, culture, options, timeFormatLo
|
|
|
536
576
|
].includes(chartType)) {
|
|
537
577
|
xAxis.tickSizeInner(-(xAxisParams.containerHeight - xAxisParams.margins.top));
|
|
538
578
|
}
|
|
539
|
-
|
|
579
|
+
let customTickValues;
|
|
580
|
+
if (tickParams.tickValues) {
|
|
581
|
+
customTickValues = tickParams.tickValues;
|
|
582
|
+
} else if (tickStep) {
|
|
583
|
+
customTickValues = generateDateTicks(tickStep, tick0, xAxisScale.domain(), useUTC);
|
|
584
|
+
}
|
|
585
|
+
if (customTickValues) {
|
|
586
|
+
xAxis.tickValues(customTickValues);
|
|
587
|
+
}
|
|
540
588
|
if (xAxisElement) {
|
|
541
589
|
(0, _d3selection.select)(xAxisElement).call(xAxis).selectAll('text').attr('aria-hidden', 'true');
|
|
542
590
|
}
|
|
543
|
-
|
|
544
|
-
const tickValues = ((_tickParams_tickValues = tickParams.tickValues) !== null && _tickParams_tickValues !== void 0 ? _tickParams_tickValues : xAxisScale.ticks(tickCount)).map(xAxis.tickFormat());
|
|
591
|
+
const tickValues = (customTickValues !== null && customTickValues !== void 0 ? customTickValues : xAxisScale.ticks(tickCount)).map(xAxis.tickFormat());
|
|
545
592
|
return {
|
|
546
593
|
xScale: xAxisScale,
|
|
547
594
|
tickValues
|
|
@@ -657,7 +704,7 @@ function createYAxisForHorizontalBarChartWithAxis(yAxisParams, isRtl) {
|
|
|
657
704
|
const { yMinMaxValues = {
|
|
658
705
|
startValue: 0,
|
|
659
706
|
endValue: 0
|
|
660
|
-
}, yAxisElement = null, yMaxValue = 0, yMinValue = 0, containerHeight, margins, tickPadding = 12, maxOfYVal = 0, yAxisTickFormat, yAxisTickCount = 4 } = yAxisParams;
|
|
707
|
+
}, yAxisElement = null, yMaxValue = 0, yMinValue = 0, containerHeight, margins, tickPadding = 12, maxOfYVal = 0, yAxisTickFormat, yAxisTickCount = 4, tickValues, tickStep, tick0 } = yAxisParams;
|
|
661
708
|
// maxOfYVal coming from horizontal bar chart with axis (Calculation done at base file)
|
|
662
709
|
const tempVal = maxOfYVal || yMinMaxValues.endValue;
|
|
663
710
|
const finalYmax = tempVal > yMaxValue ? tempVal : yMaxValue;
|
|
@@ -672,14 +719,23 @@ function createYAxisForHorizontalBarChartWithAxis(yAxisParams, isRtl) {
|
|
|
672
719
|
const axis = isRtl ? (0, _d3axis.axisRight)(yAxisScale) : (0, _d3axis.axisLeft)(yAxisScale);
|
|
673
720
|
const yAxis = axis.tickPadding(tickPadding).ticks(yAxisTickCount);
|
|
674
721
|
yAxisTickFormat ? yAxis.tickFormat(yAxisTickFormat) : yAxis.tickFormat(defaultYAxisTickFormatter);
|
|
722
|
+
let customTickValues;
|
|
723
|
+
if (tickValues) {
|
|
724
|
+
customTickValues = tickValues;
|
|
725
|
+
} else if (tickStep) {
|
|
726
|
+
customTickValues = generateNumericTicks(undefined, tickStep, tick0, yAxisScale.domain());
|
|
727
|
+
}
|
|
728
|
+
if (customTickValues) {
|
|
729
|
+
yAxis.tickValues(customTickValues);
|
|
730
|
+
}
|
|
675
731
|
yAxisElement ? (0, _d3selection.select)(yAxisElement).call(yAxis).selectAll('text').attr('aria-hidden', 'true') : '';
|
|
676
732
|
return yAxisScale;
|
|
677
733
|
}
|
|
678
|
-
function createNumericYAxis(yAxisParams, isRtl, axisData, isIntegralDataset, chartType, useSecondaryYScale = false, roundedTicks = false) {
|
|
734
|
+
function createNumericYAxis(yAxisParams, isRtl, axisData, isIntegralDataset, chartType, useSecondaryYScale = false, roundedTicks = false, scaleType) {
|
|
679
735
|
const { yMinMaxValues = {
|
|
680
736
|
startValue: 0,
|
|
681
737
|
endValue: 0
|
|
682
|
-
}, yAxisElement = null, yMaxValue = 0, yMinValue = 0, containerHeight, containerWidth, margins, tickPadding = 12, maxOfYVal = 0, yAxisTickFormat, yAxisTickCount = 4, eventAnnotationProps, eventLabelHeight } = yAxisParams;
|
|
738
|
+
}, yAxisElement = null, yMaxValue = 0, yMinValue = 0, containerHeight, containerWidth, margins, tickPadding = 12, maxOfYVal = 0, yAxisTickFormat, yAxisTickCount = 4, eventAnnotationProps, eventLabelHeight, tickValues, tickStep, tick0 } = yAxisParams;
|
|
683
739
|
// maxOfYVal coming from only area chart and Grouped vertical bar chart(Calculation done at base file)
|
|
684
740
|
const tempVal = maxOfYVal || yMinMaxValues.endValue || 0;
|
|
685
741
|
const finalYmax = tempVal > yMaxValue ? tempVal : yMaxValue;
|
|
@@ -692,18 +748,53 @@ function createNumericYAxis(yAxisParams, isRtl, axisData, isIntegralDataset, cha
|
|
|
692
748
|
yMin = yMin - yPadding;
|
|
693
749
|
yMax = yMax + yPadding;
|
|
694
750
|
}
|
|
695
|
-
|
|
751
|
+
let scaleDomain = [
|
|
696
752
|
domainValues[0],
|
|
697
|
-
|
|
698
|
-
]
|
|
753
|
+
domainValues[domainValues.length - 1]
|
|
754
|
+
];
|
|
755
|
+
if (scaleType === 'log') {
|
|
756
|
+
let domainStart = yMinMaxValues.startValue;
|
|
757
|
+
let domainEnd = yMinMaxValues.endValue;
|
|
758
|
+
if (yMinValue > 0) {
|
|
759
|
+
domainStart = Math.min(domainStart, yMinValue);
|
|
760
|
+
}
|
|
761
|
+
if (yMaxValue > 0) {
|
|
762
|
+
domainEnd = Math.max(domainEnd, yMaxValue);
|
|
763
|
+
}
|
|
764
|
+
scaleDomain = [
|
|
765
|
+
domainStart,
|
|
766
|
+
domainEnd
|
|
767
|
+
];
|
|
768
|
+
}
|
|
769
|
+
const yAxisScale = createNumericScale(scaleType).domain(scaleDomain).range([
|
|
699
770
|
containerHeight - margins.bottom,
|
|
700
771
|
margins.top + (eventAnnotationProps ? eventLabelHeight : 0)
|
|
701
772
|
]);
|
|
702
773
|
const axis = !isRtl && useSecondaryYScale || isRtl && !useSecondaryYScale ? (0, _d3axis.axisRight)(yAxisScale) : (0, _d3axis.axisLeft)(yAxisScale);
|
|
703
|
-
const yAxis = axis.tickPadding(tickPadding).
|
|
704
|
-
|
|
774
|
+
const yAxis = axis.tickPadding(tickPadding).tickSizeInner(-(containerWidth - margins.left - margins.right));
|
|
775
|
+
let customTickValues;
|
|
776
|
+
if (tickValues) {
|
|
777
|
+
customTickValues = tickValues;
|
|
778
|
+
} else if (tickStep) {
|
|
779
|
+
customTickValues = generateNumericTicks(scaleType, tickStep, tick0, yAxisScale.domain());
|
|
780
|
+
}
|
|
781
|
+
if (customTickValues) {
|
|
782
|
+
yAxis.tickValues(customTickValues);
|
|
783
|
+
axisData.yAxisDomainValues = customTickValues;
|
|
784
|
+
} else {
|
|
785
|
+
if (scaleType === 'log') {
|
|
786
|
+
axisData.yAxisDomainValues = yAxisScale.ticks();
|
|
787
|
+
} else {
|
|
788
|
+
yAxis.tickValues(domainValues);
|
|
789
|
+
axisData.yAxisDomainValues = domainValues;
|
|
790
|
+
}
|
|
791
|
+
}
|
|
792
|
+
const tickFormat = (domainValue, index, defaultFormat)=>{
|
|
793
|
+
const value = typeof domainValue === 'number' ? domainValue : domainValue.valueOf();
|
|
794
|
+
return (defaultFormat === null || defaultFormat === void 0 ? void 0 : defaultFormat(value)) === '' ? '' : defaultYAxisTickFormatter(value);
|
|
795
|
+
};
|
|
796
|
+
yAxisTickFormat ? yAxis.tickFormat(yAxisTickFormat) : yAxis.tickFormat((v, i)=>tickFormat(v, i, yAxisScale.tickFormat(yAxisTickCount)));
|
|
705
797
|
yAxisElement ? (0, _d3selection.select)(yAxisElement).call(yAxis).selectAll('text').attr('aria-hidden', 'true') : '';
|
|
706
|
-
axisData.yAxisDomainValues = domainValues;
|
|
707
798
|
return yAxisScale;
|
|
708
799
|
}
|
|
709
800
|
const createStringYAxisForHorizontalBarChartWithAxis = (yAxisParams, dataPoints, isRtl, barWidth)=>{
|
|
@@ -722,14 +813,20 @@ const createStringYAxisForHorizontalBarChartWithAxis = (yAxisParams, dataPoints,
|
|
|
722
813
|
yAxisElement ? (0, _d3selection.select)(yAxisElement).call(yAxis).selectAll('text') : '';
|
|
723
814
|
return yAxisScale;
|
|
724
815
|
};
|
|
725
|
-
const createStringYAxis = (yAxisParams, dataPoints, isRtl)=>{
|
|
726
|
-
const { containerHeight, tickPadding = 12, margins, yAxisTickFormat, yAxisElement, yAxisPadding = 0 } = yAxisParams;
|
|
816
|
+
const createStringYAxis = (yAxisParams, dataPoints, isRtl, barWidth, chartType)=>{
|
|
817
|
+
const { containerHeight, tickPadding = 12, margins, yAxisTickFormat, yAxisElement, yAxisPadding = 0, containerWidth } = yAxisParams;
|
|
727
818
|
const yAxisScale = (0, _d3scale.scaleBand)().domain(dataPoints).range([
|
|
728
819
|
containerHeight - margins.bottom,
|
|
729
820
|
margins.top
|
|
730
821
|
]).padding(yAxisPadding);
|
|
822
|
+
if (chartType === 3) {
|
|
823
|
+
yAxisScale.paddingInner(1).paddingOuter(0);
|
|
824
|
+
}
|
|
731
825
|
const axis = isRtl ? (0, _d3axis.axisRight)(yAxisScale) : (0, _d3axis.axisLeft)(yAxisScale);
|
|
732
826
|
const yAxis = axis.tickPadding(tickPadding).tickValues(dataPoints).tickSize(0);
|
|
827
|
+
if (chartType === 3) {
|
|
828
|
+
axis.tickSizeInner(-(containerWidth - margins.left - margins.right));
|
|
829
|
+
}
|
|
733
830
|
if (yAxisTickFormat) {
|
|
734
831
|
yAxis.tickFormat(yAxisTickFormat);
|
|
735
832
|
}
|
|
@@ -750,6 +847,7 @@ function calloutData(values) {
|
|
|
750
847
|
combinedResult = combinedResult.concat(elements);
|
|
751
848
|
});
|
|
752
849
|
const xValToDataPoints = {};
|
|
850
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
753
851
|
combinedResult.forEach((ele)=>{
|
|
754
852
|
const xValue = ele.x instanceof Date ? ele.x.getTime() : ele.x;
|
|
755
853
|
if (xValue in xValToDataPoints) {
|
|
@@ -877,9 +975,9 @@ function createYAxisLabels(node, yAxis, noOfCharsToTruncate, truncateLabel, isRt
|
|
|
877
975
|
const uid = tickIndex++;
|
|
878
976
|
text.text(null).append('tspan').attr('x', x).attr('y', y).attr('id', `BaseSpan-${uid}`).attr('dy', dy + 'em').attr('data-', totalWord);
|
|
879
977
|
if (truncateLabel && totalWordLength > noOfCharsToTruncate) {
|
|
880
|
-
text.append('tspan').attr('id', `showDots-${uid}`).attr('x',
|
|
978
|
+
text.append('tspan').attr('id', `showDots-${uid}`).attr('x', x).attr('y', y).attr('dy', dy + 'em').attr('dx', padding + dx + 'em').text(truncatedWord);
|
|
881
979
|
} else {
|
|
882
|
-
text.
|
|
980
|
+
text.append('tspan').attr('id', `LessLength-${uid}`).attr('x', x).attr('y', y).attr('dx', padding + dx + 'em').text(totalWord);
|
|
883
981
|
}
|
|
884
982
|
});
|
|
885
983
|
}
|
|
@@ -926,7 +1024,7 @@ function tooltipOfAxislabels(axistooltipProps) {
|
|
|
926
1024
|
return null;
|
|
927
1025
|
}
|
|
928
1026
|
const div = (0, _d3selection.select)('body').append('div').attr('id', id).attr('class', tooltipCls).style('opacity', 0);
|
|
929
|
-
const aa = axis.selectAll('
|
|
1027
|
+
const aa = axis.selectAll('[id^="BaseSpan-"]')._groups[0];
|
|
930
1028
|
const baseSpanLength = aa && Object.keys(aa).length;
|
|
931
1029
|
const originalDataArray = [];
|
|
932
1030
|
for(let i = 0; i < baseSpanLength; i++){
|
|
@@ -958,51 +1056,24 @@ function getXAxisType(points) {
|
|
|
958
1056
|
}
|
|
959
1057
|
return isXAxisDateType;
|
|
960
1058
|
}
|
|
961
|
-
function
|
|
962
|
-
const
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
});
|
|
970
|
-
const rStartValue = margins.left;
|
|
971
|
-
const rEndValue = width - margins.right;
|
|
972
|
-
return isRTL ? {
|
|
973
|
-
dStartValue: xMax,
|
|
974
|
-
dEndValue: xMin,
|
|
975
|
-
rStartValue,
|
|
976
|
-
rEndValue
|
|
977
|
-
} : {
|
|
978
|
-
dStartValue: xMin,
|
|
979
|
-
dEndValue: xMax,
|
|
980
|
-
rStartValue,
|
|
981
|
-
rEndValue
|
|
982
|
-
};
|
|
983
|
-
}
|
|
984
|
-
function domainRangeOfNumericForScatterChart(points, margins, width, isRTL) {
|
|
985
|
-
let xMin = (0, _d3array.min)(points, (point)=>{
|
|
986
|
-
return (0, _d3array.min)(point.data, (item)=>item.x);
|
|
987
|
-
});
|
|
988
|
-
let xMax = (0, _d3array.max)(points, (point)=>{
|
|
989
|
-
return (0, _d3array.max)(point.data, (item)=>{
|
|
990
|
-
return item.x;
|
|
991
|
-
});
|
|
992
|
-
});
|
|
993
|
-
const xPadding = (xMax - xMin) * 0.1;
|
|
994
|
-
xMin = xMin - xPadding;
|
|
995
|
-
xMax = xMax + xPadding;
|
|
1059
|
+
function domainRangeOfNumericForAreaLineScatterCharts(points, margins, width, isRTL, scaleType, hasMarkersMode) {
|
|
1060
|
+
const isScatterPolar = isScatterPolarSeries(points);
|
|
1061
|
+
let [xMin, xMax] = getScatterXDomainExtent(points, scaleType);
|
|
1062
|
+
if (hasMarkersMode) {
|
|
1063
|
+
const xPadding = getDomainPaddingForMarkers(xMin, xMax, scaleType);
|
|
1064
|
+
xMin = xMin - xPadding.start;
|
|
1065
|
+
xMax = xMax + xPadding.end;
|
|
1066
|
+
}
|
|
996
1067
|
const rStartValue = margins.left;
|
|
997
1068
|
const rEndValue = width - margins.right;
|
|
998
1069
|
return isRTL ? {
|
|
999
|
-
dStartValue: xMax,
|
|
1000
|
-
dEndValue: xMin,
|
|
1070
|
+
dStartValue: isScatterPolar ? 1 : xMax,
|
|
1071
|
+
dEndValue: isScatterPolar ? -1 : xMin,
|
|
1001
1072
|
rStartValue,
|
|
1002
1073
|
rEndValue
|
|
1003
1074
|
} : {
|
|
1004
|
-
dStartValue: xMin,
|
|
1005
|
-
dEndValue: xMax,
|
|
1075
|
+
dStartValue: isScatterPolar ? -1 : xMin,
|
|
1076
|
+
dEndValue: isScatterPolar ? 1 : xMax,
|
|
1006
1077
|
rStartValue,
|
|
1007
1078
|
rEndValue
|
|
1008
1079
|
};
|
|
@@ -1082,22 +1153,15 @@ function domainRangeOfVSBCNumeric(points, margins, width, isRTL, barWidth) {
|
|
|
1082
1153
|
rEndValue: rMin
|
|
1083
1154
|
};
|
|
1084
1155
|
}
|
|
1085
|
-
function
|
|
1156
|
+
function domainRangeOfDateForAreaLineScatterVerticalBarCharts(points, margins, width, isRTL, tickValues = [], chartType, barWidth, hasMarkersMode) {
|
|
1086
1157
|
let sDate;
|
|
1087
1158
|
let lDate;
|
|
1088
|
-
if (
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
});
|
|
1095
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1096
|
-
lDate = (0, _d3array.max)(points, (point)=>{
|
|
1097
|
-
return (0, _d3array.max)(point.data, (item)=>{
|
|
1098
|
-
return item.x;
|
|
1099
|
-
});
|
|
1100
|
-
});
|
|
1159
|
+
if ([
|
|
1160
|
+
0,
|
|
1161
|
+
1,
|
|
1162
|
+
7
|
|
1163
|
+
].includes(chartType)) {
|
|
1164
|
+
[sDate, lDate] = getScatterXDomainExtent(points);
|
|
1101
1165
|
// Need to draw graph with given small and large date
|
|
1102
1166
|
// (Which Involves customization of date axis tick values)
|
|
1103
1167
|
// That may be Either from given graph data or from prop 'tickValues' date values.
|
|
@@ -1115,6 +1179,11 @@ function domainRangeOfDateForAreaLineVerticalBarChart(points, margins, width, is
|
|
|
1115
1179
|
sDate = (0, _d3array.min)(points, (point)=>point.x);
|
|
1116
1180
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1117
1181
|
lDate = (0, _d3array.max)(points, (point)=>point.x);
|
|
1182
|
+
if (hasMarkersMode || chartType === 7) {
|
|
1183
|
+
const xPadding = getDomainPaddingForMarkers(sDate.getTime(), lDate.getTime());
|
|
1184
|
+
sDate = new Date(sDate.getTime() - xPadding.start);
|
|
1185
|
+
lDate = new Date(lDate.getTime() + xPadding.end);
|
|
1186
|
+
}
|
|
1118
1187
|
}
|
|
1119
1188
|
const rStartValue = margins.left;
|
|
1120
1189
|
const rEndValue = width - margins.right;
|
|
@@ -1130,50 +1199,6 @@ function domainRangeOfDateForAreaLineVerticalBarChart(points, margins, width, is
|
|
|
1130
1199
|
rEndValue
|
|
1131
1200
|
};
|
|
1132
1201
|
}
|
|
1133
|
-
function domainRangeOfDateForScatterChart(points, margins, width, isRTL, tickValues = []) {
|
|
1134
|
-
let sDate;
|
|
1135
|
-
let lDate;
|
|
1136
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1137
|
-
sDate = (0, _d3array.min)(points, (point)=>{
|
|
1138
|
-
return (0, _d3array.min)(point.data, (item)=>{
|
|
1139
|
-
return item.x;
|
|
1140
|
-
});
|
|
1141
|
-
});
|
|
1142
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1143
|
-
lDate = (0, _d3array.max)(points, (point)=>{
|
|
1144
|
-
return (0, _d3array.max)(point.data, (item)=>{
|
|
1145
|
-
return item.x;
|
|
1146
|
-
});
|
|
1147
|
-
});
|
|
1148
|
-
const xPadding = (lDate.getTime() - sDate.getTime()) * 0.1;
|
|
1149
|
-
sDate = new Date(sDate.getTime() - xPadding);
|
|
1150
|
-
lDate = new Date(lDate.getTime() + xPadding);
|
|
1151
|
-
// Need to draw graph with given small and large date
|
|
1152
|
-
// (Which Involves customization of date axis tick values)
|
|
1153
|
-
// That may be Either from given graph data or from prop 'tickValues' date values.
|
|
1154
|
-
// So, Finding smallest and largest dates
|
|
1155
|
-
sDate = (0, _d3array.min)([
|
|
1156
|
-
...tickValues,
|
|
1157
|
-
sDate
|
|
1158
|
-
]);
|
|
1159
|
-
lDate = (0, _d3array.max)([
|
|
1160
|
-
...tickValues,
|
|
1161
|
-
lDate
|
|
1162
|
-
]);
|
|
1163
|
-
const rStartValue = margins.left;
|
|
1164
|
-
const rEndValue = width - margins.right;
|
|
1165
|
-
return isRTL ? {
|
|
1166
|
-
dStartValue: lDate,
|
|
1167
|
-
dEndValue: sDate,
|
|
1168
|
-
rStartValue,
|
|
1169
|
-
rEndValue
|
|
1170
|
-
} : {
|
|
1171
|
-
dStartValue: sDate,
|
|
1172
|
-
dEndValue: lDate,
|
|
1173
|
-
rStartValue,
|
|
1174
|
-
rEndValue
|
|
1175
|
-
};
|
|
1176
|
-
}
|
|
1177
1202
|
function domainRangeOfVerticalNumeric(points, margins, containerWidth, isRTL, barWidth) {
|
|
1178
1203
|
const xMax = (0, _d3array.max)(points, (point)=>point.x);
|
|
1179
1204
|
const xMin = (0, _d3array.min)(points, (point)=>point.x);
|
|
@@ -1191,12 +1216,14 @@ function domainRangeOfVerticalNumeric(points, margins, containerWidth, isRTL, ba
|
|
|
1191
1216
|
rEndValue: rMax
|
|
1192
1217
|
};
|
|
1193
1218
|
}
|
|
1194
|
-
function findNumericMinMaxOfY(points, yAxisType, useSecondaryYScale) {
|
|
1219
|
+
function findNumericMinMaxOfY(points, yAxisType, useSecondaryYScale, scaleType) {
|
|
1195
1220
|
const values = [];
|
|
1196
1221
|
points.forEach((point)=>{
|
|
1197
1222
|
if (!useSecondaryYScale === !point.useSecondaryYScale) {
|
|
1198
1223
|
point.data.forEach((data)=>{
|
|
1199
|
-
|
|
1224
|
+
if (isValidDomainValue(data.y, scaleType)) {
|
|
1225
|
+
values.push(data.y);
|
|
1226
|
+
}
|
|
1200
1227
|
});
|
|
1201
1228
|
}
|
|
1202
1229
|
});
|
|
@@ -1574,3 +1601,176 @@ const createMeasurementSpan = (text, className, parentElement)=>{
|
|
|
1574
1601
|
measurementSpan.textContent = `${text}`;
|
|
1575
1602
|
return measurementSpan;
|
|
1576
1603
|
};
|
|
1604
|
+
function isScatterPolarSeries(points) {
|
|
1605
|
+
return points.some((item)=>{
|
|
1606
|
+
var _item_lineOptions;
|
|
1607
|
+
return typeof ((_item_lineOptions = item.lineOptions) === null || _item_lineOptions === void 0 ? void 0 : _item_lineOptions.mode) === 'string' && item.lineOptions.mode === 'scatterpolar';
|
|
1608
|
+
});
|
|
1609
|
+
}
|
|
1610
|
+
function isTextMode(points) {
|
|
1611
|
+
return points.some((item)=>{
|
|
1612
|
+
var _item_lineOptions;
|
|
1613
|
+
return typeof ((_item_lineOptions = item.lineOptions) === null || _item_lineOptions === void 0 ? void 0 : _item_lineOptions.mode) === 'string' && item.lineOptions.mode === 'text';
|
|
1614
|
+
});
|
|
1615
|
+
}
|
|
1616
|
+
// TODO: Refactor to encapsulate the complete numeric scale creation logic here, including setting domain and range.
|
|
1617
|
+
const createNumericScale = (scaleType)=>{
|
|
1618
|
+
if (scaleType === 'log') {
|
|
1619
|
+
return (0, _d3scale.scaleLog)();
|
|
1620
|
+
} else {
|
|
1621
|
+
return (0, _d3scale.scaleLinear)();
|
|
1622
|
+
}
|
|
1623
|
+
};
|
|
1624
|
+
const getDomainPaddingForMarkers = (minVal, maxVal, scaleType)=>{
|
|
1625
|
+
if (scaleType === 'log') {
|
|
1626
|
+
return {
|
|
1627
|
+
start: minVal * 0.5,
|
|
1628
|
+
end: maxVal
|
|
1629
|
+
};
|
|
1630
|
+
}
|
|
1631
|
+
const defaultPadding = (maxVal - minVal) * 0.1;
|
|
1632
|
+
return {
|
|
1633
|
+
start: defaultPadding,
|
|
1634
|
+
end: defaultPadding
|
|
1635
|
+
};
|
|
1636
|
+
};
|
|
1637
|
+
const isValidDomainValue = (value, scaleType)=>{
|
|
1638
|
+
return typeof value !== 'number' || scaleType !== 'log' || value > 0;
|
|
1639
|
+
};
|
|
1640
|
+
const isPlottable = (x, y)=>{
|
|
1641
|
+
return !(0, _chartutilities.isInvalidValue)(x) && !(0, _chartutilities.isInvalidValue)(y);
|
|
1642
|
+
};
|
|
1643
|
+
const getScatterXDomainExtent = (points, scaleType)=>{
|
|
1644
|
+
const isValidDataPointForScale = (item)=>isValidDomainValue(item.x, scaleType);
|
|
1645
|
+
const xMin = (0, _d3array.min)(points, (point)=>{
|
|
1646
|
+
return (0, _d3array.min)(point.data.filter(isValidDataPointForScale), (item)=>item.x);
|
|
1647
|
+
});
|
|
1648
|
+
const xMax = (0, _d3array.max)(points, (point)=>{
|
|
1649
|
+
return (0, _d3array.max)(point.data.filter(isValidDataPointForScale), (item)=>{
|
|
1650
|
+
return item.x;
|
|
1651
|
+
});
|
|
1652
|
+
});
|
|
1653
|
+
return [
|
|
1654
|
+
xMin,
|
|
1655
|
+
xMax
|
|
1656
|
+
];
|
|
1657
|
+
};
|
|
1658
|
+
const getRangeForScatterMarkerSize = ({ data, xScale, yScalePrimary, yScaleSecondary, useSecondaryYScale, xScaleType, yScaleType: primaryYScaleType, secondaryYScaleType })=>{
|
|
1659
|
+
// Note: This function is executed after the scale is created, so the actual padding can be
|
|
1660
|
+
// obtained by calculating the difference between the respective minimums or maximums of the
|
|
1661
|
+
// scale domain and the data. However, doing so often causes the marker size to scale up
|
|
1662
|
+
// unnecessarily when the scale uses a wider domain than required (due to the use of D3's nice
|
|
1663
|
+
// function or our own tick value calculations).
|
|
1664
|
+
// A better approach could be to treat the marker size as a fixed pixel value and adjust the
|
|
1665
|
+
// scale domain with sufficient padding to accommodate the maximum marker size—instead of doing
|
|
1666
|
+
// it the other way around (i.e., adjusting the scale domain first with padding and then scaling
|
|
1667
|
+
// the markers to fit inside the plot area).
|
|
1668
|
+
const [xMin, xMax] = getScatterXDomainExtent(data, xScaleType);
|
|
1669
|
+
const xPadding = getDomainPaddingForMarkers(+xMin, +xMax, xScaleType);
|
|
1670
|
+
const scaleXMin = xMin instanceof Date ? new Date(+xMin - xPadding.start) : xMin - xPadding.start;
|
|
1671
|
+
const scaleXMax = xMax instanceof Date ? new Date(+xMax + xPadding.end) : xMax + xPadding.end;
|
|
1672
|
+
const extraXPixels = Math.min(Math.abs(xScale(xMin) - xScale(scaleXMin)), Math.abs(xScale(scaleXMax) - xScale(xMax)));
|
|
1673
|
+
const yScaleType = useSecondaryYScale ? secondaryYScaleType : primaryYScaleType;
|
|
1674
|
+
const { startValue: yMin, endValue: yMax } = findNumericMinMaxOfY(data, undefined, useSecondaryYScale, yScaleType);
|
|
1675
|
+
const yPadding = getDomainPaddingForMarkers(yMin, yMax, yScaleType);
|
|
1676
|
+
const scaleYMin = yMin - yPadding.start;
|
|
1677
|
+
const scaleYMax = yMax + yPadding.end;
|
|
1678
|
+
const yScale = useSecondaryYScale ? yScaleSecondary : yScalePrimary;
|
|
1679
|
+
const extraYPixels = Math.min(Math.abs(yScale(scaleYMin) - yScale(yMin)), Math.abs(yScale(yMax) - yScale(scaleYMax)));
|
|
1680
|
+
return Math.min(extraXPixels, extraYPixels);
|
|
1681
|
+
};
|
|
1682
|
+
const generateLinearTicks = (tick0, tickStep, scaleDomain)=>{
|
|
1683
|
+
const domainMin = (0, _d3array.min)(scaleDomain);
|
|
1684
|
+
const domainMax = (0, _d3array.max)(scaleDomain);
|
|
1685
|
+
const precision = Math.max(calculatePrecision(tick0), calculatePrecision(tickStep));
|
|
1686
|
+
const start = Math.ceil(precisionRound((domainMin - tick0) / tickStep, precision));
|
|
1687
|
+
const end = Math.floor(precisionRound((domainMax - tick0) / tickStep, precision));
|
|
1688
|
+
const ticks = [];
|
|
1689
|
+
for(let i = start; i <= end; i++){
|
|
1690
|
+
ticks.push(precisionRound(tick0 + i * tickStep, precision));
|
|
1691
|
+
}
|
|
1692
|
+
return ticks;
|
|
1693
|
+
};
|
|
1694
|
+
const generateMonthlyTicks = (tick0, tickStepInMonths, scaleDomain, useUTC)=>{
|
|
1695
|
+
const domainMin = +(0, _d3array.min)(scaleDomain);
|
|
1696
|
+
const domainMax = +(0, _d3array.max)(scaleDomain);
|
|
1697
|
+
const getMonth = (d)=>useUTC ? d.getUTCMonth() : d.getMonth();
|
|
1698
|
+
const setMonth = (d, month)=>useUTC ? new Date(d.setUTCMonth(month)) : new Date(d.setMonth(month));
|
|
1699
|
+
// Find the earliest tick <= domainMin
|
|
1700
|
+
let start = 0;
|
|
1701
|
+
for(let firstTick = new Date(+tick0); +firstTick > domainMin;){
|
|
1702
|
+
firstTick = setMonth(firstTick, getMonth(firstTick) - tickStepInMonths);
|
|
1703
|
+
start -= tickStepInMonths;
|
|
1704
|
+
}
|
|
1705
|
+
const baseMonth = getMonth(tick0);
|
|
1706
|
+
const ticks = [];
|
|
1707
|
+
// Generate ticks forward until domainMax
|
|
1708
|
+
for(let i = start;; i += tickStepInMonths){
|
|
1709
|
+
let tickDate = setMonth(new Date(+tick0), baseMonth + i);
|
|
1710
|
+
// Handle month rollover (e.g., Jan 31 + 1 month → Mar 3 instead of Feb)
|
|
1711
|
+
if (getMonth(tickDate) !== ((baseMonth + i) % 12 + 12) % 12) {
|
|
1712
|
+
tickDate = useUTC ? new Date(tickDate.setUTCDate(0)) : new Date(tickDate.setDate(0));
|
|
1713
|
+
}
|
|
1714
|
+
if (+tickDate > domainMax) {
|
|
1715
|
+
break;
|
|
1716
|
+
}
|
|
1717
|
+
if (+tickDate >= domainMin) {
|
|
1718
|
+
ticks.push(tickDate);
|
|
1719
|
+
}
|
|
1720
|
+
}
|
|
1721
|
+
return ticks;
|
|
1722
|
+
};
|
|
1723
|
+
const generateNumericTicks = (scaleType, tickStep, tick0, scaleDomain)=>{
|
|
1724
|
+
const refTick = typeof tick0 === 'number' ? tick0 : 0;
|
|
1725
|
+
if (scaleType === 'log') {
|
|
1726
|
+
if (typeof tickStep === 'number' && tickStep > 0) {
|
|
1727
|
+
return generateLinearTicks(refTick, tickStep, scaleDomain.map((d)=>Math.log10(d))).map((t)=>Math.pow(10, t));
|
|
1728
|
+
}
|
|
1729
|
+
if (typeof tickStep === 'string') {
|
|
1730
|
+
const prefix = tickStep[0];
|
|
1731
|
+
const num = (0, _chartutilities.isNumber)(tickStep.slice(1)) ? Number(tickStep.slice(1)) : 0;
|
|
1732
|
+
if (prefix === 'L' && num > 0) {
|
|
1733
|
+
return generateLinearTicks(refTick, num, scaleDomain);
|
|
1734
|
+
}
|
|
1735
|
+
}
|
|
1736
|
+
return;
|
|
1737
|
+
}
|
|
1738
|
+
if (typeof tickStep === 'number' && tickStep > 0) {
|
|
1739
|
+
return generateLinearTicks(refTick, tickStep, scaleDomain);
|
|
1740
|
+
}
|
|
1741
|
+
};
|
|
1742
|
+
const generateDateTicks = (tickStep, tick0, scaleDomain, useUTC)=>{
|
|
1743
|
+
const refTick = tick0 instanceof Date ? tick0 : new Date(DEFAULT_DATE_STRING);
|
|
1744
|
+
if (typeof tickStep === 'number' && tickStep > 0) {
|
|
1745
|
+
return generateLinearTicks(+refTick, tickStep, scaleDomain.map((d)=>+d)).map((t)=>new Date(t));
|
|
1746
|
+
}
|
|
1747
|
+
if (typeof tickStep === 'string') {
|
|
1748
|
+
const prefix = tickStep[0];
|
|
1749
|
+
const num = (0, _chartutilities.isNumber)(tickStep.slice(1)) ? Number(tickStep.slice(1)) : 0;
|
|
1750
|
+
if (prefix === 'M' && num > 0 && num === Math.round(num)) {
|
|
1751
|
+
return generateMonthlyTicks(refTick, num, scaleDomain, useUTC);
|
|
1752
|
+
}
|
|
1753
|
+
}
|
|
1754
|
+
};
|
|
1755
|
+
function calculatePrecision(value) {
|
|
1756
|
+
/**
|
|
1757
|
+
* Group 1:
|
|
1758
|
+
* [1-9]([0]+$) matches trailing zeros
|
|
1759
|
+
* Group 2:
|
|
1760
|
+
* \.([0-9]*) matches all digits after a decimal point.
|
|
1761
|
+
*/ const groups = /[1-9]([0]+$)|\.([0-9]*)/.exec(String(value));
|
|
1762
|
+
if (!groups) {
|
|
1763
|
+
return 0;
|
|
1764
|
+
}
|
|
1765
|
+
if (groups[1]) {
|
|
1766
|
+
return -groups[1].length;
|
|
1767
|
+
}
|
|
1768
|
+
if (groups[2]) {
|
|
1769
|
+
return groups[2].length;
|
|
1770
|
+
}
|
|
1771
|
+
return 0;
|
|
1772
|
+
}
|
|
1773
|
+
function precisionRound(value, precision, base = 10) {
|
|
1774
|
+
const exp = Math.pow(base, precision);
|
|
1775
|
+
return Math.round(value * exp) / exp;
|
|
1776
|
+
}
|