GithubHelp home page GithubHelp logo

gg1d's People

Contributors

selkamand avatar

Watchers

 avatar

gg1d's Issues

Beautify legend titles

underscore to space, capitalise first letter of each word. Make togglable via an option

Error in unit rep(0, TABLE_ROWS * dims[1])

Full error message: Error in unit(rep(0, TABLE_ROWS * dims[1]), "null") :
'x' and 'units' must have length > 0

Reproducible example

df <- structure(list(testcol = c("02", "02", "02", "02", 
                                      "02", "02", "02", "02", "02", "06", "06", "06", "06", "06", "06", 
                                      "06", "06", "06", "06", "06", "06", "06", "06", "06", "06", "06", 
                                      "06", "06", "06", "06", "06", "06", "06", "06", "06", "06", "06", 
                                      "06", "06", "06", "06", "06", "06", "06", "06", "06", "06", "06", 
                                      "06", "06", "06", "06", "06", "06", "06", "06", "06", "06", "06", 
                                      "06", "06", "06", "06", "06", "06", "06", "06", "06", "06", "06", 
                                      "06", "06", "06", "06", "06", "06", "06", "06", "06", "06", "06", 
                                      "06", "06", "06", "06", "06", "06", "06", "06", "06", "06", "06", 
                                      "06", "06", "06", "06", "06", "06", "06", "06", "06", "06", "06", 
                                      "06", "06", "06", "06", "06", "06", "06", "06", "06", "06", "06", 
                                      "06", "06", "06", "06", "06", "06", "06", "06", "06", "06", "06", 
                                      "06", "06", "06", "06", "06", "06", "06", "06", "06", "06", "06", 
                                      "06", "08", "12", "12", "12", "12", "12", "12", "12", "12", "12", 
                                      "12", "12", "12", "12", "12", "12", "12", "12", "12", "12", "12", 
                                      "12", "12", "12", "12", "12", "12", "12", "12", "12", "12", "12", 
                                      "12", "12", "12", "12", "12", "12", "12", "12", "12", "12", "12", 
                                      "12", "12", "14", "14", "14", "14", "14", "14", "14", "14", "14", 
                                      "14", "14", "14", "14", "14", "14", "14", "14", "14", "14", "14", 
                                      "14", "14", "14", "14", "14", "14", "14", "14", "14", "14", "14", 
                                      "14", "14", "14", "14", "14", "14", "14", "14", "15", "15", "16")), row.names = c(NA, 
                                                                                                                  -223L), class = c("tbl_df", "tbl", "data.frame"))

gg1d_plot(df, cols_to_plot = "testcol")
#> Error in unit(rep(0, TABLE_ROWS * dims[1]), "null") :
#> 'x' and 'units' must have length > 0`

Created on 2023-03-11 with reprex v2.0.2

Add unit test: breaks and labels are different

Should consider adding a unit test for this:

df <- data.frame(col = c(0, 0, NA, NA, NA, NA, NA, NA, 0, NA))
expect_error(gg1d_plot(df, cols_to_plot="col1"), NA)

Since theres only 1 non-na value (0) an old version of gg1d would throw an error message about breaks and labels being different lengths. We fixed the issue but should add a unit test to catch future instances

Provide option to collect legends

guides = "collect" option to patchwork layout should do the trick. Should not do this by default, but should put on.

if collect_legends = TRUE, you should also show legend titles, add a message indicating show_legend_titles argument will be ignored

Add a way to ignore columns

I'm thinking an _ignore sufffix

implementation could be as simple as something like

ignore_suffix_found <- grepl(x=colnames(data), pattern = "_ignore$")
data <- data[!ignore_suffix_found]

Change na_marker colour

Can make configurable, and/or use some colour theory to ensure its always obvious vs the colour of the bars

Right align y axis titles

Or at very lease, have an option to control y axis title alignment (default should be right-alignment)

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.