Sha256: e8015b930acbe6cc241d7301b53016102d76553886fcd83f4afe25feb980d9fa

Contents?: true

Size: 1.53 KB

Versions: 28

Compression:

Stored size: 1.53 KB

Contents

rbbt.require('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
}

rbbt.ggplot2.rotate_x_labels <- function(){ theme(axis.text.x = element_text(angle = 45, vjust = 1, hjust=1)) }

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
rbbt-util-5.34.13 share/Rlib/plot.R
rbbt-util-5.34.12 share/Rlib/plot.R
rbbt-util-5.34.11 share/Rlib/plot.R
rbbt-util-5.34.10 share/Rlib/plot.R
rbbt-util-5.34.9 share/Rlib/plot.R
rbbt-util-5.34.8 share/Rlib/plot.R
rbbt-util-5.34.7 share/Rlib/plot.R
rbbt-util-5.34.5 share/Rlib/plot.R
rbbt-util-5.34.4 share/Rlib/plot.R
rbbt-util-5.34.3 share/Rlib/plot.R
rbbt-util-5.34.2 share/Rlib/plot.R
rbbt-util-5.34.1 share/Rlib/plot.R
rbbt-util-5.34.0 share/Rlib/plot.R
rbbt-util-5.33.21 share/Rlib/plot.R
rbbt-util-5.33.20 share/Rlib/plot.R
rbbt-util-5.33.19 share/Rlib/plot.R
rbbt-util-5.33.18 share/Rlib/plot.R
rbbt-util-5.33.17 share/Rlib/plot.R
rbbt-util-5.33.16 share/Rlib/plot.R
rbbt-util-5.33.15 share/Rlib/plot.R