@@ -21,7 +21,7 @@ import React, { MouseEvent, RefObject } from 'react';
2121import { connect } from 'react-redux' ;
2222import { bindActionCreators , Dispatch } from 'redux' ;
2323
24- import { ScreenReaderSummary } from '../../../../components/accessibility' ;
24+ import { GoalSemanticDescription , ScreenReaderSummary } from '../../../../components/accessibility' ;
2525import { onChartRendered } from '../../../../state/actions/chart' ;
2626import { GlobalChartState } from '../../../../state/chart_state' ;
2727import {
@@ -31,15 +31,18 @@ import {
3131} from '../../../../state/selectors/get_accessibility_config' ;
3232import { getInternalIsInitializedSelector , InitStatus } from '../../../../state/selectors/get_internal_is_intialized' ;
3333import { Dimensions } from '../../../../utils/dimensions' ;
34- import { nullShapeViewModel , ShapeViewModel } from '../../layout/types/viewmodel_types' ;
34+ import { BandViewModel , nullShapeViewModel , ShapeViewModel } from '../../layout/types/viewmodel_types' ;
3535import { geometries } from '../../state/selectors/geometries' ;
36+ import { getFirstTickValueSelector , getGoalChartSemanticDataSelector } from '../../state/selectors/get_goal_chart_data' ;
3637import { renderCanvas2d } from './canvas_renderers' ;
3738
3839interface ReactiveChartStateProps {
3940 initialized : boolean ;
4041 geometries : ShapeViewModel ;
4142 chartContainerDimensions : Dimensions ;
4243 a11ySettings : A11ySettings ;
44+ bandLabels : BandViewModel [ ] ;
45+ firstValue : number ;
4346}
4447
4548interface ReactiveChartDispatchProps {
@@ -112,11 +115,12 @@ class Component extends React.Component<Props> {
112115 chartContainerDimensions : { width, height } ,
113116 forwardStageRef,
114117 a11ySettings,
118+ bandLabels,
119+ firstValue,
115120 } = this . props ;
116121 if ( ! initialized || width === 0 || height === 0 ) {
117122 return null ;
118123 }
119-
120124 return (
121125 < figure aria-labelledby = { a11ySettings . labelId } aria-describedby = { a11ySettings . descriptionId } >
122126 < canvas
@@ -133,6 +137,7 @@ class Component extends React.Component<Props> {
133137 role = "presentation"
134138 >
135139 < ScreenReaderSummary />
140+ < GoalSemanticDescription bandLabels = { bandLabels } firstValue = { firstValue } { ...a11ySettings } />
136141 </ canvas >
137142 </ figure >
138143 ) ;
@@ -172,6 +177,8 @@ const DEFAULT_PROPS: ReactiveChartStateProps = {
172177 top : 0 ,
173178 } ,
174179 a11ySettings : DEFAULT_A11Y_SETTINGS ,
180+ bandLabels : [ ] ,
181+ firstValue : 0 ,
175182} ;
176183
177184const mapStateToProps = ( state : GlobalChartState ) : ReactiveChartStateProps => {
@@ -183,6 +190,8 @@ const mapStateToProps = (state: GlobalChartState): ReactiveChartStateProps => {
183190 geometries : geometries ( state ) ,
184191 chartContainerDimensions : state . parentDimensions ,
185192 a11ySettings : getA11ySettingsSelector ( state ) ,
193+ bandLabels : getGoalChartSemanticDataSelector ( state ) ,
194+ firstValue : getFirstTickValueSelector ( state ) ,
186195 } ;
187196} ;
188197
0 commit comments