Skip to content

Commit

Permalink
done (recharts#2960)
Browse files Browse the repository at this point in the history
  • Loading branch information
saghan authored Dec 8, 2022
1 parent 5a1bf15 commit 9c46223
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/cartesian/Bar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,7 @@ export class Bar extends PureComponent<Props, State> {
className="recharts-bar-rectangle"
{...adaptEventsOfChild(this.props, entry, i)}
key={`rectangle-${i}`} // eslint-disable-line react/no-array-index-key
role="img"
>
{Bar.renderRectangle(shape, props)}
</Layer>
Expand Down
2 changes: 1 addition & 1 deletion src/cartesian/Line.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ export class Line extends PureComponent<Props, State> {
};

return (
<Layer className="recharts-line-dots" key="dots" {...dotsProps}>
<Layer className="recharts-line-dots" key="dots" {...dotsProps} role="img">
{dots}
</Layer>
);
Expand Down
1 change: 1 addition & 0 deletions src/cartesian/Scatter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,7 @@ export class Scatter extends PureComponent<Props, State> {
className="recharts-scatter-symbol"
{...adaptEventsOfChild(this.props, entry, i)}
key={`symbol-${i}`} // eslint-disable-line react/no-array-index-key
role="img"
>
{Scatter.renderSymbolItem(activeIndex === i ? activeShape : shape, props)}
</Layer>
Expand Down
5 changes: 4 additions & 1 deletion src/chart/Sankey.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -615,7 +615,9 @@ export class Sankey extends PureComponent<Props, State> {
return option(props);
}

return <Rectangle className="recharts-sankey-node" fill="#0088fe" fillOpacity="0.8" {...filterProps(props)} />;
return (
<Rectangle className="recharts-sankey-node" fill="#0088fe" fillOpacity="0.8" {...filterProps(props)} role="img" />
);
}

renderNodes(nodes: SankeyNode[]) {
Expand Down Expand Up @@ -690,6 +692,7 @@ export class Sankey extends PureComponent<Props, State> {
<div
className={classNames('recharts-wrapper', className)}
style={{ ...style, position: 'relative', cursor: 'default', width, height }}
role="region"
>
<Surface {...attrs} width={width} height={height}>
{filterSvgElements(children)}
Expand Down
2 changes: 2 additions & 0 deletions src/chart/Treemap.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -601,6 +601,7 @@ export class Treemap extends PureComponent<Props, State> {
fill={nodeProps.depth < 2 ? colors[index % colors.length] : 'rgba(255,255,255,0)'}
stroke="#fff"
{..._.omit(nodeProps, 'children')}
role="img"
/>
{arrow}
{text}
Expand Down Expand Up @@ -734,6 +735,7 @@ export class Treemap extends PureComponent<Props, State> {
<div
className={classNames('recharts-wrapper', className)}
style={{ ...style, position: 'relative', cursor: 'default', width, height }}
role="region"
>
<Surface {...attrs} width={width} height={type === 'nest' ? height - 30 : height}>
{this.renderAllNodes()}
Expand Down
1 change: 1 addition & 0 deletions src/chart/generateCategoricalChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2137,6 +2137,7 @@ export const generateCategoricalChart = ({
ref={node => {
this.container = node;
}}
role="region"
>
<Surface {...attrs} width={width} height={height} title={title} desc={desc}>
{this.renderClipPath()}
Expand Down
1 change: 1 addition & 0 deletions src/numberAxis/Funnel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,7 @@ export class Funnel extends PureComponent<Props, State> {
className="recharts-funnel-trapezoid"
{...adaptEventsOfChild(this.props, entry, i)}
key={`trapezoid-${i}`} // eslint-disable-line react/no-array-index-key
role="img"
>
{Funnel.renderTrapezoidItem(trapezoidOptions, trapezoidProps)}
</Layer>
Expand Down
2 changes: 1 addition & 1 deletion src/shape/Sector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,6 @@ export class Sector extends PureComponent<Props> {
path = getSectorPath({ cx, cy, innerRadius, outerRadius, startAngle, endAngle });
}

return <path {...filterProps(this.props, true)} className={layerClass} d={path} />;
return <path {...filterProps(this.props, true)} className={layerClass} d={path} role="img" />;
}
}

0 comments on commit 9c46223

Please sign in to comment.