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

Image display - selecting directory #5

Open
EOGrady21 opened this issue Mar 1, 2022 · 1 comment
Open

Image display - selecting directory #5

EOGrady21 opened this issue Mar 1, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@EOGrady21
Copy link
Owner

EOGrady21 commented Mar 1, 2022

Currently image directory is automatically selected based on metadata inputs

            imgs_path <-  paste0(input$basepath, '/', input$cruise, "/rois/vpr", input$tow,"/d", input$day, "/h", input$hour, "/")

but the user should also be able to directly select the image directory by using the Choose ROI Directory button. This should override the automatic ROI directory code

But this feature does not seem to be working.

I think this is the relevant code chunk

 path <- reactive({
        home <- input$dir$root
        file.path(home, paste(unlist(dir()$path[-1]), collapse = .Platform$file.sep))
    })

 observeEvent(input$dir, {
        values$upload_state <- 'uploaded'
    })
    # browser()
    imgs_path <- reactive({
      input$update # is this working?
        if (is.null(values$upload_state)) {
            
            imgs_path <-  paste0(input$basepath, '/', input$cruise, "/rois/vpr", input$tow,"/d", input$day, "/h", input$hour, "/")
           
        } else if (values$upload_state == 'uploaded') {
            imgs_path <- path()

        } 
    })

input$dir is the Choose ROI Directory button. Maybe because path() is only getting the root directory?
I'll need to do some more troubleshooting here.

@EOGrady21 EOGrady21 added the bug Something isn't working label Mar 1, 2022
@EOGrady21
Copy link
Owner Author

This investigation has been a rabbit hole but it now seems that the Directory Choose button is not overriding the auto directory because the code assumes that the directory matches the data supplied to plots.

My question, to @kevinsorochan
Would there be a use case where a user wanted to JUST look at images without plotting the CTD data within the app?
If so would it be useful to have the ability to 'isolate' the image gallery from the rest of the app? Example would be to have a little check box on the image gallery page that would allow you to select ANY image directory to display?
Or does it make more sense to keep the images displayed unified with the CTD data to avoid potential errors/ confusion?

Sorry for a long winded comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant