ABSTRACT

THE RECENT RAPID GROWTH in data visualization hasbeen in large part driven by the power of interactive con-tent. Data visualizations can be shown in a web browser and then take advantage of the interactivity the browser provides, for example showing more information when the user hovers the mouse over a marker, or clicks on a region in a map. This interactivity used to rely on proprietary software like Adobe’s Flash, but is now achievable by everyone through JavaScript, the programming language that powers web pages. This chapter outlines various forms that interactivity takes, with links to good examples. However, as links occasionally break and online content is lost, you will find the most up-to-date links at this book’s accompanying web page: robertgrantstats.co.uk/dataviz-book

A web page is simply a plain text file that contains instructions on what to display where. These are written in Hypertext Markup Language (HTML), and can also bring in formatting instructions in a language called Cascading Style Sheets (CSS), and most relevant to data visualization, a more general-purpose programming language called JavaScript. Confusingly, JavaScript has nothing to do with Java, which is a different language for making user interfaces (you may have encountered Java applets, which have been popular for teaching statistics).