Sha256: 10293c9f0a13c3677a45184e46cc1b2f83b131bc30272ea8612896abf9020536

Contents?: true

Size: 1.41 KB

Versions: 249

Compression:

Stored size: 1.41 KB

Contents

library(ggplot2)

geom_entity <- function (real.geom = NULL, mapping = NULL, data = NULL, stat = "identity",
                          position = "identity", ...) {
    rg <- real.geom(mapping = mapping, data = data, stat = stat, 
                    position = position, ...)

    rg$geom <- proto(rg$geom, { 
        draw <- function(., data, ...) {
            grobs <- list()

            for (i in 1:nrow(data)) {
                grob <- .super$draw(., data[i,], ...) 
                if (is.null(data$entity.type)) 
                    grobs[[i]] <- garnishGrob(grob, `data-entity`=data[i,]$entity)
                else
                    grobs[[i]] <- garnishGrob(grob, `data-entity`=data[i,]$entity, `data-entity-type`=data[i,]$entity.type)
            }

            ggplot2:::ggname("geom_entity", gTree(children = do.call("gList", grobs)))
        }

        draw_groups <- function(., data, ...) {
            grobs <- list()

            for (i in 1:nrow(data)) {
                grob <- .super$draw_groups(., data[i,], ...) 
                if (is.null(data$entity.type)) 
                    grobs[[i]] <- garnishGrob(grob, `data-entity`=data[i,]$entity)
                else
                    grobs[[i]] <- garnishGrob(grob, `data-entity`=data[i,]$entity, `data-entity-type`=data[i,]$entity.type)
            }

            ggplot2:::ggname("geom_entity", gTree(children = do.call("gList", grobs)))
        }
    })

    rg
}

Version data entries

249 entries across 249 versions & 1 rubygems

Version Path
rbbt-util-5.21.102 share/Rlib/plot.R
rbbt-util-5.21.101 share/Rlib/plot.R
rbbt-util-5.21.100 share/Rlib/plot.R
rbbt-util-5.21.99 share/Rlib/plot.R
rbbt-util-5.21.98 share/Rlib/plot.R
rbbt-util-5.21.97 share/Rlib/plot.R
rbbt-util-5.21.96 share/Rlib/plot.R
rbbt-util-5.21.95 share/Rlib/plot.R
rbbt-util-5.21.94 share/Rlib/plot.R
rbbt-util-5.21.93 share/Rlib/plot.R
rbbt-util-5.21.92 share/Rlib/plot.R
rbbt-util-5.21.91 share/Rlib/plot.R
rbbt-util-5.21.90 share/Rlib/plot.R
rbbt-util-5.21.89 share/Rlib/plot.R
rbbt-util-5.21.87 share/Rlib/plot.R
rbbt-util-5.21.86 share/Rlib/plot.R
rbbt-util-5.21.85 share/Rlib/plot.R
rbbt-util-5.21.84 share/Rlib/plot.R
rbbt-util-5.21.83 share/Rlib/plot.R
rbbt-util-5.21.81 share/Rlib/plot.R