Skip to content

Commit

Permalink
Prune options in CAVScreen, see #214
Browse files Browse the repository at this point in the history
  • Loading branch information
samreid committed May 24, 2023
1 parent b0d4e58 commit 5d81772
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 13 deletions.
2 changes: 1 addition & 1 deletion js/common/CAVScreen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import SliderControlsAndBasicActionsKeyboardHelpContent from '../../../scenery-p
import CAVModel from './model/CAVModel.js';

type SelfOptions = EmptySelfOptions;
export type CAVScreenOptions = SelfOptions & ScreenOptions & PickRequired<ScreenOptions, 'tandem'>;
export type CAVScreenOptions = SelfOptions & PickRequired<ScreenOptions, 'tandem' | 'name' | 'homeScreenIcon'>;

export default class CAVScreen<M extends CAVModel, V extends CAVScreenView> extends Screen<M, V> {

Expand Down
7 changes: 3 additions & 4 deletions js/mean-and-median/MeanAndMedianScreen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@

import { Image } from '../../../scenery/js/imports.js';
import optionize, { EmptySelfOptions } from '../../../phet-core/js/optionize.js';
import CAVColors from '../common/CAVColors.js';
import centerAndVariability from '../centerAndVariability.js';
import MeanAndMedianModel from './model/MeanAndMedianModel.js';
import CAVScreen, { CAVScreenOptions } from '../common/CAVScreen.js';
import MeanAndMedianScreenView from './view/MeanAndMedianScreenView.js';
import CenterAndVariabilityStrings from '../CenterAndVariabilityStrings.js';
import ScreenIcon from '../../../joist/js/ScreenIcon.js';
import meanAndMedianScreenIcon_png from '../../images/meanAndMedianScreenIcon_png.js';
import StrictOmit from '../../../phet-core/js/types/StrictOmit.js';

type SelfOptions = EmptySelfOptions;
type MeanAndMedianScreenOptions = SelfOptions & CAVScreenOptions;
type MeanAndMedianScreenOptions = SelfOptions & StrictOmit<CAVScreenOptions, 'name' | 'homeScreenIcon'>;

export default class MeanAndMedianScreen extends CAVScreen<MeanAndMedianModel, MeanAndMedianScreenView> {

Expand All @@ -30,8 +30,7 @@ export default class MeanAndMedianScreen extends CAVScreen<MeanAndMedianModel, M
homeScreenIcon: new ScreenIcon( new Image( meanAndMedianScreenIcon_png ), {
maxIconWidthProportion: 1,
maxIconHeightProportion: 1
} ),
backgroundColorProperty: CAVColors.screenBackgroundColorProperty
} )
}, providedOptions );

super(
Expand Down
7 changes: 3 additions & 4 deletions js/median/MedianScreen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@

import { Image } from '../../../scenery/js/imports.js';
import optionize, { EmptySelfOptions } from '../../../phet-core/js/optionize.js';
import CAVColors from '../common/CAVColors.js';
import centerAndVariability from '../centerAndVariability.js';
import MedianModel from './model/MedianModel.js';
import CAVScreen, { CAVScreenOptions } from '../common/CAVScreen.js';
import MedianScreenView from './view/MedianScreenView.js';
import CenterAndVariabilityStrings from '../CenterAndVariabilityStrings.js';
import ScreenIcon from '../../../joist/js/ScreenIcon.js';
import medianScreenIcon_png from '../../images/medianScreenIcon_png.js';
import StrictOmit from '../../../phet-core/js/types/StrictOmit.js';

type SelfOptions = EmptySelfOptions;
type MedianScreenOptions = SelfOptions & CAVScreenOptions;
type MedianScreenOptions = SelfOptions & StrictOmit<CAVScreenOptions, 'name' | 'homeScreenIcon'>;

export default class MedianScreen extends CAVScreen<MedianModel, MedianScreenView> {

Expand All @@ -30,8 +30,7 @@ export default class MedianScreen extends CAVScreen<MedianModel, MedianScreenVie
homeScreenIcon: new ScreenIcon( new Image( medianScreenIcon_png ), {
maxIconWidthProportion: 1,
maxIconHeightProportion: 1
} ),
backgroundColorProperty: CAVColors.screenBackgroundColorProperty
} )
}, providedOptions );

super(
Expand Down
7 changes: 3 additions & 4 deletions js/variability/VariabilityScreen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
*/

import optionize, { EmptySelfOptions } from '../../../phet-core/js/optionize.js';
import CAVColors from '../common/CAVColors.js';
import { Image } from '../../../scenery/js/imports.js';
import centerAndVariability from '../centerAndVariability.js';
import VariabilityModel from './model/VariabilityModel.js';
Expand All @@ -17,9 +16,10 @@ import VariabilityScreenView from './view/VariabilityScreenView.js';
import ScreenIcon from '../../../joist/js/ScreenIcon.js';
import CenterAndVariabilityStrings from '../CenterAndVariabilityStrings.js';
import variabilityScreenIcon_png from '../../images/variabilityScreenIcon_png.js';
import StrictOmit from '../../../phet-core/js/types/StrictOmit.js';

type SelfOptions = EmptySelfOptions;
type VariabilityScreenOptions = SelfOptions & CAVScreenOptions;
type VariabilityScreenOptions = SelfOptions & StrictOmit<CAVScreenOptions, 'name' | 'homeScreenIcon'>;

export default class VariabilityScreen extends CAVScreen<VariabilityModel, VariabilityScreenView> {

Expand All @@ -30,8 +30,7 @@ export default class VariabilityScreen extends CAVScreen<VariabilityModel, Varia
homeScreenIcon: new ScreenIcon( new Image( variabilityScreenIcon_png ), {
maxIconWidthProportion: 1,
maxIconHeightProportion: 1
} ),
backgroundColorProperty: CAVColors.screenBackgroundColorProperty
} )
}, providedOptions );

super(
Expand Down

0 comments on commit 5d81772

Please sign in to comment.