@fluentui/react-charting 5.24.10 → 5.24.12
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.json +69 -1
- package/CHANGELOG.md +25 -2
- package/dist/react-charting.d.ts +18 -3
- package/dist/react-charting.js +1 -1
- package/dist/react-charting.min.js +1 -1
- package/etc/react-charting.api.md +7 -3
- package/lib/components/AreaChart/AreaChart.base.js +4 -0
- package/lib/components/AreaChart/AreaChart.base.js.map +1 -1
- package/lib/components/ChartTable/ChartTable.base.js +2 -1
- package/lib/components/ChartTable/ChartTable.base.js.map +1 -1
- package/lib/components/ChartTable/ChartTable.types.d.ts +1 -0
- package/lib/components/ChartTable/ChartTable.types.js.map +1 -1
- package/lib/components/CommonComponents/CartesianChart.base.js +4 -2
- package/lib/components/CommonComponents/CartesianChart.base.js.map +1 -1
- package/lib/components/CommonComponents/CartesianChart.types.d.ts +4 -0
- package/lib/components/CommonComponents/CartesianChart.types.js.map +1 -1
- package/lib/components/DeclarativeChart/DeclarativeChart.js +14 -1
- package/lib/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
- package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js +112 -12
- package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
- package/lib/components/DonutChart/Arc/Arc.js +1 -0
- package/lib/components/DonutChart/Arc/Arc.js.map +1 -1
- package/lib/components/DonutChart/DonutChart.base.js +5 -6
- package/lib/components/DonutChart/DonutChart.base.js.map +1 -1
- package/lib/components/DonutChart/DonutChart.styles.js +2 -4
- package/lib/components/DonutChart/DonutChart.styles.js.map +1 -1
- package/lib/components/DonutChart/DonutChart.types.d.ts +4 -0
- package/lib/components/DonutChart/DonutChart.types.js.map +1 -1
- package/lib/components/DonutChart/Pie/Pie.js +2 -0
- package/lib/components/DonutChart/Pie/Pie.js.map +1 -1
- package/lib/components/FunnelChart/FunnelChart.base.js +2 -0
- package/lib/components/FunnelChart/FunnelChart.base.js.map +1 -1
- package/lib/components/GaugeChart/GaugeChart.base.js +3 -5
- package/lib/components/GaugeChart/GaugeChart.base.js.map +1 -1
- package/lib/components/GaugeChart/GaugeChart.styles.js +2 -4
- package/lib/components/GaugeChart/GaugeChart.styles.js.map +1 -1
- package/lib/components/GaugeChart/GaugeChart.types.d.ts +4 -0
- package/lib/components/GaugeChart/GaugeChart.types.js.map +1 -1
- package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js +5 -0
- package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js.map +1 -1
- package/lib/components/HeatMapChart/HeatMapChart.base.js +3 -0
- package/lib/components/HeatMapChart/HeatMapChart.base.js.map +1 -1
- package/lib/components/HorizontalBarChart/HorizontalBarChart.base.js +4 -0
- package/lib/components/HorizontalBarChart/HorizontalBarChart.base.js.map +1 -1
- package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js +6 -0
- package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js.map +1 -1
- package/lib/components/Legends/Legends.base.js +5 -1
- package/lib/components/Legends/Legends.base.js.map +1 -1
- package/lib/components/LineChart/LineChart.base.d.ts +1 -0
- package/lib/components/LineChart/LineChart.base.js +53 -12
- package/lib/components/LineChart/LineChart.base.js.map +1 -1
- package/lib/components/PieChart/Arc/Arc.js +2 -0
- package/lib/components/PieChart/Arc/Arc.js.map +1 -1
- package/lib/components/PieChart/Pie/Pie.js +2 -0
- package/lib/components/PieChart/Pie/Pie.js.map +1 -1
- package/lib/components/PieChart/PieChart.base.js +1 -0
- package/lib/components/PieChart/PieChart.base.js.map +1 -1
- package/lib/components/ResponsiveContainer/ResponsiveContainer.js +13 -5
- package/lib/components/ResponsiveContainer/ResponsiveContainer.js.map +1 -1
- package/lib/components/ResponsiveContainer/ResponsiveContainer.types.d.ts +2 -4
- package/lib/components/ResponsiveContainer/ResponsiveContainer.types.js.map +1 -1
- package/lib/components/SankeyChart/SankeyChart.base.js +4 -6
- package/lib/components/SankeyChart/SankeyChart.base.js.map +1 -1
- package/lib/components/SankeyChart/SankeyChart.styles.js +3 -0
- package/lib/components/SankeyChart/SankeyChart.styles.js.map +1 -1
- package/lib/components/SankeyChart/SankeyChart.types.d.ts +4 -0
- package/lib/components/SankeyChart/SankeyChart.types.js.map +1 -1
- package/lib/components/ScatterChart/ScatterChart.base.js +41 -8
- package/lib/components/ScatterChart/ScatterChart.base.js.map +1 -1
- package/lib/components/Sparkline/Sparkline.base.d.ts +2 -2
- package/lib/components/StackedBarChart/MultiStackedBarChart.base.js +6 -1
- package/lib/components/StackedBarChart/MultiStackedBarChart.base.js.map +1 -1
- package/lib/components/StackedBarChart/StackedBarChart.base.js +5 -1
- package/lib/components/StackedBarChart/StackedBarChart.base.js.map +1 -1
- package/lib/components/TreeChart/TreeChart.base.js +17 -2
- package/lib/components/TreeChart/TreeChart.base.js.map +1 -1
- package/lib/components/VerticalBarChart/VerticalBarChart.base.js +11 -0
- package/lib/components/VerticalBarChart/VerticalBarChart.base.js.map +1 -1
- package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js +3 -0
- package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js.map +1 -1
- package/lib/utilities/ChartHoverCard/ChartHoverCard.base.js.map +1 -1
- package/lib/utilities/scatterpolar-utils.d.ts +22 -0
- package/lib/utilities/scatterpolar-utils.js +38 -0
- package/lib/utilities/scatterpolar-utils.js.map +1 -0
- package/lib/utilities/utilities.d.ts +6 -0
- package/lib/utilities/utilities.js +16 -4
- package/lib/utilities/utilities.js.map +1 -1
- package/lib-amd/components/AreaChart/AreaChart.base.js +4 -0
- package/lib-amd/components/AreaChart/AreaChart.base.js.map +1 -1
- package/lib-amd/components/ChartTable/ChartTable.base.js +2 -1
- package/lib-amd/components/ChartTable/ChartTable.base.js.map +1 -1
- package/lib-amd/components/ChartTable/ChartTable.types.d.ts +1 -0
- package/lib-amd/components/ChartTable/ChartTable.types.js.map +1 -1
- package/lib-amd/components/CommonComponents/CartesianChart.base.js +4 -2
- package/lib-amd/components/CommonComponents/CartesianChart.base.js.map +1 -1
- package/lib-amd/components/CommonComponents/CartesianChart.types.d.ts +4 -0
- package/lib-amd/components/CommonComponents/CartesianChart.types.js.map +1 -1
- package/lib-amd/components/DeclarativeChart/DeclarativeChart.js +14 -1
- package/lib-amd/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
- package/lib-amd/components/DeclarativeChart/PlotlySchemaAdapter.js +111 -11
- package/lib-amd/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
- package/lib-amd/components/DonutChart/Arc/Arc.js +1 -0
- package/lib-amd/components/DonutChart/Arc/Arc.js.map +1 -1
- package/lib-amd/components/DonutChart/DonutChart.base.js +5 -6
- package/lib-amd/components/DonutChart/DonutChart.base.js.map +1 -1
- package/lib-amd/components/DonutChart/DonutChart.styles.js +2 -4
- package/lib-amd/components/DonutChart/DonutChart.styles.js.map +1 -1
- package/lib-amd/components/DonutChart/DonutChart.types.d.ts +4 -0
- package/lib-amd/components/DonutChart/DonutChart.types.js.map +1 -1
- package/lib-amd/components/DonutChart/Pie/Pie.js +2 -0
- package/lib-amd/components/DonutChart/Pie/Pie.js.map +1 -1
- package/lib-amd/components/FunnelChart/FunnelChart.base.js +2 -0
- package/lib-amd/components/FunnelChart/FunnelChart.base.js.map +1 -1
- package/lib-amd/components/GaugeChart/GaugeChart.base.js +3 -5
- package/lib-amd/components/GaugeChart/GaugeChart.base.js.map +1 -1
- package/lib-amd/components/GaugeChart/GaugeChart.styles.js +2 -4
- package/lib-amd/components/GaugeChart/GaugeChart.styles.js.map +1 -1
- package/lib-amd/components/GaugeChart/GaugeChart.types.d.ts +4 -0
- package/lib-amd/components/GaugeChart/GaugeChart.types.js.map +1 -1
- package/lib-amd/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js +5 -0
- package/lib-amd/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js.map +1 -1
- package/lib-amd/components/HeatMapChart/HeatMapChart.base.js +3 -0
- package/lib-amd/components/HeatMapChart/HeatMapChart.base.js.map +1 -1
- package/lib-amd/components/HorizontalBarChart/HorizontalBarChart.base.js +4 -0
- package/lib-amd/components/HorizontalBarChart/HorizontalBarChart.base.js.map +1 -1
- package/lib-amd/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js +6 -0
- package/lib-amd/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js.map +1 -1
- package/lib-amd/components/Legends/Legends.base.js +5 -1
- package/lib-amd/components/Legends/Legends.base.js.map +1 -1
- package/lib-amd/components/LineChart/LineChart.base.d.ts +1 -0
- package/lib-amd/components/LineChart/LineChart.base.js +52 -12
- package/lib-amd/components/LineChart/LineChart.base.js.map +1 -1
- package/lib-amd/components/PieChart/Arc/Arc.js +2 -0
- package/lib-amd/components/PieChart/Arc/Arc.js.map +1 -1
- package/lib-amd/components/PieChart/Pie/Pie.js +2 -0
- package/lib-amd/components/PieChart/Pie/Pie.js.map +1 -1
- package/lib-amd/components/PieChart/PieChart.base.js +1 -0
- package/lib-amd/components/PieChart/PieChart.base.js.map +1 -1
- package/lib-amd/components/ResponsiveContainer/ResponsiveContainer.js +13 -5
- package/lib-amd/components/ResponsiveContainer/ResponsiveContainer.js.map +1 -1
- package/lib-amd/components/ResponsiveContainer/ResponsiveContainer.types.d.ts +2 -4
- package/lib-amd/components/ResponsiveContainer/ResponsiveContainer.types.js.map +1 -1
- package/lib-amd/components/SankeyChart/SankeyChart.base.js +4 -6
- package/lib-amd/components/SankeyChart/SankeyChart.base.js.map +1 -1
- package/lib-amd/components/SankeyChart/SankeyChart.styles.js +3 -0
- package/lib-amd/components/SankeyChart/SankeyChart.styles.js.map +1 -1
- package/lib-amd/components/SankeyChart/SankeyChart.types.d.ts +4 -0
- package/lib-amd/components/SankeyChart/SankeyChart.types.js.map +1 -1
- package/lib-amd/components/ScatterChart/ScatterChart.base.js +40 -8
- package/lib-amd/components/ScatterChart/ScatterChart.base.js.map +1 -1
- package/lib-amd/components/Sparkline/Sparkline.base.d.ts +2 -2
- package/lib-amd/components/StackedBarChart/MultiStackedBarChart.base.js +6 -1
- package/lib-amd/components/StackedBarChart/MultiStackedBarChart.base.js.map +1 -1
- package/lib-amd/components/StackedBarChart/StackedBarChart.base.js +5 -1
- package/lib-amd/components/StackedBarChart/StackedBarChart.base.js.map +1 -1
- package/lib-amd/components/TreeChart/TreeChart.base.js +17 -2
- package/lib-amd/components/TreeChart/TreeChart.base.js.map +1 -1
- package/lib-amd/components/VerticalBarChart/VerticalBarChart.base.js +11 -0
- package/lib-amd/components/VerticalBarChart/VerticalBarChart.base.js.map +1 -1
- package/lib-amd/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js +3 -0
- package/lib-amd/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js.map +1 -1
- package/lib-amd/utilities/ChartHoverCard/ChartHoverCard.base.js.map +1 -1
- package/lib-amd/utilities/scatterpolar-utils.d.ts +22 -0
- package/lib-amd/utilities/scatterpolar-utils.js +43 -0
- package/lib-amd/utilities/scatterpolar-utils.js.map +1 -0
- package/lib-amd/utilities/utilities.d.ts +6 -0
- package/lib-amd/utilities/utilities.js +18 -5
- package/lib-amd/utilities/utilities.js.map +1 -1
- package/lib-commonjs/components/AreaChart/AreaChart.base.js +4 -0
- package/lib-commonjs/components/AreaChart/AreaChart.base.js.map +1 -1
- package/lib-commonjs/components/ChartTable/ChartTable.base.js +2 -1
- package/lib-commonjs/components/ChartTable/ChartTable.base.js.map +1 -1
- package/lib-commonjs/components/ChartTable/ChartTable.types.d.ts +1 -0
- package/lib-commonjs/components/ChartTable/ChartTable.types.js.map +1 -1
- package/lib-commonjs/components/CommonComponents/CartesianChart.base.js +4 -2
- package/lib-commonjs/components/CommonComponents/CartesianChart.base.js.map +1 -1
- package/lib-commonjs/components/CommonComponents/CartesianChart.types.d.ts +4 -0
- package/lib-commonjs/components/CommonComponents/CartesianChart.types.js.map +1 -1
- package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js +14 -1
- package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
- package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js +111 -11
- package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
- package/lib-commonjs/components/DonutChart/Arc/Arc.js +1 -0
- package/lib-commonjs/components/DonutChart/Arc/Arc.js.map +1 -1
- package/lib-commonjs/components/DonutChart/DonutChart.base.js +5 -6
- package/lib-commonjs/components/DonutChart/DonutChart.base.js.map +1 -1
- package/lib-commonjs/components/DonutChart/DonutChart.styles.js +2 -4
- package/lib-commonjs/components/DonutChart/DonutChart.styles.js.map +1 -1
- package/lib-commonjs/components/DonutChart/DonutChart.types.d.ts +4 -0
- package/lib-commonjs/components/DonutChart/DonutChart.types.js.map +1 -1
- package/lib-commonjs/components/DonutChart/Pie/Pie.js +2 -0
- package/lib-commonjs/components/DonutChart/Pie/Pie.js.map +1 -1
- package/lib-commonjs/components/FunnelChart/FunnelChart.base.js +2 -0
- package/lib-commonjs/components/FunnelChart/FunnelChart.base.js.map +1 -1
- package/lib-commonjs/components/GaugeChart/GaugeChart.base.js +3 -5
- package/lib-commonjs/components/GaugeChart/GaugeChart.base.js.map +1 -1
- package/lib-commonjs/components/GaugeChart/GaugeChart.styles.js +2 -4
- package/lib-commonjs/components/GaugeChart/GaugeChart.styles.js.map +1 -1
- package/lib-commonjs/components/GaugeChart/GaugeChart.types.d.ts +4 -0
- package/lib-commonjs/components/GaugeChart/GaugeChart.types.js.map +1 -1
- package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js +5 -0
- package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js.map +1 -1
- package/lib-commonjs/components/HeatMapChart/HeatMapChart.base.js +3 -0
- package/lib-commonjs/components/HeatMapChart/HeatMapChart.base.js.map +1 -1
- package/lib-commonjs/components/HorizontalBarChart/HorizontalBarChart.base.js +4 -0
- package/lib-commonjs/components/HorizontalBarChart/HorizontalBarChart.base.js.map +1 -1
- package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js +6 -0
- package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js.map +1 -1
- package/lib-commonjs/components/Legends/Legends.base.js +5 -1
- package/lib-commonjs/components/Legends/Legends.base.js.map +1 -1
- package/lib-commonjs/components/LineChart/LineChart.base.d.ts +1 -0
- package/lib-commonjs/components/LineChart/LineChart.base.js +52 -11
- package/lib-commonjs/components/LineChart/LineChart.base.js.map +1 -1
- package/lib-commonjs/components/PieChart/Arc/Arc.js +2 -0
- package/lib-commonjs/components/PieChart/Arc/Arc.js.map +1 -1
- package/lib-commonjs/components/PieChart/Pie/Pie.js +2 -0
- package/lib-commonjs/components/PieChart/Pie/Pie.js.map +1 -1
- package/lib-commonjs/components/PieChart/PieChart.base.js +1 -0
- package/lib-commonjs/components/PieChart/PieChart.base.js.map +1 -1
- package/lib-commonjs/components/ResponsiveContainer/ResponsiveContainer.js +13 -5
- package/lib-commonjs/components/ResponsiveContainer/ResponsiveContainer.js.map +1 -1
- package/lib-commonjs/components/ResponsiveContainer/ResponsiveContainer.types.d.ts +2 -4
- package/lib-commonjs/components/ResponsiveContainer/ResponsiveContainer.types.js.map +1 -1
- package/lib-commonjs/components/SankeyChart/SankeyChart.base.js +4 -6
- package/lib-commonjs/components/SankeyChart/SankeyChart.base.js.map +1 -1
- package/lib-commonjs/components/SankeyChart/SankeyChart.styles.js +3 -0
- package/lib-commonjs/components/SankeyChart/SankeyChart.styles.js.map +1 -1
- package/lib-commonjs/components/SankeyChart/SankeyChart.types.d.ts +4 -0
- package/lib-commonjs/components/SankeyChart/SankeyChart.types.js.map +1 -1
- package/lib-commonjs/components/ScatterChart/ScatterChart.base.js +40 -7
- package/lib-commonjs/components/ScatterChart/ScatterChart.base.js.map +1 -1
- package/lib-commonjs/components/Sparkline/Sparkline.base.d.ts +2 -2
- package/lib-commonjs/components/StackedBarChart/MultiStackedBarChart.base.js +6 -1
- package/lib-commonjs/components/StackedBarChart/MultiStackedBarChart.base.js.map +1 -1
- package/lib-commonjs/components/StackedBarChart/StackedBarChart.base.js +5 -1
- package/lib-commonjs/components/StackedBarChart/StackedBarChart.base.js.map +1 -1
- package/lib-commonjs/components/TreeChart/TreeChart.base.js +17 -2
- package/lib-commonjs/components/TreeChart/TreeChart.base.js.map +1 -1
- package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.base.js +11 -0
- package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.base.js.map +1 -1
- package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js +3 -0
- package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js.map +1 -1
- package/lib-commonjs/utilities/ChartHoverCard/ChartHoverCard.base.js.map +1 -1
- package/lib-commonjs/utilities/scatterpolar-utils.d.ts +22 -0
- package/lib-commonjs/utilities/scatterpolar-utils.js +42 -0
- package/lib-commonjs/utilities/scatterpolar-utils.js.map +1 -0
- package/lib-commonjs/utilities/utilities.d.ts +6 -0
- package/lib-commonjs/utilities/utilities.js +18 -5
- package/lib-commonjs/utilities/utilities.js.map +1 -1
- package/package.json +4 -4
- package/src/components/ChartTable/ChartTable.types.ts +1 -0
- package/src/components/CommonComponents/CartesianChart.types.ts +6 -0
- package/src/components/DonutChart/DonutChart.types.ts +5 -0
- package/src/components/GaugeChart/GaugeChart.types.ts +5 -0
- package/src/components/ResponsiveContainer/ResponsiveContainer.types.ts +3 -2
- package/src/components/SankeyChart/SankeyChart.types.ts +5 -0
|
@@ -25,6 +25,7 @@ define(["require", "exports", "tslib", "react", "d3-shape", "@fluentui/react/lib
|
|
|
25
25
|
_updateChart(nextProps);
|
|
26
26
|
return null;
|
|
27
27
|
};
|
|
28
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
28
29
|
Arc.prototype.render = function () {
|
|
29
30
|
var _this = this;
|
|
30
31
|
var _a;
|
|
@@ -47,6 +48,7 @@ define(["require", "exports", "tslib", "react", "d3-shape", "@fluentui/react/lib
|
|
|
47
48
|
_this._arcId = (0, Utilities_1.getId)('piechart_arc');
|
|
48
49
|
return _this;
|
|
49
50
|
}
|
|
51
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
50
52
|
LabeledArc.prototype.render = function () {
|
|
51
53
|
var _this = this;
|
|
52
54
|
var _a, _b;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Arc.js","sourceRoot":"../src/","sources":["components/PieChart/Arc/Arc.tsx"],"names":[],"mappings":";;;;IASA;QAAyB,+BAAqC;QAY5D,aAAmB,KAAgB;YACjC,YAAA,MAAK,YAAC,KAAK,CAAC,SAAC;YAQR,iBAAW,GAAG,UAAC,QAAmB;gBACvC,YAAY,CAAC,QAAQ,CAAC,CAAC;YACzB,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"Arc.js","sourceRoot":"../src/","sources":["components/PieChart/Arc/Arc.tsx"],"names":[],"mappings":";;;;IASA;QAAyB,+BAAqC;QAY5D,aAAmB,KAAgB;YACjC,YAAA,MAAK,YAAC,KAAK,CAAC,SAAC;YAQR,iBAAW,GAAG,UAAC,QAAmB;gBACvC,YAAY,CAAC,QAAQ,CAAC,CAAC;YACzB,CAAC,CAAC;YAiBQ,cAAQ,GAAG;gBACnB,KAAI,CAAC,QAAQ,CAAC,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC,CAAC;YACxC,CAAC,CAAC;YAEQ,aAAO,GAAG;gBAClB,KAAI,CAAC,QAAQ,CAAC,EAAE,YAAY,EAAE,KAAK,EAAE,CAAC,CAAC;YACzC,CAAC,CAAC;YAhCA,KAAI,CAAC,KAAK,GAAG;gBACX,YAAY,EAAE,KAAK;aACpB,CAAC;YAEF,KAAI,CAAC,MAAM,GAAG,IAAA,iBAAK,EAAC,cAAc,CAAC,CAAC;;QACtC,CAAC;QAZa,4BAAwB,GAAtC,UAAu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qBAC9B,EACD,oBAAoB,EAAE,IAAI,CAAC,KAAK,CAAC,YAAY,EAC7C,kBAAkB,EAAE,KAAK,EACzB,QAAQ,EAAE,EAAE,EACZ,WAAW,EAAE,uBAAW,GACxB,CACA,CACL,CAAC;QACJ,CAAC;QACH,iBAAC;IAAD,CAAC,AAzDD,CAAgC,GAAG,GAyDlC;IAzDY,gCAAU;IA2DvB,SAAS,YAAY,CAAC,QAAmB;QACvC,QAAQ,CAAC,GAAG,CAAC,WAAW,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;QAC/C,QAAQ,CAAC,GAAG,CAAC,WAAW,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;IACjD,CAAC","sourcesContent":["import * as React from 'react';\nimport { arc as d3Arc } from 'd3-shape';\nimport { IArcProps, IArcState, IArcStyles } from './Arc.types';\nimport { classNamesFunction, getId, getRTL } from '@fluentui/react/lib/Utilities';\nimport { getStyles } from './Arc.styles';\nimport { wrapContent } from '../../../utilities/utilities';\nimport { SVGTooltipText } from '../../../utilities/SVGTooltipText';\nimport { formatToLocaleString } from '@fluentui/chart-utilities';\n\nexport class Arc extends React.Component<IArcProps, IArcState> {\n public static defaultProps: Partial<IArcProps> = {\n arc: d3Arc(),\n };\n\n protected _arcId: string;\n\n public static getDerivedStateFromProps(nextProps: Readonly<IArcProps>): null {\n _updateChart(nextProps);\n return null;\n }\n\n public constructor(props: IArcProps) {\n super(props);\n this.state = {\n isArcFocused: false,\n };\n\n this._arcId = getId('piechart_arc');\n }\n\n public updateChart = (newProps: IArcProps) => {\n _updateChart(newProps);\n };\n\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n public render(): JSX.Element {\n const { arc } = this.props;\n const getClassNames = classNamesFunction<IArcProps, IArcStyles>();\n const classNames = getClassNames(props => getStyles(props, this.props.theme), { ...this.props });\n\n return (\n <path\n d={arc(this.props.data)}\n className={`${this.state.isArcFocused ? classNames.arcRootFocussed : classNames.arcRoot}`}\n onClick={this.props.data?.data.onClick}\n />\n );\n }\n\n protected _onFocus = () => {\n this.setState({ isArcFocused: true });\n };\n\n protected _onBlur = () => {\n this.setState({ isArcFocused: false });\n };\n}\n\nexport class LabeledArc extends Arc {\n private _isRTL = getRTL();\n\n public constructor(props: IArcProps) {\n super(props);\n this._arcId = getId('piechart_arc');\n }\n\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n public render(): JSX.Element {\n const { data, culture } = this.props;\n const gap = 4;\n // placing the labels on the outside arc\n const [labelX, labelY] = d3Arc().centroid({\n endAngle: data?.endAngle || 0,\n startAngle: data?.startAngle || 0,\n padAngle: data?.padAngle,\n innerRadius: this.props?.outerRadius || 0,\n outerRadius: this.props?.outerRadius || 0 + gap,\n });\n\n const getClassNames = classNamesFunction<IArcProps, IArcStyles>();\n const classNames = getClassNames(props => getStyles(props, this.props.theme));\n\n const angle = ((data?.startAngle || 0) + (data?.endAngle || 0)) / 2;\n\n const content = `${data?.data.x}-${formatToLocaleString(data?.data.y, culture)}`;\n\n return (\n <g\n className={`${classNames.arc} arc`}\n data-is-focusable={true}\n id={this._arcId}\n onFocus={this._onFocus}\n onBlur={this._onBlur}\n aria-label={content}\n role=\"img\"\n >\n {super.render()}\n <SVGTooltipText\n content={content}\n textProps={{\n x: labelX + (angle > Math.PI ? -10 : 10),\n y: labelY + (angle > Math.PI / 2 && angle < (3 * Math.PI) / 2 ? 10 : -10),\n dominantBaseline: angle > Math.PI / 2 && angle < (3 * Math.PI) / 2 ? 'hanging' : 'auto',\n textAnchor: (!this._isRTL && angle > Math.PI) || (this._isRTL && angle < Math.PI) ? 'end' : 'start',\n 'aria-label': `${data?.data.x}-${formatToLocaleString(data?.data.y, culture)}`,\n className: classNames.arcText,\n }}\n isTooltipVisibleProp={this.state.isArcFocused}\n shouldReceiveFocus={false}\n maxWidth={40}\n wrapContent={wrapContent}\n />\n </g>\n );\n }\n}\n\nfunction _updateChart(newProps: IArcProps): void {\n newProps.arc.innerRadius(newProps.innerRadius);\n newProps.arc.outerRadius(newProps.outerRadius);\n}\n"]}
|
|
@@ -6,11 +6,13 @@ define(["require", "exports", "tslib", "react", "d3-shape", "d3-scale", "../Arc/
|
|
|
6
6
|
tslib_1.__extends(Pie, _super);
|
|
7
7
|
function Pie(props) {
|
|
8
8
|
var _this = _super.call(this, props) || this;
|
|
9
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
9
10
|
_this.arcGenerator = function (d, i) {
|
|
10
11
|
return (React.createElement(Arc_1.LabeledArc, { culture: _this.props.culture, key: i, data: d, innerRadius: _this.props.innerRadius, outerRadius: _this.props.outerRadius, color: "".concat(_this.colors(i)), theme: _this.props.theme }));
|
|
11
12
|
};
|
|
12
13
|
return _this;
|
|
13
14
|
}
|
|
15
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
14
16
|
Pie.prototype.render = function () {
|
|
15
17
|
var _this = this;
|
|
16
18
|
// const getClassNames = classNamesFunction<IPieProps, IPieStyles>();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Pie.js","sourceRoot":"../src/","sources":["components/PieChart/Pie/Pie.tsx"],"names":[],"mappings":";;;;IASA;QAAyB,+BAA8B;QAUrD,aAAY,KAAgB;YAC1B,YAAA,MAAK,YAAC,KAAK,CAAC,SAAC;
|
|
1
|
+
{"version":3,"file":"Pie.js","sourceRoot":"../src/","sources":["components/PieChart/Pie/Pie.tsx"],"names":[],"mappings":";;;;IASA;QAAyB,+BAA8B;QAUrD,aAAY,KAAgB;YAC1B,YAAA,MAAK,YAAC,KAAK,CAAC,SAAC;YAGf,4DAA4D;YACrD,kBAAY,GAAG,UAAC,CAAW,EAAE,CAAS;gBAC3C,OAAO,CACL,oBAAC,gBAAU,IACT,OAAO,EAAE,KAAI,CAAC,KAAK,CAAC,OAAO,EAC3B,GAAG,EAAE,CAAC,EACN,IAAI,EAAE,CAAC,EACP,WAAW,EAAE,KAAI,CAAC,KAAK,CAAC,WAAW,EACnC,WAAW,EAAE,KAAI,CAAC,KAAK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AAkB,CAAC,QAAQ;gBAC/C,6BAAK,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,gBAAc,UAAU;oBACvD,2BAAG,SAAS,EAAC,KAAK,EAAC,SAAS,EAAE,SAAS,IACpC,QAAQ,CAAC,GAAG,CAAC,UAAC,CAAW,EAAE,CAAS,IAAK,OAAA,KAAI,CAAC,YAAY,CAAC,CAAC,EAAE,CAAC,CAAC,EAAvB,CAAuB,CAAC,CAChE,CACA,CACI,CACb,CAAC;QACJ,CAAC;QAvDa,gBAAY,GAAuB;YAC/C,GAAG,EAAE,IAAA,cAAK,GAAE;iBACT,QAAQ,CAAC,IAAI,CAAC;iBACd,IAAI,CAAC,IAAI,CAAC;gBACX,uDAAuD;iBACtD,KAAK,CAAC,UAAC,CAAM,IAAK,OAAA,CAAC,CAAC,CAAC,EAAH,CAAG,CAAC;SAC1B,AANyB,CAMxB;QAkDJ,UAAC;KAAA,AAzDD,CAAyB,KAAK,CAAC,SAAS,GAyDvC;IAzDY,kBAAG","sourcesContent":["import * as React from 'react';\nimport { pie as d3Pie } from 'd3-shape';\nimport { ScaleOrdinal, scaleOrdinal } from 'd3-scale';\nimport { IPieProps } from './Pie.types';\nimport { LabeledArc } from '../Arc/Arc';\nimport { IArcData } from '../Arc/Arc.types';\nimport { FocusZone, FocusZoneDirection } from '@fluentui/react-focus';\nimport { getColorFromToken, getNextColor } from '../../../utilities/colors';\n\nexport class Pie extends React.Component<IPieProps, {}> {\n public static defaultProps: Partial<IPieProps> = {\n pie: d3Pie()\n .padAngle(0.01)\n .sort(null)\n /* eslint-disable @typescript-eslint/no-explicit-any */\n .value((d: any) => d.y),\n };\n private colors: ScaleOrdinal<string | number, any>;\n\n constructor(props: IPieProps) {\n super(props);\n }\n\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n public arcGenerator = (d: IArcData, i: number): JSX.Element => {\n return (\n <LabeledArc\n culture={this.props.culture}\n key={i}\n data={d}\n innerRadius={this.props.innerRadius}\n outerRadius={this.props.outerRadius}\n color={`${this.colors(i)}`}\n theme={this.props.theme}\n />\n );\n };\n\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n public render(): JSX.Element {\n // const getClassNames = classNamesFunction<IPieProps, IPieStyles>();\n const { pie, data, width, height, chartTitle, theme } = this.props;\n\n const defaultColors: Array<string> = [];\n if (data && !this.props.colors) {\n for (let i = 0; i < data.length; i++) {\n defaultColors.push(getNextColor(i, 0, theme?.isInverted));\n }\n }\n const { colors = defaultColors } = this.props;\n\n this.colors = scaleOrdinal().range(colors.map(color => getColorFromToken(color)));\n\n const piechart = pie(data);\n const translate = `translate(${width / 2}, ${height / 2})`;\n\n return (\n <FocusZone direction={FocusZoneDirection.domOrder}>\n <svg width={width} height={height} aria-label={chartTitle}>\n <g className=\"pie\" transform={translate}>\n {piechart.map((d: IArcData, i: number) => this.arcGenerator(d, i))}\n </g>\n </svg>\n </FocusZone>\n );\n }\n}\n"]}
|
|
@@ -10,6 +10,7 @@ define(["require", "exports", "tslib", "react", "@fluentui/react/lib/Utilities",
|
|
|
10
10
|
_this._emptyChartId = (0, Utilities_1.getId)('_PieChart_empty');
|
|
11
11
|
return _this;
|
|
12
12
|
}
|
|
13
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
13
14
|
PieChartBase.prototype.render = function () {
|
|
14
15
|
var _a = this.props, data = _a.data, width = _a.width, height = _a.height, colors = _a.colors, chartTitle = _a.chartTitle;
|
|
15
16
|
var _b = this.props, theme = _b.theme, className = _b.className, styles = _b.styles, culture = _b.culture;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PieChart.base.js","sourceRoot":"../src/","sources":["components/PieChart/PieChart.base.tsx"],"names":[],"mappings":";;;;IAMA,IAAM,aAAa,GAAG,IAAA,8BAAkB,GAAwC,CAAC;IAEjF;QAAkC,wCAAmC;QASnE,sBAAmB,KAAqB;YACtC,YAAA,MAAK,YAAC,KAAK,CAAC,SAAC;YACb,KAAI,CAAC,aAAa,GAA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AC,IAAI;gBAClC,IAAI,CAAC,KAAK,CAAC,UAAU,IAAI,2BAAG,SAAS,EAAE,IAAI,CAAC,WAAW,CAAC,UAAU,IAAG,IAAI,CAAC,KAAK,CAAC,UAAU,CAAK;gBAChG,oBAAC,SAAG,IACF,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,KAAM,GAAG,CAAC,GAAG,OAAO,EAC3B,MAAM,EAAE,MAAO,GAAG,CAAC,GAAG,OAAO,EAC7B,WAAW,EAAE,WAAW,EACxB,WAAW,EAAE,CAAC,EACd,IAAI,EAAE,IAAK,EACX,MAAM,EAAE,MAAO,EACf,UAAU,EAAE,UAAW,EACvB,KAAK,EAAE,KAAK,GACZ,CACE,CACP,CAAC,CAAC,CAAC,CACF,6BACE,EAAE,EAAE,IAAI,CAAC,aAAa,EACtB,IAAI,EAAE,OAAO,EACb,KAAK,EAAE,EAAE,OAAO,EAAE,GAAG,EAAE,gBACX,8BAA8B,GAC1C,CACH,CAAC;QACJ,CAAC;QAEO,oCAAa,GAArB;YACE,OAAO,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,UAAA,IAAI,IAAI,OAAA,IAAI,CAAC,CAAC,GAAG,CAAC,EAAV,CAAU,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QACnH,CAAC;QAhEa,yBAAY,GAA4B;YACpD,IAAI,EAAE,EAAE;YACR,KAAK,EAAE,GAAG;YACV,MAAM,EAAE,GAAG;SACZ,CAAC;QA6DJ,mBAAC;KAAA,AAlED,CAAkC,KAAK,CAAC,SAAS,GAkEhD;IAlEY,oCAAY","sourcesContent":["import * as React from 'react';\nimport { classNamesFunction, getId } from '@fluentui/react/lib/Utilities';\nimport { IPieChartProps, IPieChartStyleProps, IPieChartStyles } from './PieChart.types';\nimport { Pie } from './Pie/Pie';\nimport { IProcessedStyleSet } from '@fluentui/react/lib/Styling';\n\nconst getClassNames = classNamesFunction<IPieChartStyleProps, IPieChartStyles>();\n\nexport class PieChartBase extends React.Component<IPieChartProps, {}> {\n public static defaultProps: Partial<IPieChartProps> = {\n data: [],\n width: 600,\n height: 350,\n };\n private _classNames: IProcessedStyleSet<IPieChartStyles>;\n private _emptyChartId: string;\n\n public constructor(props: IPieChartProps) {\n super(props);\n this._emptyChartId = getId('_PieChart_empty');\n }\n\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n public render(): JSX.Element {\n const { data, width, height, colors, chartTitle } = this.props;\n\n const { theme, className, styles, culture } = this.props;\n this._classNames = getClassNames(styles!, {\n theme: theme!,\n width: width!,\n height: height!,\n className,\n });\n\n const TEXT_MAX_WIDTH = 40;\n const TEXT_LINE_HEIGHT = 16;\n const PADDING = 4;\n\n /**\n * The radius for the pie chart is computed based on the space available inside the svg\n * after subtracting the max amount of space that can be used by the text in pie chart\n */\n\n const radius = Math.min(width! - 2 * TEXT_MAX_WIDTH, height! - 2 * TEXT_LINE_HEIGHT) / 2;\n const outerRadius = radius;\n\n return !this._isChartEmpty() ? (\n <div className={this._classNames.root}>\n {this.props.chartTitle && <p className={this._classNames.chartTitle}>{this.props.chartTitle}</p>}\n <Pie\n culture={culture}\n width={width! + 2 * PADDING}\n height={height! + 2 * PADDING}\n outerRadius={outerRadius}\n innerRadius={1}\n data={data!}\n colors={colors!}\n chartTitle={chartTitle!}\n theme={theme}\n />\n </div>\n ) : (\n <div\n id={this._emptyChartId}\n role={'alert'}\n style={{ opacity: '0' }}\n aria-label={'Graph has no data to display'}\n />\n );\n }\n\n private _isChartEmpty(): boolean {\n return !(this.props.data && this.props.data.length > 0 && this.props.data.filter(item => item.y > 0).length > 0);\n }\n}\n"]}
|
|
@@ -61,15 +61,23 @@ define(["require", "exports", "tslib", "react", "@fluentui/react"], function (re
|
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
63
|
return React.Children.map(props.children, function (child) {
|
|
64
|
-
var _a;
|
|
64
|
+
var _a, _b, _c, _d, _e, _f;
|
|
65
|
+
var commonStyles = {
|
|
66
|
+
root: tslib_1.__assign(tslib_1.__assign({}, (_a = child.props.styles) === null || _a === void 0 ? void 0 : _a.root), { width: '100%', height: '100%' }),
|
|
67
|
+
chartWrapper: tslib_1.__assign(tslib_1.__assign({}, (_b = child.props.styles) === null || _b === void 0 ? void 0 : _b.chartWrapper), { width: '100%' }),
|
|
68
|
+
chart: tslib_1.__assign(tslib_1.__assign({}, (_c = child.props.styles) === null || _c === void 0 ? void 0 : _c.chart), {
|
|
69
|
+
// This overrides the pixel width of svg allowing it to resize properly within a flexbox or grid layout.
|
|
70
|
+
// Note: height is not set to 100% because that causes the charts to resize vertically in an infinite loop.
|
|
71
|
+
width: '100%' }),
|
|
72
|
+
};
|
|
65
73
|
return React.cloneElement(child, {
|
|
66
74
|
width: calculatedWidth,
|
|
67
75
|
height: calculatedHeight,
|
|
76
|
+
// For SankeyChart
|
|
68
77
|
shouldResize: (calculatedWidth !== null && calculatedWidth !== void 0 ? calculatedWidth : 0) + (calculatedHeight !== null && calculatedHeight !== void 0 ? calculatedHeight : 0),
|
|
69
|
-
styles: tslib_1.__assign(tslib_1.__assign(
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
width: calculatedWidth, height: calculatedHeight }) }),
|
|
78
|
+
styles: tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({}, child.props.styles), commonStyles), {
|
|
79
|
+
// For HeatMapChart
|
|
80
|
+
subComponentStyles: tslib_1.__assign(tslib_1.__assign({}, (_d = child.props.styles) === null || _d === void 0 ? void 0 : _d.subComponentStyles), { cartesianStyles: tslib_1.__assign(tslib_1.__assign({}, (_f = (_e = child.props.styles) === null || _e === void 0 ? void 0 : _e.subComponentStyles) === null || _f === void 0 ? void 0 : _f.cartesianStyles), commonStyles) }) }),
|
|
73
81
|
});
|
|
74
82
|
});
|
|
75
83
|
}, [size, props.aspect, props.maxHeight, props.children]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ResponsiveContainer.js","sourceRoot":"../src/","sources":["components/ResponsiveContainer/ResponsiveContainer.tsx"],"names":[],"mappings":";;;;IAIA;;;OAGG;IACI,IAAM,mBAAmB,GAAwC,UAAA,KAAK;;QAC3E,IAAM,YAAY,GAAG,KAAK,CAAC,MAAM,CAAiB,IAAI,CAAC,CAAC;QACxD,IAAM,WAAW,GAAG,KAAK,CAAC,MAAM,EAAyC,CAAC;QAEpE,IAAA,KAAkB,KAAK,CAAC,QAAQ,CAAwD,EAAE,CAAC,EAA1F,IAAI,QAAA,EAAE,OAAO,QAA6E,CAAC;QAElG,WAAW,CAAC,OAAO,GAAG,KAAK,CAAC,QAAQ,CAAC;QAErC,KAAK,CAAC,SAAS,CAAC;YACd,IAAM,OAAO,GAAG,IAAA,iBAAS,EAAC,YAAY,CAAC,OAAO,CAA6C,CAAC;YAC5F,IAAI,gBAAoC,CAAC;YACzC,IAAI,cAA0C,CAAC;YAE/C,IAAM,cAAc,GAAG,UAAC,OAA8B;;gBAC9C,IAAA,KAAqD,OAAO,CAAC,CAAC,CAAC,CAAC,WAAW,EAAlE,cAAc,WAAA,EAAU,eAAe,YAA2B,CAAC;gBAClF,sEAAsE;gBACtE,gGAAgG;gBAChG,gBAAgB,GAAG,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,qBAAqB,CAAC;oBAChD,OAAO,CAAC,UAAA,QAAQ;wBACd,IAAM,YAAY,GAAG,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC;wBAChD,IAAM,aAAa,GAAG,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC;wBAClD,IAAI,QAAQ,CAAC,cAAc,KAAK,YAAY,IAAI,QAAQ,CAAC,eAAe,KAAK,aAAa,EAAE,CAAC;4BAC3F,OAAO,QAAQ,CAAC;wBAClB,CAAC;wBAED,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,eAAe,EAAE,a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MAAM,GAClB,YAAY;wBACf,mBAAmB;wBACnB,kBAAkB,wCACb,MAAA,KAAK,CAAC,KAAK,CAAC,MAAM,0CAAE,kBAAkB,KACzC,eAAe,wCACV,MAAA,MAAA,KAAK,CAAC,KAAK,CAAC,MAAM,0CAAE,kBAAkB,0CAAE,eAAe,GACvD,YAAY,OAGpB;iBACF,CAAC,CAAC;YACL,CAAC,CAAC,CAAC;QACL,CAAC,EAAE,CAAC,IAAI,EAAE,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,SAAS,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC;QAE1D,OAAO,CACL,6BACE,GAAG,EAAE,YAAY,EACjB,KAAK,EAAE;gBACL,KAAK,EAAE,MAAA,KAAK,CAAC,KAAK,mCAAI,MAAM;gBAC5B,MAAM,EAAE,MAAA,KAAK,CAAC,MAAM,mCAAI,MAAM;gBAC9B,QAAQ,EAAE,KAAK,CAAC,QAAQ;gBACxB,SAAS,EAAE,KAAK,CAAC,SAAS;gBAC1B,SAAS,EAAE,KAAK,CAAC,SAAS;aAC3B,IAEA,YAAY,CACT,CACP,CAAC;IACJ,CAAC,CAAC;IAtHW,QAAA,mBAAmB,uBAsH9B","sourcesContent":["import * as React from 'react';\nimport { getWindow } from '@fluentui/react';\nimport { IResponsiveChildProps, IResponsiveContainerProps } from './ResponsiveContainer.types';\n\n/**\n * Responsive Container component\n * {@docCategory ResponsiveContainer}\n */\nexport const ResponsiveContainer: React.FC<IResponsiveContainerProps> = props => {\n const containerRef = React.useRef<HTMLDivElement>(null);\n const onResizeRef = React.useRef<IResponsiveContainerProps['onResize']>();\n\n const [size, setSize] = React.useState<{ containerWidth?: number; containerHeight?: number }>({});\n\n onResizeRef.current = props.onResize;\n\n React.useEffect(() => {\n const _window = getWindow(containerRef.current) as (Window & typeof globalThis) | undefined;\n let animationFrameId: number | undefined;\n let resizeObserver: ResizeObserver | undefined;\n\n const resizeCallback = (entries: ResizeObserverEntry[]) => {\n const { width: containerWidth, height: containerHeight } = entries[0].contentRect;\n // rAF is an alternative to the throttle function. For more info, see:\n // https://css-tricks.com/debouncing-throttling-explained-examples/#aa-requestanimationframe-raf\n animationFrameId = _window?.requestAnimationFrame(() => {\n setSize(prevSize => {\n const roundedWidth = Math.floor(containerWidth);\n const roundedHeight = Math.floor(containerHeight);\n if (prevSize.containerWidth === roundedWidth && prevSize.containerHeight === roundedHeight) {\n return prevSize;\n }\n\n return { containerWidth: roundedWidth, containerHeight: roundedHeight };\n });\n });\n onResizeRef.current?.(containerWidth, containerHeight);\n };\n\n if (_window && _window.ResizeObserver) {\n resizeObserver = new _window.ResizeObserver(resizeCallback);\n if (containerRef.current) {\n resizeObserver.observe(containerRef.current);\n }\n }\n\n return () => {\n if (animationFrameId) {\n _window?.cancelAnimationFrame(animationFrameId);\n }\n\n resizeObserver?.disconnect();\n };\n }, []);\n\n const chartContent = React.useMemo(() => {\n let calculatedWidth = size.containerWidth;\n let calculatedHeight = size.containerHeight;\n\n if (typeof props.aspect === 'number' && props.aspect > 0) {\n if (calculatedWidth) {\n calculatedHeight = calculatedWidth / props.aspect;\n } else if (calculatedHeight) {\n calculatedWidth = calculatedHeight * props.aspect;\n }\n\n if (typeof props.maxHeight === 'number' && calculatedHeight && calculatedHeight > props.maxHeight) {\n calculatedHeight = props.maxHeight;\n }\n }\n\n return React.Children.map(props.children, child => {\n const commonStyles = {\n root: {\n ...child.props.styles?.root,\n width: '100%',\n height: '100%',\n },\n chartWrapper: {\n ...child.props.styles?.chartWrapper,\n width: '100%',\n },\n chart: {\n ...child.props.styles?.chart,\n // This overrides the pixel width of svg allowing it to resize properly within a flexbox or grid layout.\n // Note: height is not set to 100% because that causes the charts to resize vertically in an infinite loop.\n width: '100%',\n },\n };\n\n return React.cloneElement<IResponsiveChildProps>(child, {\n width: calculatedWidth,\n height: calculatedHeight,\n // For SankeyChart\n shouldResize: (calculatedWidth ?? 0) + (calculatedHeight ?? 0),\n styles: {\n // Keep components styles\n ...child.props.styles,\n ...commonStyles,\n // For HeatMapChart\n subComponentStyles: {\n ...child.props.styles?.subComponentStyles,\n cartesianStyles: {\n ...child.props.styles?.subComponentStyles?.cartesianStyles,\n ...commonStyles,\n },\n },\n },\n });\n });\n }, [size, props.aspect, props.maxHeight, props.children]);\n\n return (\n <div\n ref={containerRef}\n style={{\n width: props.width ?? '100%',\n height: props.height ?? '100%',\n minWidth: props.minWidth,\n minHeight: props.minHeight,\n maxHeight: props.maxHeight,\n }}\n >\n {chartContent}\n </div>\n );\n};\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { IStyleFunctionOrObject } from '@fluentui/react';
|
|
3
3
|
/**
|
|
4
4
|
* Responsive Child props
|
|
5
5
|
* {@docCategory ResponsiveContainer}
|
|
@@ -8,9 +8,7 @@ export interface IResponsiveChildProps {
|
|
|
8
8
|
width?: number;
|
|
9
9
|
height?: number;
|
|
10
10
|
shouldResize?: number;
|
|
11
|
-
styles?: IStyleFunctionOrObject<
|
|
12
|
-
root: IStyle;
|
|
13
|
-
}>;
|
|
11
|
+
styles?: IStyleFunctionOrObject<any, any>;
|
|
14
12
|
}
|
|
15
13
|
/**
|
|
16
14
|
* Responsive Container props
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ResponsiveContainer.types.js","sourceRoot":"../src/","sources":["components/ResponsiveContainer/ResponsiveContainer.types.ts"],"names":[],"mappings":"","sourcesContent":["import * as React from 'react';\nimport {
|
|
1
|
+
{"version":3,"file":"ResponsiveContainer.types.js","sourceRoot":"../src/","sources":["components/ResponsiveContainer/ResponsiveContainer.types.ts"],"names":[],"mappings":"","sourcesContent":["import * as React from 'react';\nimport { IStyleFunctionOrObject } from '@fluentui/react';\n\n/**\n * Responsive Child props\n * {@docCategory ResponsiveContainer}\n */\nexport interface IResponsiveChildProps {\n width?: number;\n height?: number;\n shouldResize?: number;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n styles?: IStyleFunctionOrObject<any, any>;\n}\n\n/**\n * Responsive Container props\n * {@docCategory ResponsiveContainer}\n */\nexport interface IResponsiveContainerProps {\n /**\n * Aspect ratio (width / height) of the container. If specified, the height will be calculated by width / aspect.\n */\n aspect?: number;\n\n /**\n * Width of the container\n */\n width?: number | string;\n\n /**\n * Height of the container\n */\n height?: number | string;\n\n /**\n * Minimum width of the container\n */\n minWidth?: number | string;\n\n /**\n * Minimum height of the container\n */\n minHeight?: number | string;\n\n /**\n * Maximum height of the container\n */\n maxHeight?: number;\n\n /**\n * Callback providing the updated chart width and height values when the container is resized\n */\n onResize?: (width: number, height: number) => void;\n\n /**\n * Child component to be rendered within the container\n */\n children: React.ReactElement<IResponsiveChildProps>;\n}\n"]}
|
|
@@ -253,16 +253,14 @@ define(["require", "exports", "tslib", "@fluentui/react-focus", "@fluentui/react
|
|
|
253
253
|
// This is exported for unit tests.
|
|
254
254
|
function preRenderLayout(margins, containerWidth, containerHeight, isRtl) {
|
|
255
255
|
var left = margins.left, right = margins.right, top = margins.top, bottom = margins.bottom;
|
|
256
|
-
var width = containerWidth - right;
|
|
257
|
-
var height = containerHeight - bottom > 0 ? containerHeight - bottom : 0;
|
|
258
256
|
var sankey = (0, d3_sankey_1.sankey)()
|
|
259
257
|
.nodeWidth(NODE_WIDTH)
|
|
260
258
|
.extent([
|
|
261
259
|
[left, top],
|
|
262
|
-
[
|
|
260
|
+
[containerWidth - right, containerHeight - bottom],
|
|
263
261
|
])
|
|
264
262
|
.nodeAlign(isRtl ? d3_sankey_1.sankeyRight : d3_sankey_1.sankeyJustify);
|
|
265
|
-
return { sankey: sankey, height:
|
|
263
|
+
return { sankey: sankey, height: containerHeight, width: containerWidth };
|
|
266
264
|
}
|
|
267
265
|
exports.preRenderLayout = preRenderLayout;
|
|
268
266
|
var elipsis = '...';
|
|
@@ -597,7 +595,7 @@ define(["require", "exports", "tslib", "@fluentui/react-focus", "@fluentui/react
|
|
|
597
595
|
var calloutProps = tslib_1.__assign({ isCalloutVisible: state.isCalloutVisible, directionalHint: Callout_1.DirectionalHint.topAutoEdge, id: "toolTip".concat(this._calloutId), target: state.refSelected, color: state.color, XValue: state.xCalloutValue, YValue: state.yCalloutValue ? state.yCalloutValue : state.dataForHoverCard, descriptionMessage: state.descriptionMessage, isBeakVisible: false, gapSpace: 15, onDismiss: this._onCloseCallout, className: classNames_1.calloutContentRoot, preventDismissOnLostFocus: true }, this.props.calloutProps);
|
|
598
596
|
return (React.createElement("div", { className: classNames_1.root, role: 'presentation', ref: function (rootElem) { return (_this.chartContainer = rootElem); }, onMouseLeave: this._onCloseCallout },
|
|
599
597
|
React.createElement(react_focus_1.FocusZone, { direction: react_focus_1.FocusZoneDirection.vertical, className: classNames_1.chartWrapper },
|
|
600
|
-
React.createElement("svg", { width: width, height: height, id: this._chartId },
|
|
598
|
+
React.createElement("svg", { width: width, height: height, id: this._chartId, className: classNames_1.chart },
|
|
601
599
|
nodeLinkDomOrderArray_1.map(function (item) {
|
|
602
600
|
if (item.type === 'node') {
|
|
603
601
|
return (React.createElement("g", { key: nodes_1[item.index].nodeId, className: classNames_1.nodes }, nodeData_1[item.index]));
|
|
@@ -689,7 +687,7 @@ define(["require", "exports", "tslib", "@fluentui/react-focus", "@fluentui/react
|
|
|
689
687
|
var nodeValues = valuesOfNodes(transformed.nodes);
|
|
690
688
|
var linkValues = valuesOfLinks(transformed.links);
|
|
691
689
|
adjustOnePercentHeightNodes(nodesInColumn, nodeValues, linkValues);
|
|
692
|
-
adjustPadding(sankey,
|
|
690
|
+
adjustPadding(sankey, containerHeight - this._margins.top - this._margins.bottom, nodesInColumn);
|
|
693
691
|
// `sankey` is called a second time, probably to re-layout the nodes with the one-percent adjusted weights.
|
|
694
692
|
// NOTE: The second call to `sankey` is required to allow links to be hoverable.
|
|
695
693
|
// Without the second call, the links are not hoverable.
|