Skip to content

Commit

Permalink
Show simplified order by options in box plot
Browse files Browse the repository at this point in the history
  • Loading branch information
creilly8 committed Jan 15, 2025
1 parent 48fdac5 commit f2f1962
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions client/plots/boxplot/BoxPlot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { controlsInit, term0_term2_defaultQ, renderTerm1Label } from '../control
import { RxComponentInner } from '../../types/rx.d'
import { plotColor } from '#shared/common.js'
import { Menu } from '#dom'
import { isNumericTerm } from '#shared/terms.js'
import type { Div, Elem, SvgG, SvgSvg, SvgText } from '../../types/d3'
import type { MassAppApi, MassState, PlotConfig } from '#mass/types/mass'
import { Model } from './model/Model'
Expand Down Expand Up @@ -129,7 +128,10 @@ class TdbBoxplot extends RxComponentInner {
type: 'radio',
chartType: 'boxplot',
settingsKey: 'orderByMedian',
options: setOrderByOptions(this.app.getState().plots.find((p: PlotConfig) => p.id === this.id)),
options: [
{ label: 'Default', value: false },
{ label: 'Median values', value: true }
],
getDisplayStyle: (plot: PlotConfig) => (plot.term2 ? '' : 'none')
},
{
Expand Down Expand Up @@ -291,14 +293,6 @@ class TdbBoxplot extends RxComponentInner {
}
}

function setOrderByOptions(config: PlotConfig) {
if (!config || !config.term2) return []
return [
{ label: isNumericTerm(config.term2.term) ? 'Bins' : 'Sample count', value: false },
{ label: 'Median values', value: true }
]
}

export const boxplotInit = getCompInit(TdbBoxplot)
export const componentInit = boxplotInit

Expand Down

0 comments on commit f2f1962

Please sign in to comment.