@fluentui/react-charting 5.24.11 → 5.24.13
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 +61 -1
- package/CHANGELOG.md +25 -2
- package/bundle-size/GanttChart.fixture.js +7 -0
- package/dist/react-charting.d.ts +128 -3
- package/dist/react-charting.js +1 -1
- package/dist/react-charting.min.js +1 -1
- package/etc/react-charting.api.md +44 -2
- package/lib/GanttChart.d.ts +1 -0
- package/lib/GanttChart.js +2 -0
- package/lib/GanttChart.js.map +1 -0
- package/lib/components/CommonComponents/CartesianChart.base.js +2 -1
- package/lib/components/CommonComponents/CartesianChart.base.js.map +1 -1
- package/lib/components/CommonComponents/CartesianChart.types.d.ts +3 -3
- package/lib/components/CommonComponents/CartesianChart.types.js.map +1 -1
- package/lib/components/DeclarativeChart/DeclarativeChart.js +22 -4
- package/lib/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
- package/lib/components/DeclarativeChart/PlotlyColorAdapter.d.ts +2 -1
- package/lib/components/DeclarativeChart/PlotlyColorAdapter.js +23 -0
- package/lib/components/DeclarativeChart/PlotlyColorAdapter.js.map +1 -1
- package/lib/components/DeclarativeChart/PlotlySchemaAdapter.d.ts +2 -0
- package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js +173 -63
- package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
- package/lib/components/GanttChart/GanttChart.base.d.ts +3 -0
- package/lib/components/GanttChart/GanttChart.base.js +329 -0
- package/lib/components/GanttChart/GanttChart.base.js.map +1 -0
- package/lib/components/GanttChart/GanttChart.d.ts +7 -0
- package/lib/components/GanttChart/GanttChart.js +10 -0
- package/lib/components/GanttChart/GanttChart.js.map +1 -0
- package/lib/components/GanttChart/GanttChart.styles.d.ts +2 -0
- package/lib/components/GanttChart/GanttChart.styles.js +4 -0
- package/lib/components/GanttChart/GanttChart.styles.js.map +1 -0
- package/lib/components/GanttChart/GanttChart.types.d.ts +67 -0
- package/lib/components/GanttChart/GanttChart.types.js +2 -0
- package/lib/components/GanttChart/GanttChart.types.js.map +1 -0
- package/lib/components/GanttChart/index.d.ts +2 -0
- package/lib/components/GanttChart/index.js +3 -0
- package/lib/components/GanttChart/index.js.map +1 -0
- package/lib/components/LineChart/LineChart.base.d.ts +1 -0
- package/lib/components/LineChart/LineChart.base.js +34 -11
- package/lib/components/LineChart/LineChart.base.js.map +1 -1
- package/lib/components/ScatterChart/ScatterChart.base.js +37 -23
- package/lib/components/ScatterChart/ScatterChart.base.js.map +1 -1
- package/lib/index.d.ts +3 -1
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -1
- package/lib/types/IDataPoint.d.ts +49 -0
- package/lib/types/IDataPoint.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/test-data.d.ts +4 -1
- package/lib/utilities/test-data.js +213 -0
- package/lib/utilities/test-data.js.map +1 -1
- package/lib/utilities/utilities.d.ts +14 -6
- package/lib/utilities/utilities.js +25 -9
- package/lib/utilities/utilities.js.map +1 -1
- package/lib-amd/GanttChart.d.ts +1 -0
- package/lib-amd/GanttChart.js +6 -0
- package/lib-amd/GanttChart.js.map +1 -0
- package/lib-amd/components/CommonComponents/CartesianChart.base.js +2 -1
- package/lib-amd/components/CommonComponents/CartesianChart.base.js.map +1 -1
- package/lib-amd/components/CommonComponents/CartesianChart.types.d.ts +3 -3
- package/lib-amd/components/CommonComponents/CartesianChart.types.js.map +1 -1
- package/lib-amd/components/DeclarativeChart/DeclarativeChart.js +22 -5
- 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 +25 -2
- package/lib-amd/components/DeclarativeChart/PlotlyColorAdapter.js.map +1 -1
- package/lib-amd/components/DeclarativeChart/PlotlySchemaAdapter.d.ts +2 -0
- package/lib-amd/components/DeclarativeChart/PlotlySchemaAdapter.js +173 -62
- package/lib-amd/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
- package/lib-amd/components/GanttChart/GanttChart.base.d.ts +3 -0
- package/lib-amd/components/GanttChart/GanttChart.base.js +325 -0
- package/lib-amd/components/GanttChart/GanttChart.base.js.map +1 -0
- package/lib-amd/components/GanttChart/GanttChart.d.ts +7 -0
- package/lib-amd/components/GanttChart/GanttChart.js +12 -0
- package/lib-amd/components/GanttChart/GanttChart.js.map +1 -0
- package/lib-amd/components/GanttChart/GanttChart.styles.d.ts +2 -0
- package/lib-amd/components/GanttChart/GanttChart.styles.js +10 -0
- package/lib-amd/components/GanttChart/GanttChart.styles.js.map +1 -0
- package/lib-amd/components/GanttChart/GanttChart.types.d.ts +67 -0
- package/lib-amd/components/GanttChart/GanttChart.types.js +5 -0
- package/lib-amd/components/GanttChart/GanttChart.types.js.map +1 -0
- package/lib-amd/components/GanttChart/index.d.ts +2 -0
- package/lib-amd/components/GanttChart/index.js +7 -0
- package/lib-amd/components/GanttChart/index.js.map +1 -0
- package/lib-amd/components/LineChart/LineChart.base.d.ts +1 -0
- package/lib-amd/components/LineChart/LineChart.base.js +33 -11
- package/lib-amd/components/LineChart/LineChart.base.js.map +1 -1
- package/lib-amd/components/ScatterChart/ScatterChart.base.js +36 -23
- package/lib-amd/components/ScatterChart/ScatterChart.base.js.map +1 -1
- package/lib-amd/index.d.ts +3 -1
- package/lib-amd/index.js +3 -2
- package/lib-amd/index.js.map +1 -1
- package/lib-amd/types/IDataPoint.d.ts +49 -0
- package/lib-amd/types/IDataPoint.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/test-data.d.ts +4 -1
- package/lib-amd/utilities/test-data.js +214 -2
- package/lib-amd/utilities/test-data.js.map +1 -1
- package/lib-amd/utilities/utilities.d.ts +14 -6
- package/lib-amd/utilities/utilities.js +27 -9
- package/lib-amd/utilities/utilities.js.map +1 -1
- package/lib-commonjs/GanttChart.d.ts +1 -0
- package/lib-commonjs/GanttChart.js +5 -0
- package/lib-commonjs/GanttChart.js.map +1 -0
- package/lib-commonjs/components/CommonComponents/CartesianChart.base.js +2 -1
- package/lib-commonjs/components/CommonComponents/CartesianChart.base.js.map +1 -1
- package/lib-commonjs/components/CommonComponents/CartesianChart.types.d.ts +3 -3
- package/lib-commonjs/components/CommonComponents/CartesianChart.types.js.map +1 -1
- package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js +23 -5
- 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 +25 -1
- package/lib-commonjs/components/DeclarativeChart/PlotlyColorAdapter.js.map +1 -1
- package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.d.ts +2 -0
- package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js +173 -62
- package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
- package/lib-commonjs/components/GanttChart/GanttChart.base.d.ts +3 -0
- package/lib-commonjs/components/GanttChart/GanttChart.base.js +332 -0
- package/lib-commonjs/components/GanttChart/GanttChart.base.js.map +1 -0
- package/lib-commonjs/components/GanttChart/GanttChart.d.ts +7 -0
- package/lib-commonjs/components/GanttChart/GanttChart.js +13 -0
- package/lib-commonjs/components/GanttChart/GanttChart.js.map +1 -0
- package/lib-commonjs/components/GanttChart/GanttChart.styles.d.ts +2 -0
- package/lib-commonjs/components/GanttChart/GanttChart.styles.js +8 -0
- package/lib-commonjs/components/GanttChart/GanttChart.styles.js.map +1 -0
- package/lib-commonjs/components/GanttChart/GanttChart.types.d.ts +67 -0
- package/lib-commonjs/components/GanttChart/GanttChart.types.js +3 -0
- package/lib-commonjs/components/GanttChart/GanttChart.types.js.map +1 -0
- package/lib-commonjs/components/GanttChart/index.d.ts +2 -0
- package/lib-commonjs/components/GanttChart/index.js +6 -0
- package/lib-commonjs/components/GanttChart/index.js.map +1 -0
- package/lib-commonjs/components/LineChart/LineChart.base.d.ts +1 -0
- package/lib-commonjs/components/LineChart/LineChart.base.js +33 -10
- package/lib-commonjs/components/LineChart/LineChart.base.js.map +1 -1
- package/lib-commonjs/components/ScatterChart/ScatterChart.base.js +36 -22
- package/lib-commonjs/components/ScatterChart/ScatterChart.base.js.map +1 -1
- package/lib-commonjs/index.d.ts +3 -1
- package/lib-commonjs/index.js +3 -1
- package/lib-commonjs/index.js.map +1 -1
- package/lib-commonjs/types/IDataPoint.d.ts +49 -0
- package/lib-commonjs/types/IDataPoint.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/test-data.d.ts +4 -1
- package/lib-commonjs/utilities/test-data.js +214 -1
- package/lib-commonjs/utilities/test-data.js.map +1 -1
- package/lib-commonjs/utilities/utilities.d.ts +14 -6
- package/lib-commonjs/utilities/utilities.js +28 -10
- package/lib-commonjs/utilities/utilities.js.map +1 -1
- package/package.json +2 -2
- package/src/components/CommonComponents/CartesianChart.types.ts +5 -2
- package/src/components/GanttChart/GanttChart.types.ts +83 -0
|
@@ -10,8 +10,9 @@ import { CartesianChart, } from '../../index';
|
|
|
10
10
|
import { DirectionalHint } from '@fluentui/react/lib/Callout';
|
|
11
11
|
import { formatDateToLocaleString } from '@fluentui/chart-utilities';
|
|
12
12
|
import { EventsAnnotation } from './eventAnnotation/EventAnnotation';
|
|
13
|
-
import { calloutData, ChartTypes, getXAxisType, XAxisTypes, tooltipOfAxislabels, Points, pointTypes, getTypeOfAxis, getNextColor, getColorFromToken, findNumericMinMaxOfY, createNumericYAxis, domainRangeOfDateForAreaLineVerticalBarChart, domainRangeOfNumericForAreaChart, createStringYAxis, areArraysEqual, getCurveFactory, } from '../../utilities/index';
|
|
13
|
+
import { calloutData, ChartTypes, getXAxisType, XAxisTypes, tooltipOfAxislabels, Points, pointTypes, getTypeOfAxis, getNextColor, getColorFromToken, findNumericMinMaxOfY, createNumericYAxis, domainRangeOfDateForAreaLineVerticalBarChart, domainRangeOfNumericForAreaChart, createStringYAxis, areArraysEqual, getCurveFactory, isScatterPolarSeries, } from '../../utilities/index';
|
|
14
14
|
import { toImage } from '../../utilities/image-export-utils';
|
|
15
|
+
import { renderScatterPolarCategoryLabels } from '../../utilities/scatterpolar-utils';
|
|
15
16
|
var getClassNames = classNamesFunction();
|
|
16
17
|
var PointSize;
|
|
17
18
|
(function (PointSize) {
|
|
@@ -69,6 +70,7 @@ var LineChartBase = /** @class */ (function (_super) {
|
|
|
69
70
|
_this_1._yPaddingSecondary = 0;
|
|
70
71
|
_this_1._hasMarkersMode = false;
|
|
71
72
|
_this_1._isXAxisDateType = false;
|
|
73
|
+
_this_1._isScatterPolar = false;
|
|
72
74
|
_this_1.toImage = function (opts) {
|
|
73
75
|
var _a, _b;
|
|
74
76
|
return toImage((_a = _this_1._cartesianChartRef.current) === null || _a === void 0 ? void 0 : _a.chartContainer, (_b = _this_1._legendsRef.current) === null || _b === void 0 ? void 0 : _b.toSVG, _this_1._isRTL, opts);
|
|
@@ -106,6 +108,7 @@ var LineChartBase = /** @class */ (function (_super) {
|
|
|
106
108
|
: lineChartData;
|
|
107
109
|
_this_1._hasMarkersMode =
|
|
108
110
|
(_a = filteredData === null || filteredData === void 0 ? void 0 : filteredData.some(function (item) { var _a, _b, _c; return (_c = (_b = (_a = item.lineOptions) === null || _a === void 0 ? void 0 : _a.mode) === null || _b === void 0 ? void 0 : _b.includes) === null || _c === void 0 ? void 0 : _c.call(_b, 'markers'); })) !== null && _a !== void 0 ? _a : false;
|
|
111
|
+
_this_1._isScatterPolar = isScatterPolarSeries(filteredData);
|
|
109
112
|
return filteredData
|
|
110
113
|
? filteredData.map(function (item, index) {
|
|
111
114
|
var _a, _b;
|
|
@@ -758,7 +761,7 @@ var LineChartBase = /** @class */ (function (_super) {
|
|
|
758
761
|
tickValues: tickValues,
|
|
759
762
|
tickFormat: tickFormat,
|
|
760
763
|
};
|
|
761
|
-
return !this._isChartEmpty() ? (React.createElement(CartesianChart, __assign({}, this.props, { chartTitle: this._getChartTitle(), points: points, chartType: ChartTypes.LineChart, calloutProps: calloutProps, tickParams: tickParams, legendBars: legendBars, createYAxis: createNumericYAxis, getmargins: this._getMargins, getMinMaxOfYAxis: this._getNumericMinMaxOfY, getGraphData: this._initializeLineChartData, xAxisType: this._isXAxisDateType ? XAxisTypes.DateAxis : XAxisTypes.NumericAxis, customizedCallout: this._getCustomizedCallout(), getDomainNRangeValues: this._getDomainNRangeValues, createStringYAxis: createStringYAxis, onChartMouseLeave: this._handleChartMouseLeave, enableFirstRenderOptimization: this.props.enablePerfOptimization && this._firstRenderOptimization, ref: this._cartesianChartRef,
|
|
764
|
+
return !this._isChartEmpty() ? (React.createElement(CartesianChart, __assign({}, this.props, { chartTitle: this._getChartTitle(), points: points, chartType: ChartTypes.LineChart, calloutProps: calloutProps, tickParams: tickParams, legendBars: legendBars, createYAxis: createNumericYAxis, getmargins: this._getMargins, getMinMaxOfYAxis: this._getNumericMinMaxOfY, getGraphData: this._initializeLineChartData, xAxisType: this._isXAxisDateType ? XAxisTypes.DateAxis : XAxisTypes.NumericAxis }, (this._isScatterPolar ? { yMaxValue: 1, yMinValue: -1 } : {}), { customizedCallout: this._getCustomizedCallout(), getDomainNRangeValues: this._getDomainNRangeValues, createStringYAxis: createStringYAxis, onChartMouseLeave: this._handleChartMouseLeave, enableFirstRenderOptimization: this.props.enablePerfOptimization && this._firstRenderOptimization, ref: this._cartesianChartRef,
|
|
762
765
|
/* eslint-disable react/jsx-no-bind */
|
|
763
766
|
// eslint-disable-next-line react/no-children-prop
|
|
764
767
|
children: function (props) {
|
|
@@ -863,7 +866,7 @@ var LineChartBase = /** @class */ (function (_super) {
|
|
|
863
866
|
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
864
867
|
LineChartBase.prototype._createLines = function (xElement, containerHeight) {
|
|
865
868
|
var _this_1 = this;
|
|
866
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16;
|
|
869
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18;
|
|
867
870
|
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
868
871
|
var lines = [];
|
|
869
872
|
if (this.state.isSelectedLegend) {
|
|
@@ -896,7 +899,7 @@ var LineChartBase = /** @class */ (function (_super) {
|
|
|
896
899
|
var yPadding = this_1._points[i].useSecondaryYScale && this_1._yScaleSecondary ? this_1._yPaddingSecondary : this_1._yPaddingPrimary;
|
|
897
900
|
var extraMaxPixels = this_1._hasMarkersMode ? this_1._getRangeForScatterMarkerSize(yScale, yPadding) : 0;
|
|
898
901
|
if (this_1._points[i].data.length === 1) {
|
|
899
|
-
var
|
|
902
|
+
var _19 = this_1._points[i].data[0], x1_1 = _19.x, y1 = _19.y, xAxisCalloutData_1 = _19.xAxisCalloutData, xAxisCalloutAccessibilityData_1 = _19.xAxisCalloutAccessibilityData;
|
|
900
903
|
var circleId_1 = "".concat(this_1._circleId, "_").concat(i);
|
|
901
904
|
var isLegendSelected = this_1._legendHighlighted(legendVal) || this_1._noLegendHighlighted() || this_1.state.isSelectedLegend;
|
|
902
905
|
var currentMarkerSize = this_1._points[i].data[0].markerSize;
|
|
@@ -910,7 +913,7 @@ var LineChartBase = /** @class */ (function (_super) {
|
|
|
910
913
|
: 3.5, cx: this_1._xAxisScale(x1_1), cy: yScale(y1), fill: activePoint === circleId_1 ? theme.semanticColors.bodyBackground : lineColor, opacity: isLegendSelected ? 1 : 0.1, onMouseOver: this_1._handleHover.bind(this_1, x1_1, y1, verticaLineHeight, xAxisCalloutData_1, circleId_1, xAxisCalloutAccessibilityData_1, yScale, legendVal, lineColor), onMouseMove: this_1._handleHover.bind(this_1, x1_1, y1, verticaLineHeight, xAxisCalloutData_1, circleId_1, xAxisCalloutAccessibilityData_1, yScale, legendVal, lineColor), onMouseOut: this_1._handleMouseOut, strokeWidth: activePoint === circleId_1 ? DEFAULT_LINE_STROKE_SIZE : 0, stroke: activePoint === circleId_1 ? lineColor : '', role: "img", "aria-label": this_1._getAriaLabel(i, 0), "data-is-focusable": isLegendSelected, ref: function (e) {
|
|
911
914
|
_this_1._refCallback(e, circleId_1);
|
|
912
915
|
}, onFocus: function () { return _this_1._handleFocus(circleId_1, x1_1, xAxisCalloutData_1, circleId_1, xAxisCalloutAccessibilityData_1); }, onBlur: this_1._handleMouseOut }, this_1._getClickHandler(this_1._points[i].data[0].onDataPointClick))),
|
|
913
|
-
supportsTextMode && text && (React.createElement("text", { key: "".concat(circleId_1, "-label"), x: this_1._xAxisScale(x1_1), y: yScale(y1) +
|
|
916
|
+
!this_1._isScatterPolar && supportsTextMode && text && (React.createElement("text", { key: "".concat(circleId_1, "-label"), x: this_1._xAxisScale(x1_1), y: yScale(y1) +
|
|
914
917
|
Math.max(currentMarkerSize ? (currentMarkerSize * extraMaxPixels) / maxMarkerSize : 3.5, 4) +
|
|
915
918
|
12, className: classNames.markerLabel, opacity: isLegendSelected ? 1 : 0.1 }, text))));
|
|
916
919
|
}
|
|
@@ -961,8 +964,8 @@ var LineChartBase = /** @class */ (function (_super) {
|
|
|
961
964
|
var lineId = "".concat(this_1._lineId, "_").concat(i, "_").concat(j);
|
|
962
965
|
var borderId = "".concat(this_1._borderId, "_").concat(i, "_").concat(j);
|
|
963
966
|
var circleId = "".concat(this_1._circleId, "_").concat(i, "_").concat(j);
|
|
964
|
-
var
|
|
965
|
-
var
|
|
967
|
+
var _20 = this_1._points[i].data[j - 1], x1 = _20.x, y1 = _20.y, xAxisCalloutData = _20.xAxisCalloutData, xAxisCalloutAccessibilityData = _20.xAxisCalloutAccessibilityData;
|
|
968
|
+
var _21 = this_1._points[i].data[j], x2 = _21.x, y2 = _21.y;
|
|
966
969
|
var path = this_1._getPath(this_1._xAxisScale(x1), yScale(y1), circleId, j, false, this_1._points[i].index);
|
|
967
970
|
var strokeWidth = ((_s = this_1._points[i].lineOptions) === null || _s === void 0 ? void 0 : _s.strokeWidth) || this_1.props.strokeWidth || DEFAULT_LINE_STROKE_SIZE;
|
|
968
971
|
var isLegendSelected = this_1._legendHighlighted(legendVal) || this_1._noLegendHighlighted() || this_1.state.isSelectedLegend;
|
|
@@ -974,7 +977,7 @@ var LineChartBase = /** @class */ (function (_super) {
|
|
|
974
977
|
React.createElement("circle", __assign({ id: circleId, key: circleId, r: currentMarkerSize ? (currentMarkerSize * extraMaxPixels) / maxMarkerSize : 4, cx: this_1._xAxisScale(x1), cy: yScale(y1), "data-is-focusable": isLegendSelected, onMouseOver: this_1._handleHover.bind(this_1, x1, y1, verticaLineHeight, xAxisCalloutData, circleId, xAxisCalloutAccessibilityData, yScale, legendVal, lineColor), onMouseMove: this_1._handleHover.bind(this_1, x1, y1, verticaLineHeight, xAxisCalloutData, circleId, xAxisCalloutAccessibilityData, yScale, legendVal, lineColor), onMouseOut: this_1._handleMouseOut, onFocus: function () {
|
|
975
978
|
return _this_1._handleFocus(lineId, x1, xAxisCalloutData, circleId, xAxisCalloutAccessibilityData);
|
|
976
979
|
}, onBlur: this_1._handleMouseOut }, this_1._getClickHandler(this_1._points[i].data[j - 1].onDataPointClick), { opacity: isLegendSelected && !currentPointHidden ? 1 : 0.01, fill: this_1._getPointFill(lineColor, circleId, j, false), stroke: lineColor, strokeWidth: strokeWidth, role: "img", "aria-label": (_x = this_1._points[i].data[j - 1].text) !== null && _x !== void 0 ? _x : this_1._getAriaLabel(i, j - 1) })),
|
|
977
|
-
supportsTextMode && text && (React.createElement("text", { key: "".concat(circleId, "-label"), x: this_1._xAxisScale(x1), y: yScale(y1) +
|
|
980
|
+
!this_1._isScatterPolar && supportsTextMode && text && (React.createElement("text", { key: "".concat(circleId, "-label"), x: this_1._xAxisScale(x1), y: yScale(y1) +
|
|
978
981
|
Math.max(currentMarkerSize ? (currentMarkerSize * extraMaxPixels) / maxMarkerSize : 4, 4) +
|
|
979
982
|
12, className: classNames.markerLabel, opacity: isLegendSelected && !currentPointHidden ? 1 : 0.01 }, text)))) : (React.createElement("path", __assign({ id: circleId, key: circleId, d: path, "data-is-focusable": isLegendSelected, onMouseOver: this_1._handleHover.bind(this_1, x1, y1, verticaLineHeight, xAxisCalloutData, circleId, xAxisCalloutAccessibilityData, yScale, legendVal, lineColor), onMouseMove: this_1._handleHover.bind(this_1, x1, y1, verticaLineHeight, xAxisCalloutData, circleId, xAxisCalloutAccessibilityData, yScale, legendVal, lineColor), onMouseOut: this_1._handleMouseOut, onFocus: function () { return _this_1._handleFocus(lineId, x1, xAxisCalloutData, circleId, xAxisCalloutAccessibilityData); }, onBlur: this_1._handleMouseOut }, this_1._getClickHandler(this_1._points[i].data[j - 1].onDataPointClick), { opacity: isLegendSelected && !currentPointHidden ? 1 : 0.01, fill: this_1._getPointFill(lineColor, circleId, j, false), stroke: lineColor, strokeWidth: strokeWidth, role: "img", "aria-label": this_1._getAriaLabel(i, j - 1) }))));
|
|
980
983
|
if (j + 1 === this_1._points[i].data.length) {
|
|
@@ -983,7 +986,7 @@ var LineChartBase = /** @class */ (function (_super) {
|
|
|
983
986
|
var hiddenHoverCircleId = "".concat(circleId).concat(j, "D");
|
|
984
987
|
var lastPointHidden = this_1._points[i].hideNonActiveDots && activePoint !== lastCircleId_1;
|
|
985
988
|
path = this_1._getPath(this_1._xAxisScale(x2), yScale(y2), lastCircleId_1, j, true, this_1._points[i].index);
|
|
986
|
-
var
|
|
989
|
+
var _22 = this_1._points[i].data[j], lastCirlceXCallout_1 = _22.xAxisCalloutData, lastCirlceXCalloutAccessibilityData_1 = _22.xAxisCalloutAccessibilityData;
|
|
987
990
|
currentMarkerSize = this_1._points[i].data[j].markerSize;
|
|
988
991
|
var lastSupportsTextMode = (_z = (_y = this_1._points[i].lineOptions) === null || _y === void 0 ? void 0 : _y.mode) === null || _z === void 0 ? void 0 : _z.includes('text');
|
|
989
992
|
var lastText = this_1._points[i].data[j].text;
|
|
@@ -992,7 +995,7 @@ var LineChartBase = /** @class */ (function (_super) {
|
|
|
992
995
|
React.createElement("circle", __assign({ id: lastCircleId_1, key: lastCircleId_1, r: currentMarkerSize ? (currentMarkerSize * extraMaxPixels) / maxMarkerSize : 4, cx: this_1._xAxisScale(x2), cy: yScale(y2), "data-is-focusable": isLegendSelected, onMouseOver: this_1._handleHover.bind(this_1, x2, y2, verticaLineHeight, lastCirlceXCallout_1, lastCircleId_1, lastCirlceXCalloutAccessibilityData_1, yScale, legendVal, lineColor), onMouseMove: this_1._handleHover.bind(this_1, x2, y2, verticaLineHeight, lastCirlceXCallout_1, lastCircleId_1, lastCirlceXCalloutAccessibilityData_1, yScale, legendVal, lineColor), onMouseOut: this_1._handleMouseOut, onFocus: function () {
|
|
993
996
|
return _this_1._handleFocus(lineId, x2, lastCirlceXCallout_1, lastCircleId_1, lastCirlceXCalloutAccessibilityData_1);
|
|
994
997
|
}, onBlur: this_1._handleMouseOut }, this_1._getClickHandler(this_1._points[i].data[j].onDataPointClick), { opacity: isLegendSelected && !lastPointHidden ? 1 : 0.01, fill: this_1._getPointFill(lineColor, lastCircleId_1, j, true), stroke: lineColor, strokeWidth: strokeWidth, role: "img", "aria-label": (_2 = this_1._points[i].data[j].text) !== null && _2 !== void 0 ? _2 : this_1._getAriaLabel(i, j) })),
|
|
995
|
-
lastSupportsTextMode && lastText && (React.createElement("text", { key: "".concat(lastCircleId_1, "-label"), x: this_1._xAxisScale(x2), y: yScale(y2) +
|
|
998
|
+
!this_1._isScatterPolar && lastSupportsTextMode && lastText && (React.createElement("text", { key: "".concat(lastCircleId_1, "-label"), x: this_1._xAxisScale(x2), y: yScale(y2) +
|
|
996
999
|
Math.max(currentMarkerSize ? (currentMarkerSize * extraMaxPixels) / maxMarkerSize : 4, 4) +
|
|
997
1000
|
12, className: classNames.markerLabel, opacity: isLegendSelected && !currentPointHidden ? 1 : 0.01 }, text)))) : (React.createElement("path", __assign({ id: lastCircleId_1, key: lastCircleId_1, d: path, "data-is-focusable": isLegendSelected, onMouseOver: this_1._handleHover.bind(this_1, x2, y2, verticaLineHeight, lastCirlceXCallout_1, lastCircleId_1, lastCirlceXCalloutAccessibilityData_1, yScale, legendVal, lineColor), onMouseMove: this_1._handleHover.bind(this_1, x2, y2, verticaLineHeight, lastCirlceXCallout_1, lastCircleId_1, lastCirlceXCalloutAccessibilityData_1, yScale, legendVal, lineColor), onMouseOut: this_1._handleMouseOut, onFocus: function () {
|
|
998
1001
|
return _this_1._handleFocus(lineId, x2, lastCirlceXCallout_1, lastCircleId_1, lastCirlceXCalloutAccessibilityData_1);
|
|
@@ -1025,6 +1028,26 @@ var LineChartBase = /** @class */ (function (_super) {
|
|
|
1025
1028
|
_loop_2(j);
|
|
1026
1029
|
}
|
|
1027
1030
|
}
|
|
1031
|
+
if (this_1._isScatterPolar) {
|
|
1032
|
+
// Render category labels for all series at once to avoid overlap
|
|
1033
|
+
var allSeriesData = this_1._points.map(function (series) { return ({
|
|
1034
|
+
data: series.data
|
|
1035
|
+
.filter(function (pt) { return typeof pt.x === 'number' && typeof pt.y === 'number'; })
|
|
1036
|
+
.map(function (pt) { return ({ x: pt.x, y: pt.y, text: pt.text }); }),
|
|
1037
|
+
}); });
|
|
1038
|
+
pointsForLine.push.apply(pointsForLine, renderScatterPolarCategoryLabels({
|
|
1039
|
+
allSeriesData: allSeriesData,
|
|
1040
|
+
xAxisScale: this_1._xAxisScale,
|
|
1041
|
+
yAxisScale: yScale,
|
|
1042
|
+
className: classNames.markerLabel || '',
|
|
1043
|
+
maybeLineOptions: ((_17 = this_1._points[i]) === null || _17 === void 0 ? void 0 : _17.lineOptions)
|
|
1044
|
+
? {
|
|
1045
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1046
|
+
originXOffset: (_18 = this_1._points[i].lineOptions) === null || _18 === void 0 ? void 0 : _18.originXOffset,
|
|
1047
|
+
}
|
|
1048
|
+
: undefined,
|
|
1049
|
+
}));
|
|
1050
|
+
}
|
|
1028
1051
|
lines.push(React.createElement("g", { key: "line_".concat(i), role: "region", "aria-label": "".concat(legendVal, ", line ").concat(i + 1, " of ").concat(this_1._points.length, " with ").concat(this_1._points[i].data.length, " data points.") },
|
|
1029
1052
|
bordersForLine,
|
|
1030
1053
|
linesForLine,
|
|
@@ -1071,7 +1094,7 @@ var LineChartBase = /** @class */ (function (_super) {
|
|
|
1071
1094
|
LineChartBase.defaultProps = {
|
|
1072
1095
|
enableReflow: true,
|
|
1073
1096
|
useUTC: true,
|
|
1074
|
-
isCalloutForStack:
|
|
1097
|
+
isCalloutForStack: true,
|
|
1075
1098
|
};
|
|
1076
1099
|
return LineChartBase;
|
|
1077
1100
|
}(React.Component));
|