@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
|
@@ -379,7 +379,9 @@ define(["require", "exports", "tslib", "react", "d3-array", "d3-selection", "d3-
|
|
|
379
379
|
React.createElement("g", tslib_1.__assign({ id: "".concat(indexNumber, "-singleBar"), ref: function (e) { return (groupRef.refElement = e); } }, stackFocusProps), singleBar),
|
|
380
380
|
!_this.props.hideLabels && _this._barWidth >= 16 && showLabel && (React.createElement("text", { x: xPoint + _this._barWidth / 2,
|
|
381
381
|
//if total bar value >=0, show label above top bar, otherwise below bottom bar
|
|
382
|
-
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)") },
|
|
382
|
+
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'
|
|
383
|
+
? _this.props.yAxisTickFormat(barLabel)
|
|
384
|
+
: (0, index_3.formatScientificLimitWidth)(barLabel)))));
|
|
383
385
|
});
|
|
384
386
|
// Removing un wanted tooltip div from DOM, when prop not provided.
|
|
385
387
|
if (!_this.props.showXAxisLablesTooltip) {
|
|
@@ -594,33 +596,7 @@ define(["require", "exports", "tslib", "react", "d3-array", "d3-selection", "d3-
|
|
|
594
596
|
}
|
|
595
597
|
});
|
|
596
598
|
}
|
|
597
|
-
|
|
598
|
-
var legendToYValues_1 = {};
|
|
599
|
-
_this._points.forEach(function (xPoint) {
|
|
600
|
-
xPoint.chartData.forEach(function (bar) {
|
|
601
|
-
if (!legendToYValues_1[bar.legend]) {
|
|
602
|
-
legendToYValues_1[bar.legend] = ["".concat(bar.data)];
|
|
603
|
-
}
|
|
604
|
-
else {
|
|
605
|
-
legendToYValues_1[bar.legend].push("".concat(bar.data));
|
|
606
|
-
}
|
|
607
|
-
});
|
|
608
|
-
});
|
|
609
|
-
var yAxisLabels_1 = new Set();
|
|
610
|
-
Object.values(legendToYValues_1).forEach(function (yValues) {
|
|
611
|
-
yValues.forEach(function (yVal) {
|
|
612
|
-
yAxisLabels_1.add(yVal);
|
|
613
|
-
});
|
|
614
|
-
});
|
|
615
|
-
Object.values(_this._lineObject).forEach(function (linePoints) {
|
|
616
|
-
linePoints.forEach(function (linePoint) {
|
|
617
|
-
if (!linePoint.useSecondaryYScale) {
|
|
618
|
-
yAxisLabels_1.add("".concat(linePoint.y));
|
|
619
|
-
}
|
|
620
|
-
});
|
|
621
|
-
});
|
|
622
|
-
_this._yAxisLabels = Array.from(yAxisLabels_1);
|
|
623
|
-
}
|
|
599
|
+
_this._yAxisLabels = _this._getOrderedYAxisLabels();
|
|
624
600
|
};
|
|
625
601
|
_this._getYDomainMargins = function (containerHeight) {
|
|
626
602
|
/**
|
|
@@ -647,6 +623,49 @@ define(["require", "exports", "tslib", "react", "d3-array", "d3-selection", "d3-
|
|
|
647
623
|
}
|
|
648
624
|
return tslib_1.__assign(tslib_1.__assign({}, _this.margins), { top: _this.margins.top + yAxisTickMarginTop });
|
|
649
625
|
};
|
|
626
|
+
_this._getOrderedXAxisLabels = function () {
|
|
627
|
+
if (_this._xAxisType !== index_3.XAxisTypes.StringAxis) {
|
|
628
|
+
return [];
|
|
629
|
+
}
|
|
630
|
+
return (0, index_3.sortAxisCategories)(_this._mapCategoryToValues(), _this.props.xAxisCategoryOrder);
|
|
631
|
+
};
|
|
632
|
+
_this._getOrderedYAxisLabels = function () {
|
|
633
|
+
if (_this._yAxisType !== index_3.YAxisType.StringAxis) {
|
|
634
|
+
return [];
|
|
635
|
+
}
|
|
636
|
+
return (0, index_3.sortAxisCategories)(_this._mapCategoryToValues(true), _this.props.yAxisCategoryOrder);
|
|
637
|
+
};
|
|
638
|
+
_this._mapCategoryToValues = function (isYAxis) {
|
|
639
|
+
if (isYAxis === void 0) { isYAxis = false; }
|
|
640
|
+
var categoryToValues = {};
|
|
641
|
+
_this._points.forEach(function (point) {
|
|
642
|
+
var _a;
|
|
643
|
+
point.chartData.forEach(function (bar) {
|
|
644
|
+
var category = (isYAxis ? bar.data : point.xAxisPoint);
|
|
645
|
+
var value = isYAxis ? point.xAxisPoint : bar.data;
|
|
646
|
+
if (!categoryToValues[category]) {
|
|
647
|
+
categoryToValues[category] = [];
|
|
648
|
+
}
|
|
649
|
+
if (typeof value === 'number') {
|
|
650
|
+
categoryToValues[category].push(value);
|
|
651
|
+
}
|
|
652
|
+
});
|
|
653
|
+
(_a = point.lineData) === null || _a === void 0 ? void 0 : _a.forEach(function (linePoint) {
|
|
654
|
+
if (isYAxis && linePoint.useSecondaryYScale) {
|
|
655
|
+
return;
|
|
656
|
+
}
|
|
657
|
+
var category = (isYAxis ? linePoint.y : point.xAxisPoint);
|
|
658
|
+
var value = isYAxis ? point.xAxisPoint : linePoint.y;
|
|
659
|
+
if (!categoryToValues[category]) {
|
|
660
|
+
categoryToValues[category] = [];
|
|
661
|
+
}
|
|
662
|
+
if (typeof value === 'number') {
|
|
663
|
+
categoryToValues[category].push(value);
|
|
664
|
+
}
|
|
665
|
+
});
|
|
666
|
+
});
|
|
667
|
+
return categoryToValues;
|
|
668
|
+
};
|
|
650
669
|
(0, Utilities_1.initializeComponentRef)(_this);
|
|
651
670
|
_this.state = {
|
|
652
671
|
isCalloutVisible: false,
|
|
@@ -749,9 +768,7 @@ define(["require", "exports", "tslib", "react", "d3-array", "d3-selection", "d3-
|
|
|
749
768
|
};
|
|
750
769
|
VerticalStackedBarChartBase.prototype._createDataSetLayer = function () {
|
|
751
770
|
var _this = this;
|
|
752
|
-
var tempArr = [];
|
|
753
771
|
var dataset = this._points.map(function (singlePointData) {
|
|
754
|
-
tempArr.push(singlePointData.xAxisPoint);
|
|
755
772
|
if (_this._yAxisType === index_3.YAxisType.StringAxis) {
|
|
756
773
|
return {
|
|
757
774
|
x: singlePointData.xAxisPoint,
|
|
@@ -767,7 +784,7 @@ define(["require", "exports", "tslib", "react", "d3-array", "d3-selection", "d3-
|
|
|
767
784
|
y: total,
|
|
768
785
|
};
|
|
769
786
|
});
|
|
770
|
-
this._xAxisLabels =
|
|
787
|
+
this._xAxisLabels = this._getOrderedXAxisLabels();
|
|
771
788
|
return dataset;
|
|
772
789
|
};
|
|
773
790
|
VerticalStackedBarChartBase.prototype._renderCallout = function (props) {
|
|
@@ -979,6 +996,8 @@ define(["require", "exports", "tslib", "react", "d3-array", "d3-selection", "d3-
|
|
|
979
996
|
VerticalStackedBarChartBase.defaultProps = {
|
|
980
997
|
maxBarWidth: 24,
|
|
981
998
|
useUTC: true,
|
|
999
|
+
xAxisCategoryOrder: 'default',
|
|
1000
|
+
yAxisCategoryOrder: 'default',
|
|
982
1001
|
};
|
|
983
1002
|
return VerticalStackedBarChartBase;
|
|
984
1003
|
}(React.Component));
|