@fluentui/react-charting 5.24.12 → 5.24.14
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 +10 -3
- 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 +78 -62
- 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.js +6 -11
- package/lib/components/LineChart/LineChart.base.js.map +1 -1
- package/lib/components/ScatterChart/ScatterChart.base.js +12 -26
- 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 +7 -4
- package/lib/utilities/scatterpolar-utils.js +19 -2
- package/lib/utilities/scatterpolar-utils.js.map +1 -1
- 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 +8 -6
- package/lib/utilities/utilities.js +9 -5
- 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 +10 -4
- 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 +79 -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.js +6 -11
- package/lib-amd/components/LineChart/LineChart.base.js.map +1 -1
- package/lib-amd/components/ScatterChart/ScatterChart.base.js +12 -26
- 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 +7 -4
- package/lib-amd/utilities/scatterpolar-utils.js +21 -3
- package/lib-amd/utilities/scatterpolar-utils.js.map +1 -1
- 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 +8 -6
- package/lib-amd/utilities/utilities.js +10 -5
- 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 +11 -4
- 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 +79 -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.js +6 -11
- package/lib-commonjs/components/LineChart/LineChart.base.js.map +1 -1
- package/lib-commonjs/components/ScatterChart/ScatterChart.base.js +12 -26
- 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 +7 -4
- package/lib-commonjs/utilities/scatterpolar-utils.js +21 -3
- package/lib-commonjs/utilities/scatterpolar-utils.js.map +1 -1
- 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 +8 -6
- package/lib-commonjs/utilities/utilities.js +11 -6
- 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
|
@@ -0,0 +1,325 @@
|
|
|
1
|
+
define(["require", "exports", "tslib", "react", "d3-array", "@fluentui/react", "../Legends/index", "../CommonComponents/index", "../../utilities/index", "../../utilities/image-export-utils", "@fluentui/chart-utilities"], function (require, exports, tslib_1, React, d3_array_1, react_1, index_1, index_2, index_3, image_export_utils_1, chart_utilities_1) {
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.GanttChartBase = void 0;
|
|
5
|
+
exports.GanttChartBase = React.forwardRef(function (_a, forwardedRef) {
|
|
6
|
+
var _b, _c;
|
|
7
|
+
var _d = _a.useUTC, useUTC = _d === void 0 ? true : _d, _e = _a.yAxisCategoryOrder, yAxisCategoryOrder = _e === void 0 ? 'default' : _e, props = tslib_1.__rest(_a, ["useUTC", "yAxisCategoryOrder"]);
|
|
8
|
+
var _barHeight = React.useRef(0);
|
|
9
|
+
var _calloutId = React.useRef((0, react_1.getId)('callout'));
|
|
10
|
+
var margins = React.useRef({});
|
|
11
|
+
var _bars = React.useRef([]);
|
|
12
|
+
var _xAxisType = React.useRef(index_3.XAxisTypes.DateAxis);
|
|
13
|
+
var _yAxisType = React.useRef(index_3.YAxisType.StringAxis);
|
|
14
|
+
var _calloutAnchorPoint = React.useRef(null);
|
|
15
|
+
var _cartesianChartRef = React.useRef(null);
|
|
16
|
+
var _legendsRef = React.useRef(null);
|
|
17
|
+
var _domainMargin = React.useRef(index_3.MIN_DOMAIN_MARGIN);
|
|
18
|
+
var _yAxisPadding = React.useRef(0);
|
|
19
|
+
var _emptyChartId = React.useRef((0, react_1.getId)('Gantt_empty'));
|
|
20
|
+
var _legendColorMap = React.useRef({});
|
|
21
|
+
var _gradientId = React.useRef((0, react_1.getId)('Gantt_gradient'));
|
|
22
|
+
var prevProps = React.useRef({});
|
|
23
|
+
var _f = React.useState(''), calloutColor = _f[0], setCalloutColor = _f[1];
|
|
24
|
+
var _g = React.useState(false), isCalloutVisible = _g[0], setCalloutVisible = _g[1];
|
|
25
|
+
var _h = React.useState(''), hoveredLegend = _h[0], setHoveredLegend = _h[1];
|
|
26
|
+
var _j = React.useState(null), calloutTarget = _j[0], setCalloutTarget = _j[1];
|
|
27
|
+
var _k = React.useState(''), calloutLegend = _k[0], setCalloutLegend = _k[1];
|
|
28
|
+
var _l = React.useState(''), xCalloutValue = _l[0], setXCalloutValue = _l[1];
|
|
29
|
+
var _m = React.useState(''), yCalloutValue = _m[0], setYCalloutValue = _m[1];
|
|
30
|
+
var _o = React.useState(((_b = props.legendProps) === null || _b === void 0 ? void 0 : _b.selectedLegends) || []), selectedLegends = _o[0], setSelectedLegends = _o[1];
|
|
31
|
+
var _p = React.useState(), dataPointCalloutProps = _p[0], setDataPointCalloutProps = _p[1];
|
|
32
|
+
React.useEffect(function () {
|
|
33
|
+
var _a, _b, _c;
|
|
34
|
+
if (!(0, index_3.areArraysEqual)((_a = prevProps.current.legendProps) === null || _a === void 0 ? void 0 : _a.selectedLegends, (_b = props.legendProps) === null || _b === void 0 ? void 0 : _b.selectedLegends)) {
|
|
35
|
+
setSelectedLegends(((_c = props.legendProps) === null || _c === void 0 ? void 0 : _c.selectedLegends) || []);
|
|
36
|
+
}
|
|
37
|
+
prevProps.current = props;
|
|
38
|
+
}, [props]);
|
|
39
|
+
React.useImperativeHandle(props.componentRef, function () {
|
|
40
|
+
var _a, _b;
|
|
41
|
+
return ({
|
|
42
|
+
chartContainer: (_b = (_a = _cartesianChartRef.current) === null || _a === void 0 ? void 0 : _a.chartContainer) !== null && _b !== void 0 ? _b : null,
|
|
43
|
+
toImage: function (opts) {
|
|
44
|
+
var _a, _b;
|
|
45
|
+
return (0, image_export_utils_1.toImage)((_a = _cartesianChartRef.current) === null || _a === void 0 ? void 0 : _a.chartContainer, (_b = _legendsRef.current) === null || _b === void 0 ? void 0 : _b.toSVG, (0, react_1.getRTL)(), opts);
|
|
46
|
+
},
|
|
47
|
+
});
|
|
48
|
+
}, []);
|
|
49
|
+
var _points = React.useMemo(function () {
|
|
50
|
+
var _a, _b;
|
|
51
|
+
_legendColorMap.current = {};
|
|
52
|
+
var colorIndex = 0;
|
|
53
|
+
return ((_b = (_a = props.data) === null || _a === void 0 ? void 0 : _a.map(function (point) {
|
|
54
|
+
var _a, _b, _c, _d, _e;
|
|
55
|
+
var legend = "".concat(point.legend);
|
|
56
|
+
if (!_legendColorMap.current[legend]) {
|
|
57
|
+
var startColor = point.color
|
|
58
|
+
? (0, index_3.getColorFromToken)(point.color, (_a = props.theme) === null || _a === void 0 ? void 0 : _a.isInverted)
|
|
59
|
+
: (0, index_3.getNextColor)(colorIndex, 0, (_b = props.theme) === null || _b === void 0 ? void 0 : _b.isInverted);
|
|
60
|
+
var endColor = startColor;
|
|
61
|
+
if (props.enableGradient) {
|
|
62
|
+
var nextGradient = (0, index_3.getNextGradient)(colorIndex, 0, (_c = props.theme) === null || _c === void 0 ? void 0 : _c.isInverted);
|
|
63
|
+
startColor = ((_d = point.gradient) === null || _d === void 0 ? void 0 : _d[0]) || nextGradient[0];
|
|
64
|
+
endColor = ((_e = point.gradient) === null || _e === void 0 ? void 0 : _e[1]) || nextGradient[1];
|
|
65
|
+
}
|
|
66
|
+
_legendColorMap.current[legend] = [startColor, endColor];
|
|
67
|
+
colorIndex += 1;
|
|
68
|
+
}
|
|
69
|
+
return tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({}, point), { color: _legendColorMap.current[legend][0] }), (props.enableGradient ? { gradient: _legendColorMap.current[legend] } : {}));
|
|
70
|
+
})) !== null && _b !== void 0 ? _b : []);
|
|
71
|
+
}, [props.data, (_c = props.theme) === null || _c === void 0 ? void 0 : _c.isInverted, props.enableGradient]);
|
|
72
|
+
var _dateFormatOptions = React.useMemo(function () {
|
|
73
|
+
if (_xAxisType.current !== index_3.XAxisTypes.DateAxis) {
|
|
74
|
+
return undefined;
|
|
75
|
+
}
|
|
76
|
+
var lowestFormatLevel = 100;
|
|
77
|
+
var highestFormatLevel = -1;
|
|
78
|
+
_points.forEach(function (p) {
|
|
79
|
+
var startFormatLevel = (0, index_3.getDateFormatLevel)(p.x.start, useUTC);
|
|
80
|
+
var endFormatLevel = (0, index_3.getDateFormatLevel)(p.x.end, useUTC);
|
|
81
|
+
lowestFormatLevel = Math.min(lowestFormatLevel, startFormatLevel, endFormatLevel);
|
|
82
|
+
highestFormatLevel = Math.max(highestFormatLevel, startFormatLevel, endFormatLevel);
|
|
83
|
+
});
|
|
84
|
+
return (0, chart_utilities_1.getMultiLevelDateTimeFormatOptions)(lowestFormatLevel, highestFormatLevel);
|
|
85
|
+
}, [useUTC, _points]);
|
|
86
|
+
var _getDomainNRangeValues = React.useCallback(function (points, _margins, containerWidth, chartType, isRTL, xAxisType, barWidth, tickValues, shiftX) {
|
|
87
|
+
var xValues = [];
|
|
88
|
+
points.forEach(function (point) {
|
|
89
|
+
xValues.push(point.x.start, point.x.end);
|
|
90
|
+
});
|
|
91
|
+
var xMin = (0, d3_array_1.min)(xValues) || 0;
|
|
92
|
+
var xMax = (0, d3_array_1.max)(xValues) || 0;
|
|
93
|
+
return {
|
|
94
|
+
dStartValue: isRTL ? xMax : xMin,
|
|
95
|
+
dEndValue: isRTL ? xMin : xMax,
|
|
96
|
+
rStartValue: _margins.left + (isRTL ? 0 : shiftX),
|
|
97
|
+
rEndValue: containerWidth - _margins.right - (isRTL ? shiftX : 0),
|
|
98
|
+
};
|
|
99
|
+
}, []);
|
|
100
|
+
var _adjustProps = function () {
|
|
101
|
+
_barHeight.current = Math.max(props.barHeight || 24, 1);
|
|
102
|
+
if (props.data && props.data.length > 0) {
|
|
103
|
+
_xAxisType.current = (0, index_3.getTypeOfAxis)(props.data[0].x.start, true);
|
|
104
|
+
_yAxisType.current = (0, index_3.getTypeOfAxis)(props.data[0].y, false);
|
|
105
|
+
}
|
|
106
|
+
_yAxisPadding.current = (0, index_3.getScalePadding)(props.yAxisPadding, undefined, 1 / 2);
|
|
107
|
+
};
|
|
108
|
+
var _getMargins = React.useCallback(function (_margins) {
|
|
109
|
+
margins.current = _margins;
|
|
110
|
+
}, []);
|
|
111
|
+
var _renderContentForOnlyBars = function (point) {
|
|
112
|
+
return (React.createElement(index_3.ChartHoverCard, { XValue: point.yAxisCalloutData || point.y.toString(), Legend: point.legend, YValue: point.xAxisCalloutData || _getFormattedXValue(point), color: point.color, culture: props.culture }));
|
|
113
|
+
};
|
|
114
|
+
var _renderCallout = function (point) {
|
|
115
|
+
return point ? _renderContentForOnlyBars(point) : null;
|
|
116
|
+
};
|
|
117
|
+
var _getCustomizedCallout = function () {
|
|
118
|
+
return props.onRenderCalloutPerDataPoint
|
|
119
|
+
? props.onRenderCalloutPerDataPoint(dataPointCalloutProps, _renderCallout)
|
|
120
|
+
: null;
|
|
121
|
+
};
|
|
122
|
+
var _getFormattedXValue = React.useCallback(function (point) {
|
|
123
|
+
var formattedStartX;
|
|
124
|
+
var formattedEndX;
|
|
125
|
+
if (_xAxisType.current === index_3.XAxisTypes.DateAxis) {
|
|
126
|
+
formattedStartX = (0, chart_utilities_1.formatDateToLocaleString)(point.x.start, props.culture, useUTC, false, _dateFormatOptions);
|
|
127
|
+
formattedEndX = (0, chart_utilities_1.formatDateToLocaleString)(point.x.end, props.culture, useUTC, false, _dateFormatOptions);
|
|
128
|
+
}
|
|
129
|
+
else {
|
|
130
|
+
formattedStartX = point.x.start.toString();
|
|
131
|
+
formattedEndX = point.x.end.toString();
|
|
132
|
+
}
|
|
133
|
+
return "".concat(formattedStartX, " - ").concat(formattedEndX);
|
|
134
|
+
}, [props.culture, useUTC, _dateFormatOptions]);
|
|
135
|
+
var _getAriaLabel = React.useCallback(function (point) {
|
|
136
|
+
var _a;
|
|
137
|
+
var xValue = point.xAxisCalloutData || _getFormattedXValue(point);
|
|
138
|
+
var yValue = point.yAxisCalloutData || point.y;
|
|
139
|
+
return ((_a = point.callOutAccessibilityData) === null || _a === void 0 ? void 0 : _a.ariaLabel) || "".concat(yValue, ". ") + "".concat(xValue, ".");
|
|
140
|
+
}, [_getFormattedXValue]);
|
|
141
|
+
var _getHighlightedLegend = React.useCallback(function () {
|
|
142
|
+
return selectedLegends.length > 0 ? selectedLegends : hoveredLegend ? [hoveredLegend] : [];
|
|
143
|
+
}, [hoveredLegend, selectedLegends]);
|
|
144
|
+
/**
|
|
145
|
+
* This function checks if the given legend is highlighted or not.
|
|
146
|
+
* A legend can be highlighted in 2 ways:
|
|
147
|
+
* 1. selection: if the user clicks on it
|
|
148
|
+
* 2. hovering: if there is no selected legend and the user hovers over it
|
|
149
|
+
*/
|
|
150
|
+
var _legendHighlighted = React.useCallback(function (legend) {
|
|
151
|
+
return _getHighlightedLegend().includes("".concat(legend));
|
|
152
|
+
}, [_getHighlightedLegend]);
|
|
153
|
+
/**
|
|
154
|
+
* This function checks if none of the legends is selected or hovered.
|
|
155
|
+
*/
|
|
156
|
+
var _noLegendHighlighted = React.useCallback(function () {
|
|
157
|
+
return _getHighlightedLegend().length === 0;
|
|
158
|
+
}, [_getHighlightedLegend]);
|
|
159
|
+
var _showCallout = React.useCallback(function (target, point) {
|
|
160
|
+
if (!(_noLegendHighlighted() || _legendHighlighted(point.legend)) || _calloutAnchorPoint.current === point) {
|
|
161
|
+
return;
|
|
162
|
+
}
|
|
163
|
+
_calloutAnchorPoint.current = point;
|
|
164
|
+
setCalloutTarget(target);
|
|
165
|
+
setCalloutVisible(true);
|
|
166
|
+
setCalloutLegend(point.legend);
|
|
167
|
+
setCalloutColor(point.color);
|
|
168
|
+
setXCalloutValue(point.yAxisCalloutData || point.y.toString());
|
|
169
|
+
setYCalloutValue(point.xAxisCalloutData || _getFormattedXValue(point));
|
|
170
|
+
setDataPointCalloutProps(point);
|
|
171
|
+
}, [_getFormattedXValue, _legendHighlighted, _noLegendHighlighted]);
|
|
172
|
+
var _onBarFocus = React.useCallback(function (point, focusEvent) {
|
|
173
|
+
_showCallout(focusEvent.currentTarget, point);
|
|
174
|
+
}, [_showCallout]);
|
|
175
|
+
var _onBarHover = React.useCallback(function (point, mouseEvent) {
|
|
176
|
+
_showCallout(mouseEvent.currentTarget, point);
|
|
177
|
+
}, [_showCallout]);
|
|
178
|
+
var _createBars = React.useCallback(function (xScale, yScale) {
|
|
179
|
+
var bars = _points.map(function (point, index) {
|
|
180
|
+
var shouldHighlight = _noLegendHighlighted() || _legendHighlighted(point.legend);
|
|
181
|
+
var startColor = point.color;
|
|
182
|
+
var endColor = startColor;
|
|
183
|
+
if (props.enableGradient) {
|
|
184
|
+
startColor = point.gradient[0];
|
|
185
|
+
endColor = point.gradient[1];
|
|
186
|
+
}
|
|
187
|
+
var gradientId = "".concat(_gradientId.current, "_").concat(index);
|
|
188
|
+
var startX = xScale(point.x.start);
|
|
189
|
+
var endX = xScale(point.x.end);
|
|
190
|
+
var y = (_yAxisType.current === index_3.YAxisType.StringAxis
|
|
191
|
+
? yScale(point.y) + yScale.bandwidth() / 2
|
|
192
|
+
: yScale(point.y)) -
|
|
193
|
+
_barHeight.current / 2;
|
|
194
|
+
return (React.createElement(React.Fragment, { key: index },
|
|
195
|
+
props.enableGradient && (React.createElement("defs", null,
|
|
196
|
+
React.createElement("linearGradient", { id: gradientId },
|
|
197
|
+
React.createElement("stop", { offset: "0", stopColor: startColor }),
|
|
198
|
+
React.createElement("stop", { offset: "100%", stopColor: endColor })))),
|
|
199
|
+
React.createElement("rect", { x: Math.min(startX, endX), y: y, width: Math.abs(endX - startX), height: _barHeight.current, rx: props.roundCorners ? 3 : 0, fill: props.enableGradient ? "url(#".concat(gradientId, ")") : startColor, opacity: shouldHighlight ? 1 : 0.1, onClick: point.onClick, onMouseOver: function (event) { return _onBarHover(point, event); }, onMouseLeave: _onBarLeave, onFocus: function (event) { return _onBarFocus(point, event); }, onBlur: _onBarLeave, "data-is-focusable": shouldHighlight, role: "img", "aria-label": _getAriaLabel(point) })));
|
|
200
|
+
});
|
|
201
|
+
return bars;
|
|
202
|
+
}, [
|
|
203
|
+
_getAriaLabel,
|
|
204
|
+
_legendHighlighted,
|
|
205
|
+
_noLegendHighlighted,
|
|
206
|
+
_onBarFocus,
|
|
207
|
+
_onBarHover,
|
|
208
|
+
props.enableGradient,
|
|
209
|
+
props.roundCorners,
|
|
210
|
+
_points,
|
|
211
|
+
]);
|
|
212
|
+
var _getGraphData = React.useCallback(function (xScale, yScale, containerHeight, containerWidth, xAxisElement, yAxisElement) {
|
|
213
|
+
return (_bars.current = _createBars(xScale, yScale));
|
|
214
|
+
}, [_createBars]);
|
|
215
|
+
var _onBarLeave = function () {
|
|
216
|
+
// do nothing
|
|
217
|
+
};
|
|
218
|
+
var _handleChartMouseLeave = React.useCallback(function () {
|
|
219
|
+
_calloutAnchorPoint.current = null;
|
|
220
|
+
setCalloutTarget(null);
|
|
221
|
+
setCalloutVisible(false);
|
|
222
|
+
setCalloutLegend('');
|
|
223
|
+
setCalloutColor('');
|
|
224
|
+
setXCalloutValue('');
|
|
225
|
+
setYCalloutValue('');
|
|
226
|
+
setDataPointCalloutProps(undefined);
|
|
227
|
+
}, []);
|
|
228
|
+
var _closeCallout = function () {
|
|
229
|
+
setCalloutVisible(false);
|
|
230
|
+
};
|
|
231
|
+
var _onLegendHover = function (legend) {
|
|
232
|
+
setHoveredLegend(legend);
|
|
233
|
+
};
|
|
234
|
+
var _onLegendLeave = function () {
|
|
235
|
+
setHoveredLegend('');
|
|
236
|
+
};
|
|
237
|
+
var _getLegendData = function () {
|
|
238
|
+
var actions = [];
|
|
239
|
+
Object.keys(_legendColorMap.current).forEach(function (legendTitle) {
|
|
240
|
+
var legend = {
|
|
241
|
+
title: legendTitle,
|
|
242
|
+
color: _legendColorMap.current[legendTitle][0],
|
|
243
|
+
hoverAction: function () {
|
|
244
|
+
_handleChartMouseLeave();
|
|
245
|
+
_onLegendHover(legendTitle);
|
|
246
|
+
},
|
|
247
|
+
onMouseOutAction: function () {
|
|
248
|
+
_onLegendLeave();
|
|
249
|
+
},
|
|
250
|
+
};
|
|
251
|
+
actions.push(legend);
|
|
252
|
+
});
|
|
253
|
+
var legends = (React.createElement(index_1.Legends, tslib_1.__assign({ legends: actions, enabledWrapLines: props.enabledLegendsWrapLines, overflowProps: props.legendsOverflowProps, focusZonePropsInHoverCard: props.focusZonePropsForLegendsInHoverCard, overflowText: props.legendsOverflowText, onChange: _onLegendSelectionChange, ref: _legendsRef }, props.legendProps)));
|
|
254
|
+
return legends;
|
|
255
|
+
};
|
|
256
|
+
var _onLegendSelectionChange = function (_selectedLegends, event, currentLegend) {
|
|
257
|
+
var _a, _b;
|
|
258
|
+
if ((_a = props.legendProps) === null || _a === void 0 ? void 0 : _a.canSelectMultipleLegends) {
|
|
259
|
+
setSelectedLegends(_selectedLegends);
|
|
260
|
+
}
|
|
261
|
+
else {
|
|
262
|
+
setSelectedLegends(_selectedLegends.slice(-1));
|
|
263
|
+
}
|
|
264
|
+
if ((_b = props.legendProps) === null || _b === void 0 ? void 0 : _b.onChange) {
|
|
265
|
+
props.legendProps.onChange(_selectedLegends, event, currentLegend);
|
|
266
|
+
}
|
|
267
|
+
};
|
|
268
|
+
var _getChartTitle = function () {
|
|
269
|
+
var chartTitle = props.chartTitle;
|
|
270
|
+
return (chartTitle ? "".concat(chartTitle, ". ") : '') + "Gantt chart with ".concat(_points.length, " bars. ");
|
|
271
|
+
};
|
|
272
|
+
var _isChartEmpty = function () {
|
|
273
|
+
return !(props.data && props.data.length > 0);
|
|
274
|
+
};
|
|
275
|
+
var _getYDomainMargins = React.useCallback(function (containerHeight) {
|
|
276
|
+
_domainMargin.current = index_3.MIN_DOMAIN_MARGIN;
|
|
277
|
+
var ySet = new Set();
|
|
278
|
+
_points.forEach(function (point) {
|
|
279
|
+
ySet.add(point.y);
|
|
280
|
+
});
|
|
281
|
+
var uniqueY = Array.from(ySet);
|
|
282
|
+
/** Total height available to render the bars */
|
|
283
|
+
var totalHeight = containerHeight - (margins.current.top + index_3.MIN_DOMAIN_MARGIN) - (margins.current.bottom + index_3.MIN_DOMAIN_MARGIN);
|
|
284
|
+
if (_yAxisType.current !== index_3.YAxisType.StringAxis) {
|
|
285
|
+
_barHeight.current = Math.max(props.barHeight ||
|
|
286
|
+
(0, index_3.calculateAppropriateBarWidth)(uniqueY, totalHeight, _yAxisPadding.current), 1);
|
|
287
|
+
_domainMargin.current += _barHeight.current / 2;
|
|
288
|
+
}
|
|
289
|
+
return tslib_1.__assign(tslib_1.__assign({}, margins.current), { top: margins.current.top + _domainMargin.current, bottom: margins.current.bottom + _domainMargin.current });
|
|
290
|
+
}, [props.barHeight, _points]);
|
|
291
|
+
var _getOrderedYAxisLabels = function () {
|
|
292
|
+
return (0, index_3.sortAxisCategories)(_mapCategoryToValues(), yAxisCategoryOrder);
|
|
293
|
+
};
|
|
294
|
+
var _mapCategoryToValues = function () {
|
|
295
|
+
var categoryToValues = {};
|
|
296
|
+
_points.forEach(function (point) {
|
|
297
|
+
if (!categoryToValues[point.y]) {
|
|
298
|
+
categoryToValues[point.y] = [];
|
|
299
|
+
}
|
|
300
|
+
// FIXME
|
|
301
|
+
// categoryToValues[point.y].push(point.x.end - point.x.start);
|
|
302
|
+
});
|
|
303
|
+
return categoryToValues;
|
|
304
|
+
};
|
|
305
|
+
var _renderBars = React.useCallback(function () {
|
|
306
|
+
return React.createElement("g", null, _bars.current);
|
|
307
|
+
}, []);
|
|
308
|
+
if (!_isChartEmpty()) {
|
|
309
|
+
_adjustProps();
|
|
310
|
+
var yAxisLabels = _getOrderedYAxisLabels();
|
|
311
|
+
var legendBars = _getLegendData();
|
|
312
|
+
var calloutProps = tslib_1.__assign({ isCalloutVisible: isCalloutVisible, directionalHint: react_1.DirectionalHint.topAutoEdge, id: "toolTip".concat(_calloutId.current), target: calloutTarget, isBeakVisible: false, gapSpace: 15, color: calloutColor, legend: calloutLegend, XValue: xCalloutValue, YValue: yCalloutValue, onDismiss: _closeCallout, preventDismissOnLostFocus: true }, props.calloutProps);
|
|
313
|
+
var tickParams = {
|
|
314
|
+
tickValues: props.tickValues,
|
|
315
|
+
tickFormat: props.tickFormat,
|
|
316
|
+
};
|
|
317
|
+
return (React.createElement(index_2.CartesianChart, tslib_1.__assign({}, props, { yAxisPadding: _yAxisPadding.current, chartTitle: _getChartTitle(), points: _points, chartType: index_3.ChartTypes.GanttChart, xAxisType: _xAxisType.current, yAxisType: _yAxisType.current, stringDatasetForYAxisDomain: yAxisLabels, calloutProps: calloutProps, tickParams: tickParams, legendBars: legendBars, createYAxis: index_3.createYAxisForHorizontalBarChartWithAxis, getDomainNRangeValues: _getDomainNRangeValues, createStringYAxis: index_3.createStringYAxisForHorizontalBarChartWithAxis, getMinMaxOfYAxis: index_3.findHBCWANumericMinMaxOfY, focusZoneDirection: react_1.FocusZoneDirection.vertical, customizedCallout: _getCustomizedCallout(), getmargins: _getMargins, getYDomainMargins: _getYDomainMargins, getGraphData: _getGraphData, onChartMouseLeave: _handleChartMouseLeave, ref: _cartesianChartRef, useUTC: useUTC, children: _renderBars })));
|
|
318
|
+
}
|
|
319
|
+
else {
|
|
320
|
+
return (React.createElement("div", { id: _emptyChartId.current, role: 'alert', style: { opacity: '0' }, "aria-label": 'Graph has no data to display' }));
|
|
321
|
+
}
|
|
322
|
+
});
|
|
323
|
+
exports.GanttChartBase.displayName = 'GanttChart';
|
|
324
|
+
});
|
|
325
|
+
//# sourceMappingURL=GanttChart.base.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GanttChart.base.js","sourceRoot":"../src/","sources":["components/GanttChart/GanttChart.base.tsx"],"names":[],"mappings":";;;;IAmCa,QAAA,cAAc,GAA8C,KAAK,CAAC,UAAU,CAGvF,UAAC,EAA2D,EAAE,YAAY;;QAAvE,IAAA,cAAa,EAAb,MAAM,mBAAG,IAAI,KAAA,EAAE,0BAA8B,EAA9B,kBAAkB,mBAAG,SAAS,KAAA,EAAK,KAAK,sBAAzD,gCAA2D,CAAF;QAC1D,IAAM,UAAU,GAAG,KAAK,CAAC,MAAM,CAAS,CAAC,CAAC,CAAC;QAC3C,IAAM,UAAU,GAAG,KAAK,CAAC,MAAM,CAAS,IAAA,aAAK,EAAC,SAAS,CAAC,CAAC,CAAC;QAC1D,IAAM,OAAO,GAAG,KAAK,CAAC,MAAM,CAAW,EAAE,CAAC,CAAC;QAC3C,IAAM,KAAK,GAAG,KAAK,CAAC,MAAM,CAAsB,EAAE,CAAC,CAAC;QACpD,IAAM,UAAU,GAAG,KAAK,CAAC,MAAM,CAAa,kBAAU,CAAC,QAAQ,CAAC,CAAC;QACjE,IAAM,UAAU,GAAG,KAAK,CAAC,MAAM,CAAY,iBAAS,CAAC,UAAU,CAAC,CAAC;QACjE,IAAM,mBAAmB,GAAG,KAAK,CAAC,MAAM,CAA8B,IAAI,CAAC,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GAAG,YAAY,CAAC","sourcesContent":["import * as React from 'react';\nimport { max as d3Max, min as d3Min } from 'd3-array';\nimport { ScaleLinear, ScaleBand, ScaleTime } from 'd3-scale';\nimport { DirectionalHint, FocusZoneDirection, getId, getRTL } from '@fluentui/react';\nimport { ILegend, ILegendContainer, Legends } from '../Legends/index';\nimport { IMargins, IChart, IImageExportOptions, IGanttChartDataPoint } from '../../types/IDataPoint';\nimport { CartesianChart } from '../CommonComponents/index';\nimport { IGanttChartProps } from './GanttChart.types';\nimport {\n ChartHoverCard,\n ChartTypes,\n YAxisType,\n XAxisTypes,\n getTypeOfAxis,\n getNextColor,\n findHBCWANumericMinMaxOfY,\n createYAxisForHorizontalBarChartWithAxis,\n IDomainNRange,\n createStringYAxisForHorizontalBarChartWithAxis,\n getNextGradient,\n areArraysEqual,\n MIN_DOMAIN_MARGIN,\n sortAxisCategories,\n calculateAppropriateBarWidth,\n getColorFromToken,\n getScalePadding,\n getDateFormatLevel,\n} from '../../utilities/index';\nimport { toImage } from '../../utilities/image-export-utils';\nimport { formatDateToLocaleString, getMultiLevelDateTimeFormatOptions } from '@fluentui/chart-utilities';\n\ntype NumberScale = ScaleLinear<number, number>;\ntype StringScale = ScaleBand<string>;\ntype DateScale = ScaleTime<Date, number>;\n\nexport const GanttChartBase: React.FunctionComponent<IGanttChartProps> = React.forwardRef<\n HTMLDivElement,\n IGanttChartProps\n>(({ useUTC = true, yAxisCategoryOrder = 'default', ...props }, forwardedRef) => {\n const _barHeight = React.useRef<number>(0);\n const _calloutId = React.useRef<string>(getId('callout'));\n const margins = React.useRef<IMargins>({});\n const _bars = React.useRef<React.JSX.Element[]>([]);\n const _xAxisType = React.useRef<XAxisTypes>(XAxisTypes.DateAxis);\n const _yAxisType = React.useRef<YAxisType>(YAxisType.StringAxis);\n const _calloutAnchorPoint = React.useRef<IGanttChartDataPoint | null>(null);\n const _cartesianChartRef = React.useRef<IChart>(null);\n const _legendsRef = React.useRef<ILegendContainer>(null);\n const _domainMargin = React.useRef<number>(MIN_DOMAIN_MARGIN);\n const _yAxisPadding = React.useRef<number>(0);\n const _emptyChartId = React.useRef<string>(getId('Gantt_empty'));\n const _legendColorMap = React.useRef<Record<string, [string, string]>>({});\n const _gradientId = React.useRef<string>(getId('Gantt_gradient'));\n const prevProps = React.useRef<Partial<IGanttChartProps>>({});\n\n const [calloutColor, setCalloutColor] = React.useState<string>('');\n const [isCalloutVisible, setCalloutVisible] = React.useState<boolean>(false);\n const [hoveredLegend, setHoveredLegend] = React.useState<string>('');\n const [calloutTarget, setCalloutTarget] = React.useState<SVGElement | null>(null);\n const [calloutLegend, setCalloutLegend] = React.useState<string>('');\n const [xCalloutValue, setXCalloutValue] = React.useState<string>('');\n const [yCalloutValue, setYCalloutValue] = React.useState<string>('');\n const [selectedLegends, setSelectedLegends] = React.useState<string[]>(props.legendProps?.selectedLegends || []);\n const [dataPointCalloutProps, setDataPointCalloutProps] = React.useState<IGanttChartDataPoint>();\n\n React.useEffect(() => {\n if (!areArraysEqual(prevProps.current.legendProps?.selectedLegends, props.legendProps?.selectedLegends)) {\n setSelectedLegends(props.legendProps?.selectedLegends || []);\n }\n prevProps.current = props;\n }, [props]);\n\n React.useImperativeHandle(\n props.componentRef,\n () => ({\n chartContainer: _cartesianChartRef.current?.chartContainer ?? null,\n toImage: (opts?: IImageExportOptions): Promise<string> => {\n return toImage(_cartesianChartRef.current?.chartContainer, _legendsRef.current?.toSVG, getRTL(), opts);\n },\n }),\n [],\n );\n\n const _points = React.useMemo(() => {\n _legendColorMap.current = {};\n let colorIndex = 0;\n\n return (\n props.data?.map(point => {\n const legend = `${point.legend}`;\n if (!_legendColorMap.current[legend]) {\n let startColor = point.color\n ? getColorFromToken(point.color, props.theme?.isInverted)\n : getNextColor(colorIndex, 0, props.theme?.isInverted);\n let endColor = startColor;\n\n if (props.enableGradient) {\n const nextGradient = getNextGradient(colorIndex, 0, props.theme?.isInverted);\n startColor = point.gradient?.[0] || nextGradient[0];\n endColor = point.gradient?.[1] || nextGradient[1];\n }\n\n _legendColorMap.current[legend] = [startColor, endColor];\n colorIndex += 1;\n }\n\n return {\n ...point,\n color: _legendColorMap.current[legend][0],\n ...(props.enableGradient ? { gradient: _legendColorMap.current[legend] } : {}),\n };\n }) ?? []\n );\n }, [props.data, props.theme?.isInverted, props.enableGradient]);\n\n const _dateFormatOptions = React.useMemo(() => {\n if (_xAxisType.current !== XAxisTypes.DateAxis) {\n return undefined;\n }\n\n let lowestFormatLevel = 100;\n let highestFormatLevel = -1;\n _points.forEach(p => {\n const startFormatLevel = getDateFormatLevel(p.x.start as Date, useUTC);\n const endFormatLevel = getDateFormatLevel(p.x.end as Date, useUTC);\n lowestFormatLevel = Math.min(lowestFormatLevel, startFormatLevel, endFormatLevel);\n highestFormatLevel = Math.max(highestFormatLevel, startFormatLevel, endFormatLevel);\n });\n\n return getMultiLevelDateTimeFormatOptions(lowestFormatLevel, highestFormatLevel);\n }, [useUTC, _points]);\n\n const _getDomainNRangeValues = React.useCallback(\n (\n points: IGanttChartDataPoint[],\n _margins: IMargins,\n containerWidth: number,\n chartType: ChartTypes,\n isRTL: boolean,\n xAxisType: XAxisTypes,\n barWidth: number,\n tickValues: Date[] | number[] | undefined,\n shiftX: number,\n ): IDomainNRange => {\n const xValues: (Date | number)[] = [];\n points.forEach(point => {\n xValues.push(point.x.start, point.x.end);\n });\n\n const xMin = d3Min(xValues) || 0;\n const xMax = d3Max(xValues) || 0;\n\n return {\n dStartValue: isRTL ? xMax : xMin,\n dEndValue: isRTL ? xMin : xMax,\n rStartValue: _margins.left! + (isRTL ? 0 : shiftX),\n rEndValue: containerWidth - _margins.right! - (isRTL ? shiftX : 0),\n };\n },\n [],\n );\n\n const _adjustProps = (): void => {\n _barHeight.current = Math.max(props.barHeight || 24, 1);\n\n if (props.data && props.data.length > 0) {\n _xAxisType.current = getTypeOfAxis(props.data[0].x.start, true) as XAxisTypes;\n _yAxisType.current = getTypeOfAxis(props.data[0].y, false) as YAxisType;\n }\n\n _yAxisPadding.current = getScalePadding(props.yAxisPadding, undefined, 1 / 2);\n };\n\n const _getMargins = React.useCallback((_margins: IMargins) => {\n margins.current = _margins;\n }, []);\n\n const _renderContentForOnlyBars = (point: IGanttChartDataPoint): React.JSX.Element => {\n return (\n <ChartHoverCard\n XValue={point.yAxisCalloutData || point.y.toString()}\n Legend={point.legend}\n YValue={point.xAxisCalloutData || _getFormattedXValue(point)}\n color={point.color}\n culture={props.culture}\n />\n );\n };\n\n const _renderCallout = (point?: IGanttChartDataPoint): React.JSX.Element | null => {\n return point ? _renderContentForOnlyBars(point) : null;\n };\n\n const _getCustomizedCallout = () => {\n return props.onRenderCalloutPerDataPoint\n ? props.onRenderCalloutPerDataPoint(dataPointCalloutProps, _renderCallout)\n : null;\n };\n\n const _getFormattedXValue = React.useCallback(\n (point: IGanttChartDataPoint): string => {\n let formattedStartX: string;\n let formattedEndX: string;\n\n if (_xAxisType.current === XAxisTypes.DateAxis) {\n formattedStartX = formatDateToLocaleString(\n point.x.start as Date,\n props.culture,\n useUTC,\n false,\n _dateFormatOptions,\n );\n formattedEndX = formatDateToLocaleString(point.x.end as Date, props.culture, useUTC, false, _dateFormatOptions);\n } else {\n formattedStartX = point.x.start.toString();\n formattedEndX = point.x.end.toString();\n }\n\n return `${formattedStartX} - ${formattedEndX}`;\n },\n [props.culture, useUTC, _dateFormatOptions],\n );\n\n const _getAriaLabel = React.useCallback(\n (point: IGanttChartDataPoint): string => {\n const xValue = point.xAxisCalloutData || _getFormattedXValue(point);\n const yValue = point.yAxisCalloutData || point.y;\n return point.callOutAccessibilityData?.ariaLabel || `${yValue}. ` + `${xValue}.`;\n },\n [_getFormattedXValue],\n );\n\n const _getHighlightedLegend = React.useCallback(() => {\n return selectedLegends.length > 0 ? selectedLegends : hoveredLegend ? [hoveredLegend] : [];\n }, [hoveredLegend, selectedLegends]);\n\n /**\n * This function checks if the given legend is highlighted or not.\n * A legend can be highlighted in 2 ways:\n * 1. selection: if the user clicks on it\n * 2. hovering: if there is no selected legend and the user hovers over it\n */\n const _legendHighlighted = React.useCallback(\n (legend: string | undefined) => {\n return _getHighlightedLegend().includes(`${legend}`);\n },\n [_getHighlightedLegend],\n );\n\n /**\n * This function checks if none of the legends is selected or hovered.\n */\n const _noLegendHighlighted = React.useCallback(() => {\n return _getHighlightedLegend().length === 0;\n }, [_getHighlightedLegend]);\n\n const _showCallout = React.useCallback(\n (target: SVGElement, point: IGanttChartDataPoint) => {\n if (!(_noLegendHighlighted() || _legendHighlighted(point.legend)) || _calloutAnchorPoint.current === point) {\n return;\n }\n\n _calloutAnchorPoint.current = point;\n setCalloutTarget(target);\n setCalloutVisible(true);\n setCalloutLegend(point.legend!);\n setCalloutColor(point.color!);\n setXCalloutValue(point.yAxisCalloutData || point.y.toString());\n setYCalloutValue(point.xAxisCalloutData! || _getFormattedXValue(point));\n setDataPointCalloutProps(point);\n },\n [_getFormattedXValue, _legendHighlighted, _noLegendHighlighted],\n );\n\n const _onBarFocus = React.useCallback(\n (point: IGanttChartDataPoint, focusEvent: React.FocusEvent<SVGElement>): void => {\n _showCallout(focusEvent.currentTarget, point);\n },\n [_showCallout],\n );\n\n const _onBarHover = React.useCallback(\n (point: IGanttChartDataPoint, mouseEvent: React.MouseEvent<SVGElement>): void => {\n _showCallout(mouseEvent.currentTarget, point);\n },\n [_showCallout],\n );\n\n const _createBars = React.useCallback(\n (xScale: DateScale | NumberScale, yScale: NumberScale | StringScale): React.JSX.Element[] => {\n const bars = _points.map((point: IGanttChartDataPoint, index: number) => {\n const shouldHighlight = _noLegendHighlighted() || _legendHighlighted(point.legend);\n\n let startColor = point.color!;\n let endColor = startColor;\n if (props.enableGradient) {\n startColor = point.gradient![0];\n endColor = point.gradient![1];\n }\n const gradientId = `${_gradientId.current}_${index}`;\n\n const startX = xScale(point.x.start);\n const endX = xScale(point.x.end);\n const y =\n (_yAxisType.current === YAxisType.StringAxis\n ? (yScale as StringScale)(point.y as string)! + (yScale as StringScale).bandwidth() / 2\n : (yScale as NumberScale)(point.y as number)) -\n _barHeight.current / 2;\n\n return (\n <React.Fragment key={index}>\n {props.enableGradient && (\n <defs>\n <linearGradient id={gradientId}>\n <stop offset=\"0\" stopColor={startColor} />\n <stop offset=\"100%\" stopColor={endColor} />\n </linearGradient>\n </defs>\n )}\n <rect\n x={Math.min(startX, endX)}\n y={y}\n width={Math.abs(endX - startX)}\n height={_barHeight.current}\n rx={props.roundCorners ? 3 : 0}\n fill={props.enableGradient ? `url(#${gradientId})` : startColor}\n opacity={shouldHighlight ? 1 : 0.1}\n onClick={point.onClick}\n onMouseOver={event => _onBarHover(point, event)}\n onMouseLeave={_onBarLeave}\n onFocus={event => _onBarFocus(point, event)}\n onBlur={_onBarLeave}\n data-is-focusable={shouldHighlight}\n role=\"img\"\n aria-label={_getAriaLabel(point)}\n />\n </React.Fragment>\n );\n });\n return bars;\n },\n [\n _getAriaLabel,\n _legendHighlighted,\n _noLegendHighlighted,\n _onBarFocus,\n _onBarHover,\n props.enableGradient,\n props.roundCorners,\n _points,\n ],\n );\n\n const _getGraphData = React.useCallback(\n (\n xScale: DateScale | NumberScale,\n yScale: NumberScale | StringScale,\n containerHeight: number,\n containerWidth: number,\n xAxisElement: SVGElement | null,\n yAxisElement: SVGElement | null,\n ) => {\n return (_bars.current = _createBars(xScale, yScale));\n },\n [_createBars],\n );\n\n const _onBarLeave = (): void => {\n // do nothing\n };\n\n const _handleChartMouseLeave = React.useCallback((): void => {\n _calloutAnchorPoint.current = null;\n setCalloutTarget(null);\n setCalloutVisible(false);\n setCalloutLegend('');\n setCalloutColor('');\n setXCalloutValue('');\n setYCalloutValue('');\n setDataPointCalloutProps(undefined);\n }, []);\n\n const _closeCallout = () => {\n setCalloutVisible(false);\n };\n\n const _onLegendHover = (legend: string): void => {\n setHoveredLegend(legend);\n };\n\n const _onLegendLeave = (): void => {\n setHoveredLegend('');\n };\n\n const _getLegendData = (): React.JSX.Element => {\n const actions: ILegend[] = [];\n\n Object.keys(_legendColorMap.current).forEach((legendTitle: string) => {\n const legend: ILegend = {\n title: legendTitle,\n color: _legendColorMap.current[legendTitle][0],\n hoverAction: () => {\n _handleChartMouseLeave();\n _onLegendHover(legendTitle);\n },\n onMouseOutAction: () => {\n _onLegendLeave();\n },\n };\n\n actions.push(legend);\n });\n\n const legends = (\n <Legends\n legends={actions}\n enabledWrapLines={props.enabledLegendsWrapLines}\n overflowProps={props.legendsOverflowProps}\n focusZonePropsInHoverCard={props.focusZonePropsForLegendsInHoverCard}\n overflowText={props.legendsOverflowText}\n onChange={_onLegendSelectionChange}\n ref={_legendsRef}\n {...props.legendProps}\n />\n );\n return legends;\n };\n\n const _onLegendSelectionChange = (\n _selectedLegends: string[],\n event: React.MouseEvent<HTMLButtonElement>,\n currentLegend?: ILegend,\n ): void => {\n if (props.legendProps?.canSelectMultipleLegends) {\n setSelectedLegends(_selectedLegends);\n } else {\n setSelectedLegends(_selectedLegends.slice(-1));\n }\n if (props.legendProps?.onChange) {\n props.legendProps.onChange(_selectedLegends, event, currentLegend);\n }\n };\n\n const _getChartTitle = (): string => {\n const { chartTitle } = props;\n return (chartTitle ? `${chartTitle}. ` : '') + `Gantt chart with ${_points.length} bars. `;\n };\n\n const _isChartEmpty = (): boolean => {\n return !(props.data && props.data.length > 0);\n };\n\n const _getYDomainMargins = React.useCallback(\n (containerHeight: number): IMargins => {\n _domainMargin.current = MIN_DOMAIN_MARGIN;\n\n const ySet = new Set<string | number>();\n _points.forEach((point: IGanttChartDataPoint) => {\n ySet.add(point.y);\n });\n const uniqueY = Array.from(ySet);\n\n /** Total height available to render the bars */\n const totalHeight =\n containerHeight - (margins.current.top! + MIN_DOMAIN_MARGIN) - (margins.current.bottom! + MIN_DOMAIN_MARGIN);\n\n if (_yAxisType.current !== YAxisType.StringAxis) {\n _barHeight.current = Math.max(\n props.barHeight ||\n calculateAppropriateBarWidth(uniqueY as number[] | Date[], totalHeight, _yAxisPadding.current),\n 1,\n );\n _domainMargin.current += _barHeight.current / 2;\n }\n\n return {\n ...margins.current,\n top: margins.current.top! + _domainMargin.current,\n bottom: margins.current.bottom! + _domainMargin.current,\n };\n },\n [props.barHeight, _points],\n );\n\n const _getOrderedYAxisLabels = () => {\n return sortAxisCategories(_mapCategoryToValues(), yAxisCategoryOrder);\n };\n\n const _mapCategoryToValues = () => {\n const categoryToValues: Record<string, number[]> = {};\n _points.forEach(point => {\n if (!categoryToValues[point.y]) {\n categoryToValues[point.y] = [];\n }\n // FIXME\n // categoryToValues[point.y].push(point.x.end - point.x.start);\n });\n return categoryToValues;\n };\n\n const _renderBars = React.useCallback(() => {\n return <g>{_bars.current}</g>;\n }, []);\n\n if (!_isChartEmpty()) {\n _adjustProps();\n\n const yAxisLabels = _getOrderedYAxisLabels();\n const legendBars: React.JSX.Element = _getLegendData();\n const calloutProps = {\n isCalloutVisible,\n directionalHint: DirectionalHint.topAutoEdge,\n id: `toolTip${_calloutId.current}`,\n target: calloutTarget,\n isBeakVisible: false,\n gapSpace: 15,\n color: calloutColor,\n legend: calloutLegend,\n XValue: xCalloutValue,\n YValue: yCalloutValue,\n onDismiss: _closeCallout,\n preventDismissOnLostFocus: true,\n ...props.calloutProps,\n };\n const tickParams = {\n tickValues: props.tickValues,\n tickFormat: props.tickFormat,\n };\n\n return (\n <CartesianChart\n {...props}\n yAxisPadding={_yAxisPadding.current}\n chartTitle={_getChartTitle()}\n points={_points}\n chartType={ChartTypes.GanttChart}\n xAxisType={_xAxisType.current}\n yAxisType={_yAxisType.current}\n stringDatasetForYAxisDomain={yAxisLabels}\n calloutProps={calloutProps}\n tickParams={tickParams}\n legendBars={legendBars}\n createYAxis={createYAxisForHorizontalBarChartWithAxis}\n getDomainNRangeValues={_getDomainNRangeValues}\n createStringYAxis={createStringYAxisForHorizontalBarChartWithAxis}\n getMinMaxOfYAxis={findHBCWANumericMinMaxOfY}\n focusZoneDirection={FocusZoneDirection.vertical}\n customizedCallout={_getCustomizedCallout()}\n getmargins={_getMargins}\n getYDomainMargins={_getYDomainMargins}\n getGraphData={_getGraphData}\n onChartMouseLeave={_handleChartMouseLeave}\n ref={_cartesianChartRef}\n useUTC={useUTC}\n children={_renderBars}\n />\n );\n } else {\n return (\n <div\n id={_emptyChartId.current}\n role={'alert'}\n style={{ opacity: '0' }}\n aria-label={'Graph has no data to display'}\n />\n );\n }\n});\n\nGanttChartBase.displayName = 'GanttChart';\n"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
define(["require", "exports", "@fluentui/react/lib/Utilities", "./GanttChart.base", "./GanttChart.styles"], function (require, exports, Utilities_1, GanttChart_base_1, GanttChart_styles_1) {
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.GanttChart = void 0;
|
|
5
|
+
// Create a GanttChart variant which uses these default styles and this styled subcomponent.
|
|
6
|
+
/**
|
|
7
|
+
* GanttChart component.
|
|
8
|
+
* {@docCategory GanttChart}
|
|
9
|
+
*/
|
|
10
|
+
exports.GanttChart = (0, Utilities_1.styled)(GanttChart_base_1.GanttChartBase, GanttChart_styles_1.getStyles);
|
|
11
|
+
});
|
|
12
|
+
//# sourceMappingURL=GanttChart.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GanttChart.js","sourceRoot":"../src/","sources":["components/GanttChart/GanttChart.tsx"],"names":[],"mappings":";;;;IAMA,4FAA4F;IAC5F;;;OAGG;IACU,QAAA,UAAU,GAA8C,IAAA,kBAAM,EAIzE,gCAAc,EAAE,6BAAS,CAAC,CAAC","sourcesContent":["import * as React from 'react';\nimport { styled } from '@fluentui/react/lib/Utilities';\nimport { IGanttChartProps, IGanttChartStyleProps, IGanttChartStyles } from '../../index';\nimport { GanttChartBase } from './GanttChart.base';\nimport { getStyles } from './GanttChart.styles';\n\n// Create a GanttChart variant which uses these default styles and this styled subcomponent.\n/**\n * GanttChart component.\n * {@docCategory GanttChart}\n */\nexport const GanttChart: React.FunctionComponent<IGanttChartProps> = styled<\n IGanttChartProps,\n IGanttChartStyleProps,\n IGanttChartStyles\n>(GanttChartBase, getStyles);\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
define(["require", "exports"], function (require, exports) {
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.getStyles = void 0;
|
|
5
|
+
var getStyles = function (props) {
|
|
6
|
+
return {};
|
|
7
|
+
};
|
|
8
|
+
exports.getStyles = getStyles;
|
|
9
|
+
});
|
|
10
|
+
//# sourceMappingURL=GanttChart.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GanttChart.styles.js","sourceRoot":"../src/","sources":["components/GanttChart/GanttChart.styles.ts"],"names":[],"mappings":";;;;IAEO,IAAM,SAAS,GAAG,UAAC,KAA4B;QACpD,OAAO,EAAE,CAAC;IACZ,CAAC,CAAC;IAFW,QAAA,SAAS,aAEpB","sourcesContent":["import { IGanttChartStyleProps, IGanttChartStyles } from '../../index';\n\nexport const getStyles = (props: IGanttChartStyleProps): IGanttChartStyles => {\n return {};\n};\n"]}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { IRenderFunction, IStyleFunctionOrObject } from '@fluentui/react/lib/Utilities';
|
|
2
|
+
import { ICartesianChartProps, ICartesianChartStyleProps, ICartesianChartStyles, IGanttChartDataPoint } from '../../index';
|
|
3
|
+
/**
|
|
4
|
+
* Gantt Chart properties
|
|
5
|
+
* {@docCategory GanttChart}
|
|
6
|
+
*/
|
|
7
|
+
export interface IGanttChartProps extends ICartesianChartProps {
|
|
8
|
+
/**
|
|
9
|
+
* Data to render in the chart.
|
|
10
|
+
*/
|
|
11
|
+
data?: IGanttChartDataPoint[];
|
|
12
|
+
/**
|
|
13
|
+
* Define a custom callout renderer for a data point.
|
|
14
|
+
*/
|
|
15
|
+
onRenderCalloutPerDataPoint?: IRenderFunction<IGanttChartDataPoint>;
|
|
16
|
+
/**
|
|
17
|
+
* Width of each bar in the chart.
|
|
18
|
+
*/
|
|
19
|
+
barHeight?: number;
|
|
20
|
+
/**
|
|
21
|
+
* chart title for the chart
|
|
22
|
+
*/
|
|
23
|
+
chartTitle?: string;
|
|
24
|
+
/**
|
|
25
|
+
* Call to provide customized styling that will layer on top of the variant rules.
|
|
26
|
+
*/
|
|
27
|
+
styles?: IStyleFunctionOrObject<IGanttChartStyleProps, IGanttChartStyles>;
|
|
28
|
+
/**
|
|
29
|
+
* The prop used to define the culture to localized the numbers
|
|
30
|
+
*/
|
|
31
|
+
culture?: string;
|
|
32
|
+
/**
|
|
33
|
+
* it's padding between bar's or lines in the graph
|
|
34
|
+
*/
|
|
35
|
+
yAxisPadding?: number;
|
|
36
|
+
/**
|
|
37
|
+
*@default false
|
|
38
|
+
*Used for to elipse y axis labes and show tooltip on x axis labels
|
|
39
|
+
*/
|
|
40
|
+
showYAxisLablesTooltip?: boolean;
|
|
41
|
+
/**
|
|
42
|
+
*@default false
|
|
43
|
+
*Used for showing complete y axis lables */
|
|
44
|
+
showYAxisLables?: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* @default false
|
|
47
|
+
* The prop used to enable gradient fill color for the chart.
|
|
48
|
+
*/
|
|
49
|
+
enableGradient?: boolean;
|
|
50
|
+
/**
|
|
51
|
+
* @default false
|
|
52
|
+
* The prop used to enable rounded corners for the bars.
|
|
53
|
+
*/
|
|
54
|
+
roundCorners?: boolean;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Gantt Chart style properties
|
|
58
|
+
* {@docCategory GanttChart}
|
|
59
|
+
*/
|
|
60
|
+
export interface IGanttChartStyleProps extends ICartesianChartStyleProps {
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Gantt Chart styles
|
|
64
|
+
* {@docCategory GanttChart}
|
|
65
|
+
*/
|
|
66
|
+
export interface IGanttChartStyles extends ICartesianChartStyles {
|
|
67
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GanttChart.types.js","sourceRoot":"../src/","sources":["components/GanttChart/GanttChart.types.ts"],"names":[],"mappings":"","sourcesContent":["import { IRenderFunction, IStyleFunctionOrObject } from '@fluentui/react/lib/Utilities';\nimport {\n ICartesianChartProps,\n ICartesianChartStyleProps,\n ICartesianChartStyles,\n IGanttChartDataPoint,\n} from '../../index';\n\n/**\n * Gantt Chart properties\n * {@docCategory GanttChart}\n */\nexport interface IGanttChartProps extends ICartesianChartProps {\n /**\n * Data to render in the chart.\n */\n data?: IGanttChartDataPoint[];\n\n /**\n * Define a custom callout renderer for a data point.\n */\n onRenderCalloutPerDataPoint?: IRenderFunction<IGanttChartDataPoint>;\n\n /**\n * Width of each bar in the chart.\n */\n barHeight?: number;\n\n /**\n * chart title for the chart\n */\n chartTitle?: string;\n\n /**\n * Call to provide customized styling that will layer on top of the variant rules.\n */\n styles?: IStyleFunctionOrObject<IGanttChartStyleProps, IGanttChartStyles>;\n\n /**\n * The prop used to define the culture to localized the numbers\n */\n culture?: string;\n\n /**\n * it's padding between bar's or lines in the graph\n */\n yAxisPadding?: number;\n\n /**\n *@default false\n *Used for to elipse y axis labes and show tooltip on x axis labels\n */\n showYAxisLablesTooltip?: boolean;\n\n /**\n *@default false\n *Used for showing complete y axis lables */\n showYAxisLables?: boolean;\n\n /**\n * @default false\n * The prop used to enable gradient fill color for the chart.\n */\n enableGradient?: boolean;\n\n /**\n * @default false\n * The prop used to enable rounded corners for the bars.\n */\n roundCorners?: boolean;\n}\n\n/**\n * Gantt Chart style properties\n * {@docCategory GanttChart}\n */\nexport interface IGanttChartStyleProps extends ICartesianChartStyleProps {}\n\n/**\n * Gantt Chart styles\n * {@docCategory GanttChart}\n */\nexport interface IGanttChartStyles extends ICartesianChartStyles {}\n"]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
define(["require", "exports", "tslib", "./GanttChart", "./GanttChart.types"], function (require, exports, tslib_1, GanttChart_1, GanttChart_types_1) {
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
tslib_1.__exportStar(GanttChart_1, exports);
|
|
5
|
+
tslib_1.__exportStar(GanttChart_types_1, exports);
|
|
6
|
+
});
|
|
7
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"../src/","sources":["components/GanttChart/index.ts"],"names":[],"mappings":";;;IAAA,4CAA6B;IAC7B,kDAAmC","sourcesContent":["export * from './GanttChart';\nexport * from './GanttChart.types';\n"]}
|
|
@@ -855,7 +855,7 @@ define(["require", "exports", "tslib", "react", "d3-selection", "d3-array", "../
|
|
|
855
855
|
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
856
856
|
LineChartBase.prototype._createLines = function (xElement, containerHeight) {
|
|
857
857
|
var _this_1 = this;
|
|
858
|
-
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
|
|
858
|
+
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;
|
|
859
859
|
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
860
860
|
var lines = [];
|
|
861
861
|
if (this.state.isSelectedLegend) {
|
|
@@ -888,7 +888,7 @@ define(["require", "exports", "tslib", "react", "d3-selection", "d3-array", "../
|
|
|
888
888
|
var yPadding = this_1._points[i].useSecondaryYScale && this_1._yScaleSecondary ? this_1._yPaddingSecondary : this_1._yPaddingPrimary;
|
|
889
889
|
var extraMaxPixels = this_1._hasMarkersMode ? this_1._getRangeForScatterMarkerSize(yScale, yPadding) : 0;
|
|
890
890
|
if (this_1._points[i].data.length === 1) {
|
|
891
|
-
var
|
|
891
|
+
var _18 = this_1._points[i].data[0], x1_1 = _18.x, y1 = _18.y, xAxisCalloutData_1 = _18.xAxisCalloutData, xAxisCalloutAccessibilityData_1 = _18.xAxisCalloutAccessibilityData;
|
|
892
892
|
var circleId_1 = "".concat(this_1._circleId, "_").concat(i);
|
|
893
893
|
var isLegendSelected = this_1._legendHighlighted(legendVal) || this_1._noLegendHighlighted() || this_1.state.isSelectedLegend;
|
|
894
894
|
var currentMarkerSize = this_1._points[i].data[0].markerSize;
|
|
@@ -953,8 +953,8 @@ define(["require", "exports", "tslib", "react", "d3-selection", "d3-array", "../
|
|
|
953
953
|
var lineId = "".concat(this_1._lineId, "_").concat(i, "_").concat(j);
|
|
954
954
|
var borderId = "".concat(this_1._borderId, "_").concat(i, "_").concat(j);
|
|
955
955
|
var circleId = "".concat(this_1._circleId, "_").concat(i, "_").concat(j);
|
|
956
|
-
var
|
|
957
|
-
var
|
|
956
|
+
var _19 = this_1._points[i].data[j - 1], x1 = _19.x, y1 = _19.y, xAxisCalloutData = _19.xAxisCalloutData, xAxisCalloutAccessibilityData = _19.xAxisCalloutAccessibilityData;
|
|
957
|
+
var _20 = this_1._points[i].data[j], x2 = _20.x, y2 = _20.y;
|
|
958
958
|
var path = this_1._getPath(this_1._xAxisScale(x1), yScale(y1), circleId, j, false, this_1._points[i].index);
|
|
959
959
|
var strokeWidth = ((_s = this_1._points[i].lineOptions) === null || _s === void 0 ? void 0 : _s.strokeWidth) || this_1.props.strokeWidth || DEFAULT_LINE_STROKE_SIZE;
|
|
960
960
|
var isLegendSelected = this_1._legendHighlighted(legendVal) || this_1._noLegendHighlighted() || this_1.state.isSelectedLegend;
|
|
@@ -975,7 +975,7 @@ define(["require", "exports", "tslib", "react", "d3-selection", "d3-array", "../
|
|
|
975
975
|
var hiddenHoverCircleId = "".concat(circleId).concat(j, "D");
|
|
976
976
|
var lastPointHidden = this_1._points[i].hideNonActiveDots && activePoint !== lastCircleId_1;
|
|
977
977
|
path = this_1._getPath(this_1._xAxisScale(x2), yScale(y2), lastCircleId_1, j, true, this_1._points[i].index);
|
|
978
|
-
var
|
|
978
|
+
var _21 = this_1._points[i].data[j], lastCirlceXCallout_1 = _21.xAxisCalloutData, lastCirlceXCalloutAccessibilityData_1 = _21.xAxisCalloutAccessibilityData;
|
|
979
979
|
currentMarkerSize = this_1._points[i].data[j].markerSize;
|
|
980
980
|
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');
|
|
981
981
|
var lastText = this_1._points[i].data[j].text;
|
|
@@ -1029,12 +1029,7 @@ define(["require", "exports", "tslib", "react", "d3-selection", "d3-array", "../
|
|
|
1029
1029
|
xAxisScale: this_1._xAxisScale,
|
|
1030
1030
|
yAxisScale: yScale,
|
|
1031
1031
|
className: classNames.markerLabel || '',
|
|
1032
|
-
|
|
1033
|
-
? {
|
|
1034
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1035
|
-
originXOffset: (_18 = this_1._points[i].lineOptions) === null || _18 === void 0 ? void 0 : _18.originXOffset,
|
|
1036
|
-
}
|
|
1037
|
-
: undefined,
|
|
1032
|
+
lineOptions: (_17 = this_1._points[i]) === null || _17 === void 0 ? void 0 : _17.lineOptions,
|
|
1038
1033
|
}));
|
|
1039
1034
|
}
|
|
1040
1035
|
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.") },
|