Skip to content

Commit

Permalink
feat: add alt text for other chart types
Browse files Browse the repository at this point in the history
  • Loading branch information
rshen91 committed Apr 13, 2021
1 parent 3564f82 commit 9f1c52e
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 21 deletions.
31 changes: 20 additions & 11 deletions src/chart_types/goal_chart/renderer/canvas/connected_component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -110,17 +110,26 @@ class Component extends React.Component<Props> {
}

return (
<canvas
ref={forwardStageRef}
className="echCanvasRenderer"
width={width * this.devicePixelRatio}
height={height * this.devicePixelRatio}
onMouseMove={this.handleMouseMove.bind(this)}
style={{
width,
height,
}}
/>
<figure>
<canvas
ref={forwardStageRef}
className="echCanvasRenderer"
width={width * this.devicePixelRatio}
height={height * this.devicePixelRatio}
onMouseMove={this.handleMouseMove.bind(this)}
style={{
width,
height,
}}
// eslint-disable-next-line jsx-a11y/no-interactive-element-to-noninteractive-role
role="presentation"
>
<dl className="echScreenReaderOnly">
<dt>Chart type</dt>
<dd>Goal chart</dd>
</dl>
</canvas>
</figure>
);
}

Expand Down
30 changes: 20 additions & 10 deletions src/chart_types/heatmap/renderer/canvas/connected_component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ class Component extends React.Component<Props> {
}
}

// eslint-disable-next-line @typescript-eslint/member-ordering
render() {
const {
initialized,
Expand All @@ -107,16 +108,25 @@ class Component extends React.Component<Props> {
return null;
}
return (
<canvas
ref={forwardStageRef}
className="echCanvasRenderer"
width={width * this.devicePixelRatio}
height={height * this.devicePixelRatio}
style={{
width,
height,
}}
/>
<figure>
<canvas
ref={forwardStageRef}
className="echCanvasRenderer"
width={width * this.devicePixelRatio}
height={height * this.devicePixelRatio}
style={{
width,
height,
}}
// eslint-disable-next-line jsx-a11y/no-interactive-element-to-noninteractive-role
role="presentation"
>
<dl className="echScreenReaderOnly">
<dt>Chart type</dt>
<dd>Heatmap</dd>
</dl>
</canvas>
</figure>
);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ function layoutMaker(config: Configs, data: Datum[]) {

const View = ({ words, conf }: { words: Word[]; conf: Configs }) => (
<svg width={getWidth(conf)} height={getHeight(conf)}>
<title>Chart type: word cloud</title>
<g transform={`translate(${getWidth(conf) / 2}, ${getHeight(conf) / 2})`}>
{words.map((d, i) => {
return (
Expand Down

0 comments on commit 9f1c52e

Please sign in to comment.