Year: 2019
Type: preprint
Abstract: A prototype command, d3, that makes interactive graphs with the JavaScript library D3 (Data-Driven Documents) was presented at the 2014 London Stata Users' Group meeting. Since then, the SVG graph export format in Stata versions 14 and up has made this task much simpler. I present a new version of d3 and its supporting commands in a package called Stata2D3, which takes advantage of the innate link between SVG and web browsers. Together, they export any Stata graph to SVG, wrap it in an HTML file, tag components of the graph such as markers and lines, append data from other variables of interest, and use the D3 library to add interactivity. The result is a familiar Stata graph in the web browser, the style of which can be controlled in the usual ways, but with the option of interactivity such as pop-up information when the mouse hovers over a marker or line, highlighting one line on click or hover, or tickboxes to show and hide groups of data. Any Stata graph is immediately available, and different forms of interactivity can be added.
Author: Robert Grant
Language: English
Field: Computer Science
Domain: Physical Sciences
Keywords: interactive graphics, D3.js, HTML export
Open Access status: green
OpenAlex ID: W3130177946
