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

Allow user to swap dataset #4

Open
shihabdider opened this issue Oct 18, 2024 · 4 comments
Open

Allow user to swap dataset #4

shihabdider opened this issue Oct 18, 2024 · 4 comments

Comments

@shihabdider
Copy link
Contributor

This feature involves swapping of datasets to reuse the same build for different datasets.

  • Dataset Structure: A dataset consists of common/, data/, and datafiles.json. Other components in build/ are consistent across datasets and can be kept/copied from public/.

  • Implementation Requirements:

    • Encapsulate the dataset in a single directory for easy swapping.
    • Front-end should provide a method to select the dataset, such as a dropdown menu.
    • Include a config file mapping dataset names to their directories.
  • Compatibility Considerations: Front-end must handle missing data gracefully to ensure compatibility between datasets.

  • Build Process Changes: Modify the build process to exclude packaging the dataset within the build.

@xanthopoulakis
Copy link
Collaborator

@shihabdider , so essentially the frontent will not have a fixed dirrectory for common, data, and datafiles.json but it should ask the user on application launch where to find the datasets? how does the frontend know upon start where exactly to look into?

@shihabdider
Copy link
Contributor Author

shihabdider commented Oct 18, 2024

@xanthopoulakis see:

  • Include a config file mapping dataset names to their directories.

I can provide this, but it'll basically be an object of the form:

{ "dataset-name": "dataset-path" }

If necessary/convenient we can ensure that these paths are rooted in the build directory (and then simply symlink them into build/). Otherwise, we only need to ensure that the paths are hosted by the apache server (i.e for NYU, they are rooted in public_html/).

@shihabdider
Copy link
Contributor Author

shihabdider commented Oct 21, 2024

Here's a more detailed schema of the dataset object. I think we can actually store this inside of settings.json (since it's already being fetched).

{ 
    "datasets": [
        "dataset1": { 
            "datafiles_json": "path/to/datafiles.json",
            "data_dir": "path/to/data"
            "common_dir": "path/to/common"
        },
        "dataset2": { 
            "datafiles_json": "path/to/datafiles.json",
            "data_dir": "path/to/data"
            "common_dir": "path/to/common"
        },
    ]
}

Note: The paths will be inside the build/ directory (e.g., build/TCGA/datafiles.json, build/TCGA/data/). Absolute paths may be used in practice.


UI Behavior and Flow:

  1. Check for datasets in settings.json:

    • If the datasets object is defined, proceed to step 2.
    • If datasets is missing or null, display a blank placeholder on the dashboard page.
    • If settings.json is corrupted or fails to fetch, display an error message on the dashboard page.
  2. Default Dataset Display:

    • Display the first dataset in the datasets list by default when the application loads.
  3. Dataset Selection Dropdown:

    • Add a dropdown menu on the dashboard page to allow users to switch between available datasets.
    • Suggested location for the dropdown:

Image

  1. Dataset Switching:
    • Upon selecting a different dataset from the dropdown, update the dashboard to reflect data from the selected dataset.
    • Ensure all components relying on dataset data are refreshed accordingly.

@xanthopoulakis
Copy link
Collaborator

@shihabdider , what is the expected user behavior the user is looking at a specific Case and then they choose to to change to a different dataset. Should we by default send them to the landing page?
image

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

No branches or pull requests

2 participants