Slide 1: Slide 2: The hist() function draws a histogram Slide 3: The VI() function from the 'BrailleR' package can generate a text description of the histogram. In combination with a screen reader, this provides some information about the histogram for blind or visually impaired R users. Slide 4: The hist() function returns an object containing information about the histogram as well as drawing the histogram. VI() uses that information to create a text description of the histogram. Slide 5: The plot() functions does not return ANY information about the plot that it draws. Slide 6: This makes it hard for VI() to do anything. Slide 7: The 'BrailleR' package has its own versions of some major plotting functions that augment the information that is returned ... Slide 8: ... and the 'BrailleR' package has some new plotting functions ... Slide 9: ... that generate information about the plot. Slide 10: The 'BrailleR' package has to do a lot of work for each individual plot that it wants to support Slide 11: 'ggplot2' is a quite popular package for drawing plots in R Slide 12: But 'BrailleR' could not generate text descriptions for 'ggplot2' plots Slide 13: 'ggplot2' always generates a "ggplot" object Slide 14: And 'ggplot2' exports the ggplot_build() function, which generates more information about what is drawn Slide 15: So now 'BrailleR' can not generate text descriptions for 'ggplot2' plots! Slide 16: And this just works for a range of plots straight away Slide 17: And this just works for a range of plots straight away Slide 18: Deciding what to say and how to say it is hard; there is no "best" solution Slide 19: So we allow for flexibility; people can use their own template (based on the R package 'whisker' and the Mustache templating language; ... Slide 20: ... and people can do things with the object, like searching Slide 21: ... and people can do things with the object, like sorting Slide 22: The overall design involves gathering information about a plot, generating text from the information (using a template), and then writing methods that work with the combination of information and text. Slide 23: With 'ggplot2', we describe a plot in terms of a small number of building blocks - we can create an infinite array of plots by combining the building blocks in different ways. Slide 24: This means that the support for 'ggplot2' in 'BrailleR' can just add support for a small set of building blocks and then we can generate accessible text for an infinite array of plots. Slide 25: Slide says it all Slide 26: