RhoInc / aeexplorer

Adverse Event Explorer
https://rhoinc.github.io/aeexplorer/test-page/
MIT License
17 stars 9 forks source link

Allow users to interactively select subgrouping by age, gender, and site #120

Closed emmorris closed 6 years ago

emmorris commented 6 years ago

Jack requested that we update the AE Explorer to include a way to interactively select subgrouping by age, gender, and site.

Spencer said this shouldn't be too difficult since there is already a method that prepares the data given the grouping variable. We will just need to ignore the groups argument that controls which groups are displayed. Perhaps we could have a more complex groups argument that optionally accepts an array of group values.

jwildfire commented 6 years ago

Leaning implementing this by adding support for arrays (as well as simple strings) in config.variables.group and config.groups. When an array with more than one value is provided, a control for group will render (using the first value in the array as the default). No control will be shown if only a single option is specified.

Would be nice to write this to be general enough to support similar functionality for config.variables.major, config.variables.minor and group.variables.id since there's no real technical difference in those 4 use cases.

jwildfire commented 6 years ago

Need to think about whether there should be a "none" option in the group control.

jwildfire commented 6 years ago

Decided not to support arrays in config.variables.group, since it would've required tweaking a lot of files. Mostly just changing config.variables.group to config.variables.group[0]`, but still a bit messy.

Instead, I added config.variableOptions which looks like this by default:

    variableOptions: {
        id: [],
        major: [],
        minor: [],
        group: []
    },

Add a group control to an instance of the tool with a config like this:

{
    variables:{group:"ARM"},
    variableOptions:{
    group:["ARM","RACE","SEX"]
  },
};

Note that this is fine too:

{
    variables:{group:"ARM"},
    variableOptions:{
      group:["RACE","SEX"]
  },
};

The tool knows to add "ARM" to the variableOptions.groups array on init.

jwildfire commented 6 years ago

Test Notes

Test using all major browsers in CAT to confirm that new controls appear as expected and allow the user to change the settings as expected. In particular:

danedexF5 commented 6 years ago

@jwildfire @emmorris