Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP Add script for creating drawables (png files shown in the app) #32

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

atorch
Copy link
Owner

@atorch atorch commented Dec 22, 2023

  • Work in progress: add script for creating drawables (the .png files in res/drawable-hdpi)
    • TODO Make sure it runs, create args so that drawables can be created in German, Spanish, and other languages with translations -- that could help with Translate images into German #11
    • TODO I could look into creating a simple Docker container so that everyone can run the R drawables script with the same packages installed, same version of R, etc
  • Other misc changes (added detail in some puzzle hints)

## is shown in a puzzle about the probability of certain jumps in the game of backgammon

library(ggplot2)
library(grid)
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be nice to provide a Docker container (or a Dockerfile) with R + these libraries installed

scale_y_continuous("voter 3", breaks=c(-1, 0), labels=c("C", "T"), lim=c(-2, 1)) +
scale_x_continuous("voter 4", breaks=c(0, 1), labels=c("T", "C"), lim=c(-1, 2)))
p
ggsave("CT_vote_table.png", p, width=8, height=8)
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO Make sure this script still runs

if it does, we need to make sure (A) that it generates all of the .png drawables used by the app, and (B) that they are the same size as those used in the app. I think I may have edited some of them using GIMP to change the image size, but I could do that directly in the script

opt_list <- list(make_option("--filename_suffix", default="", type="character"),
make_option("--voter_x_label", default="voter 4", type="character"),
make_option("--voter_y_label", default="voter 3", type="character"))
opt <- parse_args(OptionParser(option_list=opt_list))
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Example usage:

Rscript create_res_drawable.R --filename "_test" --voter_y "hi voter y"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant