[R-pkg-devel] Screen reader help request

Duncan Murdoch murdoch@dunc@n @end|ng |rom gm@||@com
Sat Mar 18 00:20:08 CET 2023


Thanks very much for your response.

The two images where the tags showed up are regular figures, using 
lattice and base graphics.  There are also a lot of rgl figures, which 
have HTML code like this in the source .html file:

   <div id="rgl61108" style="width:480px;height:296.662546353523px;" 
class="rglWebGL html-widget "></div>

(Looks like I should think about rounding the height value!)

All the interesting stuff (including the alt tags) is added within the 
div by Javascript that runs after the page is loaded.  The fact that it 
didn't show up in your reader indicates to me that either it needs to be 
there before the Javascript runs, or that I put the text in the wrong 
place.  I'll try a few variations on the code and hopefully find 
something that works.

Your comments about the content of the tags was also very helpful.  I am 
imagining that there are at least two groups of readers who might make 
use of them:

   - readers who would skip over the graphics completely, but who would 
be helped by knowing what they missed.

   - readers who can get information from the graphics but only with an 
effort, so they would want to know where to apply that effort.

For the document I posted, there might not be very many people in either 
group, but I'm hoping to make the package useful to others, who would be 
writing documents with different audiences.

Duncan Murdoch

On 17/03/2023 5:18 p.m., Jonathan Godfrey wrote:
> Hello Duncan,
> 
> I guess a few people might expect me to contribute to your request. First I'll assure you that two graphics do have an alt tag which my screen reader is telling me about, so in a sense that is success. I did not check with multiple screen readers or different browsers because I would only find fault if I used inferior software; I expect success with JAWS or NVDA to represent the other and likewise for browsers. These two successes are the lattice and base graphics relating to the volcano data. Others are not showing to my screen reader (JAWS) and browser (Chrome) on my OS (Windows). I note that these are inserted using <img> though.
> 
> What should appear in an alt tag is an area of much debate though, and the attitude towards their creation differs widely. I believe that the context is the primary driver for what should be communicated. In your context, where you are obviously writing about the package (in general) and comparison of lattice v base graphics (where I do see the alt tags), it is the main text that should be communicating with your audience. You know what you are writing and why. If you do not write about the differences then you leave it up to chance that your (mostly visually-dependent) audience sees the differences that matter to you and your efforts as an author/developer. Complementing that information intended for the whole audience with a sensible alt tag on the graphics for the blind part of your audience, would be fundamentally different to what you might need to offer for the same graphics in another context, say an analysis feeding into a business report for example. In your context, the blind person needs to know that the graphic does appear, and that the graphic has a unique (enough) label to make it obvious which graphic appeared where. We do not need a full description of every last detail of each graphic, although in other contexts, that is exactly what we need.
> 
> Generating alt tag text automatically (no human interaction) is going to deliver on the technical aspects, without the analytic outcomes, although our recent efforts with the BrailleR package are trying to offer more and more factual information that could help with the analysis of the data. Our main aim is to assure the blind producer of a graphic that it does actually exist and what (roughly) it shows; it would not be great text for an alt tag in most circumstances. I've done some limited testing with AI solutions but haven't yet been overwhelmed by positive experiences.
> 
> Anyone using an R markdown workflow can add alt text using the fig.alt option in the header of their chunks. Without that, the fig.cap option is used, and if neither is used, the screen reader user is victim to their personal settings. (We choose whether to be told about unlabelled graphics which used to be helpful for ignoring advertising.) I don't put unique alt tags in all of my work because I just need to convey that the graphic is there, but I do make sure there is a default bit of text that saves blind users with the wrong settings from their decisions.
> 
> 
> An author wishing to support blind consumers of their efforts, could spend lots of time working out what to write, and never get it perfectly correct because the desires of those consumers are not homogeneous. I advise people to use an alt tag, but to make sure it does not duplicate what is already said in the main text of their document. Authors already do this when thinking about the right caption for their figures, but it is easy to see how varied that can be. At least the target audience of captions is well known to the author given the author is part of that population; in contrast, most authors are not blind and may over or under-estimate the needs of the blind readers of their work. Before doing everything an individual requests, please make sure that what is being sought is in keeping with what you are hoping to communicate.
> 
> I despair at the retrospective creation of alt tags, especially if applied to living documents. Creation of alt tags is simple for anyone using regular markdown based insertion of their graphics because the ![]() construct embraces them in the []. Authors using a LaTeX workflow must load an additional package and add an optional argument to their \includegraphics{} commands. MS Word users can label their graphics anytime but of late there is an increased use of an automated alt tag creation for them (and messages in Outlook too for that matter). I am loathed to fully describe the LaTeX pipeline unless the author is also committed to producing their output in HTML as I have utter contempt for the pdf (or post script) that is the default for most authors using any TeX workflows.
> 
> Post hoc editing of html is perhaps the worst possible action I observe. This process has separated the creator of the content from the creator of the access for blind people, and is heavily reliant on the skill set of the accessibility "expert". Such editing is common in university settings where the Disability Support Service is responsible for the accessibility. If I was an undergraduate today, I'd be camping outside the doors of my teaching staff to get the alt tags inserted. I spent plenty of time back then, sitting in corridors waiting my turn, but so many of the access challenges of the dead-tree era are thankfully behind us.
> 
> 
> I'm curious though that a blind person is going to benefit much from your package given so much of what I read relies on using a mouse, or having the ability to imagine the 3d data projected into an inherently 2d page/screen/image. In turn, that inaccessibility might heavily influence my effort to provide comprehensive alt tags.
> 
> I'd be more than happy to continue this conversation, and to do so on list because I think there are so many opportunities on offer today for people to embrace; many of which will not create piles of extra work.
> 
> Jonathan
> 
> 
> 
> -----Original Message-----
> From: R-package-devel <r-package-devel-bounces using r-project.org> On Behalf Of Duncan Murdoch
> Sent: Saturday, 18 March 2023 8:26 am
> To: r-package-devel using r-project.org
> Subject: [R-pkg-devel] Screen reader help request
> 
> I received a request a few days ago to add alt text to the plots in the HTML vignettes for the rgl package.
> 
> That was easy to do, and I did it, but realized most of the graphics that rgl produces are not in <img> format, they are WebGL canvases, and those don't support the same method of adding alternate text.  Online I've seen a variety of suggestions about how to do it for <canvas> elements, and have implemented one of them.
> 
> Could I ask someone who is familiar with one or more screen readers to test whether the method that I used works?  A sample web page produced with the new code is here:
> 
>     https://apc01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdmurdoch.github.io%2Frgl%2Fdev%2Farticles%2Frgl.html&data=05%7C01%7Ca.j.godfrey%40massey.ac.nz%7Ccd3d6ce4f3e1439e61da08db271d7564%7C388728e1bbd0437898dcf8682e644300%7C1%7C0%7C638146779729138276%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=V0dX8tOrAEZQIVizo%2FBrdB3zEXJRfIXUqqVvPiEMcHY%3D&reserved=0
> 
> The very first graphic is a plot of the iris data, and it should have alt text reading "rglwidget in chunk unnamed-chunk-1".
> 
> That was default text generated without user input, users could put whatever they wanted there instead.
> 
> Some related questions:
> 
>    - Could you suggest better default text to use?
> 
>    - Could you suggest good custom text for this particular graphic?
> 
>    - The text is inserted when some Javascript has run to initialize the page, so if the Javascript fails, there'll be no alt text.  Is that a reasonable limitation?
> 
> Duncan Murdoch
> 
> ______________________________________________
> R-package-devel using r-project.org mailing list
> https://apc01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fstat.ethz.ch%2Fmailman%2Flistinfo%2Fr-package-devel&data=05%7C01%7Ca.j.godfrey%40massey.ac.nz%7Ccd3d6ce4f3e1439e61da08db271d7564%7C388728e1bbd0437898dcf8682e644300%7C1%7C0%7C638146779729138276%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=8veaIHKoCRAfYGC%2BIAdBFVJ7JgHmtGjveuHI6fSTASs%3D&reserved=0
> 
> ______________________________________________
> R-package-devel using r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-package-devel



More information about the R-package-devel mailing list