@@ -404,7 +404,6 @@ sub init_graph {
404404
405405 my $JSXOptions = Mojo::JSON::encode_json({
406406 title => $axes -> style(' aria_label' ),
407- description => $axes -> style(' aria_description' ),
408407 boundingBox => [ $xmin , $ymax , $xmax , $ymin ],
409408 axis => 0,
410409 showNavigation => $allow_navigation ,
@@ -497,6 +496,12 @@ sub init_graph {
497496 $self -> {JSend } = ' ' ;
498497 $self -> {JS } = <<~ "END_JS" ;
499498 const board = JXG.JSXGraph.initBoard(id, $JSXOptions );
499+ const descriptionSpan = document.createElement('span');
500+ descriptionSpan.id = `\$ {id}_description`;
501+ descriptionSpan.classList.add('visually-hidden');
502+ descriptionSpan.textContent = '${\( $axes ->style('aria_description'))}';
503+ board.containerObj.after(descriptionSpan);
504+ board.containerObj.setAttribute('aria-describedby', descriptionSpan.id);
500505 board.suspendUpdate();
501506 board.create('axis', [[$xmin , $xaxis_pos ], [$xmax , $xaxis_pos ]], $XAxisOptions );
502507 board.create('axis', [[$yaxis_pos , $ymin ], [$yaxis_pos , $ymax ]], $YAxisOptions );
0 commit comments