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

Feat/guppy explorer #505

Merged
merged 40 commits into from Apr 24, 2019
Merged

Feat/guppy explorer #505

merged 40 commits into from Apr 24, 2019

Conversation

qingyashu
Copy link
Contributor

@qingyashu qingyashu commented Apr 15, 2019

Use guppy for data explorer instead of arranger. Portal config like this (under dataExplorerConfig block):

"guppyConfig": {
      "dataType": "subject",
      "fieldMapping": [
        { "field": "project", "name": "Project" },
        { "field": "study", "name": "Study" },
        { "field": "race", "name": "Race" },
        { "field": "ethnicity", "name": "Ethnicity" },
        { "field": "gender", "name": "Gender" },
        { "field": "vital_status", "name": "Vital Status" },
        { "field": "whatever_lab_result_value", "name": "Lab Result Value" },
        { "field": "file_count", "name": "File Count" },
        { "field": "file_type", "name": "File Type" },
        { "field": "file_format", "name": "File Format" }
      ],
      "manifestMapping": {
        "resourceIndexType": "file",
        "resourceIdField": "file_id",
        "referenceIdFieldInResourceIndex": "subject_id",
        "referenceIdFieldInDataIndex": "subject_id"
      }
    },
    "charts": {
      "project": {
        "chartType": "count",
        "title": "Projects"
      },
      "study": {
        "chartType": "count",
        "title": "Studies"
      },
      "file_type": {
        "chartType": "count",
        "title": "File Types"
      },
      "ethnicity": {
        "chartType": "stackedBar",
        "title": "Ethnicity"
      },
      "gender": {
        "chartType": "pie",
        "title": "Gender"
      },
      "race": {
        "chartType": "pie",
        "title": "Race"
      },
      "vital_status": {
        "chartType": "bar",
        "title": "Vital Status"
      }
    },
    "filters": {
      "tabs": [
        {
          "title": "Project",
          "fields": [
            "project",
            "study"
          ]
        },
        {
          "title": "Subject",
          "fields": [
            "race",
            "ethnicity",
            "gender",
            "vital_status"
          ]
        },
        {
          "title": "File",
          "fields": [
            "file_type"
          ]
        }
      ]
    },
    "buttons": [
      {
        "enabled": true,
        "type": "data",
        "title": "Download All Data",
        "leftIcon": "user",
        "rightIcon": "download",
        "fileName": "data.json"
      },
      {
        "enabled": true,
        "type": "manifest",
        "title": "Download Manifest",
        "leftIcon": "datafile",
        "rightIcon": "download",
        "fileName": "manifest.json"
      }
    ],
    "table": {
      "enabled": true,
      "fields": [
        "project",
        "study",
        "race",
        "ethnicity",
        "gender",
        "vital_status",
        "whatever_lab_result_value",
        "file_count",
        "file_type",
        "file_format"
      ]
    }

Notice that filters and charts are same as previous cofnig, and for table there's extra table.fields block. For backward compatibility, if there's no "guppyConfig" block in portal config, data explorer will still use arranger for data explorer page by reading arrangerConfig and related config blocks.

New Features

  • Use guppy for data explorer instead of arranger

Breaking Changes

Bug Fixes

Improvements

Dependency updates

Deployment changes

"guppyConfig": {
"dataType": "subject",
"fieldMapping": [
{ "field": "project", "name": "Project" },
Copy link
Member

@thanh-nguyen-dang thanh-nguyen-dang Apr 15, 2019

Choose a reason for hiding this comment

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

Should we automate this part to only configure the special mapping?
I mean if it is only project -> Project or vital_status -> Vital Status you don't need to put it in the fieldMapping.

Copy link
Contributor Author

@qingyashu qingyashu Apr 15, 2019

Choose a reason for hiding this comment

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

I think sometimes some field name mapping will need more caring, like thrpyv, but yeah automation is a good idea, I think we could combine both automation and customized names

@@ -123,7 +123,7 @@
},
"login": {
"title": "NIAID Data Hub",
"subTitle": "Explore, Analyze, and Share Data",
"subTitle": "search, compare, and download data",
Copy link
Contributor

@abgeorge7 abgeorge7 Apr 17, 2019

Choose a reason for hiding this comment

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

can you change this back to "Explore, Analyze, and Share Data" ?

Copy link
Contributor Author

@qingyashu qingyashu Apr 17, 2019

Choose a reason for hiding this comment

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

Prod use this so I copied them

Copy link
Contributor

@abgeorge7 abgeorge7 Apr 17, 2019

Choose a reason for hiding this comment

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

:O I'll change prod - they should all be "Explore, Analyze, and Share Data" now

"hiv_status"
]
}
]
},
"table": {
"enabled": false
"enabled": true,
Copy link
Contributor

@abgeorge7 abgeorge7 Apr 17, 2019

Choose a reason for hiding this comment

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

and this to false?

Copy link
Contributor Author

@qingyashu qingyashu Apr 17, 2019

Choose a reason for hiding this comment

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

Sure~

const end = (this.state.currentPage + 1) * this.state.pageSize;
return (
<div className={`explorer-table ${this.props.className}`}>
<p className='explorer-table__description'>{`Showing ${start} - ${end} of ${totalCount} cases`}</p>
Copy link
Contributor

@abgeorge7 abgeorge7 Apr 17, 2019

Choose a reason for hiding this comment

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

"cases" here shouldn't be hardcoded - for example, NIAID uses "subjects"

ZakirG
ZakirG approved these changes Apr 24, 2019
@qingyashu qingyashu merged commit f01ad70 into master Apr 24, 2019
3 of 4 checks passed
@m0nhawk m0nhawk deleted the feat/guppy-explorer branch Aug 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
5 participants