@fluentui/react-charts 9.3.8 → 9.3.9
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 +35 -2
- package/dist/index.d.ts +378 -0
- package/lib/PolarChart.js +1 -0
- package/lib/PolarChart.js.map +1 -0
- package/lib/components/AnnotationOnlyChart/AnnotationOnlyChart.js +2 -1
- package/lib/components/AnnotationOnlyChart/AnnotationOnlyChart.js.map +1 -1
- package/lib/components/ChartTable/ChartTable.js +21 -7
- package/lib/components/ChartTable/ChartTable.js.map +1 -1
- package/lib/components/ChartTable/ChartTable.types.js.map +1 -1
- package/lib/components/ChartTable/useChartTableStyles.styles.js +24 -3
- package/lib/components/ChartTable/useChartTableStyles.styles.js.map +1 -1
- package/lib/components/ChartTable/useChartTableStyles.styles.raw.js +14 -2
- package/lib/components/ChartTable/useChartTableStyles.styles.raw.js.map +1 -1
- package/lib/components/CommonComponents/Annotations/ChartAnnotationLayer.js +7 -5
- package/lib/components/CommonComponents/Annotations/ChartAnnotationLayer.js.map +1 -1
- package/lib/components/CommonComponents/Annotations/ChartAnnotationLayer.types.js.map +1 -1
- package/lib/components/CommonComponents/Annotations/useChartAnnotationLayer.styles.js +47 -3
- package/lib/components/CommonComponents/Annotations/useChartAnnotationLayer.styles.js.map +1 -1
- package/lib/components/CommonComponents/Annotations/useChartAnnotationLayer.styles.raw.js +24 -17
- package/lib/components/CommonComponents/Annotations/useChartAnnotationLayer.styles.raw.js.map +1 -1
- package/lib/components/CommonComponents/CartesianChart.js +32 -13
- package/lib/components/CommonComponents/CartesianChart.js.map +1 -1
- package/lib/components/CommonComponents/CartesianChart.types.js.map +1 -1
- package/lib/components/DeclarativeChart/DeclarativeChart.js +33 -29
- package/lib/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
- package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js +413 -210
- package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
- package/lib/components/DonutChart/DonutChart.js +18 -6
- 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 +25 -5
- package/lib/components/DonutChart/useDonutChartStyles.styles.js.map +1 -1
- package/lib/components/DonutChart/useDonutChartStyles.styles.raw.js +16 -5
- package/lib/components/DonutChart/useDonutChartStyles.styles.raw.js.map +1 -1
- package/lib/components/FunnelChart/FunnelChart.js +28 -6
- package/lib/components/FunnelChart/FunnelChart.js.map +1 -1
- package/lib/components/FunnelChart/FunnelChart.types.js.map +1 -1
- package/lib/components/FunnelChart/useFunnelChartStyles.styles.js +26 -4
- package/lib/components/FunnelChart/useFunnelChartStyles.styles.js.map +1 -1
- package/lib/components/FunnelChart/useFunnelChartStyles.styles.raw.js +15 -3
- package/lib/components/FunnelChart/useFunnelChartStyles.styles.raw.js.map +1 -1
- package/lib/components/GaugeChart/GaugeChart.js +7 -6
- package/lib/components/GaugeChart/GaugeChart.js.map +1 -1
- package/lib/components/GaugeChart/GaugeChart.types.js.map +1 -1
- package/lib/components/GaugeChart/useGaugeChartStyles.styles.js +31 -19
- package/lib/components/GaugeChart/useGaugeChartStyles.styles.js.map +1 -1
- package/lib/components/GaugeChart/useGaugeChartStyles.styles.raw.js +23 -18
- package/lib/components/GaugeChart/useGaugeChartStyles.styles.raw.js.map +1 -1
- package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js +1 -1
- package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js.map +1 -1
- package/lib/components/HeatMapChart/HeatMapChart.js +5 -1
- package/lib/components/HeatMapChart/HeatMapChart.js.map +1 -1
- package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js +58 -6
- package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js.map +1 -1
- package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.types.js.map +1 -1
- package/lib/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.js +18 -3
- package/lib/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.js.map +1 -1
- package/lib/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.raw.js +13 -2
- package/lib/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.raw.js.map +1 -1
- package/lib/components/Legends/OverflowMenu.js +9 -2
- package/lib/components/Legends/OverflowMenu.js.map +1 -1
- package/lib/components/LineChart/LineChart.js +5 -6
- package/lib/components/LineChart/LineChart.js.map +1 -1
- package/lib/components/PolarChart/PolarChart.js +577 -0
- package/lib/components/PolarChart/PolarChart.js.map +1 -0
- package/lib/components/PolarChart/PolarChart.types.js +1 -0
- package/lib/components/PolarChart/PolarChart.types.js.map +1 -0
- package/lib/components/PolarChart/PolarChart.utils.js +174 -0
- package/lib/components/PolarChart/PolarChart.utils.js.map +1 -0
- package/lib/components/PolarChart/index.js +2 -0
- package/lib/components/PolarChart/index.js.map +1 -0
- package/lib/components/PolarChart/usePolarChartStyles.styles.js +72 -0
- package/lib/components/PolarChart/usePolarChartStyles.styles.js.map +1 -0
- package/lib/components/PolarChart/usePolarChartStyles.styles.raw.js +61 -0
- package/lib/components/PolarChart/usePolarChartStyles.styles.raw.js.map +1 -0
- package/lib/components/SankeyChart/SankeyChart.js +14 -4
- package/lib/components/SankeyChart/SankeyChart.js.map +1 -1
- package/lib/components/SankeyChart/SankeyChart.types.js.map +1 -1
- package/lib/components/SankeyChart/useSankeyChartStyles.styles.js +23 -6
- package/lib/components/SankeyChart/useSankeyChartStyles.styles.js.map +1 -1
- package/lib/components/SankeyChart/useSankeyChartStyles.styles.raw.js +15 -5
- package/lib/components/SankeyChart/useSankeyChartStyles.styles.raw.js.map +1 -1
- package/lib/components/ScatterChart/ScatterChart.js +1 -5
- package/lib/components/ScatterChart/ScatterChart.js.map +1 -1
- package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.js +29 -38
- package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.js.map +1 -1
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -1
- package/lib/types/DataPoint.js +1 -1
- package/lib/types/DataPoint.js.map +1 -1
- package/lib/utilities/ChartTitle.js +45 -0
- package/lib/utilities/ChartTitle.js.map +1 -0
- package/lib/utilities/Common.styles.js +73 -1
- package/lib/utilities/Common.styles.js.map +1 -1
- package/lib/utilities/Common.styles.raw.js +70 -0
- package/lib/utilities/Common.styles.raw.js.map +1 -1
- package/lib/utilities/index.js +1 -0
- package/lib/utilities/index.js.map +1 -1
- package/lib/utilities/utilities.js +6 -6
- package/lib/utilities/utilities.js.map +1 -1
- package/lib-commonjs/PolarChart.js +6 -0
- package/lib-commonjs/PolarChart.js.map +1 -0
- package/lib-commonjs/components/AnnotationOnlyChart/AnnotationOnlyChart.js +2 -1
- package/lib-commonjs/components/AnnotationOnlyChart/AnnotationOnlyChart.js.map +1 -1
- package/lib-commonjs/components/ChartTable/ChartTable.js +21 -7
- package/lib-commonjs/components/ChartTable/ChartTable.js.map +1 -1
- package/lib-commonjs/components/ChartTable/ChartTable.types.js.map +1 -1
- package/lib-commonjs/components/ChartTable/useChartTableStyles.styles.js +34 -3
- package/lib-commonjs/components/ChartTable/useChartTableStyles.styles.js.map +1 -1
- package/lib-commonjs/components/ChartTable/useChartTableStyles.styles.raw.js +14 -2
- package/lib-commonjs/components/ChartTable/useChartTableStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/components/CommonComponents/Annotations/ChartAnnotationLayer.js +7 -5
- package/lib-commonjs/components/CommonComponents/Annotations/ChartAnnotationLayer.js.map +1 -1
- package/lib-commonjs/components/CommonComponents/Annotations/ChartAnnotationLayer.types.js.map +1 -1
- package/lib-commonjs/components/CommonComponents/Annotations/useChartAnnotationLayer.styles.js +58 -4
- package/lib-commonjs/components/CommonComponents/Annotations/useChartAnnotationLayer.styles.js.map +1 -1
- package/lib-commonjs/components/CommonComponents/Annotations/useChartAnnotationLayer.styles.raw.js +24 -17
- package/lib-commonjs/components/CommonComponents/Annotations/useChartAnnotationLayer.styles.raw.js.map +1 -1
- package/lib-commonjs/components/CommonComponents/CartesianChart.js +31 -12
- 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/DeclarativeChart/DeclarativeChart.js +59 -56
- package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
- package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js +419 -213
- package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
- package/lib-commonjs/components/DonutChart/DonutChart.js +17 -5
- 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 +31 -4
- package/lib-commonjs/components/DonutChart/useDonutChartStyles.styles.js.map +1 -1
- package/lib-commonjs/components/DonutChart/useDonutChartStyles.styles.raw.js +15 -4
- package/lib-commonjs/components/DonutChart/useDonutChartStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/components/FunnelChart/FunnelChart.js +27 -5
- package/lib-commonjs/components/FunnelChart/FunnelChart.js.map +1 -1
- package/lib-commonjs/components/FunnelChart/FunnelChart.types.js.map +1 -1
- package/lib-commonjs/components/FunnelChart/useFunnelChartStyles.styles.js +36 -4
- package/lib-commonjs/components/FunnelChart/useFunnelChartStyles.styles.js.map +1 -1
- package/lib-commonjs/components/FunnelChart/useFunnelChartStyles.styles.raw.js +15 -3
- package/lib-commonjs/components/FunnelChart/useFunnelChartStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/components/GaugeChart/GaugeChart.js +6 -5
- package/lib-commonjs/components/GaugeChart/GaugeChart.js.map +1 -1
- package/lib-commonjs/components/GaugeChart/GaugeChart.types.js.map +1 -1
- package/lib-commonjs/components/GaugeChart/useGaugeChartStyles.styles.js +39 -18
- package/lib-commonjs/components/GaugeChart/useGaugeChartStyles.styles.js.map +1 -1
- package/lib-commonjs/components/GaugeChart/useGaugeChartStyles.styles.raw.js +23 -18
- package/lib-commonjs/components/GaugeChart/useGaugeChartStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js +1 -1
- package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js.map +1 -1
- package/lib-commonjs/components/HeatMapChart/HeatMapChart.js +5 -1
- package/lib-commonjs/components/HeatMapChart/HeatMapChart.js.map +1 -1
- package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js +57 -5
- package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js.map +1 -1
- package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.types.js.map +1 -1
- package/lib-commonjs/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.js +26 -3
- package/lib-commonjs/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.js.map +1 -1
- package/lib-commonjs/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.raw.js +13 -2
- package/lib-commonjs/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/components/Legends/OverflowMenu.js +9 -2
- package/lib-commonjs/components/Legends/OverflowMenu.js.map +1 -1
- package/lib-commonjs/components/LineChart/LineChart.js +5 -6
- package/lib-commonjs/components/LineChart/LineChart.js.map +1 -1
- package/lib-commonjs/components/PolarChart/PolarChart.js +587 -0
- package/lib-commonjs/components/PolarChart/PolarChart.js.map +1 -0
- package/lib-commonjs/components/PolarChart/PolarChart.types.js +6 -0
- package/lib-commonjs/components/PolarChart/PolarChart.types.js.map +1 -0
- package/lib-commonjs/components/PolarChart/PolarChart.utils.js +204 -0
- package/lib-commonjs/components/PolarChart/PolarChart.utils.js.map +1 -0
- package/lib-commonjs/components/PolarChart/index.js +7 -0
- package/lib-commonjs/components/PolarChart/index.js.map +1 -0
- package/lib-commonjs/components/PolarChart/usePolarChartStyles.styles.js +107 -0
- package/lib-commonjs/components/PolarChart/usePolarChartStyles.styles.js.map +1 -0
- package/lib-commonjs/components/PolarChart/usePolarChartStyles.styles.raw.js +75 -0
- package/lib-commonjs/components/PolarChart/usePolarChartStyles.styles.raw.js.map +1 -0
- package/lib-commonjs/components/SankeyChart/SankeyChart.js +14 -4
- package/lib-commonjs/components/SankeyChart/SankeyChart.js.map +1 -1
- package/lib-commonjs/components/SankeyChart/SankeyChart.types.js.map +1 -1
- package/lib-commonjs/components/SankeyChart/useSankeyChartStyles.styles.js +28 -4
- package/lib-commonjs/components/SankeyChart/useSankeyChartStyles.styles.js.map +1 -1
- package/lib-commonjs/components/SankeyChart/useSankeyChartStyles.styles.raw.js +14 -3
- package/lib-commonjs/components/SankeyChart/useSankeyChartStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/components/ScatterChart/ScatterChart.js +1 -5
- package/lib-commonjs/components/ScatterChart/ScatterChart.js.map +1 -1
- package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.js +29 -38
- package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.js.map +1 -1
- package/lib-commonjs/index.js +1 -0
- package/lib-commonjs/index.js.map +1 -1
- package/lib-commonjs/types/DataPoint.js +1 -1
- package/lib-commonjs/types/DataPoint.js.map +1 -1
- package/lib-commonjs/utilities/ChartTitle.js +53 -0
- package/lib-commonjs/utilities/ChartTitle.js.map +1 -0
- package/lib-commonjs/utilities/Common.styles.js +69 -0
- package/lib-commonjs/utilities/Common.styles.js.map +1 -1
- package/lib-commonjs/utilities/Common.styles.raw.js +69 -0
- package/lib-commonjs/utilities/Common.styles.raw.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/utilities.js +10 -4
- package/lib-commonjs/utilities/utilities.js.map +1 -1
- package/package.json +10 -16
|
@@ -17,40 +17,42 @@ const _reactsharedcontexts = require("@fluentui/react-shared-contexts");
|
|
|
17
17
|
const _tokens = require("@fluentui/tokens");
|
|
18
18
|
const _d3color = /*#__PURE__*/ _interop_require_wildcard._(require("d3-color"));
|
|
19
19
|
const _PlotlySchemaAdapter = require("./PlotlySchemaAdapter");
|
|
20
|
+
const _index = require("../../utilities/index");
|
|
20
21
|
const _AnnotationOnlyChart = require("../AnnotationOnlyChart/AnnotationOnlyChart");
|
|
21
|
-
const
|
|
22
|
-
const
|
|
23
|
-
const
|
|
24
|
-
const
|
|
25
|
-
const
|
|
26
|
-
const
|
|
22
|
+
const _index1 = require("../DonutChart/index");
|
|
23
|
+
const _index2 = require("../VerticalStackedBarChart/index");
|
|
24
|
+
const _index3 = require("../LineChart/index");
|
|
25
|
+
const _index4 = require("../HorizontalBarChartWithAxis/index");
|
|
26
|
+
const _index5 = require("../AreaChart/index");
|
|
27
|
+
const _index6 = require("../HeatMapChart/index");
|
|
27
28
|
const _SankeyChart = require("../SankeyChart/SankeyChart");
|
|
28
|
-
const
|
|
29
|
-
const
|
|
30
|
-
const
|
|
31
|
-
const
|
|
29
|
+
const _index7 = require("../GaugeChart/index");
|
|
30
|
+
const _index8 = require("../GroupedVerticalBarChart/index");
|
|
31
|
+
const _index9 = require("../VerticalBarChart/index");
|
|
32
|
+
const _index10 = require("../ScatterChart/index");
|
|
32
33
|
const _FunnelChart = require("../FunnelChart/FunnelChart");
|
|
33
|
-
const
|
|
34
|
+
const _index11 = require("../GanttChart/index");
|
|
35
|
+
const _index12 = require("../PolarChart/index");
|
|
34
36
|
const _withResponsiveContainer = require("../ResponsiveContainer/withResponsiveContainer");
|
|
35
|
-
const
|
|
36
|
-
const
|
|
37
|
-
const _index13 = require("../../utilities/index");
|
|
37
|
+
const _index13 = require("../ChartTable/index");
|
|
38
|
+
const _index14 = require("../Legends/index");
|
|
38
39
|
const _imageexportutils = require("../../utilities/image-export-utils");
|
|
39
|
-
const ResponsiveDonutChart = (0, _withResponsiveContainer.withResponsiveContainer)(
|
|
40
|
-
const ResponsiveVerticalStackedBarChart = (0, _withResponsiveContainer.withResponsiveContainer)(
|
|
41
|
-
const ResponsiveLineChart = (0, _withResponsiveContainer.withResponsiveContainer)(
|
|
42
|
-
const ResponsiveHorizontalBarChartWithAxis = (0, _withResponsiveContainer.withResponsiveContainer)(
|
|
43
|
-
const ResponsiveAreaChart = (0, _withResponsiveContainer.withResponsiveContainer)(
|
|
44
|
-
const ResponsiveHeatMapChart = (0, _withResponsiveContainer.withResponsiveContainer)(
|
|
40
|
+
const ResponsiveDonutChart = (0, _withResponsiveContainer.withResponsiveContainer)(_index1.DonutChart);
|
|
41
|
+
const ResponsiveVerticalStackedBarChart = (0, _withResponsiveContainer.withResponsiveContainer)(_index2.VerticalStackedBarChart);
|
|
42
|
+
const ResponsiveLineChart = (0, _withResponsiveContainer.withResponsiveContainer)(_index3.LineChart);
|
|
43
|
+
const ResponsiveHorizontalBarChartWithAxis = (0, _withResponsiveContainer.withResponsiveContainer)(_index4.HorizontalBarChartWithAxis);
|
|
44
|
+
const ResponsiveAreaChart = (0, _withResponsiveContainer.withResponsiveContainer)(_index5.AreaChart);
|
|
45
|
+
const ResponsiveHeatMapChart = (0, _withResponsiveContainer.withResponsiveContainer)(_index6.HeatMapChart);
|
|
45
46
|
const ResponsiveSankeyChart = (0, _withResponsiveContainer.withResponsiveContainer)(_SankeyChart.SankeyChart);
|
|
46
|
-
const ResponsiveGaugeChart = (0, _withResponsiveContainer.withResponsiveContainer)(
|
|
47
|
-
const ResponsiveGroupedVerticalBarChart = (0, _withResponsiveContainer.withResponsiveContainer)(
|
|
48
|
-
const ResponsiveVerticalBarChart = (0, _withResponsiveContainer.withResponsiveContainer)(
|
|
49
|
-
const ResponsiveScatterChart = (0, _withResponsiveContainer.withResponsiveContainer)(
|
|
50
|
-
const ResponsiveChartTable = (0, _withResponsiveContainer.withResponsiveContainer)(
|
|
51
|
-
const ResponsiveGanttChart = (0, _withResponsiveContainer.withResponsiveContainer)(
|
|
47
|
+
const ResponsiveGaugeChart = (0, _withResponsiveContainer.withResponsiveContainer)(_index7.GaugeChart);
|
|
48
|
+
const ResponsiveGroupedVerticalBarChart = (0, _withResponsiveContainer.withResponsiveContainer)(_index8.GroupedVerticalBarChart);
|
|
49
|
+
const ResponsiveVerticalBarChart = (0, _withResponsiveContainer.withResponsiveContainer)(_index9.VerticalBarChart);
|
|
50
|
+
const ResponsiveScatterChart = (0, _withResponsiveContainer.withResponsiveContainer)(_index10.ScatterChart);
|
|
51
|
+
const ResponsiveChartTable = (0, _withResponsiveContainer.withResponsiveContainer)(_index13.ChartTable);
|
|
52
|
+
const ResponsiveGanttChart = (0, _withResponsiveContainer.withResponsiveContainer)(_index11.GanttChart);
|
|
52
53
|
// Removing responsive wrapper for FunnelChart as responsive container is not working with FunnelChart
|
|
53
54
|
//const ResponsiveFunnelChart = withResponsiveContainer(FunnelChart);
|
|
55
|
+
const ResponsivePolarChart = (0, _withResponsiveContainer.withResponsiveContainer)(_index12.PolarChart);
|
|
54
56
|
// Default x-axis key for grouping traces. Also applicable for PieData and SankeyData where x-axis is not defined.
|
|
55
57
|
const DEFAULT_XAXIS = 'x';
|
|
56
58
|
const useColorMapping = ()=>{
|
|
@@ -155,6 +157,10 @@ const chartMap = {
|
|
|
155
157
|
transformer: _PlotlySchemaAdapter.transformPlotlyJsonToFunnelChartProps,
|
|
156
158
|
renderer: _FunnelChart.FunnelChart
|
|
157
159
|
},
|
|
160
|
+
scatterpolar: {
|
|
161
|
+
transformer: _PlotlySchemaAdapter.transformPlotlyJsonToPolarChartProps,
|
|
162
|
+
renderer: ResponsivePolarChart
|
|
163
|
+
},
|
|
158
164
|
fallback: {
|
|
159
165
|
transformer: _PlotlySchemaAdapter.transformPlotlyJsonToVSBCProps,
|
|
160
166
|
renderer: ResponsiveVerticalStackedBarChart
|
|
@@ -170,6 +176,7 @@ const useIsDarkTheme = ()=>{
|
|
|
170
176
|
return isDarkTheme;
|
|
171
177
|
};
|
|
172
178
|
const DeclarativeChart = /*#__PURE__*/ _react.forwardRef(({ colorwayType = 'default', ...props }, forwardedRef)=>{
|
|
179
|
+
var _plotlyInputWithValidData_layout;
|
|
173
180
|
const { plotlySchema } = (0, _chartutilities.sanitizeJson)(props.chartSchema);
|
|
174
181
|
const chart = (0, _chartutilities.mapFluentChart)(plotlySchema);
|
|
175
182
|
if (!chart.isValid) {
|
|
@@ -196,7 +203,7 @@ const DeclarativeChart = /*#__PURE__*/ _react.forwardRef(({ colorwayType = 'defa
|
|
|
196
203
|
const isMultiPlot = _react.useRef(false);
|
|
197
204
|
const legendsRef = _react.useRef(null);
|
|
198
205
|
const containerRef = _react.useRef(null);
|
|
199
|
-
const isRTL = (0,
|
|
206
|
+
const isRTL = (0, _index.useRtl)();
|
|
200
207
|
if (!(0, _chartutilities.isArrayOrTypedArray)(selectedLegends)) {
|
|
201
208
|
selectedLegends = [];
|
|
202
209
|
}
|
|
@@ -231,7 +238,7 @@ const DeclarativeChart = /*#__PURE__*/ _react.forwardRef(({ colorwayType = 'defa
|
|
|
231
238
|
};
|
|
232
239
|
function createLegends(legendProps) {
|
|
233
240
|
// eslint-disable-next-line react/jsx-no-bind
|
|
234
|
-
return /*#__PURE__*/ _react.createElement(
|
|
241
|
+
return /*#__PURE__*/ _react.createElement(_index14.Legends, {
|
|
235
242
|
...legendProps,
|
|
236
243
|
selectedLegends: activeLegends,
|
|
237
244
|
onChange: onActiveLegendsChange,
|
|
@@ -244,7 +251,7 @@ const DeclarativeChart = /*#__PURE__*/ _react.forwardRef(({ colorwayType = 'defa
|
|
|
244
251
|
throw new Error('Container reference is null');
|
|
245
252
|
}
|
|
246
253
|
const imgExpOpts = {
|
|
247
|
-
background: (0,
|
|
254
|
+
background: (0, _index.resolveCSSVariables)(containerRef.current, _reacttheme.tokens.colorNeutralBackground1),
|
|
248
255
|
scale: 5,
|
|
249
256
|
...opts
|
|
250
257
|
};
|
|
@@ -271,25 +278,6 @@ const DeclarativeChart = /*#__PURE__*/ _react.forwardRef(({ colorwayType = 'defa
|
|
|
271
278
|
}), [
|
|
272
279
|
exportAsImage
|
|
273
280
|
]);
|
|
274
|
-
if (chart.type === 'scatterpolar') {
|
|
275
|
-
const cartesianProjection = (0, _PlotlySchemaAdapter.projectPolarToCartesian)(plotlyInputWithValidData);
|
|
276
|
-
plotlyInputWithValidData.data = cartesianProjection.data;
|
|
277
|
-
plotlyInputWithValidData.layout = cartesianProjection.layout;
|
|
278
|
-
validTracesFilteredIndex.forEach((trace, index)=>{
|
|
279
|
-
if (trace.type === 'scatterpolar') {
|
|
280
|
-
var _plotlyInputWithValidData_data_index;
|
|
281
|
-
var _plotlyInputWithValidData_data_index_mode;
|
|
282
|
-
const mode = (_plotlyInputWithValidData_data_index_mode = (_plotlyInputWithValidData_data_index = plotlyInputWithValidData.data[index]) === null || _plotlyInputWithValidData_data_index === void 0 ? void 0 : _plotlyInputWithValidData_data_index.mode) !== null && _plotlyInputWithValidData_data_index_mode !== void 0 ? _plotlyInputWithValidData_data_index_mode : '';
|
|
283
|
-
if (mode.includes('line')) {
|
|
284
|
-
validTracesFilteredIndex[index].type = 'line';
|
|
285
|
-
} else if (mode.includes('markers') || mode === 'text') {
|
|
286
|
-
validTracesFilteredIndex[index].type = 'scatter';
|
|
287
|
-
} else {
|
|
288
|
-
validTracesFilteredIndex[index].type = 'line';
|
|
289
|
-
}
|
|
290
|
-
}
|
|
291
|
-
});
|
|
292
|
-
}
|
|
293
281
|
const groupedTraces = {};
|
|
294
282
|
let nonCartesianTraceCount = 0;
|
|
295
283
|
// For annotation-only charts, create a single group entry
|
|
@@ -302,8 +290,8 @@ const DeclarativeChart = /*#__PURE__*/ _react.forwardRef(({ colorwayType = 'defa
|
|
|
302
290
|
traceKey = `${_PlotlySchemaAdapter.NON_PLOT_KEY_PREFIX}${nonCartesianTraceCount + 1}`;
|
|
303
291
|
nonCartesianTraceCount++;
|
|
304
292
|
} else {
|
|
305
|
-
var _trace_xaxis;
|
|
306
|
-
traceKey = (_trace_xaxis = trace.xaxis) !== null && _trace_xaxis !== void 0 ? _trace_xaxis : DEFAULT_XAXIS;
|
|
293
|
+
var _trace_subplot, _trace_xaxis;
|
|
294
|
+
traceKey = chart.validTracesInfo[index].type === 'scatterpolar' ? (_trace_subplot = trace.subplot) !== null && _trace_subplot !== void 0 ? _trace_subplot : _PlotlySchemaAdapter.DEFAULT_POLAR_SUBPLOT : (_trace_xaxis = trace.xaxis) !== null && _trace_xaxis !== void 0 ? _trace_xaxis : DEFAULT_XAXIS;
|
|
307
295
|
}
|
|
308
296
|
if (!groupedTraces[traceKey]) {
|
|
309
297
|
groupedTraces[traceKey] = [];
|
|
@@ -333,8 +321,21 @@ const DeclarativeChart = /*#__PURE__*/ _react.forwardRef(({ colorwayType = 'defa
|
|
|
333
321
|
isMultiPlot.current = false;
|
|
334
322
|
}
|
|
335
323
|
const allupLegendsProps = (0, _PlotlySchemaAdapter.getAllupLegendsProps)(plotlyInputWithValidData, colorMap, colorwayType, chart.validTracesInfo, isDarkTheme);
|
|
324
|
+
const titleObj = (_plotlyInputWithValidData_layout = plotlyInputWithValidData.layout) === null || _plotlyInputWithValidData_layout === void 0 ? void 0 : _plotlyInputWithValidData_layout.title;
|
|
325
|
+
var _titleObj_text;
|
|
326
|
+
const chartTitle = typeof titleObj === 'string' ? titleObj : (_titleObj_text = titleObj === null || titleObj === void 0 ? void 0 : titleObj.text) !== null && _titleObj_text !== void 0 ? _titleObj_text : '';
|
|
327
|
+
const titleFont = typeof titleObj === 'object' ? titleObj === null || titleObj === void 0 ? void 0 : titleObj.font : undefined;
|
|
328
|
+
const titleStyle = {
|
|
329
|
+
..._reacttheme.typographyStyles.caption1,
|
|
330
|
+
color: _reacttheme.tokens.colorNeutralForeground1,
|
|
331
|
+
textAlign: 'center',
|
|
332
|
+
marginBottom: _reacttheme.tokens.spacingVerticalS,
|
|
333
|
+
...(0, _index.getChartTitleInlineStyles)(titleFont)
|
|
334
|
+
};
|
|
336
335
|
// map through the grouped traces and render the appropriate chart
|
|
337
|
-
return /*#__PURE__*/ _react.createElement(_react.Fragment, null, /*#__PURE__*/ _react.createElement("div", {
|
|
336
|
+
return /*#__PURE__*/ _react.createElement(_react.Fragment, null, isMultiPlot.current && chartTitle && /*#__PURE__*/ _react.createElement("div", {
|
|
337
|
+
style: titleStyle
|
|
338
|
+
}, chartTitle), /*#__PURE__*/ _react.createElement("div", {
|
|
338
339
|
style: {
|
|
339
340
|
display: 'grid',
|
|
340
341
|
gridTemplateRows: gridProperties.templateRows,
|
|
@@ -360,9 +361,7 @@ const DeclarativeChart = /*#__PURE__*/ _react.forwardRef(({ colorwayType = 'defa
|
|
|
360
361
|
const transformedInput = preTransformOperation ? preTransformOperation(plotlyInputForGroup) : plotlyInputForGroup;
|
|
361
362
|
const cellProperties = gridProperties.layout[xAxisKey];
|
|
362
363
|
const resolvedCommonProps = chartType === 'annotation' ? {} : {
|
|
363
|
-
...interactiveCommonProps
|
|
364
|
-
xAxisAnnotation: cellProperties === null || cellProperties === void 0 ? void 0 : cellProperties.xAnnotation,
|
|
365
|
-
yAxisAnnotation: cellProperties === null || cellProperties === void 0 ? void 0 : cellProperties.yAnnotation
|
|
364
|
+
...interactiveCommonProps
|
|
366
365
|
};
|
|
367
366
|
var _cellProperties_row, _cellProperties_column;
|
|
368
367
|
return renderChart(renderer, transformer, [
|
|
@@ -373,8 +372,12 @@ const DeclarativeChart = /*#__PURE__*/ _react.forwardRef(({ colorwayType = 'defa
|
|
|
373
372
|
isDarkTheme
|
|
374
373
|
], {
|
|
375
374
|
...resolvedCommonProps,
|
|
376
|
-
|
|
377
|
-
|
|
375
|
+
...(cellProperties === null || cellProperties === void 0 ? void 0 : cellProperties.xAnnotation) && {
|
|
376
|
+
xAxisAnnotation: cellProperties.xAnnotation
|
|
377
|
+
},
|
|
378
|
+
...(cellProperties === null || cellProperties === void 0 ? void 0 : cellProperties.yAnnotation) && {
|
|
379
|
+
yAxisAnnotation: cellProperties.yAnnotation
|
|
380
|
+
},
|
|
378
381
|
componentRef: (ref)=>{
|
|
379
382
|
var _cellProperties_row, _cellProperties_column;
|
|
380
383
|
chartRefs.current[chartIdx] = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/DeclarativeChart/DeclarativeChart.tsx"],"sourcesContent":["'use client';\n\n/* eslint-disable @typescript-eslint/naming-convention */\nimport * as React from 'react';\nimport type { Data, PlotData, PlotlySchema, OutputChartType, TraceInfo } from '@fluentui/chart-utilities';\nimport {\n decodeBase64Fields,\n isArrayOrTypedArray,\n isMonthArray,\n mapFluentChart,\n sanitizeJson,\n} from '@fluentui/chart-utilities';\nimport type { GridProperties } from './PlotlySchemaAdapter';\nimport { tokens } from '@fluentui/react-theme';\nimport { ThemeContext_unstable as V9ThemeContext } from '@fluentui/react-shared-contexts';\nimport { Theme, webLightTheme } from '@fluentui/tokens';\nimport * as d3Color from 'd3-color';\n\nimport {\n correctYearMonth,\n getGridProperties,\n isNonPlotType,\n transformPlotlyJsonToDonutProps,\n transformPlotlyJsonToVSBCProps,\n transformPlotlyJsonToAreaChartProps,\n transformPlotlyJsonToLineChartProps,\n transformPlotlyJsonToHorizontalBarWithAxisProps,\n transformPlotlyJsonToHeatmapProps,\n transformPlotlyJsonToSankeyProps,\n transformPlotlyJsonToGaugeProps,\n transformPlotlyJsonToGVBCProps,\n transformPlotlyJsonToVBCProps,\n transformPlotlyJsonToChartTableProps,\n transformPlotlyJsonToScatterChartProps,\n projectPolarToCartesian,\n getAllupLegendsProps,\n NON_PLOT_KEY_PREFIX,\n SINGLE_REPEAT,\n transformPlotlyJsonToFunnelChartProps,\n transformPlotlyJsonToGanttChartProps,\n transformPlotlyJsonToAnnotationChartProps,\n} from './PlotlySchemaAdapter';\nimport type { ColorwayType } from './PlotlyColorAdapter';\nimport { AnnotationOnlyChart } from '../AnnotationOnlyChart/AnnotationOnlyChart';\nimport { DonutChart } from '../DonutChart/index';\nimport { VerticalStackedBarChart } from '../VerticalStackedBarChart/index';\nimport { LineChart } from '../LineChart/index';\nimport { HorizontalBarChartWithAxis } from '../HorizontalBarChartWithAxis/index';\nimport { AreaChart } from '../AreaChart/index';\nimport { HeatMapChart } from '../HeatMapChart/index';\nimport { SankeyChart } from '../SankeyChart/SankeyChart';\nimport { GaugeChart } from '../GaugeChart/index';\nimport { GroupedVerticalBarChart } from '../GroupedVerticalBarChart/index';\nimport { VerticalBarChart } from '../VerticalBarChart/index';\nimport { Chart, ImageExportOptions } from '../../types/index';\nimport { ScatterChart } from '../ScatterChart/index';\nimport { FunnelChart } from '../FunnelChart/FunnelChart';\nimport { GanttChart } from '../GanttChart/index';\n\nimport { withResponsiveContainer } from '../ResponsiveContainer/withResponsiveContainer';\nimport { ChartTable } from '../ChartTable/index';\nimport { LegendsProps, Legends, LegendContainer } from '../Legends/index';\nimport { JSXElement } from '@fluentui/react-utilities/src/index';\nimport { resolveCSSVariables, useRtl } from '../../utilities/index';\nimport { exportChartsAsImage } from '../../utilities/image-export-utils';\n\nconst ResponsiveDonutChart = withResponsiveContainer(DonutChart);\nconst ResponsiveVerticalStackedBarChart = withResponsiveContainer(VerticalStackedBarChart);\nconst ResponsiveLineChart = withResponsiveContainer(LineChart);\nconst ResponsiveHorizontalBarChartWithAxis = withResponsiveContainer(HorizontalBarChartWithAxis);\nconst ResponsiveAreaChart = withResponsiveContainer(AreaChart);\nconst ResponsiveHeatMapChart = withResponsiveContainer(HeatMapChart);\nconst ResponsiveSankeyChart = withResponsiveContainer(SankeyChart);\nconst ResponsiveGaugeChart = withResponsiveContainer(GaugeChart);\nconst ResponsiveGroupedVerticalBarChart = withResponsiveContainer(GroupedVerticalBarChart);\nconst ResponsiveVerticalBarChart = withResponsiveContainer(VerticalBarChart);\nconst ResponsiveScatterChart = withResponsiveContainer(ScatterChart);\nconst ResponsiveChartTable = withResponsiveContainer(ChartTable);\nconst ResponsiveGanttChart = withResponsiveContainer(GanttChart);\n// Removing responsive wrapper for FunnelChart as responsive container is not working with FunnelChart\n//const ResponsiveFunnelChart = withResponsiveContainer(FunnelChart);\n\n// Default x-axis key for grouping traces. Also applicable for PieData and SankeyData where x-axis is not defined.\nconst DEFAULT_XAXIS = 'x';\n\n/**\n * DeclarativeChart schema.\n * {@docCategory DeclarativeChart}\n */\nexport interface Schema {\n /**\n * Plotly schema represented as JSON object\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n plotlySchema: any;\n}\n\n/**\n * DeclarativeChart props.\n * {@docCategory DeclarativeChart}\n */\nexport interface DeclarativeChartProps extends React.RefAttributes<HTMLDivElement> {\n /**\n * The schema representing the chart data, layout and configuration\n */\n chartSchema: Schema;\n\n /**\n * Callback when an event occurs\n */\n onSchemaChange?: (eventData: Schema) => void;\n\n /**\n * Optional callback to access the IDeclarativeChart interface. Use this instead of ref for accessing\n * the public methods and properties of the component.\n */\n componentRef?: React.Ref<IDeclarativeChart>;\n\n /**\n * Optional prop to specify the colorway type of the chart.\n * - 'default': Use Fluent UI color palette aligning with plotly colorway.\n * - 'builtin': Use Fluent UI colorway.\n * - 'others': Reserved for future colorways.\n * @default 'default'\n */\n colorwayType?: ColorwayType;\n}\n\n/**\n * {@docCategory DeclarativeChart}\n */\nexport interface IDeclarativeChart {\n exportAsImage: (opts?: ImageExportOptions) => Promise<string>;\n}\n\nconst useColorMapping = () => {\n const colorMap = React.useRef(new Map<string, string>());\n return colorMap;\n};\n\nfunction renderChart<TProps>(\n Renderer: React.ComponentType<TProps>,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n transformer: (...args: any[]) => TProps,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n transformerArgs: any[],\n commonProps: Partial<TProps>,\n cellRow: number,\n cellColumn: number,\n): JSXElement {\n const chartProps = transformer(...transformerArgs);\n return (\n <div\n key={`${cellRow}_${cellColumn}`}\n style={{\n gridRowStart: cellRow,\n gridRowEnd: cellRow + 1,\n gridColumnStart: cellColumn,\n gridColumnEnd: cellColumn + 1,\n }}\n >\n <Renderer {...chartProps} {...commonProps} />\n </div>\n );\n}\n\ntype PreTransformHooks = {\n preTransformCondition?: (plotlySchema: PlotlySchema) => boolean;\n preTransformOperation?: (plotlySchema: PlotlySchema) => PlotlySchema;\n};\n\nconst LineAreaPreTransformOp = (plotlyInput: PlotlySchema) => {\n const xValues = (plotlyInput.data[0] as PlotData).x;\n const isXMonth = isMonthArray(xValues);\n let renderData = plotlyInput.data;\n if (isXMonth) {\n renderData = plotlyInput.data.map((dataPoint: PlotData) => ({\n ...dataPoint,\n x: correctYearMonth(dataPoint.x),\n }));\n }\n return { data: renderData, layout: plotlyInput.layout };\n};\n\ntype ChartTypeMap = {\n annotation: {\n transformer: typeof transformPlotlyJsonToAnnotationChartProps;\n renderer: typeof AnnotationOnlyChart;\n } & PreTransformHooks;\n donut: {\n transformer: typeof transformPlotlyJsonToDonutProps;\n renderer: typeof ResponsiveDonutChart;\n } & PreTransformHooks;\n sankey: {\n transformer: typeof transformPlotlyJsonToSankeyProps;\n renderer: typeof ResponsiveSankeyChart;\n } & PreTransformHooks;\n table: {\n transformer: typeof transformPlotlyJsonToChartTableProps;\n renderer: typeof ResponsiveChartTable;\n } & PreTransformHooks;\n horizontalbar: {\n transformer: typeof transformPlotlyJsonToHorizontalBarWithAxisProps;\n renderer: typeof ResponsiveHorizontalBarChartWithAxis;\n } & PreTransformHooks;\n groupedverticalbar: {\n transformer: typeof transformPlotlyJsonToGVBCProps;\n renderer: typeof ResponsiveGroupedVerticalBarChart;\n } & PreTransformHooks;\n verticalstackedbar: {\n transformer: typeof transformPlotlyJsonToVSBCProps;\n renderer: typeof ResponsiveVerticalStackedBarChart;\n } & PreTransformHooks;\n heatmap: {\n transformer: typeof transformPlotlyJsonToHeatmapProps;\n renderer: typeof ResponsiveHeatMapChart;\n } & PreTransformHooks;\n gauge: {\n transformer: typeof transformPlotlyJsonToGaugeProps;\n renderer: typeof ResponsiveGaugeChart;\n } & PreTransformHooks;\n verticalbar: {\n transformer: typeof transformPlotlyJsonToVBCProps;\n renderer: typeof ResponsiveVerticalBarChart;\n } & PreTransformHooks;\n area: {\n transformer: typeof transformPlotlyJsonToAreaChartProps;\n renderer: typeof ResponsiveAreaChart;\n } & PreTransformHooks;\n line: {\n transformer: typeof transformPlotlyJsonToLineChartProps;\n renderer: typeof ResponsiveLineChart;\n } & PreTransformHooks;\n scatter: {\n transformer: typeof transformPlotlyJsonToScatterChartProps;\n renderer: typeof ResponsiveScatterChart;\n } & PreTransformHooks;\n gantt: {\n transformer: typeof transformPlotlyJsonToGanttChartProps;\n renderer: typeof ResponsiveGanttChart;\n } & PreTransformHooks;\n funnel: {\n transformer: typeof transformPlotlyJsonToFunnelChartProps;\n renderer: typeof FunnelChart;\n } & PreTransformHooks;\n fallback: {\n transformer: typeof transformPlotlyJsonToVSBCProps;\n renderer: typeof ResponsiveVerticalStackedBarChart;\n } & PreTransformHooks;\n};\n\nconst chartMap: ChartTypeMap = {\n annotation: {\n transformer: transformPlotlyJsonToAnnotationChartProps,\n renderer: AnnotationOnlyChart,\n },\n // PieData category charts\n donut: {\n transformer: transformPlotlyJsonToDonutProps,\n renderer: ResponsiveDonutChart,\n },\n // SankeyData category charts\n sankey: {\n transformer: transformPlotlyJsonToSankeyProps,\n renderer: ResponsiveSankeyChart,\n },\n // TableData category charts\n table: {\n transformer: transformPlotlyJsonToChartTableProps,\n renderer: ResponsiveChartTable,\n },\n // PlotData category charts\n horizontalbar: {\n transformer: transformPlotlyJsonToHorizontalBarWithAxisProps,\n renderer: ResponsiveHorizontalBarChartWithAxis,\n },\n groupedverticalbar: {\n transformer: transformPlotlyJsonToGVBCProps,\n renderer: ResponsiveGroupedVerticalBarChart,\n },\n verticalstackedbar: {\n transformer: transformPlotlyJsonToVSBCProps,\n renderer: ResponsiveVerticalStackedBarChart,\n },\n heatmap: {\n transformer: transformPlotlyJsonToHeatmapProps,\n renderer: ResponsiveHeatMapChart,\n },\n gauge: {\n transformer: transformPlotlyJsonToGaugeProps,\n renderer: ResponsiveGaugeChart,\n },\n verticalbar: {\n transformer: transformPlotlyJsonToVBCProps,\n renderer: ResponsiveVerticalBarChart,\n },\n area: {\n transformer: transformPlotlyJsonToAreaChartProps,\n renderer: ResponsiveAreaChart,\n preTransformOperation: LineAreaPreTransformOp,\n },\n line: {\n transformer: transformPlotlyJsonToLineChartProps,\n renderer: ResponsiveLineChart,\n preTransformOperation: LineAreaPreTransformOp,\n },\n scatter: {\n transformer: transformPlotlyJsonToScatterChartProps,\n renderer: ResponsiveScatterChart,\n preTransformOperation: LineAreaPreTransformOp,\n },\n gantt: {\n transformer: transformPlotlyJsonToGanttChartProps,\n renderer: ResponsiveGanttChart,\n },\n funnel: {\n transformer: transformPlotlyJsonToFunnelChartProps,\n renderer: FunnelChart,\n },\n fallback: {\n transformer: transformPlotlyJsonToVSBCProps,\n renderer: ResponsiveVerticalStackedBarChart,\n },\n};\n\nconst useIsDarkTheme = (): boolean => {\n const parentV9Theme = React.useContext(V9ThemeContext) as Theme;\n const v9Theme: Theme = parentV9Theme ? parentV9Theme : webLightTheme;\n\n // Get background and foreground colors\n const backgroundColor = d3Color.hsl(v9Theme.colorNeutralBackground1);\n const foregroundColor = d3Color.hsl(v9Theme.colorNeutralForeground1);\n\n const isDarkTheme = backgroundColor.l < foregroundColor.l;\n\n return isDarkTheme;\n};\n\n/**\n * DeclarativeChart component.\n * {@docCategory DeclarativeChart}\n */\nexport const DeclarativeChart: React.FunctionComponent<DeclarativeChartProps> = React.forwardRef<\n HTMLDivElement,\n DeclarativeChartProps\n>(({ colorwayType = 'default', ...props }, forwardedRef) => {\n const { plotlySchema } = sanitizeJson(props.chartSchema);\n const chart: OutputChartType = mapFluentChart(plotlySchema);\n if (!chart.isValid) {\n throw new Error(`Invalid chart schema: ${chart.errorMessage}`);\n }\n let plotlyInput = plotlySchema as PlotlySchema;\n try {\n plotlyInput = decodeBase64Fields(plotlyInput);\n } catch (error) {\n throw new Error(`Failed to decode plotly schema: ${error}`);\n }\n const plotlyInputWithValidData: PlotlySchema = {\n ...plotlyInput,\n data: chart.validTracesInfo!.map(trace => plotlyInput.data[trace.index]),\n };\n\n const validTracesFilteredIndex: TraceInfo[] = chart.validTracesInfo!.map((trace, index) => ({\n index,\n type: trace.type,\n }));\n\n let { selectedLegends } = plotlySchema;\n const colorMap = useColorMapping();\n const isDarkTheme = useIsDarkTheme();\n const chartRefs = React.useRef<{ compRef: Chart | null; row: number; col: number }[]>([]);\n const isMultiPlot = React.useRef(false);\n const legendsRef = React.useRef<LegendContainer>(null);\n const containerRef = React.useRef<HTMLDivElement>(null);\n const isRTL = useRtl();\n\n if (!isArrayOrTypedArray(selectedLegends)) {\n selectedLegends = [];\n }\n\n const [activeLegends, setActiveLegends] = React.useState<string[]>(selectedLegends);\n const onActiveLegendsChange = (keys: string[]) => {\n setActiveLegends(keys);\n if (props.onSchemaChange) {\n props.onSchemaChange({ plotlySchema: { plotlyInput, selectedLegends: keys } });\n }\n };\n\n React.useEffect(() => {\n // eslint-disable-next-line @typescript-eslint/no-shadow\n const { plotlySchema } = sanitizeJson(props.chartSchema);\n // eslint-disable-next-line @typescript-eslint/no-shadow\n const { selectedLegends } = plotlySchema;\n setActiveLegends(selectedLegends ?? []);\n }, [props.chartSchema]);\n\n const multiSelectLegendProps = {\n canSelectMultipleLegends: true,\n onChange: onActiveLegendsChange,\n selectedLegends: activeLegends,\n };\n\n const interactiveCommonProps = {\n legendProps: multiSelectLegendProps,\n };\n\n function createLegends(legendProps: LegendsProps): JSXElement {\n // eslint-disable-next-line react/jsx-no-bind\n return (\n <Legends\n {...legendProps}\n selectedLegends={activeLegends}\n onChange={onActiveLegendsChange}\n legendRef={legendsRef}\n />\n );\n }\n\n const exportAsImage = React.useCallback(\n async (opts?: ImageExportOptions) => {\n if (!containerRef.current) {\n throw new Error('Container reference is null');\n }\n\n const imgExpOpts = {\n background: resolveCSSVariables(containerRef.current, tokens.colorNeutralBackground1),\n scale: 5,\n ...opts,\n };\n\n if (!isMultiPlot.current) {\n if (!chartRefs.current[0]?.compRef?.toImage) {\n throw new Error('Chart cannot be exported as image');\n }\n\n return chartRefs.current[0].compRef.toImage(imgExpOpts);\n }\n\n return exportChartsAsImage(\n chartRefs.current.map(item => ({\n container: item.compRef?.chartContainer,\n row: item.row,\n col: item.col,\n })),\n legendsRef.current?.toSVG,\n isRTL,\n imgExpOpts,\n );\n },\n [isRTL],\n );\n\n React.useImperativeHandle(\n props.componentRef,\n () => ({\n exportAsImage,\n }),\n [exportAsImage],\n );\n\n if (chart.type === 'scatterpolar') {\n const cartesianProjection = projectPolarToCartesian(plotlyInputWithValidData);\n plotlyInputWithValidData.data = cartesianProjection.data;\n plotlyInputWithValidData.layout = cartesianProjection.layout;\n validTracesFilteredIndex.forEach((trace, index) => {\n if (trace.type === 'scatterpolar') {\n const mode = (plotlyInputWithValidData.data[index] as PlotData)?.mode ?? '';\n if (mode.includes('line')) {\n validTracesFilteredIndex[index].type = 'line';\n } else if (mode.includes('markers') || mode === 'text') {\n validTracesFilteredIndex[index].type = 'scatter';\n } else {\n validTracesFilteredIndex[index].type = 'line';\n }\n }\n });\n }\n const groupedTraces: Record<string, number[]> = {};\n let nonCartesianTraceCount = 0;\n\n // For annotation-only charts, create a single group entry\n if (chart.type === 'annotation') {\n groupedTraces[DEFAULT_XAXIS] = [];\n } else {\n plotlyInputWithValidData.data.forEach((trace: Data, index: number) => {\n let traceKey = '';\n if (isNonPlotType(chart.validTracesInfo![index].type)) {\n traceKey = `${NON_PLOT_KEY_PREFIX}${nonCartesianTraceCount + 1}`;\n nonCartesianTraceCount++;\n } else {\n traceKey = (trace as PlotData).xaxis ?? DEFAULT_XAXIS;\n }\n if (!groupedTraces[traceKey]) {\n groupedTraces[traceKey] = [];\n }\n groupedTraces[traceKey].push(index);\n });\n }\n\n isMultiPlot.current = Object.keys(groupedTraces).length > 1;\n const gridProperties: GridProperties = getGridProperties(\n plotlyInputWithValidData,\n isMultiPlot.current,\n chart.validTracesInfo!,\n );\n\n // Render only one plot if the grid properties cannot determine positioning of multiple plots.\n if (\n isMultiPlot.current &&\n gridProperties.templateRows === SINGLE_REPEAT &&\n gridProperties.templateColumns === SINGLE_REPEAT\n ) {\n if (chart.type === 'donut') {\n // If there are multiple data traces for donut/pie, picking the last one similar to plotly\n const keys = Object.keys(groupedTraces);\n keys.forEach((key, index) => {\n if (index < keys.length - 1) {\n delete groupedTraces[key];\n }\n });\n } else {\n Object.keys(groupedTraces).forEach((key, index) => {\n if (index > 0) {\n delete groupedTraces[key];\n }\n });\n }\n isMultiPlot.current = false;\n }\n\n const allupLegendsProps = getAllupLegendsProps(\n plotlyInputWithValidData,\n colorMap,\n colorwayType,\n chart.validTracesInfo!,\n isDarkTheme,\n );\n\n type ChartType = keyof ChartTypeMap;\n // map through the grouped traces and render the appropriate chart\n return (\n <>\n <div\n style={{\n display: 'grid',\n gridTemplateRows: gridProperties.templateRows,\n gridTemplateColumns: gridProperties.templateColumns,\n }}\n ref={containerRef}\n >\n {Object.entries(groupedTraces).map(([xAxisKey, index], chartIdx) => {\n const plotlyInputForGroup: PlotlySchema = {\n ...plotlyInputWithValidData,\n data: index.map(idx => plotlyInputWithValidData.data[idx]),\n };\n\n const filteredTracesInfo = validTracesFilteredIndex.filter(trace => index.includes(trace.index));\n let chartType =\n chart.type === 'fallback' || chart.type === 'groupedverticalbar'\n ? chart.type\n : filteredTracesInfo[0]?.type ?? chart.type;\n\n if (\n validTracesFilteredIndex.some(trace => trace.type === 'line') &&\n validTracesFilteredIndex.some(trace => trace.type === 'scatter')\n ) {\n chartType = 'line';\n }\n\n const chartEntry = chartMap[chartType as ChartType];\n if (chartEntry) {\n const { transformer, renderer, preTransformCondition, preTransformOperation } = chartEntry;\n if (preTransformCondition === undefined || preTransformCondition(plotlyInputForGroup)) {\n const transformedInput = preTransformOperation\n ? preTransformOperation(plotlyInputForGroup)\n : plotlyInputForGroup;\n const cellProperties = gridProperties.layout[xAxisKey];\n\n const resolvedCommonProps = (\n chartType === 'annotation'\n ? {}\n : {\n ...interactiveCommonProps,\n xAxisAnnotation: cellProperties?.xAnnotation,\n yAxisAnnotation: cellProperties?.yAnnotation,\n }\n ) as Partial<ReturnType<typeof transformer>>;\n\n return renderChart<ReturnType<typeof transformer>>(\n renderer,\n transformer,\n [transformedInput, isMultiPlot.current, colorMap, colorwayType, isDarkTheme],\n {\n ...resolvedCommonProps,\n xAxisAnnotation: cellProperties?.xAnnotation,\n yAxisAnnotation: cellProperties?.yAnnotation,\n componentRef: (ref: Chart | null) => {\n chartRefs.current[chartIdx] = {\n compRef: ref,\n row: cellProperties?.row ?? 1,\n col: cellProperties?.column ?? 1,\n };\n },\n },\n cellProperties?.row ?? 1,\n cellProperties?.column ?? 1,\n );\n }\n return <></>;\n } else {\n throw new Error(`Unsupported chart type :${plotlyInputForGroup.data[0]?.type}`);\n }\n })}\n </div>\n {isMultiPlot.current && createLegends(allupLegendsProps)}\n </>\n );\n});\nDeclarativeChart.displayName = 'DeclarativeChart';\n"],"names":["React","decodeBase64Fields","isArrayOrTypedArray","isMonthArray","mapFluentChart","sanitizeJson","tokens","ThemeContext_unstable","V9ThemeContext","webLightTheme","d3Color","correctYearMonth","getGridProperties","isNonPlotType","transformPlotlyJsonToDonutProps","transformPlotlyJsonToVSBCProps","transformPlotlyJsonToAreaChartProps","transformPlotlyJsonToLineChartProps","transformPlotlyJsonToHorizontalBarWithAxisProps","transformPlotlyJsonToHeatmapProps","transformPlotlyJsonToSankeyProps","transformPlotlyJsonToGaugeProps","transformPlotlyJsonToGVBCProps","transformPlotlyJsonToVBCProps","transformPlotlyJsonToChartTableProps","transformPlotlyJsonToScatterChartProps","projectPolarToCartesian","getAllupLegendsProps","NON_PLOT_KEY_PREFIX","SINGLE_REPEAT","transformPlotlyJsonToFunnelChartProps","transformPlotlyJsonToGanttChartProps","transformPlotlyJsonToAnnotationChartProps","AnnotationOnlyChart","DonutChart","VerticalStackedBarChart","LineChart","HorizontalBarChartWithAxis","AreaChart","HeatMapChart","SankeyChart","GaugeChart","GroupedVerticalBarChart","VerticalBarChart","ScatterChart","FunnelChart","GanttChart","withResponsiveContainer","ChartTable","Legends","resolveCSSVariables","useRtl","exportChartsAsImage","ResponsiveDonutChart","ResponsiveVerticalStackedBarChart","ResponsiveLineChart","ResponsiveHorizontalBarChartWithAxis","ResponsiveAreaChart","ResponsiveHeatMapChart","ResponsiveSankeyChart","ResponsiveGaugeChart","ResponsiveGroupedVerticalBarChart","ResponsiveVerticalBarChart","ResponsiveScatterChart","ResponsiveChartTable","ResponsiveGanttChart","DEFAULT_XAXIS","useColorMapping","colorMap","useRef","Map","renderChart","Renderer","transformer","transformerArgs","commonProps","cellRow","cellColumn","chartProps","div","key","style","gridRowStart","gridRowEnd","gridColumnStart","gridColumnEnd","LineAreaPreTransformOp","plotlyInput","xValues","data","x","isXMonth","renderData","map","dataPoint","layout","chartMap","annotation","renderer","donut","sankey","table","horizontalbar","groupedverticalbar","verticalstackedbar","heatmap","gauge","verticalbar","area","preTransformOperation","line","scatter","gantt","funnel","fallback","useIsDarkTheme","parentV9Theme","useContext","v9Theme","backgroundColor","hsl","colorNeutralBackground1","foregroundColor","colorNeutralForeground1","isDarkTheme","l","DeclarativeChart","forwardRef","colorwayType","props","forwardedRef","plotlySchema","chartSchema","chart","isValid","Error","errorMessage","error","plotlyInputWithValidData","validTracesInfo","trace","index","validTracesFilteredIndex","type","selectedLegends","chartRefs","isMultiPlot","legendsRef","containerRef","isRTL","activeLegends","setActiveLegends","useState","onActiveLegendsChange","keys","onSchemaChange","useEffect","multiSelectLegendProps","canSelectMultipleLegends","onChange","interactiveCommonProps","legendProps","createLegends","legendRef","exportAsImage","useCallback","opts","current","imgExpOpts","background","scale","compRef","toImage","item","container","chartContainer","row","col","toSVG","useImperativeHandle","componentRef","cartesianProjection","forEach","mode","includes","groupedTraces","nonCartesianTraceCount","traceKey","xaxis","push","Object","length","gridProperties","templateRows","templateColumns","allupLegendsProps","display","gridTemplateRows","gridTemplateColumns","ref","entries","xAxisKey","chartIdx","filteredTracesInfo","plotlyInputForGroup","idx","filter","chartType","some","chartEntry","preTransformCondition","undefined","transformedInput","cellProperties","resolvedCommonProps","xAxisAnnotation","xAnnotation","yAxisAnnotation","yAnnotation","column","displayName"],"mappings":"AAAA;;;;;;;;eAsVa8H;;;;iEAnVU,QAAQ;gCAQxB,4BAA4B;4BAEZ,wBAAwB;qCACS,kCAAkC;wBACrD,mBAAmB;mEAC/B,WAAW;qCAyB7B,wBAAwB;qCAEK,6CAA6C;uBACtD,sBAAsB;wBACT,mCAAmC;wBACjD,qBAAqB;wBACJ,sCAAsC;wBACvD,qBAAqB;wBAClB,wBAAwB;6BACzB,6BAA6B;wBAC9B,sBAAsB;wBACT,mCAAmC;wBAC1C,4BAA4B;wBAEhC,wBAAwB;6BACzB,6BAA6B;yBAC9B,sBAAsB;yCAET,iDAAiD;yBAC9D,sBAAsB;yBACM,mBAAmB;yBAE9B,wBAAwB;kCAChC,qCAAqC;AAEzE,MAAMzE,2BAAuBN,gDAAAA,EAAwBb,iBAAAA;AACrD,MAAMoB,wCAAoCP,gDAAAA,EAAwBZ,+BAAAA;AAClE,MAAMoB,0BAAsBR,gDAAAA,EAAwBX,iBAAAA;AACpD,MAAMoB,uCAAuCT,oDAAAA,EAAwBV,kCAAAA;AACrE,MAAMoB,0BAAsBV,gDAAAA,EAAwBT,iBAAAA;AACpD,MAAMoB,6BAAyBX,gDAAAA,EAAwBR,oBAAAA;AACvD,MAAMoB,4BAAwBZ,gDAAAA,EAAwBP,wBAAAA;AACtD,MAAMoB,2BAAuBb,gDAAAA,EAAwBN,kBAAAA;AACrD,MAAMoB,wCAAoCd,gDAAAA,EAAwBL,+BAAAA;AAClE,MAAMoB,6BAA6Bf,oDAAAA,EAAwBJ,wBAAAA;AAC3D,MAAMoB,6BAAyBhB,gDAAAA,EAAwBH,oBAAAA;AACvD,MAAMoB,2BAAuBjB,gDAAAA,E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KAAKqC,CAAAA,sBAAAA,mBAAAA,QAAAA,mBAAAA,KAAAA,IAAAA,KAAAA,IAAAA,eAAgBrC,GAAG,AAAHA,MAAG,QAAnBqC,wBAAAA,KAAAA,IAAAA,sBAAuB;4BAC5BpC,KAAKoC,CAAAA,yBAAAA,mBAAAA,QAAAA,mBAAAA,KAAAA,IAAAA,KAAAA,IAAAA,eAAgBM,MAAAA,AAAM,MAAA,QAAtBN,2BAAAA,KAAAA,IAAAA,yBAA0B;wBACjC;oBACF;gBACF,GACAA,CAAAA,sBAAAA,mBAAAA,QAAAA,mBAAAA,KAAAA,IAAAA,KAAAA,IAAAA,eAAgBrC,GAAAA,AAAG,MAAA,QAAnBqC,wBAAAA,KAAAA,IAAAA,sBAAuB,GACvBA,CAAAA,yBAAAA,mBAAAA,QAAAA,mBAAAA,KAAAA,IAAAA,KAAAA,IAAAA,eAAgBM,MAAAA,AAAM,MAAA,QAAtBN,2BAAAA,KAAAA,IAAAA,yBAA0B;YAE9B;YACA,OAAA,WAAA,GAAO,OAAA,aAAA,CAAA,OAAA,QAAA,EAAA;QACT,OAAO;gBACsCT;YAA3C,MAAM,IAAIrE,MAAM,CAAC,wBAAwB,EAAA,CAAEqE,6BAAAA,oBAAoBnH,IAAI,CAAC,EAAA,AAAE,MAAA,QAA3BmH,+BAAAA,KAAAA,IAAAA,KAAAA,IAAAA,2BAA6B7D,IAAI,EAAE;QAChF;IACF,KAEDG,YAAYqB,OAAO,IAAIL,cAAciC;AAG5C,GAAG;AACHrE,iBAAiB8F,WAAW,GAAG"}
|
|
1
|
+
{"version":3,"sources":["../src/components/DeclarativeChart/DeclarativeChart.tsx"],"sourcesContent":["'use client';\n\n/* eslint-disable @typescript-eslint/naming-convention */\nimport * as React from 'react';\nimport type { Data, PlotData, PlotlySchema, OutputChartType, TraceInfo } from '@fluentui/chart-utilities';\nimport {\n decodeBase64Fields,\n isArrayOrTypedArray,\n isMonthArray,\n mapFluentChart,\n sanitizeJson,\n} from '@fluentui/chart-utilities';\nimport type { GridProperties } from './PlotlySchemaAdapter';\nimport { tokens, typographyStyles } from '@fluentui/react-theme';\nimport { ThemeContext_unstable as V9ThemeContext } from '@fluentui/react-shared-contexts';\nimport { Theme, webLightTheme } from '@fluentui/tokens';\nimport * as d3Color from 'd3-color';\n\nimport {\n correctYearMonth,\n getGridProperties,\n isNonPlotType,\n transformPlotlyJsonToDonutProps,\n transformPlotlyJsonToVSBCProps,\n transformPlotlyJsonToAreaChartProps,\n transformPlotlyJsonToLineChartProps,\n transformPlotlyJsonToHorizontalBarWithAxisProps,\n transformPlotlyJsonToHeatmapProps,\n transformPlotlyJsonToSankeyProps,\n transformPlotlyJsonToGaugeProps,\n transformPlotlyJsonToGVBCProps,\n transformPlotlyJsonToVBCProps,\n transformPlotlyJsonToChartTableProps,\n transformPlotlyJsonToScatterChartProps,\n getAllupLegendsProps,\n NON_PLOT_KEY_PREFIX,\n SINGLE_REPEAT,\n transformPlotlyJsonToFunnelChartProps,\n transformPlotlyJsonToGanttChartProps,\n transformPlotlyJsonToAnnotationChartProps,\n transformPlotlyJsonToPolarChartProps,\n DEFAULT_POLAR_SUBPLOT,\n} from './PlotlySchemaAdapter';\nimport { getChartTitleInlineStyles } from '../../utilities/index';\nimport type { ColorwayType } from './PlotlyColorAdapter';\nimport { AnnotationOnlyChart } from '../AnnotationOnlyChart/AnnotationOnlyChart';\nimport { DonutChart } from '../DonutChart/index';\nimport { VerticalStackedBarChart } from '../VerticalStackedBarChart/index';\nimport { LineChart } from '../LineChart/index';\nimport { HorizontalBarChartWithAxis } from '../HorizontalBarChartWithAxis/index';\nimport { AreaChart } from '../AreaChart/index';\nimport { HeatMapChart } from '../HeatMapChart/index';\nimport { SankeyChart } from '../SankeyChart/SankeyChart';\nimport { GaugeChart } from '../GaugeChart/index';\nimport { GroupedVerticalBarChart } from '../GroupedVerticalBarChart/index';\nimport { VerticalBarChart } from '../VerticalBarChart/index';\nimport { Chart, ImageExportOptions } from '../../types/index';\nimport { ScatterChart } from '../ScatterChart/index';\nimport { FunnelChart } from '../FunnelChart/FunnelChart';\nimport { GanttChart } from '../GanttChart/index';\nimport { PolarChart } from '../PolarChart/index';\n\nimport { withResponsiveContainer } from '../ResponsiveContainer/withResponsiveContainer';\nimport { ChartTable } from '../ChartTable/index';\nimport { LegendsProps, Legends, LegendContainer } from '../Legends/index';\nimport { JSXElement } from '@fluentui/react-utilities/src/index';\nimport { resolveCSSVariables, useRtl } from '../../utilities/index';\nimport { exportChartsAsImage } from '../../utilities/image-export-utils';\n\nconst ResponsiveDonutChart = withResponsiveContainer(DonutChart);\nconst ResponsiveVerticalStackedBarChart = withResponsiveContainer(VerticalStackedBarChart);\nconst ResponsiveLineChart = withResponsiveContainer(LineChart);\nconst ResponsiveHorizontalBarChartWithAxis = withResponsiveContainer(HorizontalBarChartWithAxis);\nconst ResponsiveAreaChart = withResponsiveContainer(AreaChart);\nconst ResponsiveHeatMapChart = withResponsiveContainer(HeatMapChart);\nconst ResponsiveSankeyChart = withResponsiveContainer(SankeyChart);\nconst ResponsiveGaugeChart = withResponsiveContainer(GaugeChart);\nconst ResponsiveGroupedVerticalBarChart = withResponsiveContainer(GroupedVerticalBarChart);\nconst ResponsiveVerticalBarChart = withResponsiveContainer(VerticalBarChart);\nconst ResponsiveScatterChart = withResponsiveContainer(ScatterChart);\nconst ResponsiveChartTable = withResponsiveContainer(ChartTable);\nconst ResponsiveGanttChart = withResponsiveContainer(GanttChart);\n// Removing responsive wrapper for FunnelChart as responsive container is not working with FunnelChart\n//const ResponsiveFunnelChart = withResponsiveContainer(FunnelChart);\nconst ResponsivePolarChart = withResponsiveContainer(PolarChart);\n\n// Default x-axis key for grouping traces. Also applicable for PieData and SankeyData where x-axis is not defined.\nconst DEFAULT_XAXIS = 'x';\n\n/**\n * DeclarativeChart schema.\n * {@docCategory DeclarativeChart}\n */\nexport interface Schema {\n /**\n * Plotly schema represented as JSON object\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n plotlySchema: any;\n}\n\n/**\n * DeclarativeChart props.\n * {@docCategory DeclarativeChart}\n */\nexport interface DeclarativeChartProps extends React.RefAttributes<HTMLDivElement> {\n /**\n * The schema representing the chart data, layout and configuration\n */\n chartSchema: Schema;\n\n /**\n * Callback when an event occurs\n */\n onSchemaChange?: (eventData: Schema) => void;\n\n /**\n * Optional callback to access the IDeclarativeChart interface. Use this instead of ref for accessing\n * the public methods and properties of the component.\n */\n componentRef?: React.Ref<IDeclarativeChart>;\n\n /**\n * Optional prop to specify the colorway type of the chart.\n * - 'default': Use Fluent UI color palette aligning with plotly colorway.\n * - 'builtin': Use Fluent UI colorway.\n * - 'others': Reserved for future colorways.\n * @default 'default'\n */\n colorwayType?: ColorwayType;\n}\n\n/**\n * {@docCategory DeclarativeChart}\n */\nexport interface IDeclarativeChart {\n exportAsImage: (opts?: ImageExportOptions) => Promise<string>;\n}\n\nconst useColorMapping = () => {\n const colorMap = React.useRef(new Map<string, string>());\n return colorMap;\n};\n\nfunction renderChart<TProps>(\n Renderer: React.ComponentType<TProps>,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n transformer: (...args: any[]) => TProps,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n transformerArgs: any[],\n commonProps: Partial<TProps>,\n cellRow: number,\n cellColumn: number,\n): JSXElement {\n const chartProps = transformer(...transformerArgs);\n return (\n <div\n key={`${cellRow}_${cellColumn}`}\n style={{\n gridRowStart: cellRow,\n gridRowEnd: cellRow + 1,\n gridColumnStart: cellColumn,\n gridColumnEnd: cellColumn + 1,\n }}\n >\n <Renderer {...chartProps} {...commonProps} />\n </div>\n );\n}\n\ntype PreTransformHooks = {\n preTransformCondition?: (plotlySchema: PlotlySchema) => boolean;\n preTransformOperation?: (plotlySchema: PlotlySchema) => PlotlySchema;\n};\n\nconst LineAreaPreTransformOp = (plotlyInput: PlotlySchema) => {\n const xValues = (plotlyInput.data[0] as PlotData).x;\n const isXMonth = isMonthArray(xValues);\n let renderData = plotlyInput.data;\n if (isXMonth) {\n renderData = plotlyInput.data.map((dataPoint: PlotData) => ({\n ...dataPoint,\n x: correctYearMonth(dataPoint.x),\n }));\n }\n return { data: renderData, layout: plotlyInput.layout };\n};\n\ntype ChartTypeMap = {\n annotation: {\n transformer: typeof transformPlotlyJsonToAnnotationChartProps;\n renderer: typeof AnnotationOnlyChart;\n } & PreTransformHooks;\n donut: {\n transformer: typeof transformPlotlyJsonToDonutProps;\n renderer: typeof ResponsiveDonutChart;\n } & PreTransformHooks;\n sankey: {\n transformer: typeof transformPlotlyJsonToSankeyProps;\n renderer: typeof ResponsiveSankeyChart;\n } & PreTransformHooks;\n table: {\n transformer: typeof transformPlotlyJsonToChartTableProps;\n renderer: typeof ResponsiveChartTable;\n } & PreTransformHooks;\n horizontalbar: {\n transformer: typeof transformPlotlyJsonToHorizontalBarWithAxisProps;\n renderer: typeof ResponsiveHorizontalBarChartWithAxis;\n } & PreTransformHooks;\n groupedverticalbar: {\n transformer: typeof transformPlotlyJsonToGVBCProps;\n renderer: typeof ResponsiveGroupedVerticalBarChart;\n } & PreTransformHooks;\n verticalstackedbar: {\n transformer: typeof transformPlotlyJsonToVSBCProps;\n renderer: typeof ResponsiveVerticalStackedBarChart;\n } & PreTransformHooks;\n heatmap: {\n transformer: typeof transformPlotlyJsonToHeatmapProps;\n renderer: typeof ResponsiveHeatMapChart;\n } & PreTransformHooks;\n gauge: {\n transformer: typeof transformPlotlyJsonToGaugeProps;\n renderer: typeof ResponsiveGaugeChart;\n } & PreTransformHooks;\n verticalbar: {\n transformer: typeof transformPlotlyJsonToVBCProps;\n renderer: typeof ResponsiveVerticalBarChart;\n } & PreTransformHooks;\n area: {\n transformer: typeof transformPlotlyJsonToAreaChartProps;\n renderer: typeof ResponsiveAreaChart;\n } & PreTransformHooks;\n line: {\n transformer: typeof transformPlotlyJsonToLineChartProps;\n renderer: typeof ResponsiveLineChart;\n } & PreTransformHooks;\n scatter: {\n transformer: typeof transformPlotlyJsonToScatterChartProps;\n renderer: typeof ResponsiveScatterChart;\n } & PreTransformHooks;\n gantt: {\n transformer: typeof transformPlotlyJsonToGanttChartProps;\n renderer: typeof ResponsiveGanttChart;\n } & PreTransformHooks;\n funnel: {\n transformer: typeof transformPlotlyJsonToFunnelChartProps;\n renderer: typeof FunnelChart;\n } & PreTransformHooks;\n scatterpolar: {\n transformer: typeof transformPlotlyJsonToPolarChartProps;\n renderer: typeof ResponsivePolarChart;\n } & PreTransformHooks;\n fallback: {\n transformer: typeof transformPlotlyJsonToVSBCProps;\n renderer: typeof ResponsiveVerticalStackedBarChart;\n } & PreTransformHooks;\n};\n\nconst chartMap: ChartTypeMap = {\n annotation: {\n transformer: transformPlotlyJsonToAnnotationChartProps,\n renderer: AnnotationOnlyChart,\n },\n // PieData category charts\n donut: {\n transformer: transformPlotlyJsonToDonutProps,\n renderer: ResponsiveDonutChart,\n },\n // SankeyData category charts\n sankey: {\n transformer: transformPlotlyJsonToSankeyProps,\n renderer: ResponsiveSankeyChart,\n },\n // TableData category charts\n table: {\n transformer: transformPlotlyJsonToChartTableProps,\n renderer: ResponsiveChartTable,\n },\n // PlotData category charts\n horizontalbar: {\n transformer: transformPlotlyJsonToHorizontalBarWithAxisProps,\n renderer: ResponsiveHorizontalBarChartWithAxis,\n },\n groupedverticalbar: {\n transformer: transformPlotlyJsonToGVBCProps,\n renderer: ResponsiveGroupedVerticalBarChart,\n },\n verticalstackedbar: {\n transformer: transformPlotlyJsonToVSBCProps,\n renderer: ResponsiveVerticalStackedBarChart,\n },\n heatmap: {\n transformer: transformPlotlyJsonToHeatmapProps,\n renderer: ResponsiveHeatMapChart,\n },\n gauge: {\n transformer: transformPlotlyJsonToGaugeProps,\n renderer: ResponsiveGaugeChart,\n },\n verticalbar: {\n transformer: transformPlotlyJsonToVBCProps,\n renderer: ResponsiveVerticalBarChart,\n },\n area: {\n transformer: transformPlotlyJsonToAreaChartProps,\n renderer: ResponsiveAreaChart,\n preTransformOperation: LineAreaPreTransformOp,\n },\n line: {\n transformer: transformPlotlyJsonToLineChartProps,\n renderer: ResponsiveLineChart,\n preTransformOperation: LineAreaPreTransformOp,\n },\n scatter: {\n transformer: transformPlotlyJsonToScatterChartProps,\n renderer: ResponsiveScatterChart,\n preTransformOperation: LineAreaPreTransformOp,\n },\n gantt: {\n transformer: transformPlotlyJsonToGanttChartProps,\n renderer: ResponsiveGanttChart,\n },\n funnel: {\n transformer: transformPlotlyJsonToFunnelChartProps,\n renderer: FunnelChart,\n },\n scatterpolar: {\n transformer: transformPlotlyJsonToPolarChartProps,\n renderer: ResponsivePolarChart,\n },\n fallback: {\n transformer: transformPlotlyJsonToVSBCProps,\n renderer: ResponsiveVerticalStackedBarChart,\n },\n};\n\nconst useIsDarkTheme = (): boolean => {\n const parentV9Theme = React.useContext(V9ThemeContext) as Theme;\n const v9Theme: Theme = parentV9Theme ? parentV9Theme : webLightTheme;\n\n // Get background and foreground colors\n const backgroundColor = d3Color.hsl(v9Theme.colorNeutralBackground1);\n const foregroundColor = d3Color.hsl(v9Theme.colorNeutralForeground1);\n\n const isDarkTheme = backgroundColor.l < foregroundColor.l;\n\n return isDarkTheme;\n};\n\n/**\n * DeclarativeChart component.\n * {@docCategory DeclarativeChart}\n */\nexport const DeclarativeChart: React.FunctionComponent<DeclarativeChartProps> = React.forwardRef<\n HTMLDivElement,\n DeclarativeChartProps\n>(({ colorwayType = 'default', ...props }, forwardedRef) => {\n const { plotlySchema } = sanitizeJson(props.chartSchema);\n const chart: OutputChartType = mapFluentChart(plotlySchema);\n if (!chart.isValid) {\n throw new Error(`Invalid chart schema: ${chart.errorMessage}`);\n }\n let plotlyInput = plotlySchema as PlotlySchema;\n try {\n plotlyInput = decodeBase64Fields(plotlyInput);\n } catch (error) {\n throw new Error(`Failed to decode plotly schema: ${error}`);\n }\n const plotlyInputWithValidData: PlotlySchema = {\n ...plotlyInput,\n data: chart.validTracesInfo!.map(trace => plotlyInput.data[trace.index]),\n };\n\n const validTracesFilteredIndex: TraceInfo[] = chart.validTracesInfo!.map((trace, index) => ({\n index,\n type: trace.type,\n }));\n\n let { selectedLegends } = plotlySchema;\n const colorMap = useColorMapping();\n const isDarkTheme = useIsDarkTheme();\n const chartRefs = React.useRef<{ compRef: Chart | null; row: number; col: number }[]>([]);\n const isMultiPlot = React.useRef(false);\n const legendsRef = React.useRef<LegendContainer>(null);\n const containerRef = React.useRef<HTMLDivElement>(null);\n const isRTL = useRtl();\n\n if (!isArrayOrTypedArray(selectedLegends)) {\n selectedLegends = [];\n }\n\n const [activeLegends, setActiveLegends] = React.useState<string[]>(selectedLegends);\n const onActiveLegendsChange = (keys: string[]) => {\n setActiveLegends(keys);\n if (props.onSchemaChange) {\n props.onSchemaChange({ plotlySchema: { plotlyInput, selectedLegends: keys } });\n }\n };\n\n React.useEffect(() => {\n // eslint-disable-next-line @typescript-eslint/no-shadow\n const { plotlySchema } = sanitizeJson(props.chartSchema);\n // eslint-disable-next-line @typescript-eslint/no-shadow\n const { selectedLegends } = plotlySchema;\n setActiveLegends(selectedLegends ?? []);\n }, [props.chartSchema]);\n\n const multiSelectLegendProps = {\n canSelectMultipleLegends: true,\n onChange: onActiveLegendsChange,\n selectedLegends: activeLegends,\n };\n\n const interactiveCommonProps = {\n legendProps: multiSelectLegendProps,\n };\n\n function createLegends(legendProps: LegendsProps): JSXElement {\n // eslint-disable-next-line react/jsx-no-bind\n return (\n <Legends\n {...legendProps}\n selectedLegends={activeLegends}\n onChange={onActiveLegendsChange}\n legendRef={legendsRef}\n />\n );\n }\n\n const exportAsImage = React.useCallback(\n async (opts?: ImageExportOptions) => {\n if (!containerRef.current) {\n throw new Error('Container reference is null');\n }\n\n const imgExpOpts = {\n background: resolveCSSVariables(containerRef.current, tokens.colorNeutralBackground1),\n scale: 5,\n ...opts,\n };\n\n if (!isMultiPlot.current) {\n if (!chartRefs.current[0]?.compRef?.toImage) {\n throw new Error('Chart cannot be exported as image');\n }\n\n return chartRefs.current[0].compRef.toImage(imgExpOpts);\n }\n\n return exportChartsAsImage(\n chartRefs.current.map(item => ({\n container: item.compRef?.chartContainer,\n row: item.row,\n col: item.col,\n })),\n legendsRef.current?.toSVG,\n isRTL,\n imgExpOpts,\n );\n },\n [isRTL],\n );\n\n React.useImperativeHandle(\n props.componentRef,\n () => ({\n exportAsImage,\n }),\n [exportAsImage],\n );\n\n const groupedTraces: Record<string, number[]> = {};\n let nonCartesianTraceCount = 0;\n\n // For annotation-only charts, create a single group entry\n if (chart.type === 'annotation') {\n groupedTraces[DEFAULT_XAXIS] = [];\n } else {\n plotlyInputWithValidData.data.forEach((trace: Data, index: number) => {\n let traceKey = '';\n if (isNonPlotType(chart.validTracesInfo![index].type)) {\n traceKey = `${NON_PLOT_KEY_PREFIX}${nonCartesianTraceCount + 1}`;\n nonCartesianTraceCount++;\n } else {\n traceKey =\n chart.validTracesInfo![index].type === 'scatterpolar'\n ? (trace as { subplot?: string }).subplot ?? DEFAULT_POLAR_SUBPLOT\n : (trace as PlotData).xaxis ?? DEFAULT_XAXIS;\n }\n if (!groupedTraces[traceKey]) {\n groupedTraces[traceKey] = [];\n }\n groupedTraces[traceKey].push(index);\n });\n }\n\n isMultiPlot.current = Object.keys(groupedTraces).length > 1;\n const gridProperties: GridProperties = getGridProperties(\n plotlyInputWithValidData,\n isMultiPlot.current,\n chart.validTracesInfo!,\n );\n\n // Render only one plot if the grid properties cannot determine positioning of multiple plots.\n if (\n isMultiPlot.current &&\n gridProperties.templateRows === SINGLE_REPEAT &&\n gridProperties.templateColumns === SINGLE_REPEAT\n ) {\n if (chart.type === 'donut') {\n // If there are multiple data traces for donut/pie, picking the last one similar to plotly\n const keys = Object.keys(groupedTraces);\n keys.forEach((key, index) => {\n if (index < keys.length - 1) {\n delete groupedTraces[key];\n }\n });\n } else {\n Object.keys(groupedTraces).forEach((key, index) => {\n if (index > 0) {\n delete groupedTraces[key];\n }\n });\n }\n isMultiPlot.current = false;\n }\n\n const allupLegendsProps = getAllupLegendsProps(\n plotlyInputWithValidData,\n colorMap,\n colorwayType,\n chart.validTracesInfo!,\n isDarkTheme,\n );\n\n type ChartType = keyof ChartTypeMap;\n\n const titleObj = plotlyInputWithValidData.layout?.title;\n const chartTitle = typeof titleObj === 'string' ? titleObj : titleObj?.text ?? '';\n const titleFont = typeof titleObj === 'object' ? titleObj?.font : undefined;\n\n const titleStyle: React.CSSProperties = {\n ...typographyStyles.caption1,\n color: tokens.colorNeutralForeground1,\n textAlign: 'center',\n marginBottom: tokens.spacingVerticalS,\n ...getChartTitleInlineStyles(titleFont),\n };\n\n // map through the grouped traces and render the appropriate chart\n return (\n <>\n {isMultiPlot.current && chartTitle && <div style={titleStyle}>{chartTitle}</div>}\n <div\n style={{\n display: 'grid',\n gridTemplateRows: gridProperties.templateRows,\n gridTemplateColumns: gridProperties.templateColumns,\n }}\n ref={containerRef}\n >\n {Object.entries(groupedTraces).map(([xAxisKey, index], chartIdx) => {\n const plotlyInputForGroup: PlotlySchema = {\n ...plotlyInputWithValidData,\n data: index.map(idx => plotlyInputWithValidData.data[idx]),\n };\n\n const filteredTracesInfo = validTracesFilteredIndex.filter(trace => index.includes(trace.index));\n let chartType =\n chart.type === 'fallback' || chart.type === 'groupedverticalbar'\n ? chart.type\n : filteredTracesInfo[0]?.type ?? chart.type;\n\n if (\n validTracesFilteredIndex.some(trace => trace.type === 'line') &&\n validTracesFilteredIndex.some(trace => trace.type === 'scatter')\n ) {\n chartType = 'line';\n }\n\n const chartEntry = chartMap[chartType as ChartType];\n if (chartEntry) {\n const { transformer, renderer, preTransformCondition, preTransformOperation } = chartEntry;\n if (preTransformCondition === undefined || preTransformCondition(plotlyInputForGroup)) {\n const transformedInput = preTransformOperation\n ? preTransformOperation(plotlyInputForGroup)\n : plotlyInputForGroup;\n const cellProperties = gridProperties.layout[xAxisKey];\n\n const resolvedCommonProps = (\n chartType === 'annotation'\n ? {}\n : {\n ...interactiveCommonProps,\n }\n ) as Partial<ReturnType<typeof transformer>>;\n\n return renderChart<ReturnType<typeof transformer>>(\n renderer,\n transformer,\n [transformedInput, isMultiPlot.current, colorMap, colorwayType, isDarkTheme],\n {\n ...resolvedCommonProps,\n ...(cellProperties?.xAnnotation && { xAxisAnnotation: cellProperties.xAnnotation }),\n ...(cellProperties?.yAnnotation && { yAxisAnnotation: cellProperties.yAnnotation }),\n componentRef: (ref: Chart | null) => {\n chartRefs.current[chartIdx] = {\n compRef: ref,\n row: cellProperties?.row ?? 1,\n col: cellProperties?.column ?? 1,\n };\n },\n },\n cellProperties?.row ?? 1,\n cellProperties?.column ?? 1,\n );\n }\n return <></>;\n } else {\n throw new Error(`Unsupported chart type :${plotlyInputForGroup.data[0]?.type}`);\n }\n })}\n </div>\n {isMultiPlot.current && createLegends(allupLegendsProps)}\n </>\n );\n});\nDeclarativeChart.displayName = 'DeclarativeChart';\n"],"names":["React","decodeBase64Fields","isArrayOrTypedArray","isMonthArray","mapFluentChart","sanitizeJson","tokens","typographyStyles","ThemeContext_unstable","V9ThemeContext","webLightTheme","d3Color","correctYearMonth","getGridProperties","isNonPlotType","transformPlotlyJsonToDonutProps","transformPlotlyJsonToVSBCProps","transformPlotlyJsonToAreaChartProps","transformPlotlyJsonToLineChartProps","transformPlotlyJsonToHorizontalBarWithAxisProps","transformPlotlyJsonToHeatmapProps","transformPlotlyJsonToSankeyProps","transformPlotlyJsonToGaugeProps","transformPlotlyJsonToGVBCProps","transformPlotlyJsonToVBCProps","transformPlotlyJsonToChartTableProps","transformPlotlyJsonToScatterChartProps","getAllupLegendsProps","NON_PLOT_KEY_PREFIX","SINGLE_REPEAT","transformPlotlyJsonToFunnelChartProps","transformPlotlyJsonToGanttChartProps","transformPlotlyJsonToAnnotationChartProps","transformPlotlyJsonToPolarChartProps","DEFAULT_POLAR_SUBPLOT","getChartTitleInlineStyles","AnnotationOnlyChart","DonutChart","VerticalStackedBarChart","LineChart","HorizontalBarChartWithAxis","AreaChart","HeatMapChart","SankeyChart","GaugeChart","GroupedVerticalBarChart","VerticalBarChart","ScatterChart","FunnelChart","GanttChart","PolarChart","withResponsiveContainer","ChartTable","Legends","resolveCSSVariables","useRtl","exportChartsAsImage","ResponsiveDonutChart","ResponsiveVerticalStackedBarChart","ResponsiveLineChart","ResponsiveHorizontalBarChartWithAxis","ResponsiveAreaChart","ResponsiveHeatMapChart","ResponsiveSankeyChart","ResponsiveGaugeChart","ResponsiveGroupedVerticalBarChart","ResponsiveVerticalBarChart","ResponsiveScatterChart","ResponsiveChartTable","ResponsiveGanttChart","ResponsivePolarChart","DEFAULT_XAXIS","useColorMapping","colorMap","useRef","Map","renderChart","Renderer","transformer","transformerArgs","commonProps","cellRow","cellColumn","chartProps","div","key","style","gridRowStart","gridRowEnd","gridColumnStart","gridColumnEnd","LineAreaPreTransformOp","plotlyInput","xValues","data","x","isXMonth","renderData","map","dataPoint","layout","chartMap","annotation","renderer","donut","sankey","table","horizontalbar","groupedverticalbar","verticalstackedbar","heatmap","gauge","verticalbar","area","preTransformOperation","line","scatter","gantt","funnel","scatterpolar","fallback","useIsDarkTheme","parentV9Theme","useContext","v9Theme","backgroundColor","hsl","colorNeutralBackground1","foregroundColor","colorNeutralForeground1","isDarkTheme","l","DeclarativeChart","forwardRef","colorwayType","props","forwardedRef","plotlyInputWithValidData","plotlySchema","chartSchema","chart","isValid","Error","errorMessage","error","validTracesInfo","trace","index","validTracesFilteredIndex","type","selectedLegends","chartRefs","isMultiPlot","legendsRef","containerRef","isRTL","activeLegends","setActiveLegends","useState","onActiveLegendsChange","keys","onSchemaChange","useEffect","multiSelectLegendProps","canSelectMultipleLegends","onChange","interactiveCommonProps","legendProps","createLegends","legendRef","exportAsImage","useCallback","opts","current","imgExpOpts","background","scale","compRef","toImage","item","container","chartContainer","row","col","toSVG","useImperativeHandle","componentRef","groupedTraces","nonCartesianTraceCount","forEach","traceKey","subplot","xaxis","push","Object","length","gridProperties","templateRows","templateColumns","allupLegendsProps","titleObj","title","chartTitle","text","titleFont","font","undefined","titleStyle","caption1","color","textAlign","marginBottom","spacingVerticalS","display","gridTemplateRows","gridTemplateColumns","ref","entries","xAxisKey","chartIdx","filteredTracesInfo","plotlyInputForGroup","idx","filter","includes","chartType","some","chartEntry","preTransformCondition","transformedInput","cellProperties","resolvedCommonProps","xAnnotation","xAxisAnnotation","yAnnotation","yAxisAnnotation","column","displayName"],"mappings":"AAAA;;;;;;;;eAkWaoI;;;;iEA/VU,QAAQ;gCAQxB,4BAA4B;4BAEM,wBAAwB;qCACT,kCAAkC;wBACrD,mBAAmB;mEAC/B,WAAW;qCA0B7B,wBAAwB;uBACW,wBAAwB;qCAE9B,6CAA6C;wBACtD,sBAAsB;wBACT,mCAAmC;wBACjD,qBAAqB;wBACJ,sCAAsC;wBACvD,qBAAqB;wBAClB,wBAAwB;6BACzB,6BAA6B;wBAC9B,sBAAsB;wBACT,mCAAmC;wBAC1C,4BAA4B;yBAEhC,wBAAwB;6BACzB,6BAA6B;yBAC9B,sBAAsB;yBACtB,sBAAsB;yCAET,iDAAiD;yBAC9D,sBAAsB;yBACM,mBAAmB;kCAGtC,qCAAqC;AAEzE,MAAM3E,2BAAuBN,gDAAAA,EAAwBd,kBAAAA;AACrD,MAAMqB,wCAAoCP,gDAAAA,EAAwBb,+BAAAA;AAClE,MAAMqB,0BAAsBR,gDAAAA,EAAwBZ,iBAAAA;AACpD,MAAMqB,2CAAuCT,gDAAAA,EAAwBX,kCAAAA;AACrE,MAAMqB,0BAAsBV,gDAAAA,EAAwBV,iBAAAA;AACpD,MAAMqB,6BAAyBX,gDAAAA,EAAwBT,oBAAAA;AACvD,MAAMqB,4BAAwBZ,gDAAAA,EAAwBR,wBAAAA;AACtD,MAAMqB,2BAAuBb,gDAAAA,EAAwBP,kBAAAA;AACrD,MAAMqB,wCAAoCd,gDAAAA,EAAwBN,+BAAAA;AAClE,MAAMqB,6BAA6Bf,oDAAAA,EAAwBL,wBAAAA;AAC3D,MAAMqB,6BAAyBhB,gDAAAA,EAAwBJ,qBAAAA;AACvD,MAAMqB,2BAAuBjB,gDAAAA,EAAwBC,mBAAAA;AACrD,MAAMiB,2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