@fluentui/react-charting 5.24.9 → 5.24.10
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 +28 -1
- package/CHANGELOG.md +13 -2
- package/dist/react-charting.d.ts +149 -0
- package/dist/react-charting.js +1 -1
- package/dist/react-charting.min.js +1 -1
- package/etc/react-charting.api.md +40 -0
- package/lib/FunnelChart.d.ts +1 -0
- package/lib/FunnelChart.js +2 -0
- package/lib/FunnelChart.js.map +1 -0
- package/lib/components/DeclarativeChart/DeclarativeChart.js +7 -1
- package/lib/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
- package/lib/components/DeclarativeChart/PlotlySchemaAdapter.d.ts +2 -0
- package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js +120 -0
- package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
- package/lib/components/FunnelChart/FunnelChart.base.d.ts +3 -0
- package/lib/components/FunnelChart/FunnelChart.base.js +264 -0
- package/lib/components/FunnelChart/FunnelChart.base.js.map +1 -0
- package/lib/components/FunnelChart/FunnelChart.d.ts +7 -0
- package/lib/components/FunnelChart/FunnelChart.js +9 -0
- package/lib/components/FunnelChart/FunnelChart.js.map +1 -0
- package/lib/components/FunnelChart/FunnelChart.styles.d.ts +2 -0
- package/lib/components/FunnelChart/FunnelChart.styles.js +38 -0
- package/lib/components/FunnelChart/FunnelChart.styles.js.map +1 -0
- package/lib/components/FunnelChart/FunnelChart.types.d.ts +139 -0
- package/lib/components/FunnelChart/FunnelChart.types.js +2 -0
- package/lib/components/FunnelChart/FunnelChart.types.js.map +1 -0
- package/lib/components/FunnelChart/funnelGeometry.d.ts +77 -0
- package/lib/components/FunnelChart/funnelGeometry.js +194 -0
- package/lib/components/FunnelChart/funnelGeometry.js.map +1 -0
- package/lib/components/FunnelChart/index.d.ts +2 -0
- package/lib/components/FunnelChart/index.js +3 -0
- package/lib/components/FunnelChart/index.js.map +1 -0
- package/lib/components/HeatMapChart/HeatMapChart.base.d.ts +0 -1
- package/lib/components/HeatMapChart/HeatMapChart.base.js +2 -16
- package/lib/components/HeatMapChart/HeatMapChart.base.js.map +1 -1
- package/lib/components/LineChart/LineChart.base.d.ts +2 -0
- package/lib/components/LineChart/LineChart.base.js +17 -10
- package/lib/components/LineChart/LineChart.base.js.map +1 -1
- package/lib/components/LineChart/LineChart.types.d.ts +6 -0
- package/lib/components/LineChart/LineChart.types.js.map +1 -1
- package/lib/index.d.ts +2 -0
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -1
- package/lib/utilities/utilities.d.ts +3 -0
- package/lib/utilities/utilities.js +14 -0
- package/lib/utilities/utilities.js.map +1 -1
- package/lib-amd/FunnelChart.d.ts +1 -0
- package/lib-amd/FunnelChart.js +6 -0
- package/lib-amd/FunnelChart.js.map +1 -0
- package/lib-amd/components/DeclarativeChart/DeclarativeChart.js +6 -1
- package/lib-amd/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
- package/lib-amd/components/DeclarativeChart/PlotlySchemaAdapter.d.ts +2 -0
- package/lib-amd/components/DeclarativeChart/PlotlySchemaAdapter.js +122 -1
- package/lib-amd/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
- package/lib-amd/components/FunnelChart/FunnelChart.base.d.ts +3 -0
- package/lib-amd/components/FunnelChart/FunnelChart.base.js +258 -0
- package/lib-amd/components/FunnelChart/FunnelChart.base.js.map +1 -0
- package/lib-amd/components/FunnelChart/FunnelChart.d.ts +7 -0
- package/lib-amd/components/FunnelChart/FunnelChart.js +11 -0
- package/lib-amd/components/FunnelChart/FunnelChart.js.map +1 -0
- package/lib-amd/components/FunnelChart/FunnelChart.styles.d.ts +2 -0
- package/lib-amd/components/FunnelChart/FunnelChart.styles.js +43 -0
- package/lib-amd/components/FunnelChart/FunnelChart.styles.js.map +1 -0
- package/lib-amd/components/FunnelChart/FunnelChart.types.d.ts +139 -0
- package/lib-amd/components/FunnelChart/FunnelChart.types.js +5 -0
- package/lib-amd/components/FunnelChart/FunnelChart.types.js.map +1 -0
- package/lib-amd/components/FunnelChart/funnelGeometry.d.ts +77 -0
- package/lib-amd/components/FunnelChart/funnelGeometry.js +204 -0
- package/lib-amd/components/FunnelChart/funnelGeometry.js.map +1 -0
- package/lib-amd/components/FunnelChart/index.d.ts +2 -0
- package/lib-amd/components/FunnelChart/index.js +7 -0
- package/lib-amd/components/FunnelChart/index.js.map +1 -0
- package/lib-amd/components/HeatMapChart/HeatMapChart.base.d.ts +0 -1
- package/lib-amd/components/HeatMapChart/HeatMapChart.base.js +2 -15
- package/lib-amd/components/HeatMapChart/HeatMapChart.base.js.map +1 -1
- package/lib-amd/components/LineChart/LineChart.base.d.ts +2 -0
- package/lib-amd/components/LineChart/LineChart.base.js +17 -10
- package/lib-amd/components/LineChart/LineChart.base.js.map +1 -1
- package/lib-amd/components/LineChart/LineChart.types.d.ts +6 -0
- package/lib-amd/components/LineChart/LineChart.types.js.map +1 -1
- package/lib-amd/index.d.ts +2 -0
- package/lib-amd/index.js +3 -2
- package/lib-amd/index.js.map +1 -1
- package/lib-amd/utilities/utilities.d.ts +3 -0
- package/lib-amd/utilities/utilities.js +17 -2
- package/lib-amd/utilities/utilities.js.map +1 -1
- package/lib-commonjs/FunnelChart.d.ts +1 -0
- package/lib-commonjs/FunnelChart.js +5 -0
- package/lib-commonjs/FunnelChart.js.map +1 -0
- package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js +6 -0
- package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
- package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.d.ts +2 -0
- package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js +122 -1
- package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
- package/lib-commonjs/components/FunnelChart/FunnelChart.base.d.ts +3 -0
- package/lib-commonjs/components/FunnelChart/FunnelChart.base.js +267 -0
- package/lib-commonjs/components/FunnelChart/FunnelChart.base.js.map +1 -0
- package/lib-commonjs/components/FunnelChart/FunnelChart.d.ts +7 -0
- package/lib-commonjs/components/FunnelChart/FunnelChart.js +12 -0
- package/lib-commonjs/components/FunnelChart/FunnelChart.js.map +1 -0
- package/lib-commonjs/components/FunnelChart/FunnelChart.styles.d.ts +2 -0
- package/lib-commonjs/components/FunnelChart/FunnelChart.styles.js +42 -0
- package/lib-commonjs/components/FunnelChart/FunnelChart.styles.js.map +1 -0
- package/lib-commonjs/components/FunnelChart/FunnelChart.types.d.ts +139 -0
- package/lib-commonjs/components/FunnelChart/FunnelChart.types.js +3 -0
- package/lib-commonjs/components/FunnelChart/FunnelChart.types.js.map +1 -0
- package/lib-commonjs/components/FunnelChart/funnelGeometry.d.ts +77 -0
- package/lib-commonjs/components/FunnelChart/funnelGeometry.js +202 -0
- package/lib-commonjs/components/FunnelChart/funnelGeometry.js.map +1 -0
- package/lib-commonjs/components/FunnelChart/index.d.ts +2 -0
- package/lib-commonjs/components/FunnelChart/index.js +6 -0
- package/lib-commonjs/components/FunnelChart/index.js.map +1 -0
- package/lib-commonjs/components/HeatMapChart/HeatMapChart.base.d.ts +0 -1
- package/lib-commonjs/components/HeatMapChart/HeatMapChart.base.js +1 -15
- package/lib-commonjs/components/HeatMapChart/HeatMapChart.base.js.map +1 -1
- package/lib-commonjs/components/LineChart/LineChart.base.d.ts +2 -0
- package/lib-commonjs/components/LineChart/LineChart.base.js +17 -10
- package/lib-commonjs/components/LineChart/LineChart.base.js.map +1 -1
- package/lib-commonjs/components/LineChart/LineChart.types.d.ts +6 -0
- package/lib-commonjs/components/LineChart/LineChart.types.js.map +1 -1
- package/lib-commonjs/index.d.ts +2 -0
- package/lib-commonjs/index.js +3 -1
- package/lib-commonjs/index.js.map +1 -1
- package/lib-commonjs/utilities/utilities.d.ts +3 -0
- package/lib-commonjs/utilities/utilities.js +17 -1
- package/lib-commonjs/utilities/utilities.js.map +1 -1
- package/package.json +2 -2
- package/src/components/FunnelChart/FunnelChart.types.ts +153 -0
- package/src/components/LineChart/LineChart.types.ts +7 -0
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getSegmentTextProps = exports.getStackedVerticalFunnelSegmentGeometry = exports.getStackedHorizontalFunnelSegmentGeometry = exports.getVerticalFunnelSegmentGeometry = exports.getHorizontalFunnelSegmentGeometry = void 0;
|
|
4
|
+
function getHorizontalFunnelSegmentGeometry(_a) {
|
|
5
|
+
var d = _a.d, i = _a.i, data = _a.data, funnelWidth = _a.funnelWidth, funnelHeight = _a.funnelHeight, isRTL = _a.isRTL;
|
|
6
|
+
var segmentHeight = funnelHeight / data.length;
|
|
7
|
+
var widthScale = function (value) { return (value / Math.max.apply(Math, data.map(function (dataPoint) { return dataPoint.value; }))) * funnelWidth; };
|
|
8
|
+
var topWidth = widthScale(d.value);
|
|
9
|
+
var bottomWidth = i < data.length - 1 ? widthScale(data[i + 1].value) : 0;
|
|
10
|
+
var xOffset = (funnelWidth - topWidth) / 2;
|
|
11
|
+
var nextXOffset = (funnelWidth - bottomWidth) / 2;
|
|
12
|
+
var xStart = isRTL ? funnelWidth - xOffset : xOffset;
|
|
13
|
+
var xEnd = isRTL ? funnelWidth - nextXOffset : nextXOffset;
|
|
14
|
+
var isLastSegment = i === data.length - 1;
|
|
15
|
+
var textY = isLastSegment ? i * segmentHeight + segmentHeight * 0.33 : i * segmentHeight + segmentHeight / 2;
|
|
16
|
+
var textX = funnelWidth / 2;
|
|
17
|
+
var availableWidth = topWidth;
|
|
18
|
+
if (isLastSegment) {
|
|
19
|
+
var yFromTop = textY - i * segmentHeight;
|
|
20
|
+
var widthAtY = topWidth * (1 - yFromTop / segmentHeight);
|
|
21
|
+
availableWidth = Math.max(widthAtY * 0.8, 0);
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
availableWidth = Math.min(topWidth, bottomWidth) * 0.9;
|
|
25
|
+
}
|
|
26
|
+
var pathD = "M".concat(xStart, ",").concat(i * segmentHeight, "\n L").concat(funnelWidth - xStart, ",").concat(i * segmentHeight, "\n L").concat(funnelWidth - xEnd, ",").concat((i + 1) * segmentHeight, "\n L").concat(xEnd, ",").concat((i + 1) * segmentHeight, "\n Z");
|
|
27
|
+
return { pathD: pathD, textX: textX, textY: textY, availableWidth: availableWidth };
|
|
28
|
+
}
|
|
29
|
+
exports.getHorizontalFunnelSegmentGeometry = getHorizontalFunnelSegmentGeometry;
|
|
30
|
+
function getVerticalFunnelSegmentGeometry(_a) {
|
|
31
|
+
var d = _a.d, i = _a.i, data = _a.data, funnelWidth = _a.funnelWidth, funnelHeight = _a.funnelHeight, isRTL = _a.isRTL;
|
|
32
|
+
var segmentWidth = funnelWidth / data.length;
|
|
33
|
+
var heightScale = function (value) { return (value / Math.max.apply(Math, data.map(function (dataPoint) { return dataPoint.value; }))) * funnelHeight; };
|
|
34
|
+
var leftHeight = heightScale(d.value);
|
|
35
|
+
var rightHeight = i < data.length - 1 ? heightScale(data[i + 1].value) : 0;
|
|
36
|
+
var yOffset = (funnelHeight - leftHeight) / 2;
|
|
37
|
+
var nextYOffset = (funnelHeight - rightHeight) / 2;
|
|
38
|
+
var x0 = i * segmentWidth;
|
|
39
|
+
var x1 = (i + 1) * segmentWidth;
|
|
40
|
+
var isLastSegment = i === data.length - 1;
|
|
41
|
+
var textX;
|
|
42
|
+
var textY;
|
|
43
|
+
var availableWidth = segmentWidth * 0.8;
|
|
44
|
+
if (isLastSegment) {
|
|
45
|
+
// For the triangular last segment, position text at 1/4 from the left edge
|
|
46
|
+
textX = x0 + (x1 - x0) * 0.25;
|
|
47
|
+
textY = funnelHeight / 2;
|
|
48
|
+
// For triangular segments, we need to check both height and width constraints
|
|
49
|
+
// The segment needs to be large enough to contain text
|
|
50
|
+
var segmentArea = (leftHeight * segmentWidth) / 2; // Area of triangle
|
|
51
|
+
var minAreaForText = 800; // Minimum area needed to show text
|
|
52
|
+
if (leftHeight < 40 || segmentArea < minAreaForText) {
|
|
53
|
+
// Hide text if height is too small or area is insufficient
|
|
54
|
+
availableWidth = 0;
|
|
55
|
+
}
|
|
56
|
+
else {
|
|
57
|
+
// Calculate available width at text position
|
|
58
|
+
var widthAtTextPosition = (x1 - x0) * 0.75;
|
|
59
|
+
availableWidth = widthAtTextPosition * 0.6;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
else {
|
|
63
|
+
textX = (x0 + x1) / 2;
|
|
64
|
+
textY = funnelHeight / 2;
|
|
65
|
+
var minHeight = Math.min(leftHeight, rightHeight);
|
|
66
|
+
availableWidth = minHeight > 20 ? segmentWidth * 0.8 : 0;
|
|
67
|
+
}
|
|
68
|
+
var pathD = "M".concat(x0, ",").concat(yOffset, "\n L").concat(x1, ",").concat(nextYOffset, "\n L").concat(x1, ",").concat(funnelHeight - nextYOffset, "\n L").concat(x0, ",").concat(funnelHeight - yOffset, "\n Z");
|
|
69
|
+
return { pathD: pathD, textX: textX, textY: textY, availableWidth: availableWidth };
|
|
70
|
+
}
|
|
71
|
+
exports.getVerticalFunnelSegmentGeometry = getVerticalFunnelSegmentGeometry;
|
|
72
|
+
function getStackedHorizontalFunnelSegmentGeometry(_a) {
|
|
73
|
+
var _b, _c;
|
|
74
|
+
var i = _a.i, k = _a.k, stages = _a.stages, totals = _a.totals, maxTotal = _a.maxTotal, funnelWidth = _a.funnelWidth, funnelHeight = _a.funnelHeight;
|
|
75
|
+
var segmentHeight = funnelHeight / stages.length;
|
|
76
|
+
var cur = stages[i];
|
|
77
|
+
var next = stages[i + 1] || { subValues: [] };
|
|
78
|
+
var curTotal = totals[i] || 1;
|
|
79
|
+
var nextTotal = totals[i + 1] || 0;
|
|
80
|
+
var cumTop = 0;
|
|
81
|
+
var cumBot = 0;
|
|
82
|
+
var _loop_1 = function (idx) {
|
|
83
|
+
var v_1 = cur.subValues[idx];
|
|
84
|
+
var vNext_1 = (_b = next.subValues) === null || _b === void 0 ? void 0 : _b.find(function (x) { return x.category === v_1.category; });
|
|
85
|
+
var val_1 = v_1.value;
|
|
86
|
+
var nextVal_1 = vNext_1 ? vNext_1.value : 0;
|
|
87
|
+
cumTop += (val_1 / curTotal) * (curTotal / maxTotal) * funnelWidth;
|
|
88
|
+
cumBot += (nextVal_1 / nextTotal || 0) * (nextTotal / maxTotal) * funnelWidth;
|
|
89
|
+
};
|
|
90
|
+
for (var idx = 0; idx < k; idx++) {
|
|
91
|
+
_loop_1(idx);
|
|
92
|
+
}
|
|
93
|
+
var v = cur.subValues[k];
|
|
94
|
+
var vNext = (_c = next.subValues) === null || _c === void 0 ? void 0 : _c.find(function (x) { return x.category === v.category; });
|
|
95
|
+
var val = v.value;
|
|
96
|
+
var nextVal = vNext ? vNext.value : 0;
|
|
97
|
+
var topW = (val / curTotal) * (curTotal / maxTotal) * funnelWidth;
|
|
98
|
+
var botW = (nextVal / nextTotal || 0) * (nextTotal / maxTotal) * funnelWidth;
|
|
99
|
+
var topStart = (funnelWidth - (curTotal / maxTotal) * funnelWidth) / 2 + cumTop;
|
|
100
|
+
var topEnd = topStart + topW;
|
|
101
|
+
var botStart = (funnelWidth - (nextTotal / maxTotal) * funnelWidth) / 2 + cumBot;
|
|
102
|
+
var botEnd = botStart + botW;
|
|
103
|
+
var textX = (topStart + topEnd + botStart + botEnd) / 4;
|
|
104
|
+
var isLastSegment = i === stages.length - 1;
|
|
105
|
+
var textY = isLastSegment ? i * segmentHeight + segmentHeight * 0.33 : (i + 0.5) * segmentHeight;
|
|
106
|
+
// Calculate available width based on this specific segment's width
|
|
107
|
+
var availableWidth;
|
|
108
|
+
if (isLastSegment) {
|
|
109
|
+
// For triangular last segment, use the width at text Y position
|
|
110
|
+
var yFromTop = textY - i * segmentHeight;
|
|
111
|
+
var widthRatio = 1 - yFromTop / segmentHeight;
|
|
112
|
+
availableWidth = topW * widthRatio;
|
|
113
|
+
}
|
|
114
|
+
else {
|
|
115
|
+
// For trapezoidal segments, use the actual segment width
|
|
116
|
+
availableWidth = Math.min(topW, botW);
|
|
117
|
+
}
|
|
118
|
+
var pathD = "M".concat(topStart, ",").concat(i * segmentHeight, "\n L").concat(topEnd, ",").concat(i * segmentHeight, "\n L").concat(botEnd, ",").concat((i + 1) * segmentHeight, "\n L").concat(botStart, ",").concat((i + 1) * segmentHeight, "\n Z");
|
|
119
|
+
return { pathD: pathD, textX: textX, textY: textY, availableWidth: availableWidth };
|
|
120
|
+
}
|
|
121
|
+
exports.getStackedHorizontalFunnelSegmentGeometry = getStackedHorizontalFunnelSegmentGeometry;
|
|
122
|
+
function getStackedVerticalFunnelSegmentGeometry(_a) {
|
|
123
|
+
var _b, _c;
|
|
124
|
+
var i = _a.i, k = _a.k, stages = _a.stages, totals = _a.totals, maxTotal = _a.maxTotal, funnelWidth = _a.funnelWidth, funnelHeight = _a.funnelHeight;
|
|
125
|
+
var segmentWidth = funnelWidth / stages.length;
|
|
126
|
+
var cur = stages[i];
|
|
127
|
+
var next = stages[i + 1] || { subValues: [] };
|
|
128
|
+
var curTotal = totals[i] || 1;
|
|
129
|
+
var nextTotal = totals[i + 1] || 0;
|
|
130
|
+
var cumTop = 0;
|
|
131
|
+
var cumBot = 0;
|
|
132
|
+
var _loop_2 = function (idx) {
|
|
133
|
+
var v_2 = cur.subValues[idx];
|
|
134
|
+
var vNext_2 = (_b = next.subValues) === null || _b === void 0 ? void 0 : _b.find(function (x) { return x.category === v_2.category; });
|
|
135
|
+
var val_2 = v_2.value;
|
|
136
|
+
var nextVal_2 = vNext_2 ? vNext_2.value : 0;
|
|
137
|
+
cumTop += (val_2 / curTotal) * (curTotal / maxTotal) * funnelHeight;
|
|
138
|
+
cumBot += (nextVal_2 / nextTotal || 0) * (nextTotal / maxTotal) * funnelHeight;
|
|
139
|
+
};
|
|
140
|
+
for (var idx = 0; idx < k; idx++) {
|
|
141
|
+
_loop_2(idx);
|
|
142
|
+
}
|
|
143
|
+
var v = cur.subValues[k];
|
|
144
|
+
var vNext = (_c = next.subValues) === null || _c === void 0 ? void 0 : _c.find(function (x) { return x.category === v.category; });
|
|
145
|
+
var val = v.value;
|
|
146
|
+
var nextVal = vNext ? vNext.value : 0;
|
|
147
|
+
var topH = (val / curTotal) * (curTotal / maxTotal) * funnelHeight;
|
|
148
|
+
var botH = (nextVal / nextTotal || 0) * (nextTotal / maxTotal) * funnelHeight;
|
|
149
|
+
var leftStart = i * segmentWidth;
|
|
150
|
+
var leftEnd = (i + 1) * segmentWidth;
|
|
151
|
+
var topStart = (funnelHeight - (curTotal / maxTotal) * funnelHeight) / 2 + cumTop;
|
|
152
|
+
var topEnd = topStart + topH;
|
|
153
|
+
var botStart = (funnelHeight - (nextTotal / maxTotal) * funnelHeight) / 2 + cumBot;
|
|
154
|
+
var botEnd = botStart + botH;
|
|
155
|
+
var isLastSegment = i === stages.length - 1;
|
|
156
|
+
var textX;
|
|
157
|
+
var textY;
|
|
158
|
+
var availableWidth;
|
|
159
|
+
if (isLastSegment) {
|
|
160
|
+
textX = leftStart + (leftEnd - leftStart) * 0.25;
|
|
161
|
+
textY = (topStart + topEnd) / 2;
|
|
162
|
+
// For triangular segments, calculate available width at text position
|
|
163
|
+
var segmentWidthAtTextPos = (leftEnd - leftStart) * 0.5;
|
|
164
|
+
availableWidth = segmentWidthAtTextPos * 0.8;
|
|
165
|
+
// For triangular last segments, also check if there's enough height
|
|
166
|
+
// The segment area should be large enough to contain text
|
|
167
|
+
var segmentArea = (topH * segmentWidth) / 2;
|
|
168
|
+
if (topH < 24 || segmentArea < 600) {
|
|
169
|
+
availableWidth = 0;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
else {
|
|
173
|
+
textX = (leftStart + leftEnd) / 2;
|
|
174
|
+
textY = (topStart + topEnd + botStart + botEnd) / 4;
|
|
175
|
+
// For trapezoidal segments, use full segment width
|
|
176
|
+
availableWidth = Math.abs(leftEnd - leftStart) * 0.9;
|
|
177
|
+
// Check if the segment has sufficient height for text
|
|
178
|
+
// For non-last segments, we need to ensure there's enough vertical space
|
|
179
|
+
var avgHeight = (topH + botH) / 2;
|
|
180
|
+
if (avgHeight < 20) {
|
|
181
|
+
availableWidth = 0;
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
var pathD = "M".concat(leftStart, ",").concat(topStart, "\n L").concat(leftEnd, ",").concat(botStart, "\n L").concat(leftEnd, ",").concat(botEnd, "\n L").concat(leftStart, ",").concat(topEnd, "\n Z");
|
|
185
|
+
return { pathD: pathD, textX: textX, textY: textY, availableWidth: availableWidth };
|
|
186
|
+
}
|
|
187
|
+
exports.getStackedVerticalFunnelSegmentGeometry = getStackedVerticalFunnelSegmentGeometry;
|
|
188
|
+
function getSegmentTextProps(_a) {
|
|
189
|
+
var availableWidth = _a.availableWidth, _b = _a.minTextWidth, minTextWidth = _b === void 0 ? 24 : _b, textX = _a.textX, textY = _a.textY, value = _a.value, culture = _a.culture, onMouseOver = _a.onMouseOver, onMouseMove = _a.onMouseMove, onMouseOut = _a.onMouseOut;
|
|
190
|
+
return {
|
|
191
|
+
show: availableWidth > minTextWidth && availableWidth > 0,
|
|
192
|
+
x: textX,
|
|
193
|
+
y: textY,
|
|
194
|
+
value: value,
|
|
195
|
+
culture: culture,
|
|
196
|
+
onMouseOver: onMouseOver,
|
|
197
|
+
onMouseMove: onMouseMove,
|
|
198
|
+
onMouseOut: onMouseOut,
|
|
199
|
+
};
|
|
200
|
+
}
|
|
201
|
+
exports.getSegmentTextProps = getSegmentTextProps;
|
|
202
|
+
//# sourceMappingURL=funnelGeometry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"funnelGeometry.js","sourceRoot":"../src/","sources":["components/FunnelChart/funnelGeometry.ts"],"names":[],"mappings":";;;AA2BA,SAAgB,kCAAkC,CAAC,EAclD;QAbC,CAAC,OAAA,EACD,CAAC,OAAA,EACD,IAAI,UAAA,EACJ,WAAW,iBAAA,EACX,YAAY,kBAAA,EACZ,KAAK,WAAA;IASL,IAAM,aAAa,GAAG,YAAY,GAAG,IAAI,CAAC,MAAM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,CAAC;IACH,CAAC;IAED,IAAM,KAAK,GAAG,WAAI,SAAS,cAAI,QAAQ,oBAClC,OAAO,cAAI,QAAQ,oBACnB,OAAO,cAAI,MAAM,oBACjB,SAAS,cAAI,MAAM,YACpB,CAAC;IACL,OAAO,EAAE,KAAK,OAAA,EAAE,KAAK,OAAA,EAAE,KAAK,OAAA,EAAE,cAAc,gBAAA,EAAE,CAAC;AACjD,CAAC;AApFD,0FAoFC;AAED,SAAgB,mBAAmB,CAAC,EAoBnC;QAnBC,cAAc,oBAAA,EACd,oBAAiB,EAAjB,YAAY,mBAAG,EAAE,KAAA,EACjB,KAAK,WAAA,EACL,KAAK,WAAA,EACL,KAAK,WAAA,EACL,OAAO,aAAA,EACP,WAAW,iBAAA,EACX,WAAW,iBAAA,EACX,UAAU,gBAAA;IAYV,OAAO;QACL,IAAI,EAAE,cAAc,GAAG,YAAY,IAAI,cAAc,GAAG,CAAC;QACzD,CAAC,EAAE,KAAK;QACR,CAAC,EAAE,KAAK;QACR,KAAK,OAAA;QACL,OAAO,SAAA;QACP,WAAW,aAAA;QACX,WAAW,aAAA;QACX,UAAU,YAAA;KACX,CAAC;AACJ,CAAC;AA/BD,kDA+BC","sourcesContent":["import * as React from 'react';\nimport { IFunnelChartDataPoint } from './FunnelChart.types';\n\nexport interface IFunnelSegmentGeometry {\n pathD: string;\n textX: number;\n textY: number;\n availableWidth: number;\n}\n\nexport interface IStackedFunnelSegmentGeometry {\n pathD: string;\n textX: number;\n textY: number;\n availableWidth: number;\n}\n\ninterface ISubValue {\n category: string;\n value: number;\n color: string;\n}\n\ninterface IStage {\n subValues: ISubValue[];\n}\n\nexport function getHorizontalFunnelSegmentGeometry({\n d,\n i,\n data,\n funnelWidth,\n funnelHeight,\n isRTL,\n}: {\n d: IFunnelChartDataPoint;\n i: number;\n data: IFunnelChartDataPoint[];\n funnelWidth: number;\n funnelHeight: number;\n isRTL: boolean;\n}): IFunnelSegmentGeometry {\n const segmentHeight = funnelHeight / data.length;\n const widthScale = (value: number) => (value / Math.max(...data.map(dataPoint => dataPoint.value!))) * funnelWidth;\n const topWidth = widthScale(d.value!);\n const bottomWidth = i < data.length - 1 ? widthScale(data[i + 1].value!) : 0;\n const xOffset = (funnelWidth - topWidth) / 2;\n const nextXOffset = (funnelWidth - bottomWidth) / 2;\n const xStart = isRTL ? funnelWidth - xOffset : xOffset;\n const xEnd = isRTL ? funnelWidth - nextXOffset : nextXOffset;\n\n const isLastSegment = i === data.length - 1;\n const textY = isLastSegment ? i * segmentHeight + segmentHeight * 0.33 : i * segmentHeight + segmentHeight / 2;\n\n const textX = funnelWidth / 2;\n let availableWidth = topWidth;\n if (isLastSegment) {\n const yFromTop = textY - i * segmentHeight;\n const widthAtY = topWidth * (1 - yFromTop / segmentHeight);\n availableWidth = Math.max(widthAtY * 0.8, 0);\n } else {\n availableWidth = Math.min(topWidth, bottomWidth) * 0.9;\n }\n const pathD = `M${xStart},${i * segmentHeight}\n L${funnelWidth - xStart},${i * segmentHeight}\n L${funnelWidth - xEnd},${(i + 1) * segmentHeight}\n L${xEnd},${(i + 1) * segmentHeight}\n Z`;\n return { pathD, textX, textY, availableWidth };\n}\n\nexport function getVerticalFunnelSegmentGeometry({\n d,\n i,\n data,\n funnelWidth,\n funnelHeight,\n isRTL,\n}: {\n d: IFunnelChartDataPoint;\n i: number;\n data: IFunnelChartDataPoint[];\n funnelWidth: number;\n funnelHeight: number;\n isRTL: boolean;\n}): IFunnelSegmentGeometry {\n const segmentWidth = funnelWidth / data.length;\n const heightScale = (value: number) => (value / Math.max(...data.map(dataPoint => dataPoint.value!))) * funnelHeight;\n const leftHeight = heightScale(d.value!);\n const rightHeight = i < data.length - 1 ? heightScale(data[i + 1].value!) : 0;\n const yOffset = (funnelHeight - leftHeight) / 2;\n const nextYOffset = (funnelHeight - rightHeight) / 2;\n const x0 = i * segmentWidth;\n const x1 = (i + 1) * segmentWidth;\n\n const isLastSegment = i === data.length - 1;\n let textX: number;\n let textY: number;\n let availableWidth = segmentWidth * 0.8;\n\n if (isLastSegment) {\n // For the triangular last segment, position text at 1/4 from the left edge\n textX = x0 + (x1 - x0) * 0.25;\n textY = funnelHeight / 2;\n\n // For triangular segments, we need to check both height and width constraints\n // The segment needs to be large enough to contain text\n const segmentArea = (leftHeight * segmentWidth) / 2; // Area of triangle\n const minAreaForText = 800; // Minimum area needed to show text\n\n if (leftHeight < 40 || segmentArea < minAreaForText) {\n // Hide text if height is too small or area is insufficient\n availableWidth = 0;\n } else {\n // Calculate available width at text position\n const widthAtTextPosition = (x1 - x0) * 0.75;\n availableWidth = widthAtTextPosition * 0.6;\n }\n } else {\n textX = (x0 + x1) / 2;\n textY = funnelHeight / 2;\n const minHeight = Math.min(leftHeight, rightHeight);\n availableWidth = minHeight > 20 ? segmentWidth * 0.8 : 0;\n }\n\n const pathD = `M${x0},${yOffset}\n L${x1},${nextYOffset}\n L${x1},${funnelHeight - nextYOffset}\n L${x0},${funnelHeight - yOffset}\n Z`;\n return { pathD, textX, textY, availableWidth };\n}\n\nexport function getStackedHorizontalFunnelSegmentGeometry({\n i,\n k,\n stages,\n totals,\n maxTotal,\n funnelWidth,\n funnelHeight,\n}: {\n i: number;\n k: number;\n stages: IStage[];\n totals: number[];\n maxTotal: number;\n funnelWidth: number;\n funnelHeight: number;\n}): IStackedFunnelSegmentGeometry {\n const segmentHeight = funnelHeight / stages.length;\n const cur = stages[i];\n const next = stages[i + 1] || { subValues: [] };\n const curTotal = totals[i] || 1;\n const nextTotal = totals[i + 1] || 0;\n\n let cumTop = 0;\n let cumBot = 0;\n for (let idx = 0; idx < k; idx++) {\n const v = cur.subValues[idx];\n const vNext = next.subValues?.find((x: ISubValue) => x.category === v.category);\n const val = v.value;\n const nextVal = vNext ? vNext.value : 0;\n cumTop += (val / curTotal) * (curTotal / maxTotal) * funnelWidth;\n cumBot += (nextVal / nextTotal || 0) * (nextTotal / maxTotal) * funnelWidth;\n }\n const v = cur.subValues[k];\n const vNext = next.subValues?.find((x: ISubValue) => x.category === v.category);\n const val = v.value;\n const nextVal = vNext ? vNext.value : 0;\n const topW = (val / curTotal) * (curTotal / maxTotal) * funnelWidth;\n const botW = (nextVal / nextTotal || 0) * (nextTotal / maxTotal) * funnelWidth;\n const topStart = (funnelWidth - (curTotal / maxTotal) * funnelWidth) / 2 + cumTop;\n const topEnd = topStart + topW;\n const botStart = (funnelWidth - (nextTotal / maxTotal) * funnelWidth) / 2 + cumBot;\n const botEnd = botStart + botW;\n const textX = (topStart + topEnd + botStart + botEnd) / 4;\n\n const isLastSegment = i === stages.length - 1;\n const textY = isLastSegment ? i * segmentHeight + segmentHeight * 0.33 : (i + 0.5) * segmentHeight;\n\n // Calculate available width based on this specific segment's width\n let availableWidth: number;\n if (isLastSegment) {\n // For triangular last segment, use the width at text Y position\n const yFromTop = textY - i * segmentHeight;\n const widthRatio = 1 - yFromTop / segmentHeight;\n availableWidth = topW * widthRatio;\n } else {\n // For trapezoidal segments, use the actual segment width\n availableWidth = Math.min(topW, botW);\n }\n\n const pathD = `M${topStart},${i * segmentHeight}\n L${topEnd},${i * segmentHeight}\n L${botEnd},${(i + 1) * segmentHeight}\n L${botStart},${(i + 1) * segmentHeight}\n Z`;\n return { pathD, textX, textY, availableWidth };\n}\n\nexport function getStackedVerticalFunnelSegmentGeometry({\n i,\n k,\n stages,\n totals,\n maxTotal,\n funnelWidth,\n funnelHeight,\n}: {\n i: number;\n k: number;\n stages: IStage[];\n totals: number[];\n maxTotal: number;\n funnelWidth: number;\n funnelHeight: number;\n}): IStackedFunnelSegmentGeometry {\n const segmentWidth = funnelWidth / stages.length;\n const cur = stages[i];\n const next = stages[i + 1] || { subValues: [] };\n const curTotal = totals[i] || 1;\n const nextTotal = totals[i + 1] || 0;\n\n let cumTop = 0;\n let cumBot = 0;\n for (let idx = 0; idx < k; idx++) {\n const v = cur.subValues[idx];\n const vNext = next.subValues?.find((x: ISubValue) => x.category === v.category);\n const val = v.value;\n const nextVal = vNext ? vNext.value : 0;\n cumTop += (val / curTotal) * (curTotal / maxTotal) * funnelHeight;\n cumBot += (nextVal / nextTotal || 0) * (nextTotal / maxTotal) * funnelHeight;\n }\n const v = cur.subValues[k];\n const vNext = next.subValues?.find((x: ISubValue) => x.category === v.category);\n const val = v.value;\n const nextVal = vNext ? vNext.value : 0;\n const topH = (val / curTotal) * (curTotal / maxTotal) * funnelHeight;\n const botH = (nextVal / nextTotal || 0) * (nextTotal / maxTotal) * funnelHeight;\n const leftStart = i * segmentWidth;\n const leftEnd = (i + 1) * segmentWidth;\n const topStart = (funnelHeight - (curTotal / maxTotal) * funnelHeight) / 2 + cumTop;\n const topEnd = topStart + topH;\n const botStart = (funnelHeight - (nextTotal / maxTotal) * funnelHeight) / 2 + cumBot;\n const botEnd = botStart + botH;\n\n const isLastSegment = i === stages.length - 1;\n let textX: number;\n let textY: number;\n let availableWidth: number;\n\n if (isLastSegment) {\n textX = leftStart + (leftEnd - leftStart) * 0.25;\n textY = (topStart + topEnd) / 2;\n // For triangular segments, calculate available width at text position\n const segmentWidthAtTextPos = (leftEnd - leftStart) * 0.5;\n availableWidth = segmentWidthAtTextPos * 0.8;\n\n // For triangular last segments, also check if there's enough height\n // The segment area should be large enough to contain text\n const segmentArea = (topH * segmentWidth) / 2;\n if (topH < 24 || segmentArea < 600) {\n availableWidth = 0;\n }\n } else {\n textX = (leftStart + leftEnd) / 2;\n textY = (topStart + topEnd + botStart + botEnd) / 4;\n // For trapezoidal segments, use full segment width\n availableWidth = Math.abs(leftEnd - leftStart) * 0.9;\n\n // Check if the segment has sufficient height for text\n // For non-last segments, we need to ensure there's enough vertical space\n const avgHeight = (topH + botH) / 2;\n if (avgHeight < 20) {\n availableWidth = 0;\n }\n }\n\n const pathD = `M${leftStart},${topStart}\n L${leftEnd},${botStart}\n L${leftEnd},${botEnd}\n L${leftStart},${topEnd}\n Z`;\n return { pathD, textX, textY, availableWidth };\n}\n\nexport function getSegmentTextProps({\n availableWidth,\n minTextWidth = 24,\n textX,\n textY,\n value,\n culture,\n onMouseOver,\n onMouseMove,\n onMouseOut,\n}: {\n availableWidth: number;\n minTextWidth?: number;\n textX: number;\n textY: number;\n value: number;\n culture: string | undefined;\n onMouseOver: (event: React.MouseEvent<SVGElement>) => void;\n onMouseMove: (event: React.MouseEvent<SVGElement>) => void;\n onMouseOut: () => void;\n}) {\n return {\n show: availableWidth > minTextWidth && availableWidth > 0,\n x: textX,\n y: textY,\n value,\n culture,\n onMouseOver,\n onMouseMove,\n onMouseOut,\n };\n}\n"]}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var tslib_1 = require("tslib");
|
|
4
|
+
tslib_1.__exportStar(require("./FunnelChart"), exports);
|
|
5
|
+
tslib_1.__exportStar(require("./FunnelChart.types"), exports);
|
|
6
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"../src/","sources":["components/FunnelChart/index.ts"],"names":[],"mappings":";;;AAAA,wDAA8B;AAC9B,8DAAoC","sourcesContent":["export * from './FunnelChart';\nexport * from './FunnelChart.types';\n"]}
|
|
@@ -86,7 +86,6 @@ export declare class HeatMapChartBase extends React.Component<IHeatMapChartProps
|
|
|
86
86
|
private _onRectMouseOver;
|
|
87
87
|
private _onRectBlurOrMouseOut;
|
|
88
88
|
private _handleChartMouseLeave;
|
|
89
|
-
private _getInvertedTextColor;
|
|
90
89
|
/**
|
|
91
90
|
* This is the function which is responsible for
|
|
92
91
|
* drawing the rectangle in the graph and also
|
|
@@ -13,7 +13,6 @@ var chart_utilities_1 = require("@fluentui/chart-utilities");
|
|
|
13
13
|
var utilities_1 = require("../../utilities/utilities");
|
|
14
14
|
var d3_format_1 = require("d3-format");
|
|
15
15
|
var d3_time_format_1 = require("d3-time-format");
|
|
16
|
-
var colors_1 = require("../../utilities/colors");
|
|
17
16
|
var image_export_utils_1 = require("../../utilities/image-export-utils");
|
|
18
17
|
var getClassNames = (0, Utilities_1.classNamesFunction)();
|
|
19
18
|
var HeatMapChartBase = /** @class */ (function (_super) {
|
|
@@ -110,11 +109,6 @@ var HeatMapChartBase = /** @class */ (function (_super) {
|
|
|
110
109
|
isCalloutVisible: false,
|
|
111
110
|
});
|
|
112
111
|
};
|
|
113
|
-
_this._getInvertedTextColor = function (color) {
|
|
114
|
-
return color === _this.props.theme.semanticColors.bodyText
|
|
115
|
-
? _this.props.theme.semanticColors.bodyBackground
|
|
116
|
-
: _this.props.theme.semanticColors.bodyText;
|
|
117
|
-
};
|
|
118
112
|
/**
|
|
119
113
|
* This is the function which is responsible for
|
|
120
114
|
* drawing the rectangle in the graph and also
|
|
@@ -140,15 +134,7 @@ var HeatMapChartBase = /** @class */ (function (_super) {
|
|
|
140
134
|
* data point such as x, y , value, rectText property of the rectangle
|
|
141
135
|
*/
|
|
142
136
|
var dataPointObject_1 = _this._dataSet[yAxisDataPoint][index];
|
|
143
|
-
var
|
|
144
|
-
var foregroundColor = _this.props.theme.semanticColors.bodyText;
|
|
145
|
-
if (_this.chartContainer) {
|
|
146
|
-
styleRules = (0, utilities_1.resolveCSSVariables)(_this.chartContainer, foregroundColor);
|
|
147
|
-
}
|
|
148
|
-
var contrastRatio = (0, colors_1.getColorContrast)(styleRules, _this._colorScale(dataPointObject_1.value));
|
|
149
|
-
if (contrastRatio < 3) {
|
|
150
|
-
foregroundColor = _this._getInvertedTextColor(foregroundColor);
|
|
151
|
-
}
|
|
137
|
+
var foregroundColor = (0, utilities_1.getContrastTextColor)(_this._colorScale(dataPointObject_1.value), _this.props.theme);
|
|
152
138
|
rectElement = (React.createElement("g", { key: id, role: "img", "aria-label": _this._getAriaLabel(dataPointObject_1), "data-is-focusable": _this._legendHighlighted(dataPointObject_1.legend) || _this._noLegendHighlighted(), fillOpacity: _this._getOpacity(dataPointObject_1.legend), transform: "translate(".concat(_this._xAxisScale(dataPointObject_1.x), ", ").concat(_this._yAxisScale(dataPointObject_1.y), ")"), ref: function (gElement) {
|
|
153
139
|
_this._rectRefCallback(gElement, id, dataPointObject_1);
|
|
154
140
|
}, onFocus: _this._onRectFocus.bind(_this, id, dataPointObject_1), onBlur: _this._onRectBlurOrMouseOut, onMouseOver: _this._onRectMouseOver.bind(_this, id, dataPointObject_1), onMouseOut: _this._onRectBlurOrMouseOut },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HeatMapChart.base.js","sourceRoot":"../src/","sources":["components/HeatMapChart/HeatMapChart.base.tsx"],"names":[],"mappings":";;;;AAAA,iEAAoH;AAQpH,qCAAwD;AACxD,2DAMuC;AACvC,qDAA2D;AAC3D,uDAA8D;AAE9D,6BAA+B;AAE/B,0CAAsE;AACtE,6DAAiE;AACjE,uDAamC;AAEnC,uCAA+C;AAC/C,iDAA4D;AAC5D,iDAA0D;AAC1D,yEAA6D;AA+D7D,IAAM,aAAa,GAAG,IAAA,8BAAkB,GAAgD,CAAC;AACzF;IAAsC,4CAAuD;IAoC3F,0BAAmB,KAAyB;;QAC1C,YAAA,MAAK,YAAC,KAAK,CAAC,SAAC;QAdf;;;WAGG;QACK,mBAAa,GAAgC,EAAE,CAAC;QAsJjD,aAAO,GAAG,UAAC,IAA0B;;YAC1C,OAAO,IAAA,4BAAO,EAAC,MAAA,KAAI,CAAC,kBAAkB,CAAC,OAAO,0CAAE,cAAc,EAAE,MAAA,KAAI,CAAC,WAAW,CAAC,OAAO,0CAAE,KAAK,EAAE,IAAA,kBAAM,GAAE,EAAE,IAAI,CAAC,CAAC;QACnH,CAAC,CAAC;QAEM,uBAAiB,GAAG;YAC1B,OAAO,EAAE,UAAU,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,EAAE,CAAC;QACxC,CAAC,CAAC;QAEM,4BAAsB,GAAG,UAC/B,MAAgC,EAChC,OAAiB,EACjB,KAAa,EACb,SAAqB,EACrB,KAAc,EACd,SAAqB,EACrB,QAAgB,EAChB,UAAyC,EACzC,MAAc;YAEd,IAAI,iBA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QACxC,IAAI,CAAC,QAAQ,CAAC;YACZ,YAAY,EAAE,WAAW;SAC1B,CAAC,CAAC;IACL,CAAC;IAED;;;OAGG;IACK,yCAAc,GAAtB;QACE,IAAI,CAAC,QAAQ,CAAC;YACZ,YAAY,EAAE,EAAE;SACjB,CAAC,CAAC;IACL,CAAC;IACD;;;;;OAKG;IACK,yCAAc,GAAtB,UAAuB,WAAmB;QACxC;;;;WAIG;QACH,IAAI,IAAI,CAAC,KAAK,CAAC,cAAc,KAAK,WAAW,EAAE,CAAC;YAC9C,IAAI,CAAC,QAAQ,CAAC;gBACZ,cAAc,EAAE,EAAE;aACnB,CAAC,CAAC;QACL,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,QAAQ,CAAC;gBACZ,cAAc,EAAE,WAAW;aAC5B,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IAyRO,wCAAa,GAArB;QACE,OAAO,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IAC1D,CAAC;IAvsBa,6BAAY,GAAgC;QACxD,kBAAkB,EAAE,SAAS;QAC7B,kBAAkB,EAAE,SAAS;KAC9B,AAHyB,CAGxB;IAuyBJ,uBAAC;CAAA,AA3yBD,CAAsC,KAAK,CAAC,SAAS,GA2yBpD;AA3yBY,4CAAgB","sourcesContent":["import { CartesianChart, IChildProps, IModifiedCartesianChartProps } from '../../components/CommonComponents/index';\nimport {\n IAccessibilityProps,\n IChart,\n IHeatMapChartData,\n IHeatMapChartDataPoint,\n IImageExportOptions,\n} from '../../types/IDataPoint';\nimport { scaleLinear as d3ScaleLinear } from 'd3-scale';\nimport {\n classNamesFunction,\n getId,\n getRTL,\n initializeComponentRef,\n memoizeFunction,\n} from '@fluentui/react/lib/Utilities';\nimport { FocusZoneDirection } from '@fluentui/react-focus';\nimport { DirectionalHint } from '@fluentui/react/lib/Callout';\nimport { IProcessedStyleSet } from '@fluentui/react/lib/Styling';\nimport * as React from 'react';\nimport { IHeatMapChartProps, IHeatMapChartStyleProps, IHeatMapChartStyles } from './HeatMapChart.types';\nimport { ILegend, ILegendContainer, Legends } from '../Legends/index';\nimport { formatToLocaleString } from '@fluentui/chart-utilities';\nimport {\n ChartTypes,\n createNumericYAxis,\n getAccessibleDataObject,\n XAxisTypes,\n YAxisType,\n getTypeOfAxis,\n IMargins,\n IDomainNRange,\n domainRangeOfXStringAxis,\n createStringYAxis,\n resolveCSSVariables,\n sortAxisCategories,\n} from '../../utilities/utilities';\nimport { Target } from '@fluentui/react';\nimport { format as d3Format } from 'd3-format';\nimport { timeFormat as d3TimeFormat } from 'd3-time-format';\nimport { getColorContrast } from '../../utilities/colors';\nimport { toImage } from '../../utilities/image-export-utils';\n\ntype DataSet = {\n dataSet: RectanglesGraphData;\n yAxisPoints: string[];\n xAxisPoints: string[];\n};\ntype FlattenData = IHeatMapChartDataPoint & {\n legend: string;\n};\ninterface IRectRef {\n data: FlattenData;\n refElement: SVGGElement;\n}\ntype RectanglesGraphData = { [key: string]: FlattenData[] };\nexport interface IHeatMapChartState {\n /**\n * contains the selected legend string\n */\n selectedLegend: string;\n /**\n * contains the hovered legend string\n */\n activeLegend: string;\n /**\n * determines wethere to show or hide the callout\n * @default false\n */\n isCalloutVisible: boolean;\n /**\n * y value to be shown in callout\n */\n calloutYValue: string;\n /**\n * legend title to be shown in callout\n */\n calloutLegend: string;\n /**\n * color of the text in the callout\n */\n calloutTextColor: string;\n /**\n * The target that the Callout should try to position itself based on\n */\n target: Target;\n /**\n * ratio to show in the callout\n */\n ratio: [number, number] | null;\n\n /**\n * description message to show in the callout\n */\n descriptionMessage: string;\n /**\n * id to give to callout for accesiblity purpose\n */\n calloutId: string;\n /**\n * Accessibility data for callout\n */\n callOutAccessibilityData?: IAccessibilityProps;\n}\nconst getClassNames = classNamesFunction<IHeatMapChartStyleProps, IHeatMapChartStyles>();\nexport class HeatMapChartBase extends React.Component<IHeatMapChartProps, IHeatMapChartState> implements IChart {\n public static defaultProps: Partial<IHeatMapChartProps> = {\n xAxisCategoryOrder: 'default',\n yAxisCategoryOrder: 'default',\n };\n\n private _classNames: IProcessedStyleSet<IHeatMapChartStyles>;\n private _stringXAxisDataPoints: string[];\n private _stringYAxisDataPoints: string[];\n private _createSet: (\n data: IHeatMapChartData[],\n xDate: string | undefined,\n xNum: string | undefined,\n yDate: string | undefined,\n yNum: string | undefined,\n ) => DataSet;\n private _dataSet: RectanglesGraphData;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private _colorScale: any;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private _xAxisScale: any;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private _yAxisScale: any;\n /**\n * This array contains ref for all the rectangles\n * drawn inside the chard\n */\n private _rectRefArray: { [key: string]: IRectRef } = {};\n private _xAxisType: XAxisTypes;\n private _yAxisType: YAxisType;\n private _calloutAnchorPoint: FlattenData | null;\n private _emptyChartId: string;\n private margins: IMargins;\n private _cartesianChartRef: React.RefObject<IChart>;\n private _legendsRef: React.RefObject<ILegendContainer>;\n\n public constructor(props: IHeatMapChartProps) {\n super(props);\n\n initializeComponentRef(this);\n\n /**\n * below funciton creates a new data set from the prop\n * @data and also finds all the unique x-axis datapoints\n * and y-axis datapoints(which will render in the axis in graph)\n * we store this in a memoized function, because we want to calulate\n * this set whenever props changes.\n */\n this._createSet = memoizeFunction(\n (\n data: IHeatMapChartData[],\n xDate: string | undefined,\n xNum: string | undefined,\n yDate: string | undefined,\n yNum: string | undefined,\n ): DataSet => this._createNewDataSet(data, xDate, xNum, yDate, yNum),\n );\n this.state = {\n selectedLegend: props.legendProps?.selectedLegend ?? '',\n activeLegend: '',\n isCalloutVisible: false,\n target: null,\n calloutLegend: '',\n calloutTextColor: '',\n calloutYValue: '',\n ratio: null,\n descriptionMessage: '',\n calloutId: '',\n };\n this._emptyChartId = getId('_HeatMap_empty');\n this._cartesianChartRef = React.createRef();\n this._legendsRef = React.createRef();\n }\n\n public componentDidUpdate(prevProps: IHeatMapChartProps): void {\n if (prevProps.legendProps?.selectedLegend !== this.props.legendProps?.selectedLegend) {\n this.setState({\n selectedLegend: this.props.legendProps?.selectedLegend ?? '',\n });\n }\n }\n\n public render(): React.ReactNode {\n const { x, y } = this._getXandY();\n this._xAxisType = getTypeOfAxis(x, true) as XAxisTypes;\n this._yAxisType = getTypeOfAxis(y, false) as YAxisType;\n const { data, xAxisDateFormatString, xAxisNumberFormatString, yAxisDateFormatString, yAxisNumberFormatString } =\n this.props;\n this._colorScale = this._getColorScale();\n const { dataSet, xAxisPoints, yAxisPoints } = this._createSet(\n data,\n xAxisDateFormatString,\n xAxisNumberFormatString,\n yAxisDateFormatString,\n yAxisNumberFormatString,\n );\n this._dataSet = dataSet;\n this._stringYAxisDataPoints = yAxisPoints;\n this._stringXAxisDataPoints = xAxisPoints;\n this._classNames = getClassNames(this.props.styles!, { theme: this.props.theme! });\n const calloutProps: IModifiedCartesianChartProps['calloutProps'] = {\n isBeakVisible: false,\n gapSpace: 8,\n ...this.props.calloutProps,\n isCalloutVisible: this.state.isCalloutVisible,\n id: this.state.calloutId,\n YValue: this.state.calloutYValue,\n legend: this.state.calloutLegend,\n color: this.state.calloutTextColor,\n target: this.state.target,\n styles: this._classNames.subComponentStyles.calloutStyles,\n directionalHint: DirectionalHint.topAutoEdge,\n onDismiss: this._closeCallout,\n ...getAccessibleDataObject(this.state.callOutAccessibilityData, 'text', false),\n preventDismissOnLostFocus: true,\n };\n const chartHoverProps: IModifiedCartesianChartProps['chartHoverProps'] = {\n ...(this.state.ratio && {\n ratio: this.state.ratio,\n }),\n descriptionMessage: this.state.descriptionMessage,\n };\n const tickParams = {\n tickValues: this.props.tickValues,\n tickFormat: this.props.tickFormat,\n };\n return !this._isChartEmpty() ? (\n <CartesianChart\n {...this.props}\n chartTitle={this._getChartTitle()}\n points={data}\n chartType={ChartTypes.HeatMapChart}\n xAxisType={XAxisTypes.StringAxis}\n yAxisType={YAxisType.StringAxis}\n calloutProps={calloutProps}\n createYAxis={createNumericYAxis}\n chartHoverProps={chartHoverProps}\n styles={this._classNames.subComponentStyles!.cartesianStyles}\n datasetForXAxisDomain={this._stringXAxisDataPoints}\n stringDatasetForYAxisDomain={this._stringYAxisDataPoints}\n createStringYAxis={createStringYAxis}\n getDomainNRangeValues={this._getDomainNRangeValues}\n getMinMaxOfYAxis={this._getMinMaxOfYAxis}\n getmargins={this._getMargins}\n xAxisTickCount={this._stringXAxisDataPoints.length}\n xAxistickSize={0}\n xAxisPadding={0.02}\n yAxisPadding={0.02}\n svgFocusZoneProps={{\n direction: FocusZoneDirection.bidirectional,\n }}\n legendBars={this._createLegendBars()}\n onChartMouseLeave={this._handleChartMouseLeave}\n ref={this._cartesianChartRef}\n tickParams={tickParams}\n /* eslint-disable react/jsx-no-bind */\n // eslint-disable-next-line react/no-children-prop\n children={(props: IChildProps) => {\n this._xAxisScale = props.xScale;\n this._yAxisScale = props.yScalePrimary;\n return this._createRectangles();\n }}\n />\n ) : (\n <div\n id={this._emptyChartId}\n role={'alert'}\n style={{ opacity: '0' }}\n aria-label={'Graph has no data to display'}\n />\n );\n }\n\n public get chartContainer(): HTMLElement | null {\n return this._cartesianChartRef.current?.chartContainer || null;\n }\n\n public toImage = (opts?: IImageExportOptions): Promise<string> => {\n return toImage(this._cartesianChartRef.current?.chartContainer, this._legendsRef.current?.toSVG, getRTL(), opts);\n };\n\n private _getMinMaxOfYAxis = () => {\n return { startValue: 0, endValue: 0 };\n };\n\n private _getDomainNRangeValues = (\n points: IHeatMapChartDataPoint[],\n margins: IMargins,\n width: number,\n chartType: ChartTypes,\n isRTL: boolean,\n xAxisType: XAxisTypes,\n barWidth: number,\n tickValues: Date[] | number[] | undefined,\n shiftX: number,\n ) => {\n let domainNRangeValue: IDomainNRange;\n if (xAxisType === XAxisTypes.NumericAxis || xAxisType === XAxisTypes.DateAxis) {\n domainNRangeValue = { dStartValue: 0, dEndValue: 0, rStartValue: 0, rEndValue: 0 };\n } else {\n domainNRangeValue = domainRangeOfXStringAxis(this.margins, width, isRTL);\n }\n return domainNRangeValue;\n };\n\n private _getXandY = (): { x: string | Date | number; y: string | Date | number } => {\n let x: string | Date | number = '';\n let y: string | Date | number = '';\n this.props.data.forEach((item: IHeatMapChartData) => {\n if (item.data && item.data.length > 0) {\n x = item.data[0].x;\n y = item.data[0].y;\n return { x, y };\n }\n });\n return { x, y };\n };\n\n private _getMargins = (margins: IMargins) => {\n this.margins = margins;\n };\n\n private _getOpacity = (legendTitle: string): string => {\n const opacity = this._legendHighlighted(legendTitle) || this._noLegendHighlighted() ? '1' : '0.1';\n return opacity;\n };\n\n private _rectRefCallback = (rectElement: SVGGElement, index: number | string, dataPointObject: FlattenData): void => {\n this._rectRefArray[index] = { data: dataPointObject, refElement: rectElement };\n };\n\n private _onRectFocus = (id: string, data: FlattenData): void => {\n this.setState({\n target: this._rectRefArray[id].refElement,\n /** Show the callout if highlighted rectangle is focused and Hide it if unhighlighted rectangle is focused */\n isCalloutVisible: this.state.selectedLegend === '' || this.state.selectedLegend === data.legend,\n calloutYValue: `${data.rectText}`,\n calloutTextColor: Number.isNaN(data.value)\n ? this.props.theme!.semanticColors.bodyText\n : this._colorScale(data.value),\n calloutLegend: data.legend,\n ratio: data.ratio || null,\n descriptionMessage: data.descriptionMessage || '',\n calloutId: id,\n callOutAccessibilityData: data.callOutAccessibilityData,\n });\n };\n\n private _onRectMouseOver = (id: string, data: FlattenData, mouseEvent: React.MouseEvent<SVGGElement>): void => {\n mouseEvent.persist();\n if (this._calloutAnchorPoint !== data) {\n this._calloutAnchorPoint = data;\n this.setState({\n target: this._rectRefArray[id].refElement,\n /** Show the callout if highlighted rectangle is hovered and Hide it if unhighlighted rectangle is hovered */\n isCalloutVisible: this.state.selectedLegend === '' || this.state.selectedLegend === data.legend,\n calloutYValue: `${data.rectText}`,\n calloutTextColor: Number.isNaN(data.value)\n ? this.props.theme!.semanticColors.bodyText\n : this._colorScale(data.value),\n calloutLegend: data.legend,\n ratio: data.ratio || null,\n descriptionMessage: data.descriptionMessage || '',\n calloutId: id,\n callOutAccessibilityData: data.callOutAccessibilityData,\n });\n }\n };\n\n private _onRectBlurOrMouseOut = (): void => {\n /**/\n };\n\n private _handleChartMouseLeave = (): void => {\n this._calloutAnchorPoint = null;\n this.setState({\n isCalloutVisible: false,\n });\n };\n\n private _getInvertedTextColor = (color: string): string => {\n return color === this.props.theme!.semanticColors.bodyText\n ? this.props.theme!.semanticColors.bodyBackground\n : this.props.theme!.semanticColors.bodyText;\n };\n\n /**\n * This is the function which is responsible for\n * drawing the rectangle in the graph and also\n * attaching dom events to that rectangles\n */\n private _createRectangles = (): React.ReactNode => {\n const rectangles: JSX.Element[] = [];\n const yAxisDataPoints = this._stringYAxisDataPoints.slice().reverse();\n /**\n * yAxisDataPoint is noting but the DataPoint\n * which will be rendered on the y-axis\n */\n yAxisDataPoints.forEach((yAxisDataPoint: string) => {\n let index = 0;\n this._stringXAxisDataPoints.forEach((xAxisDataPoint: string) => {\n let rectElement: JSX.Element;\n const id = `x${xAxisDataPoint}y${yAxisDataPoint}`;\n if (\n this._dataSet[yAxisDataPoint][index]?.x === xAxisDataPoint &&\n typeof this._dataSet[yAxisDataPoint][index]?.value === 'number'\n ) {\n /**\n * dataPointObject is an object where it contains information on single\n * data point such as x, y , value, rectText property of the rectangle\n */\n const dataPointObject = this._dataSet[yAxisDataPoint][index];\n let styleRules = '';\n let foregroundColor = this.props.theme!.semanticColors.bodyText;\n if (this.chartContainer) {\n styleRules = resolveCSSVariables(this.chartContainer!, foregroundColor);\n }\n const contrastRatio = getColorContrast(styleRules, this._colorScale(dataPointObject.value));\n if (contrastRatio < 3) {\n foregroundColor = this._getInvertedTextColor(foregroundColor);\n }\n rectElement = (\n <g\n key={id}\n role=\"img\"\n aria-label={this._getAriaLabel(dataPointObject)}\n data-is-focusable={this._legendHighlighted(dataPointObject.legend) || this._noLegendHighlighted()}\n fillOpacity={this._getOpacity(dataPointObject.legend)}\n transform={`translate(${this._xAxisScale(dataPointObject.x)}, ${this._yAxisScale(dataPointObject.y)})`}\n ref={(gElement: SVGGElement) => {\n this._rectRefCallback(gElement, id, dataPointObject);\n }}\n onFocus={this._onRectFocus.bind(this, id, dataPointObject)}\n onBlur={this._onRectBlurOrMouseOut}\n onMouseOver={this._onRectMouseOver.bind(this, id, dataPointObject)}\n onMouseOut={this._onRectBlurOrMouseOut}\n >\n <rect\n fill={this._colorScale(dataPointObject.value)}\n width={this._xAxisScale.bandwidth()}\n height={this._yAxisScale.bandwidth()}\n onClick={dataPointObject.onClick}\n />\n <text\n dominantBaseline={'middle'}\n textAnchor={'middle'}\n className={this._classNames.text}\n transform={`translate(${this._xAxisScale.bandwidth() / 2}, ${this._yAxisScale.bandwidth() / 2})`}\n fill={foregroundColor}\n >\n {formatToLocaleString(dataPointObject.rectText, this.props.culture, this.props.useUTC)}\n </text>\n </g>\n );\n index++;\n } else {\n const dataPointObject: FlattenData = {\n x: xAxisDataPoint,\n y: yAxisDataPoint,\n value: NaN,\n rectText: 'No data available',\n legend: '',\n };\n rectElement = (\n <g\n key={id}\n role=\"img\"\n aria-label={this._getAriaLabel(dataPointObject)}\n data-is-focusable={this._noLegendHighlighted()}\n transform={`translate(${this._xAxisScale(dataPointObject.x)}, ${this._yAxisScale(dataPointObject.y)})`}\n ref={(gElement: SVGGElement) => {\n this._rectRefCallback(gElement, id, dataPointObject);\n }}\n onFocus={this._onRectFocus.bind(this, id, dataPointObject)}\n onBlur={this._onRectBlurOrMouseOut}\n onMouseOver={this._onRectMouseOver.bind(this, id, dataPointObject)}\n onMouseOut={this._onRectBlurOrMouseOut}\n >\n <rect fill=\"transparent\" width={this._xAxisScale.bandwidth()} height={this._yAxisScale.bandwidth()} />\n </g>\n );\n }\n rectangles.push(rectElement);\n });\n });\n return rectangles;\n };\n /**\n * when the legend is hovered we need to highlight\n * all the rectangles which fall under that category\n * and un-highlight the rest of them\n * @param legendTitle\n */\n private _onLegendHover(legendTitle: string): void {\n this.setState({\n activeLegend: legendTitle,\n });\n }\n\n /**\n * when the mouse is out from the legend , we need\n * to show the graph in initial mode.\n */\n private _onLegendLeave(): void {\n this.setState({\n activeLegend: '',\n });\n }\n /**\n * @param legendTitle\n * when the legend is clicked we need to highlight\n * all the rectangles which fall under that category\n * and un highlight the rest of them\n */\n private _onLegendClick(legendTitle: string): void {\n /**\n * check if the legend is already selceted,\n * if yes, un-select the legend, else\n * set the selected legend state to legendTitle\n */\n if (this.state.selectedLegend === legendTitle) {\n this.setState({\n selectedLegend: '',\n });\n } else {\n this.setState({\n selectedLegend: legendTitle,\n });\n }\n }\n private _createLegendBars = (): JSX.Element => {\n const { data, legendProps } = this.props;\n const legends: ILegend[] = [];\n data.forEach((item: IHeatMapChartData) => {\n const legend: ILegend = {\n title: item.legend,\n color: this._colorScale(item.value),\n action: () => {\n this._onLegendClick(item.legend);\n },\n hoverAction: () => {\n this._handleChartMouseLeave();\n this._onLegendHover(item.legend);\n },\n onMouseOutAction: () => {\n this._onLegendLeave();\n },\n };\n legends.push(legend);\n });\n return <Legends {...legendProps} legends={legends} ref={this._legendsRef} />;\n };\n\n private _getColorScale = () => {\n const { domainValuesForColorScale, rangeValuesForColorScale } = this.props;\n return d3ScaleLinear()\n .domain(domainValuesForColorScale)\n .range(rangeValuesForColorScale as unknown as number[]);\n };\n\n private _getXIndex = (value: string | Date | number): string => {\n if (this._xAxisType === XAxisTypes.DateAxis) {\n return `${(value as Date).getTime()}`;\n } else if (this._xAxisType === XAxisTypes.StringAxis) {\n return value as string;\n } else if (this._xAxisType === XAxisTypes.NumericAxis) {\n return `${value}`;\n } else {\n return '';\n }\n };\n private _getYIndex = (value: string | Date | number): string => {\n if (this._yAxisType === YAxisType.DateAxis) {\n return `${(value as Date).getTime()}`;\n } else if (this._yAxisType === YAxisType.StringAxis) {\n return value as string;\n } else if (this._yAxisType === YAxisType.NumericAxis) {\n return `${value}`;\n } else {\n return '';\n }\n };\n\n /**\n * This will create a new data set based on the prop\n * @data\n * We will be using This data set to contsruct our rectangles\n * in the chart, we use this data set becuase, when we loop in this\n * data and build the heat map, it will support accessibility as\n * specified in the figma\n */\n\n private _createNewDataSet = (\n data: IHeatMapChartData[],\n xAxisDateFormatString: string | undefined,\n xAxisNumberFormatString: string | undefined,\n yAxisDateFormatString: string | undefined,\n yAxisNumberFormatString: string | undefined,\n ): DataSet => {\n /**\n * please do not destructure any of the props here,\n * instead send them as parameter to this functions so that\n * this functions get called whenever the prop changes\n */\n const flattenData: FlattenData[] = [];\n /**\n * below for each loop will store all the datapoints in the one array.\n * basically it will flatten the nestesd array (data prop) into single array\n * of object. where each object contains x, y, rectText , value and legend propety of single\n * data point.\n */\n data.forEach((item: IHeatMapChartData) => {\n item.data.forEach((point: IHeatMapChartDataPoint) => {\n flattenData.push({ ...point, legend: item.legend });\n });\n });\n const yPoints: RectanglesGraphData = {};\n const uniqueYPoints: { [key: string]: '1' } = {};\n const uniqueXPoints: { [key: string]: '1' } = {};\n flattenData.forEach((item: FlattenData) => {\n const posX = this._getXIndex(item.x);\n const posY = this._getYIndex(item.y);\n\n uniqueXPoints[posX] = '1';\n uniqueYPoints[posY] = '1';\n /** we will check if the property(posY) is already there in object, if Yes,\n * then we will append the item in the Array related to the pos, if not\n * then we will simply append the item in the new Array and\n * assign that array to the property (posY) in the Object\n * and finally we will get the array of Objects associated to each\n * property (which is nothing but y data point) and object in the\n * array are noting but x data points associated to the property y\n */\n if (yPoints[posY]) {\n yPoints[posY] = [...yPoints[posY], item];\n } else {\n yPoints[posY] = [item];\n }\n });\n /**\n * we will now sort(ascending) the array's of y data point based on the x value\n * sorting is important to achive the accessibility order of the\n * rectangles and then format the x and y datapoints respectively\n */\n Object.keys(yPoints).forEach((item: string) => {\n yPoints[item] = this._getOrderedXPoints(yPoints[item]);\n\n yPoints[item].forEach((datapoint: IHeatMapChartDataPoint) => {\n if (this._xAxisType === XAxisTypes.DateAxis) {\n datapoint.x = this._getStringFormattedDate(datapoint.x as string, xAxisDateFormatString);\n }\n if (this._xAxisType === XAxisTypes.NumericAxis) {\n datapoint.x = this._getStringFormattedNumber(datapoint.x as string, xAxisNumberFormatString);\n }\n if (this._xAxisType === XAxisTypes.StringAxis) {\n datapoint.x = this._getFormattedLabelForXAxisDataPoint(datapoint.x as string);\n }\n if (this._yAxisType === YAxisType.DateAxis) {\n datapoint.y = this._getStringFormattedDate(datapoint.y as string, yAxisDateFormatString);\n }\n if (this._yAxisType === YAxisType.NumericAxis) {\n datapoint.y = this._getStringFormattedNumber(datapoint.y as string, yAxisNumberFormatString);\n }\n if (this._yAxisType === YAxisType.StringAxis) {\n datapoint.y = this._getFormattedLabelForYAxisDataPoint(datapoint.y as string);\n }\n });\n });\n /**\n * if y-axis data points are of type date or number or if we have string formatter,\n * then we need to change data points to their respective string\n * format, becuase in the private variable this._stringYAxisDatapoints, points will be stored in\n * string format. and in here `yPoint` are not so we need to change, so that\n * function `this._createRectangles` should work perfetcly while looping, and if we don't change\n * then `this._createRectangles` will fail while looping, causing the error\n * Cannot read property 'forEach' of undefined\n */\n\n Object.keys(yPoints).forEach((yPoint: string) => {\n if (this._yAxisType === YAxisType.DateAxis) {\n yPoints[this._getStringFormattedDate(yPoint, yAxisDateFormatString)] = yPoints[yPoint];\n } else if (this._yAxisType === YAxisType.NumericAxis) {\n yPoints[`${this._getStringFormattedNumber(yPoint, yAxisNumberFormatString)}`] = yPoints[yPoint];\n } else {\n yPoints[this._getFormattedLabelForYAxisDataPoint(yPoint)] = yPoints[yPoint];\n }\n });\n /**\n * assigning new data set\n */\n const dataSet = yPoints;\n /**\n * These are the Y axis data points which will get rendered in the\n * Y axis in graph\n */\n const yAxisPoints = this._getYAxisDataPoints(uniqueYPoints);\n /**\n * These are the x axis data points which will get rendered in the\n * x axis in the graph\n */\n\n const xAxisPoints = this._getXAxisDataPoints(uniqueXPoints);\n return {\n dataSet,\n yAxisPoints,\n xAxisPoints,\n };\n };\n\n /**\n * This function will return the final sorted and formatted x-axis points\n * which will be rendered on the x-axis\n * @param points\n * @returns x-axis points\n */\n private _getXAxisDataPoints = (points: { [key: string]: '1' }): string[] => {\n let xAxisPoints: string[] = [];\n const unFormattedXAxisDataPoints = this._getOrderedXAxisLabels(points);\n xAxisPoints = unFormattedXAxisDataPoints.map((xPoint: string) => {\n if (this._xAxisType === XAxisTypes.DateAxis) {\n return this._getStringFormattedDate(xPoint, this.props.xAxisDateFormatString);\n } else if (this._xAxisType === XAxisTypes.NumericAxis) {\n return this._getStringFormattedNumber(xPoint, this.props.xAxisNumberFormatString);\n } else {\n return this._getFormattedLabelForXAxisDataPoint(xPoint);\n }\n });\n\n return xAxisPoints;\n };\n /**\n * This function will return the final sorted and formatted y-axis points\n * which will be rendered on the y-axis\n * @param points\n * @returns yaxis points\n */\n private _getYAxisDataPoints = (points: { [key: string]: '1' }): string[] => {\n let yAxisPoints: string[] = [];\n const unFormattedYAxisDataPoints = this._getOrderedYAxisLabels(points);\n yAxisPoints = unFormattedYAxisDataPoints.map((yPoint: string) => {\n if (this._yAxisType === YAxisType.DateAxis) {\n return this._getStringFormattedDate(yPoint, this.props.yAxisDateFormatString);\n } else if (this._yAxisType === YAxisType.NumericAxis) {\n return this._getStringFormattedNumber(yPoint, this.props.yAxisNumberFormatString);\n } else {\n return this._getFormattedLabelForYAxisDataPoint(yPoint);\n }\n });\n\n return yAxisPoints;\n };\n\n private _getStringFormattedDate = (point: string, formatString?: string): string => {\n const date = new Date();\n date.setTime(+point);\n return d3TimeFormat(formatString || '%b/%d')(date);\n };\n\n private _getStringFormattedNumber = (point: string, formatString?: string): string => {\n return d3Format(formatString || '.2~s')(+point);\n };\n\n private _getFormattedLabelForXAxisDataPoint = (point: string): string => {\n const { xAxisStringFormatter } = this.props;\n return xAxisStringFormatter ? xAxisStringFormatter(point) : point;\n };\n\n private _getFormattedLabelForYAxisDataPoint = (point: string): string => {\n const { yAxisStringFormatter } = this.props;\n return yAxisStringFormatter ? yAxisStringFormatter(point) : point;\n };\n\n private _closeCallout = () => {\n this.setState({\n isCalloutVisible: false,\n });\n };\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 private _legendHighlighted = (legendTitle: string) => {\n return (\n this.state.selectedLegend === legendTitle ||\n (this.state.selectedLegend === '' && this.state.activeLegend === legendTitle)\n );\n };\n\n /**\n * This function checks if none of the legends is selected or hovered.\n */\n private _noLegendHighlighted = () => {\n return this.state.selectedLegend === '' && this.state.activeLegend === '';\n };\n\n private _getAriaLabel = (point: FlattenData): string => {\n const xValue = point.x;\n const yValue = point.y;\n const legend = point.legend;\n const zValue = point.ratio ? `${point.ratio[0]}/${point.ratio[1]}` : point.rectText || point.value;\n const description = point.descriptionMessage;\n return (\n point.callOutAccessibilityData?.ariaLabel ||\n `${xValue}, ${yValue}. ${legend}, ${zValue}.` + (description ? ` ${description}.` : '')\n );\n };\n\n private _isChartEmpty(): boolean {\n return !(this.props.data && this.props.data.length > 0);\n }\n\n private _getChartTitle = (): string => {\n const { chartTitle } = this.props;\n const numDataPoints = this.props.data.reduce((acc, curr) => acc + curr.data.length, 0);\n return (chartTitle ? `${chartTitle}. ` : '') + `Heat map chart with ${numDataPoints} data points. `;\n };\n\n private _getOrderedXAxisLabels = (points: { [key: string]: '1' }) => {\n if (!this._shouldOrderXAxisLabelsByCategoryOrder()) {\n // Keep the original ordering logic as the default behavior to ensure backward compatibility\n return Object.keys(points).sort((a: string, b: string) => {\n if (this._xAxisType === XAxisTypes.DateAxis || this._xAxisType === XAxisTypes.NumericAxis) {\n return +a - +b;\n } else {\n return this.props.sortOrder === 'none' ? 0 : a.toLowerCase() > b.toLowerCase() ? 1 : -1;\n }\n });\n }\n\n return sortAxisCategories(this._mapCategoryToValues(), this.props.xAxisCategoryOrder);\n };\n\n private _getOrderedYAxisLabels = (points: { [key: string]: '1' }) => {\n if (!this._shouldOrderYAxisLabelsByCategoryOrder()) {\n // Keep the original ordering logic as the default behavior to ensure backward compatibility\n return Object.keys(points).sort((a: string, b: string) => {\n if (this._yAxisType === YAxisType.DateAxis || this._yAxisType === YAxisType.NumericAxis) {\n return +a - +b;\n } else {\n return this.props.sortOrder === 'none' ? 0 : a.toLowerCase() > b.toLowerCase() ? 1 : -1;\n }\n });\n }\n\n return sortAxisCategories(this._mapCategoryToValues(true), this.props.yAxisCategoryOrder);\n };\n\n private _getOrderedXPoints = (xPoints: FlattenData[]) => {\n if (!this._shouldOrderXAxisLabelsByCategoryOrder()) {\n return xPoints.sort((a: IHeatMapChartDataPoint, b: IHeatMapChartDataPoint) => {\n if (this._xAxisType === XAxisTypes.StringAxis) {\n return this.props.sortOrder === 'none'\n ? 0\n : (a.x as string).toLowerCase() > (b.x as string).toLowerCase()\n ? 1\n : -1;\n } else if (this._xAxisType === XAxisTypes.DateAxis) {\n return (a.x as Date).getTime() - (b.x as Date).getTime();\n } else if (this._xAxisType === XAxisTypes.NumericAxis) {\n return +(a.x as string) > +(b.x as string) ? 1 : -1;\n } else {\n return a.x > b.x ? 1 : -1;\n }\n });\n }\n\n const result: FlattenData[] = [];\n\n const xValueToPoints: Record<string, FlattenData[]> = {};\n xPoints.forEach(point => {\n const xValue = point.x as string;\n if (!xValueToPoints[xValue]) {\n xValueToPoints[xValue] = [];\n }\n xValueToPoints[xValue].push(point);\n });\n\n const xAxisLabels = this._getOrderedXAxisLabels({});\n xAxisLabels.forEach(xValue => {\n if (xValueToPoints[xValue]) {\n result.push(...xValueToPoints[xValue]);\n }\n });\n\n return result;\n };\n\n private _shouldOrderXAxisLabelsByCategoryOrder = () => {\n return this._xAxisType === XAxisTypes.StringAxis && this.props.xAxisCategoryOrder !== 'default';\n };\n\n private _shouldOrderYAxisLabelsByCategoryOrder = () => {\n return this._yAxisType === YAxisType.StringAxis && this.props.yAxisCategoryOrder !== 'default';\n };\n\n private _mapCategoryToValues = (isYAxis = false) => {\n const categoryToValues: Record<string, number[]> = {};\n this.props.data.forEach(item => {\n item.data.forEach(point => {\n const category = (isYAxis ? point.y : point.x) as string;\n if (!categoryToValues[category]) {\n categoryToValues[category] = [];\n }\n categoryToValues[category].push(point.value);\n });\n });\n return categoryToValues;\n };\n}\n"]}
|
|
1
|
+
{"version":3,"file":"HeatMapChart.base.js","sourceRoot":"../src/","sources":["components/HeatMapChart/HeatMapChart.base.tsx"],"names":[],"mappings":";;;;AAAA,iEAAoH;AAQpH,qCAAwD;AACxD,2DAMuC;AACvC,qDAA2D;AAC3D,uDAA8D;AAE9D,6BAA+B;AAE/B,0CAAsE;AACtE,6DAAiE;AACjE,uDAamC;AAEnC,uCAA+C;AAC/C,iDAA4D;AAC5D,yEAA6D;AA+D7D,IAAM,aAAa,GAAG,IAAA,8BAAkB,GAAgD,CAAC;AACzF;IAAsC,4CAAuD;IAoC3F,0BAAmB,KAAyB;;QAC1C,YAAA,MAAK,YAAC,KAAK,CAAC,SAAC;QAdf;;;WAGG;QACK,mBAAa,GAAgC,EAAE,CAAC;QAsJjD,aAAO,GAAG,UAAC,IAA0B;;YAC1C,OAAO,IAAA,4BAAO,EAAC,MAAA,KAAI,CAAC,kBAAkB,CAAC,OAAO,0CAAE,cAAc,EAAE,MAAA,KAAI,CAAC,WAAW,CAAC,OAAO,0CAAE,KAAK,EAAE,IAAA,kBAAM,GAAE,EAAE,IAAI,CAAC,CAAC;QACnH,CAAC,CAAC;QAEM,uBAAiB,GAAG;YAC1B,OAAO,EAAE,UAAU,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,EAAE,CAAC;QACxC,CAAC,CAAC;QAEM,4BAAsB,GAAG,UAC/B,MAAgC,EAChC,OAAiB,EACjB,KAAa,EACb,SAAqB,EACrB,KAAc,EACd,SAAqB,EACrB,QAAgB,EAChB,UAAyC,EACzC,MAAc;YAEd,IAAI,iBAAgC,CAAC;YACrC,IAAI,SAAS,KAAK,sBAAU,CAAC,WAAW,IAAI,SAAS,KAAK,sBAAU,CAAC,QAAQ,EAAE,CAAC;gBAC9E,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AAS;KAC9B,AAHyB,CAGxB;IAyxBJ,uBAAC;CAAA,AA7xBD,CAAsC,KAAK,CAAC,SAAS,GA6xBpD;AA7xBY,4CAAgB","sourcesContent":["import { CartesianChart, IChildProps, IModifiedCartesianChartProps } from '../../components/CommonComponents/index';\nimport {\n IAccessibilityProps,\n IChart,\n IHeatMapChartData,\n IHeatMapChartDataPoint,\n IImageExportOptions,\n} from '../../types/IDataPoint';\nimport { scaleLinear as d3ScaleLinear } from 'd3-scale';\nimport {\n classNamesFunction,\n getId,\n getRTL,\n initializeComponentRef,\n memoizeFunction,\n} from '@fluentui/react/lib/Utilities';\nimport { FocusZoneDirection } from '@fluentui/react-focus';\nimport { DirectionalHint } from '@fluentui/react/lib/Callout';\nimport { IProcessedStyleSet } from '@fluentui/react/lib/Styling';\nimport * as React from 'react';\nimport { IHeatMapChartProps, IHeatMapChartStyleProps, IHeatMapChartStyles } from './HeatMapChart.types';\nimport { ILegend, ILegendContainer, Legends } from '../Legends/index';\nimport { formatToLocaleString } from '@fluentui/chart-utilities';\nimport {\n ChartTypes,\n createNumericYAxis,\n getAccessibleDataObject,\n XAxisTypes,\n YAxisType,\n getTypeOfAxis,\n IMargins,\n IDomainNRange,\n domainRangeOfXStringAxis,\n createStringYAxis,\n sortAxisCategories,\n getContrastTextColor,\n} from '../../utilities/utilities';\nimport { Target } from '@fluentui/react';\nimport { format as d3Format } from 'd3-format';\nimport { timeFormat as d3TimeFormat } from 'd3-time-format';\nimport { toImage } from '../../utilities/image-export-utils';\n\ntype DataSet = {\n dataSet: RectanglesGraphData;\n yAxisPoints: string[];\n xAxisPoints: string[];\n};\ntype FlattenData = IHeatMapChartDataPoint & {\n legend: string;\n};\ninterface IRectRef {\n data: FlattenData;\n refElement: SVGGElement;\n}\ntype RectanglesGraphData = { [key: string]: FlattenData[] };\nexport interface IHeatMapChartState {\n /**\n * contains the selected legend string\n */\n selectedLegend: string;\n /**\n * contains the hovered legend string\n */\n activeLegend: string;\n /**\n * determines wethere to show or hide the callout\n * @default false\n */\n isCalloutVisible: boolean;\n /**\n * y value to be shown in callout\n */\n calloutYValue: string;\n /**\n * legend title to be shown in callout\n */\n calloutLegend: string;\n /**\n * color of the text in the callout\n */\n calloutTextColor: string;\n /**\n * The target that the Callout should try to position itself based on\n */\n target: Target;\n /**\n * ratio to show in the callout\n */\n ratio: [number, number] | null;\n\n /**\n * description message to show in the callout\n */\n descriptionMessage: string;\n /**\n * id to give to callout for accesiblity purpose\n */\n calloutId: string;\n /**\n * Accessibility data for callout\n */\n callOutAccessibilityData?: IAccessibilityProps;\n}\nconst getClassNames = classNamesFunction<IHeatMapChartStyleProps, IHeatMapChartStyles>();\nexport class HeatMapChartBase extends React.Component<IHeatMapChartProps, IHeatMapChartState> implements IChart {\n public static defaultProps: Partial<IHeatMapChartProps> = {\n xAxisCategoryOrder: 'default',\n yAxisCategoryOrder: 'default',\n };\n\n private _classNames: IProcessedStyleSet<IHeatMapChartStyles>;\n private _stringXAxisDataPoints: string[];\n private _stringYAxisDataPoints: string[];\n private _createSet: (\n data: IHeatMapChartData[],\n xDate: string | undefined,\n xNum: string | undefined,\n yDate: string | undefined,\n yNum: string | undefined,\n ) => DataSet;\n private _dataSet: RectanglesGraphData;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private _colorScale: any;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private _xAxisScale: any;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private _yAxisScale: any;\n /**\n * This array contains ref for all the rectangles\n * drawn inside the chard\n */\n private _rectRefArray: { [key: string]: IRectRef } = {};\n private _xAxisType: XAxisTypes;\n private _yAxisType: YAxisType;\n private _calloutAnchorPoint: FlattenData | null;\n private _emptyChartId: string;\n private margins: IMargins;\n private _cartesianChartRef: React.RefObject<IChart>;\n private _legendsRef: React.RefObject<ILegendContainer>;\n\n public constructor(props: IHeatMapChartProps) {\n super(props);\n\n initializeComponentRef(this);\n\n /**\n * below funciton creates a new data set from the prop\n * @data and also finds all the unique x-axis datapoints\n * and y-axis datapoints(which will render in the axis in graph)\n * we store this in a memoized function, because we want to calulate\n * this set whenever props changes.\n */\n this._createSet = memoizeFunction(\n (\n data: IHeatMapChartData[],\n xDate: string | undefined,\n xNum: string | undefined,\n yDate: string | undefined,\n yNum: string | undefined,\n ): DataSet => this._createNewDataSet(data, xDate, xNum, yDate, yNum),\n );\n this.state = {\n selectedLegend: props.legendProps?.selectedLegend ?? '',\n activeLegend: '',\n isCalloutVisible: false,\n target: null,\n calloutLegend: '',\n calloutTextColor: '',\n calloutYValue: '',\n ratio: null,\n descriptionMessage: '',\n calloutId: '',\n };\n this._emptyChartId = getId('_HeatMap_empty');\n this._cartesianChartRef = React.createRef();\n this._legendsRef = React.createRef();\n }\n\n public componentDidUpdate(prevProps: IHeatMapChartProps): void {\n if (prevProps.legendProps?.selectedLegend !== this.props.legendProps?.selectedLegend) {\n this.setState({\n selectedLegend: this.props.legendProps?.selectedLegend ?? '',\n });\n }\n }\n\n public render(): React.ReactNode {\n const { x, y } = this._getXandY();\n this._xAxisType = getTypeOfAxis(x, true) as XAxisTypes;\n this._yAxisType = getTypeOfAxis(y, false) as YAxisType;\n const { data, xAxisDateFormatString, xAxisNumberFormatString, yAxisDateFormatString, yAxisNumberFormatString } =\n this.props;\n this._colorScale = this._getColorScale();\n const { dataSet, xAxisPoints, yAxisPoints } = this._createSet(\n data,\n xAxisDateFormatString,\n xAxisNumberFormatString,\n yAxisDateFormatString,\n yAxisNumberFormatString,\n );\n this._dataSet = dataSet;\n this._stringYAxisDataPoints = yAxisPoints;\n this._stringXAxisDataPoints = xAxisPoints;\n this._classNames = getClassNames(this.props.styles!, { theme: this.props.theme! });\n const calloutProps: IModifiedCartesianChartProps['calloutProps'] = {\n isBeakVisible: false,\n gapSpace: 8,\n ...this.props.calloutProps,\n isCalloutVisible: this.state.isCalloutVisible,\n id: this.state.calloutId,\n YValue: this.state.calloutYValue,\n legend: this.state.calloutLegend,\n color: this.state.calloutTextColor,\n target: this.state.target,\n styles: this._classNames.subComponentStyles.calloutStyles,\n directionalHint: DirectionalHint.topAutoEdge,\n onDismiss: this._closeCallout,\n ...getAccessibleDataObject(this.state.callOutAccessibilityData, 'text', false),\n preventDismissOnLostFocus: true,\n };\n const chartHoverProps: IModifiedCartesianChartProps['chartHoverProps'] = {\n ...(this.state.ratio && {\n ratio: this.state.ratio,\n }),\n descriptionMessage: this.state.descriptionMessage,\n };\n const tickParams = {\n tickValues: this.props.tickValues,\n tickFormat: this.props.tickFormat,\n };\n return !this._isChartEmpty() ? (\n <CartesianChart\n {...this.props}\n chartTitle={this._getChartTitle()}\n points={data}\n chartType={ChartTypes.HeatMapChart}\n xAxisType={XAxisTypes.StringAxis}\n yAxisType={YAxisType.StringAxis}\n calloutProps={calloutProps}\n createYAxis={createNumericYAxis}\n chartHoverProps={chartHoverProps}\n styles={this._classNames.subComponentStyles!.cartesianStyles}\n datasetForXAxisDomain={this._stringXAxisDataPoints}\n stringDatasetForYAxisDomain={this._stringYAxisDataPoints}\n createStringYAxis={createStringYAxis}\n getDomainNRangeValues={this._getDomainNRangeValues}\n getMinMaxOfYAxis={this._getMinMaxOfYAxis}\n getmargins={this._getMargins}\n xAxisTickCount={this._stringXAxisDataPoints.length}\n xAxistickSize={0}\n xAxisPadding={0.02}\n yAxisPadding={0.02}\n svgFocusZoneProps={{\n direction: FocusZoneDirection.bidirectional,\n }}\n legendBars={this._createLegendBars()}\n onChartMouseLeave={this._handleChartMouseLeave}\n ref={this._cartesianChartRef}\n tickParams={tickParams}\n /* eslint-disable react/jsx-no-bind */\n // eslint-disable-next-line react/no-children-prop\n children={(props: IChildProps) => {\n this._xAxisScale = props.xScale;\n this._yAxisScale = props.yScalePrimary;\n return this._createRectangles();\n }}\n />\n ) : (\n <div\n id={this._emptyChartId}\n role={'alert'}\n style={{ opacity: '0' }}\n aria-label={'Graph has no data to display'}\n />\n );\n }\n\n public get chartContainer(): HTMLElement | null {\n return this._cartesianChartRef.current?.chartContainer || null;\n }\n\n public toImage = (opts?: IImageExportOptions): Promise<string> => {\n return toImage(this._cartesianChartRef.current?.chartContainer, this._legendsRef.current?.toSVG, getRTL(), opts);\n };\n\n private _getMinMaxOfYAxis = () => {\n return { startValue: 0, endValue: 0 };\n };\n\n private _getDomainNRangeValues = (\n points: IHeatMapChartDataPoint[],\n margins: IMargins,\n width: number,\n chartType: ChartTypes,\n isRTL: boolean,\n xAxisType: XAxisTypes,\n barWidth: number,\n tickValues: Date[] | number[] | undefined,\n shiftX: number,\n ) => {\n let domainNRangeValue: IDomainNRange;\n if (xAxisType === XAxisTypes.NumericAxis || xAxisType === XAxisTypes.DateAxis) {\n domainNRangeValue = { dStartValue: 0, dEndValue: 0, rStartValue: 0, rEndValue: 0 };\n } else {\n domainNRangeValue = domainRangeOfXStringAxis(this.margins, width, isRTL);\n }\n return domainNRangeValue;\n };\n\n private _getXandY = (): { x: string | Date | number; y: string | Date | number } => {\n let x: string | Date | number = '';\n let y: string | Date | number = '';\n this.props.data.forEach((item: IHeatMapChartData) => {\n if (item.data && item.data.length > 0) {\n x = item.data[0].x;\n y = item.data[0].y;\n return { x, y };\n }\n });\n return { x, y };\n };\n\n private _getMargins = (margins: IMargins) => {\n this.margins = margins;\n };\n\n private _getOpacity = (legendTitle: string): string => {\n const opacity = this._legendHighlighted(legendTitle) || this._noLegendHighlighted() ? '1' : '0.1';\n return opacity;\n };\n\n private _rectRefCallback = (rectElement: SVGGElement, index: number | string, dataPointObject: FlattenData): void => {\n this._rectRefArray[index] = { data: dataPointObject, refElement: rectElement };\n };\n\n private _onRectFocus = (id: string, data: FlattenData): void => {\n this.setState({\n target: this._rectRefArray[id].refElement,\n /** Show the callout if highlighted rectangle is focused and Hide it if unhighlighted rectangle is focused */\n isCalloutVisible: this.state.selectedLegend === '' || this.state.selectedLegend === data.legend,\n calloutYValue: `${data.rectText}`,\n calloutTextColor: Number.isNaN(data.value)\n ? this.props.theme!.semanticColors.bodyText\n : this._colorScale(data.value),\n calloutLegend: data.legend,\n ratio: data.ratio || null,\n descriptionMessage: data.descriptionMessage || '',\n calloutId: id,\n callOutAccessibilityData: data.callOutAccessibilityData,\n });\n };\n\n private _onRectMouseOver = (id: string, data: FlattenData, mouseEvent: React.MouseEvent<SVGGElement>): void => {\n mouseEvent.persist();\n if (this._calloutAnchorPoint !== data) {\n this._calloutAnchorPoint = data;\n this.setState({\n target: this._rectRefArray[id].refElement,\n /** Show the callout if highlighted rectangle is hovered and Hide it if unhighlighted rectangle is hovered */\n isCalloutVisible: this.state.selectedLegend === '' || this.state.selectedLegend === data.legend,\n calloutYValue: `${data.rectText}`,\n calloutTextColor: Number.isNaN(data.value)\n ? this.props.theme!.semanticColors.bodyText\n : this._colorScale(data.value),\n calloutLegend: data.legend,\n ratio: data.ratio || null,\n descriptionMessage: data.descriptionMessage || '',\n calloutId: id,\n callOutAccessibilityData: data.callOutAccessibilityData,\n });\n }\n };\n\n private _onRectBlurOrMouseOut = (): void => {\n /**/\n };\n\n private _handleChartMouseLeave = (): void => {\n this._calloutAnchorPoint = null;\n this.setState({\n isCalloutVisible: false,\n });\n };\n\n /**\n * This is the function which is responsible for\n * drawing the rectangle in the graph and also\n * attaching dom events to that rectangles\n */\n private _createRectangles = (): React.ReactNode => {\n const rectangles: JSX.Element[] = [];\n const yAxisDataPoints = this._stringYAxisDataPoints.slice().reverse();\n /**\n * yAxisDataPoint is noting but the DataPoint\n * which will be rendered on the y-axis\n */\n yAxisDataPoints.forEach((yAxisDataPoint: string) => {\n let index = 0;\n this._stringXAxisDataPoints.forEach((xAxisDataPoint: string) => {\n let rectElement: JSX.Element;\n const id = `x${xAxisDataPoint}y${yAxisDataPoint}`;\n if (\n this._dataSet[yAxisDataPoint][index]?.x === xAxisDataPoint &&\n typeof this._dataSet[yAxisDataPoint][index]?.value === 'number'\n ) {\n /**\n * dataPointObject is an object where it contains information on single\n * data point such as x, y , value, rectText property of the rectangle\n */\n const dataPointObject = this._dataSet[yAxisDataPoint][index];\n const foregroundColor = getContrastTextColor(this._colorScale(dataPointObject.value), this.props.theme!);\n rectElement = (\n <g\n key={id}\n role=\"img\"\n aria-label={this._getAriaLabel(dataPointObject)}\n data-is-focusable={this._legendHighlighted(dataPointObject.legend) || this._noLegendHighlighted()}\n fillOpacity={this._getOpacity(dataPointObject.legend)}\n transform={`translate(${this._xAxisScale(dataPointObject.x)}, ${this._yAxisScale(dataPointObject.y)})`}\n ref={(gElement: SVGGElement) => {\n this._rectRefCallback(gElement, id, dataPointObject);\n }}\n onFocus={this._onRectFocus.bind(this, id, dataPointObject)}\n onBlur={this._onRectBlurOrMouseOut}\n onMouseOver={this._onRectMouseOver.bind(this, id, dataPointObject)}\n onMouseOut={this._onRectBlurOrMouseOut}\n >\n <rect\n fill={this._colorScale(dataPointObject.value)}\n width={this._xAxisScale.bandwidth()}\n height={this._yAxisScale.bandwidth()}\n onClick={dataPointObject.onClick}\n />\n <text\n dominantBaseline={'middle'}\n textAnchor={'middle'}\n className={this._classNames.text}\n transform={`translate(${this._xAxisScale.bandwidth() / 2}, ${this._yAxisScale.bandwidth() / 2})`}\n fill={foregroundColor}\n >\n {formatToLocaleString(dataPointObject.rectText, this.props.culture, this.props.useUTC)}\n </text>\n </g>\n );\n index++;\n } else {\n const dataPointObject: FlattenData = {\n x: xAxisDataPoint,\n y: yAxisDataPoint,\n value: NaN,\n rectText: 'No data available',\n legend: '',\n };\n rectElement = (\n <g\n key={id}\n role=\"img\"\n aria-label={this._getAriaLabel(dataPointObject)}\n data-is-focusable={this._noLegendHighlighted()}\n transform={`translate(${this._xAxisScale(dataPointObject.x)}, ${this._yAxisScale(dataPointObject.y)})`}\n ref={(gElement: SVGGElement) => {\n this._rectRefCallback(gElement, id, dataPointObject);\n }}\n onFocus={this._onRectFocus.bind(this, id, dataPointObject)}\n onBlur={this._onRectBlurOrMouseOut}\n onMouseOver={this._onRectMouseOver.bind(this, id, dataPointObject)}\n onMouseOut={this._onRectBlurOrMouseOut}\n >\n <rect fill=\"transparent\" width={this._xAxisScale.bandwidth()} height={this._yAxisScale.bandwidth()} />\n </g>\n );\n }\n rectangles.push(rectElement);\n });\n });\n return rectangles;\n };\n /**\n * when the legend is hovered we need to highlight\n * all the rectangles which fall under that category\n * and un-highlight the rest of them\n * @param legendTitle\n */\n private _onLegendHover(legendTitle: string): void {\n this.setState({\n activeLegend: legendTitle,\n });\n }\n\n /**\n * when the mouse is out from the legend , we need\n * to show the graph in initial mode.\n */\n private _onLegendLeave(): void {\n this.setState({\n activeLegend: '',\n });\n }\n /**\n * @param legendTitle\n * when the legend is clicked we need to highlight\n * all the rectangles which fall under that category\n * and un highlight the rest of them\n */\n private _onLegendClick(legendTitle: string): void {\n /**\n * check if the legend is already selceted,\n * if yes, un-select the legend, else\n * set the selected legend state to legendTitle\n */\n if (this.state.selectedLegend === legendTitle) {\n this.setState({\n selectedLegend: '',\n });\n } else {\n this.setState({\n selectedLegend: legendTitle,\n });\n }\n }\n private _createLegendBars = (): JSX.Element => {\n const { data, legendProps } = this.props;\n const legends: ILegend[] = [];\n data.forEach((item: IHeatMapChartData) => {\n const legend: ILegend = {\n title: item.legend,\n color: this._colorScale(item.value),\n action: () => {\n this._onLegendClick(item.legend);\n },\n hoverAction: () => {\n this._handleChartMouseLeave();\n this._onLegendHover(item.legend);\n },\n onMouseOutAction: () => {\n this._onLegendLeave();\n },\n };\n legends.push(legend);\n });\n return <Legends {...legendProps} legends={legends} ref={this._legendsRef} />;\n };\n\n private _getColorScale = () => {\n const { domainValuesForColorScale, rangeValuesForColorScale } = this.props;\n return d3ScaleLinear()\n .domain(domainValuesForColorScale)\n .range(rangeValuesForColorScale as unknown as number[]);\n };\n\n private _getXIndex = (value: string | Date | number): string => {\n if (this._xAxisType === XAxisTypes.DateAxis) {\n return `${(value as Date).getTime()}`;\n } else if (this._xAxisType === XAxisTypes.StringAxis) {\n return value as string;\n } else if (this._xAxisType === XAxisTypes.NumericAxis) {\n return `${value}`;\n } else {\n return '';\n }\n };\n private _getYIndex = (value: string | Date | number): string => {\n if (this._yAxisType === YAxisType.DateAxis) {\n return `${(value as Date).getTime()}`;\n } else if (this._yAxisType === YAxisType.StringAxis) {\n return value as string;\n } else if (this._yAxisType === YAxisType.NumericAxis) {\n return `${value}`;\n } else {\n return '';\n }\n };\n\n /**\n * This will create a new data set based on the prop\n * @data\n * We will be using This data set to contsruct our rectangles\n * in the chart, we use this data set becuase, when we loop in this\n * data and build the heat map, it will support accessibility as\n * specified in the figma\n */\n\n private _createNewDataSet = (\n data: IHeatMapChartData[],\n xAxisDateFormatString: string | undefined,\n xAxisNumberFormatString: string | undefined,\n yAxisDateFormatString: string | undefined,\n yAxisNumberFormatString: string | undefined,\n ): DataSet => {\n /**\n * please do not destructure any of the props here,\n * instead send them as parameter to this functions so that\n * this functions get called whenever the prop changes\n */\n const flattenData: FlattenData[] = [];\n /**\n * below for each loop will store all the datapoints in the one array.\n * basically it will flatten the nestesd array (data prop) into single array\n * of object. where each object contains x, y, rectText , value and legend propety of single\n * data point.\n */\n data.forEach((item: IHeatMapChartData) => {\n item.data.forEach((point: IHeatMapChartDataPoint) => {\n flattenData.push({ ...point, legend: item.legend });\n });\n });\n const yPoints: RectanglesGraphData = {};\n const uniqueYPoints: { [key: string]: '1' } = {};\n const uniqueXPoints: { [key: string]: '1' } = {};\n flattenData.forEach((item: FlattenData) => {\n const posX = this._getXIndex(item.x);\n const posY = this._getYIndex(item.y);\n\n uniqueXPoints[posX] = '1';\n uniqueYPoints[posY] = '1';\n /** we will check if the property(posY) is already there in object, if Yes,\n * then we will append the item in the Array related to the pos, if not\n * then we will simply append the item in the new Array and\n * assign that array to the property (posY) in the Object\n * and finally we will get the array of Objects associated to each\n * property (which is nothing but y data point) and object in the\n * array are noting but x data points associated to the property y\n */\n if (yPoints[posY]) {\n yPoints[posY] = [...yPoints[posY], item];\n } else {\n yPoints[posY] = [item];\n }\n });\n /**\n * we will now sort(ascending) the array's of y data point based on the x value\n * sorting is important to achive the accessibility order of the\n * rectangles and then format the x and y datapoints respectively\n */\n Object.keys(yPoints).forEach((item: string) => {\n yPoints[item] = this._getOrderedXPoints(yPoints[item]);\n\n yPoints[item].forEach((datapoint: IHeatMapChartDataPoint) => {\n if (this._xAxisType === XAxisTypes.DateAxis) {\n datapoint.x = this._getStringFormattedDate(datapoint.x as string, xAxisDateFormatString);\n }\n if (this._xAxisType === XAxisTypes.NumericAxis) {\n datapoint.x = this._getStringFormattedNumber(datapoint.x as string, xAxisNumberFormatString);\n }\n if (this._xAxisType === XAxisTypes.StringAxis) {\n datapoint.x = this._getFormattedLabelForXAxisDataPoint(datapoint.x as string);\n }\n if (this._yAxisType === YAxisType.DateAxis) {\n datapoint.y = this._getStringFormattedDate(datapoint.y as string, yAxisDateFormatString);\n }\n if (this._yAxisType === YAxisType.NumericAxis) {\n datapoint.y = this._getStringFormattedNumber(datapoint.y as string, yAxisNumberFormatString);\n }\n if (this._yAxisType === YAxisType.StringAxis) {\n datapoint.y = this._getFormattedLabelForYAxisDataPoint(datapoint.y as string);\n }\n });\n });\n /**\n * if y-axis data points are of type date or number or if we have string formatter,\n * then we need to change data points to their respective string\n * format, becuase in the private variable this._stringYAxisDatapoints, points will be stored in\n * string format. and in here `yPoint` are not so we need to change, so that\n * function `this._createRectangles` should work perfetcly while looping, and if we don't change\n * then `this._createRectangles` will fail while looping, causing the error\n * Cannot read property 'forEach' of undefined\n */\n\n Object.keys(yPoints).forEach((yPoint: string) => {\n if (this._yAxisType === YAxisType.DateAxis) {\n yPoints[this._getStringFormattedDate(yPoint, yAxisDateFormatString)] = yPoints[yPoint];\n } else if (this._yAxisType === YAxisType.NumericAxis) {\n yPoints[`${this._getStringFormattedNumber(yPoint, yAxisNumberFormatString)}`] = yPoints[yPoint];\n } else {\n yPoints[this._getFormattedLabelForYAxisDataPoint(yPoint)] = yPoints[yPoint];\n }\n });\n /**\n * assigning new data set\n */\n const dataSet = yPoints;\n /**\n * These are the Y axis data points which will get rendered in the\n * Y axis in graph\n */\n const yAxisPoints = this._getYAxisDataPoints(uniqueYPoints);\n /**\n * These are the x axis data points which will get rendered in the\n * x axis in the graph\n */\n\n const xAxisPoints = this._getXAxisDataPoints(uniqueXPoints);\n return {\n dataSet,\n yAxisPoints,\n xAxisPoints,\n };\n };\n\n /**\n * This function will return the final sorted and formatted x-axis points\n * which will be rendered on the x-axis\n * @param points\n * @returns x-axis points\n */\n private _getXAxisDataPoints = (points: { [key: string]: '1' }): string[] => {\n let xAxisPoints: string[] = [];\n const unFormattedXAxisDataPoints = this._getOrderedXAxisLabels(points);\n xAxisPoints = unFormattedXAxisDataPoints.map((xPoint: string) => {\n if (this._xAxisType === XAxisTypes.DateAxis) {\n return this._getStringFormattedDate(xPoint, this.props.xAxisDateFormatString);\n } else if (this._xAxisType === XAxisTypes.NumericAxis) {\n return this._getStringFormattedNumber(xPoint, this.props.xAxisNumberFormatString);\n } else {\n return this._getFormattedLabelForXAxisDataPoint(xPoint);\n }\n });\n\n return xAxisPoints;\n };\n /**\n * This function will return the final sorted and formatted y-axis points\n * which will be rendered on the y-axis\n * @param points\n * @returns yaxis points\n */\n private _getYAxisDataPoints = (points: { [key: string]: '1' }): string[] => {\n let yAxisPoints: string[] = [];\n const unFormattedYAxisDataPoints = this._getOrderedYAxisLabels(points);\n yAxisPoints = unFormattedYAxisDataPoints.map((yPoint: string) => {\n if (this._yAxisType === YAxisType.DateAxis) {\n return this._getStringFormattedDate(yPoint, this.props.yAxisDateFormatString);\n } else if (this._yAxisType === YAxisType.NumericAxis) {\n return this._getStringFormattedNumber(yPoint, this.props.yAxisNumberFormatString);\n } else {\n return this._getFormattedLabelForYAxisDataPoint(yPoint);\n }\n });\n\n return yAxisPoints;\n };\n\n private _getStringFormattedDate = (point: string, formatString?: string): string => {\n const date = new Date();\n date.setTime(+point);\n return d3TimeFormat(formatString || '%b/%d')(date);\n };\n\n private _getStringFormattedNumber = (point: string, formatString?: string): string => {\n return d3Format(formatString || '.2~s')(+point);\n };\n\n private _getFormattedLabelForXAxisDataPoint = (point: string): string => {\n const { xAxisStringFormatter } = this.props;\n return xAxisStringFormatter ? xAxisStringFormatter(point) : point;\n };\n\n private _getFormattedLabelForYAxisDataPoint = (point: string): string => {\n const { yAxisStringFormatter } = this.props;\n return yAxisStringFormatter ? yAxisStringFormatter(point) : point;\n };\n\n private _closeCallout = () => {\n this.setState({\n isCalloutVisible: false,\n });\n };\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 private _legendHighlighted = (legendTitle: string) => {\n return (\n this.state.selectedLegend === legendTitle ||\n (this.state.selectedLegend === '' && this.state.activeLegend === legendTitle)\n );\n };\n\n /**\n * This function checks if none of the legends is selected or hovered.\n */\n private _noLegendHighlighted = () => {\n return this.state.selectedLegend === '' && this.state.activeLegend === '';\n };\n\n private _getAriaLabel = (point: FlattenData): string => {\n const xValue = point.x;\n const yValue = point.y;\n const legend = point.legend;\n const zValue = point.ratio ? `${point.ratio[0]}/${point.ratio[1]}` : point.rectText || point.value;\n const description = point.descriptionMessage;\n return (\n point.callOutAccessibilityData?.ariaLabel ||\n `${xValue}, ${yValue}. ${legend}, ${zValue}.` + (description ? ` ${description}.` : '')\n );\n };\n\n private _isChartEmpty(): boolean {\n return !(this.props.data && this.props.data.length > 0);\n }\n\n private _getChartTitle = (): string => {\n const { chartTitle } = this.props;\n const numDataPoints = this.props.data.reduce((acc, curr) => acc + curr.data.length, 0);\n return (chartTitle ? `${chartTitle}. ` : '') + `Heat map chart with ${numDataPoints} data points. `;\n };\n\n private _getOrderedXAxisLabels = (points: { [key: string]: '1' }) => {\n if (!this._shouldOrderXAxisLabelsByCategoryOrder()) {\n // Keep the original ordering logic as the default behavior to ensure backward compatibility\n return Object.keys(points).sort((a: string, b: string) => {\n if (this._xAxisType === XAxisTypes.DateAxis || this._xAxisType === XAxisTypes.NumericAxis) {\n return +a - +b;\n } else {\n return this.props.sortOrder === 'none' ? 0 : a.toLowerCase() > b.toLowerCase() ? 1 : -1;\n }\n });\n }\n\n return sortAxisCategories(this._mapCategoryToValues(), this.props.xAxisCategoryOrder);\n };\n\n private _getOrderedYAxisLabels = (points: { [key: string]: '1' }) => {\n if (!this._shouldOrderYAxisLabelsByCategoryOrder()) {\n // Keep the original ordering logic as the default behavior to ensure backward compatibility\n return Object.keys(points).sort((a: string, b: string) => {\n if (this._yAxisType === YAxisType.DateAxis || this._yAxisType === YAxisType.NumericAxis) {\n return +a - +b;\n } else {\n return this.props.sortOrder === 'none' ? 0 : a.toLowerCase() > b.toLowerCase() ? 1 : -1;\n }\n });\n }\n\n return sortAxisCategories(this._mapCategoryToValues(true), this.props.yAxisCategoryOrder);\n };\n\n private _getOrderedXPoints = (xPoints: FlattenData[]) => {\n if (!this._shouldOrderXAxisLabelsByCategoryOrder()) {\n return xPoints.sort((a: IHeatMapChartDataPoint, b: IHeatMapChartDataPoint) => {\n if (this._xAxisType === XAxisTypes.StringAxis) {\n return this.props.sortOrder === 'none'\n ? 0\n : (a.x as string).toLowerCase() > (b.x as string).toLowerCase()\n ? 1\n : -1;\n } else if (this._xAxisType === XAxisTypes.DateAxis) {\n return (a.x as Date).getTime() - (b.x as Date).getTime();\n } else if (this._xAxisType === XAxisTypes.NumericAxis) {\n return +(a.x as string) > +(b.x as string) ? 1 : -1;\n } else {\n return a.x > b.x ? 1 : -1;\n }\n });\n }\n\n const result: FlattenData[] = [];\n\n const xValueToPoints: Record<string, FlattenData[]> = {};\n xPoints.forEach(point => {\n const xValue = point.x as string;\n if (!xValueToPoints[xValue]) {\n xValueToPoints[xValue] = [];\n }\n xValueToPoints[xValue].push(point);\n });\n\n const xAxisLabels = this._getOrderedXAxisLabels({});\n xAxisLabels.forEach(xValue => {\n if (xValueToPoints[xValue]) {\n result.push(...xValueToPoints[xValue]);\n }\n });\n\n return result;\n };\n\n private _shouldOrderXAxisLabelsByCategoryOrder = () => {\n return this._xAxisType === XAxisTypes.StringAxis && this.props.xAxisCategoryOrder !== 'default';\n };\n\n private _shouldOrderYAxisLabelsByCategoryOrder = () => {\n return this._yAxisType === YAxisType.StringAxis && this.props.yAxisCategoryOrder !== 'default';\n };\n\n private _mapCategoryToValues = (isYAxis = false) => {\n const categoryToValues: Record<string, number[]> = {};\n this.props.data.forEach(item => {\n item.data.forEach(point => {\n const category = (isYAxis ? point.y : point.x) as string;\n if (!categoryToValues[category]) {\n categoryToValues[category] = [];\n }\n categoryToValues[category].push(point.value);\n });\n });\n return categoryToValues;\n };\n}\n"]}
|
|
@@ -14,6 +14,8 @@ export interface ILineChartState extends IBasestate {
|
|
|
14
14
|
xAxisCalloutAccessibilityData?: IAccessibilityProps;
|
|
15
15
|
nearestCircleToHighlight: ILineChartDataPoint | null;
|
|
16
16
|
activeLine: number | null;
|
|
17
|
+
YValue: string | number;
|
|
18
|
+
legendVal: string;
|
|
17
19
|
}
|
|
18
20
|
export declare class LineChartBase extends React.Component<ILineChartProps, ILineChartState> implements IChart {
|
|
19
21
|
static defaultProps: Partial<ILineChartProps>;
|