R/qtlcharts is an R package to create interactive charts for QTL data, for use with R/qtl. R/qtlcharts is written in R and CoffeeScript, making use of the JavaScript libraries D3, jQuery, and jQueryUI.

The aim of this guide is to explain the basic strategy of the package and the organization of the code, in the hope that others may wish to contribute to its development or to make use of different pieces of the software.

Basic layout of source

The source for the package is at GitHub. The devel branch contains the current development version, while the main branch contains the stable version.

R/qtlcharts uses htmlwidgets as the basic driver for the construction of interactive graphs: It creates an html file with links to the necessary resources and opens it in a browser.

JavaScript and CoffeeScript code are within the inst/htmlwidgets subdirectory. (When the package is installed, the contents of the inst directory are moved up one level, and there is no inst directory anymore.)

The JavaScript libraries are located in subdirectories of inst/htmlwidgets/lib. This includes D3, jQuery, and jQueryUI, as well as a set of basic graphic panels, d3panels.

The key functions that form the higher-level QTL visualizations are in inst/htmlwidgets/lib/qtlcharts. Each has an additional file within the inst/htmlwidgets directory with the code that htmlwidgets needs, as well as a YAML file that describes the set of resources needed for that chart.


R/qtlcharts is being developed in