diff --git a/CHANGELOG.md b/CHANGELOG.md index 48740ebe5..896fd6692 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ ### ✨ New features/enhancements - Made the graph's zoom, reset view and sidebar buttons keyboard and screen reader accessible (accessible names, visible focus outlines, and activation with Enter/Space) +- Added an accessible name and description to the graph SVG, labelled its course areas and courses groups, labelled each course with its text, and hid decorative parts (arrows, and/or nodes, region shapes, and shadow and blur effects) from screen readers - Changed the colour of hybrid nodes to avoid a visual clash with the darkened background when selecting a focus - Updated section codes on the grid page to match the official timetable builder (listed as LEC/TUT/PRA instead of L/T/P) - Updated text on the course panel of the grid page to better communicate the panel's behaviour diff --git a/js/components/graph/Graph.js b/js/components/graph/Graph.js index 022a7ef03..3a1e2db2c 100644 --- a/js/components/graph/Graph.js +++ b/js/components/graph/Graph.js @@ -8,6 +8,7 @@ import Edge from "./Edge" import Node from "./Node" import Button from "./Button" import InfoBox from "./InfoBox" +import { GRAPH_A11Y_TEXT, getGraphA11yDescription, getGraphA11yName } from "./a11y" import GraphCanvas, { NODE_DROPSHADOW_FILTER_ID } from "./GraphCanvas" import Sidebar from "./Sidebar" import { numCredits, transformPoint, formatTransform } from "./util" @@ -921,7 +922,13 @@ export class Graph extends React.Component { ) } - return {Object.values(boolsJSON).map(generateBool)} + // Hidden from screen readers: an "and"/"or" read on its own, away from the + // courses it connects, is meaningless + return ( + + ) } /** @@ -970,7 +977,12 @@ export class Graph extends React.Component { } }) - return {edgesCopy.map(generateEdge)} + // Hidden from screen readers: the arrows are purely visual + return ( + + ) } /** @@ -995,7 +1007,7 @@ export class Graph extends React.Component { nodeDropshadowFilter ) => { return ( - + {Object.values(hybridsJSON).map(entry => { return ( + return ( +