mirror of
https://github.com/rstudio/shiny.git
synced 2026-04-07 03:00:20 -04:00
More informative comments
This commit is contained in:
@@ -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]])
|
||||
})
|
||||
|
||||
@@ -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];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user