Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions client/src/components/body/Reading/Reading.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ const Reading = (props) => {
);
const [originalPieLabels, setOriginalPieLabels] = useState([]);
const [mobileLabelWrap, setMobileLabelWrap] = useState(false);
const [accessiblePieLabel, setAccessiblePieLabel] = useState("");
let [scrollPositionPercentage, setScrollPositionPercentage] = useState(0);
let [seconds, setSeconds] = useState(0);
let [pagePosition, setPagePosition] = useState([]);
Expand Down Expand Up @@ -195,6 +196,18 @@ const Reading = (props) => {
return labelsForReturn;
}

const createAccessiblePieLabel = (pieLabels, pieDataSet, pieTitle) => {
let formattedLabel = "Pie chart titled '" + pieTitle + "' with data: ";
for (let index = 0; index < pieLabels.length; index++) {
if (index != pieLabels.length - 1) {
formattedLabel += pieLabels[index] + ": " + pieDataSet[index] + ", ";
} else {
formattedLabel += pieLabels[index] + ": " + pieDataSet[index] + ".";
}
}
setAccessiblePieLabel(formattedLabel);
};

useEffect(() => {
const windowResizeEvent = () => {
if (window.innerWidth > PIE_WINDOW_RESIZE_WIDTH) {
Expand Down Expand Up @@ -224,6 +237,11 @@ const Reading = (props) => {
);
}
}
createAccessiblePieLabel(
data[0].reading.piechart.data.labels,
data[0].reading.piechart.data.datasets[0].data,
data[0].reading.piechart.header,
);
setReadingData(data[0].reading);
});

Expand Down Expand Up @@ -360,6 +378,8 @@ const Reading = (props) => {
data={readingData?.piechart.data}
options={largeViewPortOptions}
height={!isImagine && PIE_SIZE}
aria-label={accessiblePieLabel}
role="img"
/>
</div>
{readingData?.piechart?.caption !== "" &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ const RSAEncryption = () => {
} catch (err) {
// On some older systems, the 'crypto' library doesn't have full compatibility.
// Instead of *actually* doing RSA, we fake it and just shuffle some numbers.

let publicKey =
"69d8e47ce6873023aa78cfe7d7e0f93f5276fc3f704872b072a49e5c5c5a8480545bc614ff2ddcb8cf157b2500bb2695f2beaa1df4a55d25c985a7a6c6d48603c34cf67b717a31832d141ab485b78935fc6231d231cc987680ba8855a5d4505363323882c256abec86839466ef45194837f09e3c07f675b4b792524eba1b14cef21ffa2fad22d158851419167cc6ff4b166951c7645ff1bcf96f4c281f76a05fcb57c3eb9b8e93b13e87d04edebe6fed";
let n =
Expand Down
Loading