RhoInc/aeexplorer

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

emmorris opened this issue · 5 comments

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.

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.

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

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.

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:

  • Confirm that adding 2+ values to each component (id, major, minor and groups) of the variableOptions array described above adds a new control.
  • Confirm that multiple filters are created if more than one variableOptions array is provided, and that they both work as expected.
  • Confirm that the new variableOption controls work before and after filtering, searching, and changing the summarizeBy option.
  • Confirm that the value for the default variable appears in the variable control even if it is not specified in config (as described in the previous comment). That is, ARM appears in the groups control with these settings:
{
    variables:{group:"ARM"},
    variableOptions:{
      group:["RACE","SEX"]
  },
};

@jwildfire @emmorris

  • Confirm that adding 2+ values to each component: Pass. new controls added across top of the page, each with the 2 options that I had added.
  • Confirm that multiple filters are created if more than one variableOptions array is provided, and that they both work as expected: Confirmed
  • Confirm that the new variableOption controls work before and after filtering, searching, and changing the summarizeBy option: Confirmed
  • Confirm that the value for the default variable appears in the variable control even if it is not specified in config: Confirmed