stjude / proteinpaint

Data visualization and analysis framework focused on phenotype-molecular data integration at cohort level.
https://proteinpaint.stjude.org/
Other
18 stars 5 forks source link

`getSupportedChartTypes()` should assess ds.cohort{addCharts{},hideCharts{}} and replace allowedChartTypes[] #2229

Open xzhou82 opened 1 week ago

xzhou82 commented 1 week ago

getSupportedChartTypes() does two things:

  1. compute chart types that can work for a ds, based on term type and data type availability. e.g. if survival term is present, allow survival chart. this computing only generate common chart types.
  2. return allowed chart types per subcohort. mass client will show chart buttons solely based on this
  3. optionally, apply ds overrides from a new structure below. addCharts will add things, hideCharts will hide things. this is a better design than allowedChartTypes[] that does two things and lead to excessive config on datasets
cohort {
  addCharts: {
     bySubcohort: {
       <cohort1>: [ 'chartype1', ...]
     }
     list: [ 'chartype1', ...]
   }
   hideCharts: {
      // same structure as addCharts
   }
}
  1. bySubcohort{} is chart type list per subcohort, this will be used for profile which has a subcohort-specific chart type we have to support
  2. list[] is a flat list
  3. both bySubcohort and list can be used at same time
xzhou82 commented 1 week ago

may hold this off and coordinate with Airen's efforts