-
Notifications
You must be signed in to change notification settings - Fork 12
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
ospsuite addins #1412
Comments
Selecting and copying a unitExampleCodeunitPicker <- function() {
ui <- miniPage(
gadgetTitleBar("OSP Unit Picker", left = NULL),
miniContentPanel(
selectInput(
inputId = "dimension",
label = span(icon("folder-open"), " Dimension"),
choices = names(ospsuite::ospUnits)
),
selectInput(
inputId = "unit",
label = span(icon("folder-tree"), " Unit"),
choices = as.character(ospsuite::ospUnits$`Abundance per mass protein`)
),
actionButton(
inputId = "copy",
label = "Copy",
icon = icon("copy")
)
)
)
server <- function(input, output, session) {
# Update available units based on selected dimension
observeEvent(input$dimension, {
updateSelectInput(
session = session,
inputId = "unit",
choices = as.character(ospsuite::ospUnits[[input$dimension]])
)
})
# Copy the unit wrapped with quotes in your current R script position
observeEvent(input$copy, {
rstudioapi::insertText(paste0('"', input$unit, '"'))
})
observeEvent(input$done, {
stopApp()
})
}
runGadget(ui, server)
} |
Nice! Should we maybe have a separate package |
Great idea ! |
@pchelle Very nice, great enhancements! |
@Felixmil @rengelke @Laura-Villain Check this out, especially @Laura-Villain present it to our users? Would it substitute our unit converter? |
The unit converter is now implemented as an addin. I also forked my repo as an Open-Systems-Pharmacology repo. It'll be more visible to users this way. |
Substitute, I don't know (as in a reproducible code it's always nice to have the option to write a code), but I definitely think that it will help a lot of people that are not super comfortable with R, and I can present that soon |
The addin: View Simulation Tree / |
For potential users, I was planning to deploy pkgdown documentation and record in vignettes tutorial videos showing usage of the current addins. |
For new Addins feature requests, let's now use the appropriate Github repo: |
RStudio provides an Addins feature that users could leverage when writing scripts.
I drafted below 2 simple functions for potential addins that could be used as starting point for discussing of such features.
Important
Feel free to comment
The text was updated successfully, but these errors were encountered: