More informative comments

This commit is contained in:
Winston Chang
2015-04-23 11:53:17 -05:00
parent 7208688128
commit a093afb630
2 changed files with 11 additions and 7 deletions

View File

@@ -173,8 +173,8 @@ getGgplotCoordmap <- function(p, pixelratio) {
)
}
# Given a built ggplot object and corresponding gtable, return x and y domains
# (data space coords) and ranges (pixel coords).
# Given a built ggplot object, return x and y domains (data space coords) for
# each panel.
find_panel_info <- function(b) {
layout <- b$panel$layout
# Convert factor to numbers
@@ -197,6 +197,8 @@ getGgplotCoordmap <- function(p, pixelratio) {
scale_x <- l$SCALE_X
scale_y <- l$SCALE_Y
# For each of the faceting variables, get the value of that variable in
# the current panel.
vars <- lapply(facet_vars, function(var) {
list(name = var, value = l[[var]])
})

View File

@@ -151,8 +151,8 @@ outputBindings.register(imageOutputBinding, 'shiny.imageOutput');
var imageutils = {};
// Modifies the panel objects in a coordmap, adding scale_x, scale_y,
// scaleinv_x, scaleinv_y functions to each one.
// Modifies the panel objects in a coordmap, adding scale(), scaleInv(),
// and clip() functions to each one.
imageutils.initPanelScales = function(coordmap) {
// Map a value x from a domain to a range. If clip is true, clip it to the
// range.
@@ -244,11 +244,13 @@ imageutils.initPanelScales = function(coordmap) {
};
// This adds functions to the coordmap object to handles various
// coordinate-mapping tasks, and sends information to the server.
// The coordmap is an array of objects, each of which represents a panel.
// This adds functions to the coordmap object to handle various
// coordinate-mapping tasks, and send information to the server.
// The input coordmap is an array of objects, each of which represents a panel.
// coordmap must be an array, even if empty, so that it can be modified in
// place; when empty, we add a dummy panel to the array.
// It also calls initPanelScales, which modifies each panel object to have
// scale, scaleInv, and clip functions.
imageutils.initCoordmap = function($el, coordmap) {
var el = $el[0];