@fluentui/react-charting 5.24.3 → 5.24.5
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 +85 -1
- package/CHANGELOG.md +29 -2
- package/config/tests.js +0 -12
- package/dist/react-charting.d.ts +38 -1
- package/dist/react-charting.js +1 -1
- package/dist/react-charting.min.js +1 -1
- package/etc/react-charting.api.md +8 -1
- package/lib/components/AreaChart/AreaChart.base.d.ts +1 -0
- package/lib/components/AreaChart/AreaChart.base.js +4 -1
- package/lib/components/AreaChart/AreaChart.base.js.map +1 -1
- package/lib/components/CommonComponents/CartesianChart.base.js +14 -13
- package/lib/components/CommonComponents/CartesianChart.base.js.map +1 -1
- package/lib/components/CommonComponents/CartesianChart.styles.js +41 -37
- package/lib/components/CommonComponents/CartesianChart.styles.js.map +1 -1
- package/lib/components/CommonComponents/CartesianChart.types.d.ts +12 -2
- package/lib/components/CommonComponents/CartesianChart.types.js.map +1 -1
- package/lib/components/DeclarativeChart/DeclarativeChart.js +38 -16
- package/lib/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
- package/lib/components/DeclarativeChart/PlotlyColorAdapter.d.ts +2 -1
- package/lib/components/DeclarativeChart/PlotlyColorAdapter.js +9 -1
- package/lib/components/DeclarativeChart/PlotlyColorAdapter.js.map +1 -1
- package/lib/components/DeclarativeChart/PlotlySchemaAdapter.d.ts +13 -3
- package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js +276 -199
- package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
- package/lib/components/DonutChart/DonutChart.base.js +1 -0
- package/lib/components/DonutChart/DonutChart.base.js.map +1 -1
- package/lib/components/DonutChart/DonutChart.styles.js +18 -0
- 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/GroupedVerticalBarChart/GroupedVerticalBarChart.base.d.ts +2 -0
- package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js +25 -4
- package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js.map +1 -1
- package/lib/components/HeatMapChart/HeatMapChart.base.d.ts +7 -0
- package/lib/components/HeatMapChart/HeatMapChart.base.js +95 -37
- package/lib/components/HeatMapChart/HeatMapChart.base.js.map +1 -1
- package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.d.ts +3 -0
- package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js +24 -3
- package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js.map +1 -1
- package/lib/components/ScatterChart/ScatterChart.base.js +84 -55
- package/lib/components/ScatterChart/ScatterChart.base.js.map +1 -1
- package/lib/components/ScatterChart/ScatterChart.styles.js +12 -0
- package/lib/components/ScatterChart/ScatterChart.styles.js.map +1 -1
- package/lib/components/ScatterChart/ScatterChart.types.d.ts +5 -0
- package/lib/components/ScatterChart/ScatterChart.types.js.map +1 -1
- package/lib/components/VerticalBarChart/VerticalBarChart.base.d.ts +2 -0
- package/lib/components/VerticalBarChart/VerticalBarChart.base.js +30 -7
- package/lib/components/VerticalBarChart/VerticalBarChart.base.js.map +1 -1
- package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.base.d.ts +3 -0
- package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js +51 -32
- package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js.map +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js.map +1 -1
- package/lib/types/IDataPoint.d.ts +18 -0
- package/lib/types/IDataPoint.js.map +1 -1
- package/lib/utilities/SVGTooltipText.js +3 -3
- package/lib/utilities/SVGTooltipText.js.map +1 -1
- package/lib/utilities/utilities.d.ts +6 -3
- package/lib/utilities/utilities.js +58 -29
- package/lib/utilities/utilities.js.map +1 -1
- package/lib-amd/components/AreaChart/AreaChart.base.d.ts +1 -0
- package/lib-amd/components/AreaChart/AreaChart.base.js +4 -1
- package/lib-amd/components/AreaChart/AreaChart.base.js.map +1 -1
- package/lib-amd/components/CommonComponents/CartesianChart.base.js +14 -13
- package/lib-amd/components/CommonComponents/CartesianChart.base.js.map +1 -1
- package/lib-amd/components/CommonComponents/CartesianChart.styles.js +41 -37
- package/lib-amd/components/CommonComponents/CartesianChart.styles.js.map +1 -1
- package/lib-amd/components/CommonComponents/CartesianChart.types.d.ts +12 -2
- package/lib-amd/components/CommonComponents/CartesianChart.types.js.map +1 -1
- package/lib-amd/components/DeclarativeChart/DeclarativeChart.js +37 -15
- package/lib-amd/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
- package/lib-amd/components/DeclarativeChart/PlotlyColorAdapter.d.ts +2 -1
- package/lib-amd/components/DeclarativeChart/PlotlyColorAdapter.js +11 -2
- package/lib-amd/components/DeclarativeChart/PlotlyColorAdapter.js.map +1 -1
- package/lib-amd/components/DeclarativeChart/PlotlySchemaAdapter.d.ts +13 -3
- package/lib-amd/components/DeclarativeChart/PlotlySchemaAdapter.js +276 -199
- package/lib-amd/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
- package/lib-amd/components/DonutChart/DonutChart.base.js +1 -0
- package/lib-amd/components/DonutChart/DonutChart.base.js.map +1 -1
- package/lib-amd/components/DonutChart/DonutChart.styles.js +17 -1
- 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/GroupedVerticalBarChart/GroupedVerticalBarChart.base.d.ts +2 -0
- package/lib-amd/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js +24 -3
- package/lib-amd/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js.map +1 -1
- package/lib-amd/components/HeatMapChart/HeatMapChart.base.d.ts +7 -0
- package/lib-amd/components/HeatMapChart/HeatMapChart.base.js +94 -36
- package/lib-amd/components/HeatMapChart/HeatMapChart.base.js.map +1 -1
- package/lib-amd/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.d.ts +3 -0
- package/lib-amd/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js +23 -2
- package/lib-amd/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js.map +1 -1
- package/lib-amd/components/ScatterChart/ScatterChart.base.js +83 -54
- package/lib-amd/components/ScatterChart/ScatterChart.base.js.map +1 -1
- package/lib-amd/components/ScatterChart/ScatterChart.styles.js +12 -1
- package/lib-amd/components/ScatterChart/ScatterChart.styles.js.map +1 -1
- package/lib-amd/components/ScatterChart/ScatterChart.types.d.ts +5 -0
- package/lib-amd/components/ScatterChart/ScatterChart.types.js.map +1 -1
- package/lib-amd/components/VerticalBarChart/VerticalBarChart.base.d.ts +2 -0
- package/lib-amd/components/VerticalBarChart/VerticalBarChart.base.js +29 -6
- package/lib-amd/components/VerticalBarChart/VerticalBarChart.base.js.map +1 -1
- package/lib-amd/components/VerticalStackedBarChart/VerticalStackedBarChart.base.d.ts +3 -0
- package/lib-amd/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js +50 -31
- package/lib-amd/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js.map +1 -1
- package/lib-amd/index.d.ts +1 -1
- package/lib-amd/index.js.map +1 -1
- package/lib-amd/types/IDataPoint.d.ts +18 -0
- package/lib-amd/types/IDataPoint.js.map +1 -1
- package/lib-amd/utilities/SVGTooltipText.js +3 -3
- package/lib-amd/utilities/SVGTooltipText.js.map +1 -1
- package/lib-amd/utilities/utilities.d.ts +6 -3
- package/lib-amd/utilities/utilities.js +59 -30
- package/lib-amd/utilities/utilities.js.map +1 -1
- package/lib-commonjs/components/AreaChart/AreaChart.base.d.ts +1 -0
- package/lib-commonjs/components/AreaChart/AreaChart.base.js +4 -1
- package/lib-commonjs/components/AreaChart/AreaChart.base.js.map +1 -1
- package/lib-commonjs/components/CommonComponents/CartesianChart.base.js +14 -13
- package/lib-commonjs/components/CommonComponents/CartesianChart.base.js.map +1 -1
- package/lib-commonjs/components/CommonComponents/CartesianChart.styles.js +41 -37
- package/lib-commonjs/components/CommonComponents/CartesianChart.styles.js.map +1 -1
- package/lib-commonjs/components/CommonComponents/CartesianChart.types.d.ts +12 -2
- package/lib-commonjs/components/CommonComponents/CartesianChart.types.js.map +1 -1
- package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js +37 -15
- package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
- package/lib-commonjs/components/DeclarativeChart/PlotlyColorAdapter.d.ts +2 -1
- package/lib-commonjs/components/DeclarativeChart/PlotlyColorAdapter.js +11 -2
- package/lib-commonjs/components/DeclarativeChart/PlotlyColorAdapter.js.map +1 -1
- package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.d.ts +13 -3
- package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js +276 -198
- package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
- package/lib-commonjs/components/DonutChart/DonutChart.base.js +1 -0
- package/lib-commonjs/components/DonutChart/DonutChart.base.js.map +1 -1
- package/lib-commonjs/components/DonutChart/DonutChart.styles.js +18 -0
- 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/GroupedVerticalBarChart/GroupedVerticalBarChart.base.d.ts +2 -0
- package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js +24 -3
- package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js.map +1 -1
- package/lib-commonjs/components/HeatMapChart/HeatMapChart.base.d.ts +7 -0
- package/lib-commonjs/components/HeatMapChart/HeatMapChart.base.js +94 -36
- package/lib-commonjs/components/HeatMapChart/HeatMapChart.base.js.map +1 -1
- package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.d.ts +3 -0
- package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js +23 -2
- package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js.map +1 -1
- package/lib-commonjs/components/ScatterChart/ScatterChart.base.js +83 -54
- package/lib-commonjs/components/ScatterChart/ScatterChart.base.js.map +1 -1
- package/lib-commonjs/components/ScatterChart/ScatterChart.styles.js +12 -0
- package/lib-commonjs/components/ScatterChart/ScatterChart.styles.js.map +1 -1
- package/lib-commonjs/components/ScatterChart/ScatterChart.types.d.ts +5 -0
- package/lib-commonjs/components/ScatterChart/ScatterChart.types.js.map +1 -1
- package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.base.d.ts +2 -0
- package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.base.js +29 -6
- package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.base.js.map +1 -1
- package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.base.d.ts +3 -0
- package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js +50 -31
- package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js.map +1 -1
- package/lib-commonjs/index.d.ts +1 -1
- package/lib-commonjs/index.js.map +1 -1
- package/lib-commonjs/types/IDataPoint.d.ts +18 -0
- package/lib-commonjs/types/IDataPoint.js.map +1 -1
- package/lib-commonjs/utilities/SVGTooltipText.js +3 -3
- package/lib-commonjs/utilities/SVGTooltipText.js.map +1 -1
- package/lib-commonjs/utilities/utilities.d.ts +6 -3
- package/lib-commonjs/utilities/utilities.js +59 -30
- package/lib-commonjs/utilities/utilities.js.map +1 -1
- package/package.json +2 -2
- package/src/components/CommonComponents/CartesianChart.types.ts +20 -1
- package/src/components/DonutChart/DonutChart.types.ts +5 -0
- package/src/components/ScatterChart/ScatterChart.types.ts +7 -1
|
@@ -391,7 +391,9 @@ var VerticalStackedBarChartBase = /** @class */ (function (_super) {
|
|
|
391
391
|
React.createElement("g", tslib_1.__assign({ id: "".concat(indexNumber, "-singleBar"), ref: function (e) { return (groupRef.refElement = e); } }, stackFocusProps), singleBar),
|
|
392
392
|
!_this.props.hideLabels && _this._barWidth >= 16 && showLabel && (React.createElement("text", { x: xPoint + _this._barWidth / 2,
|
|
393
393
|
//if total bar value >=0, show label above top bar, otherwise below bottom bar
|
|
394
|
-
y: barLabel >= _this.Y_ORIGIN ? yPoint - 6 : yPoint + heightOfLastBar + 12, textAnchor: "middle", className: _this._classNames.barLabel, "aria-label": "Total: ".concat(barLabel), role: "img", transform: "translate(".concat(xScaleBandwidthTranslate, ", 0)") },
|
|
394
|
+
y: barLabel >= _this.Y_ORIGIN ? yPoint - 6 : yPoint + heightOfLastBar + 12, textAnchor: "middle", className: _this._classNames.barLabel, "aria-label": "Total: ".concat(barLabel), role: "img", transform: "translate(".concat(xScaleBandwidthTranslate, ", 0)") }, typeof _this.props.yAxisTickFormat === 'function'
|
|
395
|
+
? _this.props.yAxisTickFormat(barLabel)
|
|
396
|
+
: (0, index_3.formatScientificLimitWidth)(barLabel)))));
|
|
395
397
|
});
|
|
396
398
|
// Removing un wanted tooltip div from DOM, when prop not provided.
|
|
397
399
|
if (!_this.props.showXAxisLablesTooltip) {
|
|
@@ -606,33 +608,7 @@ var VerticalStackedBarChartBase = /** @class */ (function (_super) {
|
|
|
606
608
|
}
|
|
607
609
|
});
|
|
608
610
|
}
|
|
609
|
-
|
|
610
|
-
var legendToYValues_1 = {};
|
|
611
|
-
_this._points.forEach(function (xPoint) {
|
|
612
|
-
xPoint.chartData.forEach(function (bar) {
|
|
613
|
-
if (!legendToYValues_1[bar.legend]) {
|
|
614
|
-
legendToYValues_1[bar.legend] = ["".concat(bar.data)];
|
|
615
|
-
}
|
|
616
|
-
else {
|
|
617
|
-
legendToYValues_1[bar.legend].push("".concat(bar.data));
|
|
618
|
-
}
|
|
619
|
-
});
|
|
620
|
-
});
|
|
621
|
-
var yAxisLabels_1 = new Set();
|
|
622
|
-
Object.values(legendToYValues_1).forEach(function (yValues) {
|
|
623
|
-
yValues.forEach(function (yVal) {
|
|
624
|
-
yAxisLabels_1.add(yVal);
|
|
625
|
-
});
|
|
626
|
-
});
|
|
627
|
-
Object.values(_this._lineObject).forEach(function (linePoints) {
|
|
628
|
-
linePoints.forEach(function (linePoint) {
|
|
629
|
-
if (!linePoint.useSecondaryYScale) {
|
|
630
|
-
yAxisLabels_1.add("".concat(linePoint.y));
|
|
631
|
-
}
|
|
632
|
-
});
|
|
633
|
-
});
|
|
634
|
-
_this._yAxisLabels = Array.from(yAxisLabels_1);
|
|
635
|
-
}
|
|
611
|
+
_this._yAxisLabels = _this._getOrderedYAxisLabels();
|
|
636
612
|
};
|
|
637
613
|
_this._getYDomainMargins = function (containerHeight) {
|
|
638
614
|
/**
|
|
@@ -659,6 +635,49 @@ var VerticalStackedBarChartBase = /** @class */ (function (_super) {
|
|
|
659
635
|
}
|
|
660
636
|
return tslib_1.__assign(tslib_1.__assign({}, _this.margins), { top: _this.margins.top + yAxisTickMarginTop });
|
|
661
637
|
};
|
|
638
|
+
_this._getOrderedXAxisLabels = function () {
|
|
639
|
+
if (_this._xAxisType !== index_3.XAxisTypes.StringAxis) {
|
|
640
|
+
return [];
|
|
641
|
+
}
|
|
642
|
+
return (0, index_3.sortAxisCategories)(_this._mapCategoryToValues(), _this.props.xAxisCategoryOrder);
|
|
643
|
+
};
|
|
644
|
+
_this._getOrderedYAxisLabels = function () {
|
|
645
|
+
if (_this._yAxisType !== index_3.YAxisType.StringAxis) {
|
|
646
|
+
return [];
|
|
647
|
+
}
|
|
648
|
+
return (0, index_3.sortAxisCategories)(_this._mapCategoryToValues(true), _this.props.yAxisCategoryOrder);
|
|
649
|
+
};
|
|
650
|
+
_this._mapCategoryToValues = function (isYAxis) {
|
|
651
|
+
if (isYAxis === void 0) { isYAxis = false; }
|
|
652
|
+
var categoryToValues = {};
|
|
653
|
+
_this._points.forEach(function (point) {
|
|
654
|
+
var _a;
|
|
655
|
+
point.chartData.forEach(function (bar) {
|
|
656
|
+
var category = (isYAxis ? bar.data : point.xAxisPoint);
|
|
657
|
+
var value = isYAxis ? point.xAxisPoint : bar.data;
|
|
658
|
+
if (!categoryToValues[category]) {
|
|
659
|
+
categoryToValues[category] = [];
|
|
660
|
+
}
|
|
661
|
+
if (typeof value === 'number') {
|
|
662
|
+
categoryToValues[category].push(value);
|
|
663
|
+
}
|
|
664
|
+
});
|
|
665
|
+
(_a = point.lineData) === null || _a === void 0 ? void 0 : _a.forEach(function (linePoint) {
|
|
666
|
+
if (isYAxis && linePoint.useSecondaryYScale) {
|
|
667
|
+
return;
|
|
668
|
+
}
|
|
669
|
+
var category = (isYAxis ? linePoint.y : point.xAxisPoint);
|
|
670
|
+
var value = isYAxis ? point.xAxisPoint : linePoint.y;
|
|
671
|
+
if (!categoryToValues[category]) {
|
|
672
|
+
categoryToValues[category] = [];
|
|
673
|
+
}
|
|
674
|
+
if (typeof value === 'number') {
|
|
675
|
+
categoryToValues[category].push(value);
|
|
676
|
+
}
|
|
677
|
+
});
|
|
678
|
+
});
|
|
679
|
+
return categoryToValues;
|
|
680
|
+
};
|
|
662
681
|
(0, Utilities_1.initializeComponentRef)(_this);
|
|
663
682
|
_this.state = {
|
|
664
683
|
isCalloutVisible: false,
|
|
@@ -761,9 +780,7 @@ var VerticalStackedBarChartBase = /** @class */ (function (_super) {
|
|
|
761
780
|
};
|
|
762
781
|
VerticalStackedBarChartBase.prototype._createDataSetLayer = function () {
|
|
763
782
|
var _this = this;
|
|
764
|
-
var tempArr = [];
|
|
765
783
|
var dataset = this._points.map(function (singlePointData) {
|
|
766
|
-
tempArr.push(singlePointData.xAxisPoint);
|
|
767
784
|
if (_this._yAxisType === index_3.YAxisType.StringAxis) {
|
|
768
785
|
return {
|
|
769
786
|
x: singlePointData.xAxisPoint,
|
|
@@ -779,7 +796,7 @@ var VerticalStackedBarChartBase = /** @class */ (function (_super) {
|
|
|
779
796
|
y: total,
|
|
780
797
|
};
|
|
781
798
|
});
|
|
782
|
-
this._xAxisLabels =
|
|
799
|
+
this._xAxisLabels = this._getOrderedXAxisLabels();
|
|
783
800
|
return dataset;
|
|
784
801
|
};
|
|
785
802
|
VerticalStackedBarChartBase.prototype._renderCallout = function (props) {
|
|
@@ -991,6 +1008,8 @@ var VerticalStackedBarChartBase = /** @class */ (function (_super) {
|
|
|
991
1008
|
VerticalStackedBarChartBase.defaultProps = {
|
|
992
1009
|
maxBarWidth: 24,
|
|
993
1010
|
useUTC: true,
|
|
1011
|
+
xAxisCategoryOrder: 'default',
|
|
1012
|
+
yAxisCategoryOrder: 'default',
|
|
994
1013
|
};
|
|
995
1014
|
return VerticalStackedBarChartBase;
|
|
996
1015
|
}(React.Component));
|