Skip to content

Commit

Permalink
hide linear and logistic regression options
Browse files Browse the repository at this point in the history
  • Loading branch information
karishma-gangwani committed Jan 8, 2025
1 parent f03812c commit 4310b0e
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 18 deletions.
1 change: 0 additions & 1 deletion client/plots/regression.inputs.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ export class RegressionInputs {
/* Create configuration data for each section of the input UI
see google doc "Regression UI"
*/

// configuration for the outcome variable section
this.outcome = {
/*** static configuration ***/
Expand Down
1 change: 0 additions & 1 deletion client/plots/regression.inputs.term.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { termsettingInit } from '#termsetting'
import { getNormalRoot } from '#filter'
import { get_bin_label } from '#shared/termdb.bins.js'
import { InputValuesTable } from './regression.inputs.values.table'
import { Menu } from '#dom/menu'
Expand Down
1 change: 1 addition & 0 deletions client/plots/regression.js
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@ export function makeChartBtnMenu(holder, chartsInstance) {
]

for (const { label, type } of lst) {
if (!chartsInstance.state.currentCohortChartTypes.includes(type)) continue
holder
.append('div')
.attr('class', 'sja_menuoption sja_sharp_border')
Expand Down
35 changes: 19 additions & 16 deletions server/src/termdb.server.init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -560,28 +560,31 @@ export function server_init_db_queries(ds) {
}

/*
here defines common chart types, including:
- generally applicable to any ds, e.g. summary
- computable chart type based on term type or ds.queries{} availability, e.g. survival, singleCell
each chart type has a callback equivalent to isSupported() that executes on context parameters
to yield true/false indicating if the chart type should be shown or not
this is **not** an exhaustive list:
- numericDictCluster is not defined here, it is defined in ds that wants it
- does not include special "uncommon" chart type
can be overridden by ds.isSupportedChartOverride{}, inside the init() function, in order to achieve:
- hide common chart type by providing a callback that returns false
(e.g. even if a ds has survival term, collaborator still doesn't want km plot to show...)
- add special "uncommon" chart (profile)
- supply new callback of existing chart type, to execute adhoc logic (e.g. consider user's role...)
This section defines common chart types, such as 'summary charts', which are generally applicable to any dataset (ds).
These chart types can be computed based on term types or the availability of ds.queries{}, for example, survival or singleCell charts.
Each chart type has a callback function equivalent to isSupported() that executes on context parameters
to determine if the chart type should be displayed (returns true) or not (returns false).
This is not an exhaustive list:
- numericDictCluster is not defined here; it is defined in the specific dataset that requires it.
- Special "uncommon" chart types are not included here.
These chart types can be overridden by ds.isSupportedChartOverride{} within the init() function to:
- Hide a common chart type by providing a callback that returns false
(e.g., even if a dataset has a survival term, a collaborator may not want the KM plot to be shown).
- Add a special "uncommon" chart type (e.g., profile).
- Supply a new callback for an existing chart type to execute ad-hoc logic (e.g., considering the user's role).
*/

const defaultCommonCharts: isSupportedChartCallbacks = {
dictionary: () => true,
summary: () => true,
matrix: () => true,
regression: () => true,
linear: () => true,
logistic: () => true,
cox: () => true,
facet: () => true,
survival: ({ cohortTermTypes }) => cohortTermTypes.survival > 0,
cuminc: ({ cohortTermTypes }) => cohortTermTypes.condition > 0,
Expand Down

0 comments on commit 4310b0e

Please sign in to comment.