ggthemeassist
ggthemeassist copied to clipboard
Bonus feature: An annotate() helper
One of the biggest selling points for the addin is the ability to trial-and-error a legend into the right position, and since positioning annotations can be a pain as well, it would be cool if there was a way the assistant could, well, assist with annotations.
I thought about this a bit today: The whole thing would not be a big deal if we restrict to one annotation. Just a textInput and "click" for the position like @calligross did for legend.position. But restricting to one annonation is obviously nonsense. I experimented with a numericInput to select the number of annotations (n) one wants to place in the plot. Depending on that input, n textInputs appear, one for each annotation. With every textInput comes an actionButton. The idea is to fetch input$click for every annotation separately. By clicking on the respective action button the next input$click will be ascribed to the respective annotation.
I´m still struggling on the actionButton-input$click-thing, that's why no PR so far...
I think this sould be more or less straight forward, all you need is:
- a data.frame
- four inputs (id, x, y, text)
- three buttons (insert, update, delete)
The id input may be hidden and updated by selecting a DT row.
Take a look at: http://www.r-bloggers.com/shiny-crud-app/
That could be very useful, too: https://cran.r-project.org/web/packages/rhandsontable/vignettes/intro_rhandsontable.html
Probably saves the trouble to define the CRUD methods oneself.
#51