GithubHelp home page GithubHelp logo

timelyportfolio / explodingboxplotr Goto Github PK

View Code? Open in Web Editor NEW
37.0 37.0 10.0 159 KB

d3.js exploding boxplots for R as an htmlwidget

License: Other

Makefile 0.03% R 1.29% JavaScript 0.27% CSS 0.27% HTML 98.14%

explodingboxplotr's Introduction

exploding_boxplotR

d3.js Exploding Boxplots

CRAN RStudio mirror downloads

d3.js Exploding Boxplots from d3_exploding_boxplot in htmlwidget form for R

Installation

# get newest htmlwidgets
devtools::install_github("ramnathv/htmlwidgets")
devtools::install_github("timelyportfolio/explodingboxplotR")

Usage

library(explodingboxplotR)

# use this to replicate
#   from ?boxplot
#boxplot(count ~ spray, data = InsectSprays, col = "lightgray")

exploding_boxplot(
  data.frame(
    rowname = rownames(InsectSprays),
    InsectSprays,
    stringsAsFactors = FALSE
  ),
  y = "count",
  group = "spray",
  color = "spray",
  label = "rowname"
)

# demonstrate all of the options
#  xlab does not work
#  filed issue on source repo
exploding_boxplot(
  data.frame(
    rowname = rownames(InsectSprays),
    InsectSprays,
    stringsAsFactors = FALSE
  ),
  y = "count",
  group = "spray",
  color = "spray",
  label = "rowname",
  iqr = 2,
  margin = list(bottom = 50, left = 30, top = 20, right = 20),
  xlab = "Spray Type",
  ylab = "Count Provided"
)

License

MIT + file LICENSE © Kenton Russell.

explodingboxplotr's People

Contributors

timelyportfolio avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

explodingboxplotr's Issues

Enhancement requests

I'm sure most if not all are on list

a) axis labels and some control over orientation
b) ability to 'implode' and exploded bar - rather than refreshing browser
c) more control over 'label'. Currently entering one field appears to show that and faintly the other axis
d) title
e) Ability to control box color inc setting to just one. Currently has variety of colors with no specific meaning. labels for some colors e.g. yellow are hard to read
f) Explanation of iqr argument in exploding_boxplot()

Great widget. Sure will have plenty of users

Another Shiny issue. Nothing displayed.

Hi, I have recently discovered this package, and I am pretty fond of it.

Unfortunately, I can't manage to make it work together with Shiny.

Here is the dummy code I tried :

library(shiny)
library(explodingboxplotR)
data(iris)

 ui <- fluidPage(
    titlePanel("Exploding Boxplot Test"),
    mainPanel(
        exploding_boxplotOutput("box")
    )
)

server <- function(input, output, session) {
    output$box <- renderExploding_boxplot({
        print("ping")
        exploding_boxplot(
            data.frame(
                rowname = rownames(iris),
                iris,
                stringsAsFactors = FALSE
            ),
            y = "Sepal.Length",
            group = "Species",
            color = "Species",
            label = "Species"
        )
    })
}

shinyApp(ui,server)

When I launch it, nothing seems to happen (the Shiny server starts with the title on the page, but that's it).

sessionInfo()
R version 3.2.3 (2015-12-10)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 14.04.3 LTS

locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
[3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=fr_FR.UTF-8 LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=fr_FR.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=fr_FR.UTF-8 LC_IDENTIFICATION=C

attached base packages:
[1] stats graphics grDevices utils datasets methods base

other attached packages:
[1] explodingboxplotR_0.0.1 shiny_0.13.0

loaded via a namespace (and not attached):
[1] htmlwidgets_0.5.2 R6_2.1.2 tools_3.2.3 htmltools_0.3
[5] yaml_2.1.13 Rcpp_0.12.3 jsonlite_0.9.19 digest_0.6.9
[9] xtable_1.8-2 httpuv_1.3.3 mime_0.4

Shiny issue. Resources not loading

Love the package but...

library(shiny)
library(explodingboxplotR)
app <- shinyApp(
  ui = fluidPage(
    exploding_boxplotOutput("test", width = "100%", height = "400px")
  ),
  server = function(input, output) ({

  output$test <-  renderExploding_boxplot({
    exploding_boxplot(
      data.frame(
        rowname = rownames(InsectSprays),
        InsectSprays,
        stringsAsFactors = FALSE
      ),
      y = "count",
      group = "spray",
      color = "spray",
      label = "rowname"
    )

  })
})
)

runApp(app)

http://127.0.0.1:6501/exploding_boxplot-binding-0.0.1/exploding_boxplot.js Failed to load resource: the server responded with a status of 404 (Not Found)
http://127.0.0.1:6501/favicon.ico Failed to load resource: the server responded with a status of 404 (Not Found)

sessionInfo()
R version 3.2.2 (2015-08-14)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 8 x64 (build 9200)

locale:
[1] LC_COLLATE=English_Canada.1252 LC_CTYPE=English_Canada.1252 LC_MONETARY=English_Canada.1252 LC_NUMERIC=C
[5] LC_TIME=English_Canada.1252

attached base packages:
[1] stats graphics grDevices utils datasets methods base

other attached packages:
[1] explodingboxplotR_0.0.1 shiny_0.12.2.9000

loaded via a namespace (and not attached):
[1] htmlwidgets_0.5.2 R6_2.1.1 rsconnect_0.4.1.4 htmltools_0.3 tools_3.2.2 yaml_2.1.13 Rcpp_0.12.2
[8] jsonlite_0.9.19 digest_0.6.9 xtable_1.8-0 httpuv_1.3.3 mime_0.4

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.